From 9bb979dbfb2c4edc31018a83970567f8734c0b61 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 30 七月 2024 11:42:45 +0800
Subject: [PATCH] 单位字典保存前进行重复校验
---
constvar/const.go | 148 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 144 insertions(+), 4 deletions(-)
diff --git a/constvar/const.go b/constvar/const.go
index 5ca6de9..335b6d5 100644
--- a/constvar/const.go
+++ b/constvar/const.go
@@ -53,13 +53,72 @@
StoredProduct // 鍙偍瀛樼殑浜у搧
)
+// MaterialMode 鐗╂枡绫诲瀷(瀛楃涓诧級
type MaterialMode string
const (
- MaterialModeRaw MaterialMode = "鍘熸潗鏂�"
- MaterialModeSemi MaterialMode = "鍗婃垚鍝�"
- MaterialModeFinished MaterialMode = "鎴愬搧"
+ MaterialModeRaw MaterialMode = "鍘熸潗鏂�"
+ MaterialModeSemi MaterialMode = "鍗婃垚鍝�"
+ MaterialModeFinished MaterialMode = "鎴愬搧"
+ MaterialModeAuxiliary MaterialMode = "杈呮枡" //杈呮枡
+ MaterialModeConsumables MaterialMode = "鑰楁潗" //鑰楁潗
+ MaterialModeOther MaterialMode = "鍏朵粬" //鍏朵粬
+ MaterialModeVirtual MaterialMode = "铏氭嫙浠�" //铏氭嫙浠�, 涓嶈兘閿�鍞紝涓嶈兘鍑哄叆搴擄紝涓嶈兘閲囪喘
)
+
+func (t MaterialMode) Valid() bool {
+ if t != MaterialModeRaw &&
+ t != MaterialModeSemi &&
+ t != MaterialModeAuxiliary &&
+ t != MaterialModeConsumables &&
+ t != MaterialModeOther &&
+ t != MaterialModeFinished &&
+ t != MaterialModeVirtual {
+ return false
+ }
+ return true
+}
+
+func (t MaterialMode) Type() MaterialType {
+ switch t {
+ case MaterialModeRaw:
+ return MaterialTypeRaw
+ case MaterialModeSemi:
+ return MaterialTypeSemi
+ case MaterialModeFinished:
+ return MaterialTypeFinished
+ case MaterialModeAuxiliary:
+ return MaterialTypeAuxiliary
+ case MaterialModeConsumables:
+ return MaterialTypeConsumables
+ case MaterialModeOther:
+ return MaterialTypeOther
+ case MaterialModeVirtual:
+ return MaterialTypeVirtual
+ }
+ return MaterialType(0)
+}
+
+// MaterialType 鐗╂枡绫诲瀷(鏁板瓧)
+type MaterialType int
+
+const (
+ MaterialTypeRaw = iota + 1 // 鍘熸潗鏂�
+ MaterialTypeSemi // 鍗婃垚鍝�
+ MaterialTypeFinished // 鎴愬搧
+ MaterialTypeAuxiliary //杈呮枡
+ MaterialTypeConsumables //鑰楁潗
+ MaterialTypeOther //鍏朵粬
+ MaterialTypeVirtual //铏氭嫙浠�
+)
+
+func (t MaterialType) Valid() bool {
+ if t < MaterialTypeRaw ||
+ t > MaterialTypeVirtual {
+ return false
+ }
+ return true
+}
type MaterialStatus int
@@ -176,7 +235,7 @@
OperationStatus_Waiting //姝e湪绛夊緟
OperationStatus_Ready //灏辩华
OperationStatus_Finish //瀹屾垚
- OperationStatus_Cancel //瀹屾垚
+ OperationStatus_Cancel //鍙栨秷
)
type PostType int
@@ -223,3 +282,84 @@
"png": FileType_Picture,
"svg": FileType_Picture,
}
+
+type FileTemplateCategory int
+
+const (
+ FileTemplateCategory_Selfmade FileTemplateCategory = iota + 1 //鍏ュ簱-鑷埗
+ FileTemplateCategory_Output //鍑哄簱
+ FileTemplateCategory_JialianInput1 = 14 //鍢夎仈鍏ュ簱妯℃澘1
+ FileTemplateCategory_JialianOutput1 = 15 //鍢夎仈鍑哄簱妯″潡1
+ FileWarehouseCategory_JialianInput2 = 16 //鍢夎仈鍏ュ簱妯℃澘2
+ FileWarehouseCategory_JialianOutput2 = 17 //鍢夎仈鍑哄簱妯″潡2
+ FileWarehouseCategory_JialianInput3 = 18 //鍢夎仈鐗╂枡瀵煎叆鍏ュ簱妯℃澘3-涓濈坏
+)
+
+type CodeStandardType string
+
+const (
+ CodeStandardType_Material CodeStandardType = "鐗╂枡缂栫爜"
+ CodeStandardType_Incoming CodeStandardType = "鍏ュ簱缂栫爜"
+ CodeStandardType_Outgoing CodeStandardType = "鍑哄簱缂栫爜"
+ CodeStandardType_Internal CodeStandardType = "璋冩嫧缂栫爜"
+ CodeStandardType_Disuse CodeStandardType = "浠撳簱鎶ュ簾缂栫爜"
+ CodeStandardType_TakeStock CodeStandardType = "鐩樼偣缂栫爜"
+)
+
+type OperationSource int
+
+const (
+ OperationSourcePurchase OperationSource = 1 //閲囪喘鍏ュ簱
+ OperationSourceProduction OperationSource = 2 //鐢熶骇鍏ュ簱
+ OperationSourceOutsourcing OperationSource = 3 //濮斿鍏ュ簱
+ OperationSourceProductionApply OperationSource = 4 //鐢熶骇棰嗘枡
+ OperationSourceOutsourcingApply OperationSource = 5 //濮斿棰嗘枡
+ OperationSourceSaleDelivery OperationSource = 6 //閿�鍞彂璐�
+)
+
+const DoMonthStatsToken = "Eoh2ZAUJjtbmu0TBkc3dq7MPCpL4riw5NVxOfgXYlKvHF6sR"
+
+type SystemConfigType int
+
+const (
+ SystemConfigTypeInventoryCutOffPoint SystemConfigType = 1 //搴撳瓨缁撶畻鏃堕棿鐐�
+)
+
+type MiniDictType int
+
+const (
+ StorageType MiniDictType = iota + 1 // 鍏ュ簱绫诲瀷
+ StockoutType // 鍑哄簱绫诲瀷
+ TransferType // 璋冩嫧绫诲瀷
+ TakeStockType // 鐩樼偣绫诲瀷
+ DisuseType // 鎶ュ簾绫诲瀷
+ ProductSource // 浜у搧鏉ユ簮
+)
+
+const (
+ InputTotalHeader string = "鍏ュ簱鍚堣"
+ OutPutTotalHeader string = "鍑哄簱鍚堣"
+)
+
+func (t MiniDictType) Valid() bool {
+ if t <= 0 {
+ return false
+ }
+ return true
+}
+
+// BoolType 甯冨皵绫诲瀷
+type BoolType int
+
+const (
+ BoolTypeTrue BoolType = 1 // true
+ BoolTypeFalse BoolType = 2 // false
+)
+
+func (slf BoolType) IsValid() bool {
+ return slf == BoolTypeTrue || slf == BoolTypeFalse
+}
+
+func (slf BoolType) Bool() bool {
+ return slf == BoolTypeTrue
+}
--
Gitblit v1.8.0