From 5bc036d71ff6094e550c99168eae2e2b4d495f51 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 13 九月 2023 21:10:26 +0800 Subject: [PATCH] 增加位置表,产品分类表,产品表 --- constvar/const.go | 128 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 128 insertions(+), 0 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index c2ae672..dff496d 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -1 +1,129 @@ package constvar + +type BaseOperationType int + +const ( + BaseOperationTypeIncoming BaseOperationType = iota + 1 //鏀惰揣 + BaseOperationTypeOutgoing //浜よ揣 + BaseOperationTypeInternal //鍐呴儴璋冩嫧 +) + +func (slf BaseOperationType) IsValid() bool { + return slf == BaseOperationTypeIncoming || + slf == BaseOperationTypeOutgoing || + slf == BaseOperationTypeInternal +} + +type ReservationMethod int + +const ( + ReservationMethodAtConfirm ReservationMethod = iota + 1 //鍦ㄧ‘璁ゆ椂 + ReservationMethodManual //鎵嬪姩 + ReservationMethodByDate //鍦ㄩ瀹氭棩鏈熶箣鍓� +) + +func (slf ReservationMethod) IsValid() bool { + return slf == ReservationMethodAtConfirm || + slf == ReservationMethodManual || + slf == ReservationMethodByDate +} + +type WhetherType int + +const ( + WhetherTypeAsk WhetherType = iota + 1 //璇㈤棶 + WhetherTypeAlways //鎬绘槸 + ReservationNever //浠庝笉 +) + +func (slf WhetherType) IsValid() bool { + return slf == WhetherTypeAsk || + slf == WhetherTypeAlways || + slf == ReservationNever +} + +// ProductType 浜у搧绫诲瀷 +type ProductType int + +const ( + ProductTypeRaw = iota + 1 // 鍘熸潗鏂� + ProductTypeSemi // 鍗婃垚鍝� + ProductTypeFinished // 鎴愬搧 +) + +type ProductStatus int + +const ( + ProductStatusCreate ProductStatus = iota // 鏂板缓 + ProductStatusActive // 鍚敤 + ProductStatusInactive = -1 // 鍋滅敤 +) + +// PurchaseType 閲囪喘绫诲瀷 +type PurchaseType int + +const ( + PurchaseTypeOutSource PurchaseType = iota + 1 // 閲囪喘 + PurchaseTypeSelf // 鑷埗 + PurchaseTypeEntrust // 濮斿 +) + +func (t PurchaseType) Valid() bool { + if t < PurchaseTypeOutSource || + t > PurchaseTypeEntrust { + return false + } + return true +} + +// LocationType 浣嶇疆绫诲瀷 +type LocationType int + +const ( + LocationTypeVendor LocationType = iota + 1 // 渚涘簲鍟嗕綅缃� + LocationTypeView // 瑙嗗浘 + LocationTypeInternal // 鍐呴儴浣嶇疆 + LocationTypeCustomer // 瀹㈡埛浣嶇疆 + LocationTypeInventoryLoss // 搴撳瓨鎹熷け + LocationTypeProduction // 鐢熶骇 + LocationTypeTransit // 涓浆浣嶇疆 +) + +func (t LocationType) Valid() bool { + return t >= LocationTypeVendor && t <= LocationTypeTransit +} + +type ForceRemovalStrategy int + +const ( + ForceRemovalStrategyFIFO ForceRemovalStrategy = iota + 1 + ForceRemovalStrategyLIFO + ForceRemovalStrategyClosestLocation +) + +func (t ForceRemovalStrategy) Valid() bool { + return t >= ForceRemovalStrategyFIFO && t <= ForceRemovalStrategyClosestLocation +} + +type CostingMethod int + +const ( + CostingMethodStandardPrice CostingMethod = iota + 1 //鏍囧噯浠锋牸 + CostingMethodFIFO //鍏堣繘鍏堝嚭 + CostingMethodAverageCost // +) + +func (t CostingMethod) Valid() bool { + return t >= CostingMethodStandardPrice && t <= CostingMethodAverageCost +} + +type InventoryValuation int + +const ( + InventoryValuationManual InventoryValuation = iota + 1 //鎵嬪姩 + InventoryValuationAuto //鑷姩 +) + +func (t InventoryValuation) Valid() bool { + return t >= InventoryValuationManual && t <= InventoryValuationAuto +} -- Gitblit v1.8.0