Dockerfile
This commit is contained in:
21
consts/stock/batch_status.go
Normal file
21
consts/stock/batch_status.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package stock
|
||||
|
||||
// BatchStatus 批次状态枚举
|
||||
type BatchStatus int
|
||||
|
||||
const (
|
||||
BatchStatusActive BatchStatus = 1 // 活跃
|
||||
BatchStatusExpiring BatchStatus = 2 // 临期
|
||||
BatchStatusExpired BatchStatus = 3 // 过期
|
||||
BatchStatusSoldOut BatchStatus = 4 // 售罄
|
||||
)
|
||||
|
||||
// GetAllBatchStatuses 获取所有批次状态
|
||||
func GetAllBatchStatuses() []BatchStatus {
|
||||
return []BatchStatus{
|
||||
BatchStatusActive,
|
||||
BatchStatusExpiring,
|
||||
BatchStatusExpired,
|
||||
BatchStatusSoldOut,
|
||||
}
|
||||
}
|
||||
57
consts/stock/capacity_unit_area.go
Normal file
57
consts/stock/capacity_unit_area.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitArea 面积单位枚举
|
||||
type CapacityUnitArea string
|
||||
|
||||
const (
|
||||
CapacityUnitAreaSquareM CapacityUnitArea = "M2" // 平方米
|
||||
CapacityUnitAreaSquareFT CapacityUnitArea = "FT2" // 平方英尺
|
||||
CapacityUnitAreaSquareIN CapacityUnitArea = "IN2" // 平方英寸
|
||||
CapacityUnitAreaSquareCM CapacityUnitArea = "CM2" // 平方厘米
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitAreas 获取所有面积单位
|
||||
func GetAllCapacityUnitAreas() []CapacityUnitArea {
|
||||
return []CapacityUnitArea{
|
||||
CapacityUnitAreaSquareM,
|
||||
CapacityUnitAreaSquareFT,
|
||||
CapacityUnitAreaSquareIN,
|
||||
CapacityUnitAreaSquareCM,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitAreaKeyValue struct {
|
||||
Key CapacityUnitArea
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitAreaSquareMKeyValue = CapacityUnitAreaKeyValue{Key: CapacityUnitAreaSquareM, Value: "平方米"}
|
||||
CapacityUnitAreaSquareFTKeyValue = CapacityUnitAreaKeyValue{Key: CapacityUnitAreaSquareFT, Value: "平方英尺"}
|
||||
CapacityUnitAreaSquareINKeyValue = CapacityUnitAreaKeyValue{Key: CapacityUnitAreaSquareIN, Value: "平方英寸"}
|
||||
CapacityUnitAreaSquareCMKeyValue = CapacityUnitAreaKeyValue{Key: CapacityUnitAreaSquareCM, Value: "平方厘米"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitAreaKeyValue() []CapacityUnitAreaKeyValue {
|
||||
return []CapacityUnitAreaKeyValue{
|
||||
CapacityUnitAreaSquareMKeyValue,
|
||||
CapacityUnitAreaSquareFTKeyValue,
|
||||
CapacityUnitAreaSquareINKeyValue,
|
||||
CapacityUnitAreaSquareCMKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitAreaValueMap = map[CapacityUnitArea]string{
|
||||
CapacityUnitAreaSquareM: CapacityUnitAreaSquareMKeyValue.Value,
|
||||
CapacityUnitAreaSquareFT: CapacityUnitAreaSquareFTKeyValue.Value,
|
||||
CapacityUnitAreaSquareIN: CapacityUnitAreaSquareINKeyValue.Value,
|
||||
CapacityUnitAreaSquareCM: CapacityUnitAreaSquareCMKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitAreaValueByKey(key CapacityUnitArea) (value string) {
|
||||
value, exists := capacityUnitAreaValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
72
consts/stock/capacity_unit_length.go
Normal file
72
consts/stock/capacity_unit_length.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitLength 长度单位枚举
|
||||
type CapacityUnitLength string
|
||||
|
||||
const (
|
||||
CapacityUnitLengthM CapacityUnitLength = "M" // 米
|
||||
CapacityUnitLengthCM CapacityUnitLength = "CM" // 厘米
|
||||
CapacityUnitLengthMM CapacityUnitLength = "MM" // 毫米
|
||||
CapacityUnitLengthKM CapacityUnitLength = "KM" // 千米
|
||||
CapacityUnitLengthFT CapacityUnitLength = "FT" // 英尺
|
||||
CapacityUnitLengthIN CapacityUnitLength = "IN" // 英寸
|
||||
CapacityUnitLengthYD CapacityUnitLength = "YD" // 码
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitLengths 获取所有长度单位
|
||||
func GetAllCapacityUnitLengths() []CapacityUnitLength {
|
||||
return []CapacityUnitLength{
|
||||
CapacityUnitLengthM,
|
||||
CapacityUnitLengthCM,
|
||||
CapacityUnitLengthMM,
|
||||
CapacityUnitLengthKM,
|
||||
CapacityUnitLengthFT,
|
||||
CapacityUnitLengthIN,
|
||||
CapacityUnitLengthYD,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitLengthKeyValue struct {
|
||||
Key CapacityUnitLength
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitLengthMKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthM, Value: "米"}
|
||||
CapacityUnitLengthCMKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthCM, Value: "厘米"}
|
||||
CapacityUnitLengthMMKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthMM, Value: "毫米"}
|
||||
CapacityUnitLengthKMKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthKM, Value: "千米"}
|
||||
CapacityUnitLengthFTKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthFT, Value: "英尺"}
|
||||
CapacityUnitLengthINKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthIN, Value: "英寸"}
|
||||
CapacityUnitLengthYDKeyValue = CapacityUnitLengthKeyValue{Key: CapacityUnitLengthYD, Value: "码"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitLengthKeyValue() []CapacityUnitLengthKeyValue {
|
||||
return []CapacityUnitLengthKeyValue{
|
||||
CapacityUnitLengthMKeyValue,
|
||||
CapacityUnitLengthCMKeyValue,
|
||||
CapacityUnitLengthMMKeyValue,
|
||||
CapacityUnitLengthKMKeyValue,
|
||||
CapacityUnitLengthFTKeyValue,
|
||||
CapacityUnitLengthINKeyValue,
|
||||
CapacityUnitLengthYDKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitLengthValueMap = map[CapacityUnitLength]string{
|
||||
CapacityUnitLengthM: CapacityUnitLengthMKeyValue.Value,
|
||||
CapacityUnitLengthCM: CapacityUnitLengthCMKeyValue.Value,
|
||||
CapacityUnitLengthMM: CapacityUnitLengthMMKeyValue.Value,
|
||||
CapacityUnitLengthKM: CapacityUnitLengthKMKeyValue.Value,
|
||||
CapacityUnitLengthFT: CapacityUnitLengthFTKeyValue.Value,
|
||||
CapacityUnitLengthIN: CapacityUnitLengthINKeyValue.Value,
|
||||
CapacityUnitLengthYD: CapacityUnitLengthYDKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitLengthValueByKey(key CapacityUnitLength) (value string) {
|
||||
value, exists := capacityUnitLengthValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
252
consts/stock/capacity_unit_packaging.go
Normal file
252
consts/stock/capacity_unit_packaging.go
Normal file
@@ -0,0 +1,252 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitPackaging 包装单位枚举
|
||||
type CapacityUnitPackaging string
|
||||
|
||||
const (
|
||||
// 纸箱类
|
||||
CapacityUnitPackagingCartonInner CapacityUnitPackaging = "CARTON_INNER" // 内盒
|
||||
CapacityUnitPackagingCartonOuter CapacityUnitPackaging = "CARTON_OUTER" // 外箱
|
||||
CapacityUnitPackagingCarton CapacityUnitPackaging = "CARTON" // 纸箱
|
||||
CapacityUnitPackagingCase CapacityUnitPackaging = "CASE" // 箱/盒
|
||||
CapacityUnitPackagingBox CapacityUnitPackaging = "BOX" // 箱
|
||||
CapacityUnitPackagingMiniBox CapacityUnitPackaging = "MINI_BOX" // 迷你盒
|
||||
|
||||
// 托盘/容器类
|
||||
CapacityUnitPackagingPallet CapacityUnitPackaging = "PALLET" // 托盘
|
||||
CapacityUnitPackagingTray CapacityUnitPackaging = "TRAY" // 托盘/托架
|
||||
CapacityUnitPackagingContainer CapacityUnitPackaging = "CONTAINER" // 集装箱/货柜
|
||||
CapacityUnitPackagingBin CapacityUnitPackaging = "BIN" // 料箱
|
||||
CapacityUnitPackagingCrate CapacityUnitPackaging = "CRATE" // 条板箱
|
||||
CapacityUnitPackagingBasket CapacityUnitPackaging = "BASKET" // 篮子
|
||||
CapacityUnitPackagingCart CapacityUnitPackaging = "CART" // 手推车
|
||||
|
||||
// 袋/包/捆类
|
||||
CapacityUnitPackagingBag CapacityUnitPackaging = "BAG" // 袋
|
||||
CapacityUnitPackagingSack CapacityUnitPackaging = "SACK" // 麻袋
|
||||
CapacityUnitPackagingPack CapacityUnitPackaging = "PACK" // 包
|
||||
CapacityUnitPackagingBundle CapacityUnitPackaging = "BUNDLE" // 捆
|
||||
CapacityUnitPackagingBale CapacityUnitPackaging = "BALE" // 大包/捆
|
||||
CapacityUnitPackagingPacket CapacityUnitPackaging = "PACKET" // 小包
|
||||
|
||||
// 瓶/罐/桶类
|
||||
CapacityUnitPackagingBottle CapacityUnitPackaging = "BOTTLE" // 瓶
|
||||
CapacityUnitPackagingDrum CapacityUnitPackaging = "DRUM" // 桶
|
||||
CapacityUnitPackagingJar CapacityUnitPackaging = "JAR" // 罐/瓶
|
||||
CapacityUnitPackagingCan CapacityUnitPackaging = "CAN" // 罐/听
|
||||
CapacityUnitPackagingBarrel CapacityUnitPackaging = "BARREL" // 大桶
|
||||
CapacityUnitPackagingKeg CapacityUnitPackaging = "KEG" // 小桶
|
||||
CapacityUnitPackagingTin CapacityUnitPackaging = "TIN" // 锡罐
|
||||
|
||||
// 卷/轴/管类
|
||||
CapacityUnitPackagingRoll CapacityUnitPackaging = "ROLL" // 卷
|
||||
CapacityUnitPackagingReel CapacityUnitPackaging = "REEL" // 卷盘
|
||||
CapacityUnitPackagingSpool CapacityUnitPackaging = "SPOOL" // 线轴
|
||||
CapacityUnitPackagingTube CapacityUnitPackaging = "TUBE" // 筒/管
|
||||
CapacityUnitPackagingCoil CapacityUnitPackaging = "COIL" // 线圈
|
||||
|
||||
// 板/片/块类
|
||||
CapacityUnitPackagingSheet CapacityUnitPackaging = "SHEET" // 张/片
|
||||
CapacityUnitPackagingPanel CapacityUnitPackaging = "PANEL" // 板
|
||||
CapacityUnitPackagingBlock CapacityUnitPackaging = "BLOCK" // 块
|
||||
CapacityUnitPackagingPlate CapacityUnitPackaging = "PLATE" // 板/片
|
||||
CapacityUnitPackagingSlab CapacityUnitPackaging = "SLAB" // 厚板
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitPackaging 获取所有包装单位
|
||||
func GetAllCapacityUnitPackaging() []CapacityUnitPackaging {
|
||||
return []CapacityUnitPackaging{
|
||||
// 纸箱类
|
||||
CapacityUnitPackagingCartonInner,
|
||||
CapacityUnitPackagingCartonOuter,
|
||||
CapacityUnitPackagingCarton,
|
||||
CapacityUnitPackagingCase,
|
||||
CapacityUnitPackagingBox,
|
||||
CapacityUnitPackagingMiniBox,
|
||||
// 托盘/容器类
|
||||
CapacityUnitPackagingPallet,
|
||||
CapacityUnitPackagingTray,
|
||||
CapacityUnitPackagingContainer,
|
||||
CapacityUnitPackagingBin,
|
||||
CapacityUnitPackagingCrate,
|
||||
CapacityUnitPackagingBasket,
|
||||
CapacityUnitPackagingCart,
|
||||
// 袋/包/捆类
|
||||
CapacityUnitPackagingBag,
|
||||
CapacityUnitPackagingSack,
|
||||
CapacityUnitPackagingPack,
|
||||
CapacityUnitPackagingBundle,
|
||||
CapacityUnitPackagingBale,
|
||||
CapacityUnitPackagingPacket,
|
||||
// 瓶/罐/桶类
|
||||
CapacityUnitPackagingBottle,
|
||||
CapacityUnitPackagingDrum,
|
||||
CapacityUnitPackagingJar,
|
||||
CapacityUnitPackagingCan,
|
||||
CapacityUnitPackagingBarrel,
|
||||
CapacityUnitPackagingKeg,
|
||||
CapacityUnitPackagingTin,
|
||||
// 卷/轴/管类
|
||||
CapacityUnitPackagingRoll,
|
||||
CapacityUnitPackagingReel,
|
||||
CapacityUnitPackagingSpool,
|
||||
CapacityUnitPackagingTube,
|
||||
CapacityUnitPackagingCoil,
|
||||
// 板/片/块类
|
||||
CapacityUnitPackagingSheet,
|
||||
CapacityUnitPackagingPanel,
|
||||
CapacityUnitPackagingBlock,
|
||||
CapacityUnitPackagingPlate,
|
||||
CapacityUnitPackagingSlab,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitPackagingKeyValue struct {
|
||||
Key CapacityUnitPackaging
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
// 纸箱类
|
||||
CapacityUnitPackagingCartonInnerKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCartonInner, Value: "内盒"}
|
||||
CapacityUnitPackagingCartonOuterKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCartonOuter, Value: "外箱"}
|
||||
CapacityUnitPackagingCartonKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCarton, Value: "纸箱"}
|
||||
CapacityUnitPackagingCaseKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCase, Value: "箱/盒"}
|
||||
CapacityUnitPackagingBoxKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBox, Value: "箱"}
|
||||
CapacityUnitPackagingMiniBoxKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingMiniBox, Value: "迷你盒"}
|
||||
// 托盘/容器类
|
||||
CapacityUnitPackagingPalletKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingPallet, Value: "托盘"}
|
||||
CapacityUnitPackagingTrayKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingTray, Value: "托盘/托架"}
|
||||
CapacityUnitPackagingContainerKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingContainer, Value: "集装箱/货柜"}
|
||||
CapacityUnitPackagingBinKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBin, Value: "料箱"}
|
||||
CapacityUnitPackagingCrateKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCrate, Value: "条板箱"}
|
||||
CapacityUnitPackagingBasketKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBasket, Value: "篮子"}
|
||||
CapacityUnitPackagingCartKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCart, Value: "手推车"}
|
||||
// 袋/包/捆类
|
||||
CapacityUnitPackagingBagKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBag, Value: "袋"}
|
||||
CapacityUnitPackagingSackKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingSack, Value: "麻袋"}
|
||||
CapacityUnitPackagingPackKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingPack, Value: "包"}
|
||||
CapacityUnitPackagingBundleKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBundle, Value: "捆"}
|
||||
CapacityUnitPackagingBaleKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBale, Value: "大包/捆"}
|
||||
CapacityUnitPackagingPacketKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingPacket, Value: "小包"}
|
||||
// 瓶/罐/桶类
|
||||
CapacityUnitPackagingBottleKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBottle, Value: "瓶"}
|
||||
CapacityUnitPackagingDrumKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingDrum, Value: "桶"}
|
||||
CapacityUnitPackagingJarKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingJar, Value: "罐/瓶"}
|
||||
CapacityUnitPackagingCanKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCan, Value: "罐/听"}
|
||||
CapacityUnitPackagingBarrelKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBarrel, Value: "大桶"}
|
||||
CapacityUnitPackagingKegKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingKeg, Value: "小桶"}
|
||||
CapacityUnitPackagingTinKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingTin, Value: "锡罐"}
|
||||
// 卷/轴/管类
|
||||
CapacityUnitPackagingRollKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingRoll, Value: "卷"}
|
||||
CapacityUnitPackagingReelKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingReel, Value: "卷盘"}
|
||||
CapacityUnitPackagingSpoolKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingSpool, Value: "线轴"}
|
||||
CapacityUnitPackagingTubeKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingTube, Value: "筒/管"}
|
||||
CapacityUnitPackagingCoilKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingCoil, Value: "线圈"}
|
||||
// 板/片/块类
|
||||
CapacityUnitPackagingSheetKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingSheet, Value: "张/片"}
|
||||
CapacityUnitPackagingPanelKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingPanel, Value: "板"}
|
||||
CapacityUnitPackagingBlockKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingBlock, Value: "块"}
|
||||
CapacityUnitPackagingPlateKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingPlate, Value: "板/片"}
|
||||
CapacityUnitPackagingSlabKeyValue = CapacityUnitPackagingKeyValue{Key: CapacityUnitPackagingSlab, Value: "厚板"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitPackagingKeyValue() []CapacityUnitPackagingKeyValue {
|
||||
return []CapacityUnitPackagingKeyValue{
|
||||
// 纸箱类
|
||||
CapacityUnitPackagingCartonInnerKeyValue,
|
||||
CapacityUnitPackagingCartonOuterKeyValue,
|
||||
CapacityUnitPackagingCartonKeyValue,
|
||||
CapacityUnitPackagingCaseKeyValue,
|
||||
CapacityUnitPackagingBoxKeyValue,
|
||||
CapacityUnitPackagingMiniBoxKeyValue,
|
||||
// 托盘/容器类
|
||||
CapacityUnitPackagingPalletKeyValue,
|
||||
CapacityUnitPackagingTrayKeyValue,
|
||||
CapacityUnitPackagingContainerKeyValue,
|
||||
CapacityUnitPackagingBinKeyValue,
|
||||
CapacityUnitPackagingCrateKeyValue,
|
||||
CapacityUnitPackagingBasketKeyValue,
|
||||
CapacityUnitPackagingCartKeyValue,
|
||||
// 袋/包/捆类
|
||||
CapacityUnitPackagingBagKeyValue,
|
||||
CapacityUnitPackagingSackKeyValue,
|
||||
CapacityUnitPackagingPackKeyValue,
|
||||
CapacityUnitPackagingBundleKeyValue,
|
||||
CapacityUnitPackagingBaleKeyValue,
|
||||
CapacityUnitPackagingPacketKeyValue,
|
||||
// 瓶/罐/桶类
|
||||
CapacityUnitPackagingBottleKeyValue,
|
||||
CapacityUnitPackagingDrumKeyValue,
|
||||
CapacityUnitPackagingJarKeyValue,
|
||||
CapacityUnitPackagingCanKeyValue,
|
||||
CapacityUnitPackagingBarrelKeyValue,
|
||||
CapacityUnitPackagingKegKeyValue,
|
||||
CapacityUnitPackagingTinKeyValue,
|
||||
// 卷/轴/管类
|
||||
CapacityUnitPackagingRollKeyValue,
|
||||
CapacityUnitPackagingReelKeyValue,
|
||||
CapacityUnitPackagingSpoolKeyValue,
|
||||
CapacityUnitPackagingTubeKeyValue,
|
||||
CapacityUnitPackagingCoilKeyValue,
|
||||
// 板/片/块类
|
||||
CapacityUnitPackagingSheetKeyValue,
|
||||
CapacityUnitPackagingPanelKeyValue,
|
||||
CapacityUnitPackagingBlockKeyValue,
|
||||
CapacityUnitPackagingPlateKeyValue,
|
||||
CapacityUnitPackagingSlabKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitPackagingValueMap = map[CapacityUnitPackaging]string{
|
||||
// 纸箱类
|
||||
CapacityUnitPackagingCartonInner: CapacityUnitPackagingCartonInnerKeyValue.Value,
|
||||
CapacityUnitPackagingCartonOuter: CapacityUnitPackagingCartonOuterKeyValue.Value,
|
||||
CapacityUnitPackagingCarton: CapacityUnitPackagingCartonKeyValue.Value,
|
||||
CapacityUnitPackagingCase: CapacityUnitPackagingCaseKeyValue.Value,
|
||||
CapacityUnitPackagingBox: CapacityUnitPackagingBoxKeyValue.Value,
|
||||
CapacityUnitPackagingMiniBox: CapacityUnitPackagingMiniBoxKeyValue.Value,
|
||||
// 托盘/容器类
|
||||
CapacityUnitPackagingPallet: CapacityUnitPackagingPalletKeyValue.Value,
|
||||
CapacityUnitPackagingTray: CapacityUnitPackagingTrayKeyValue.Value,
|
||||
CapacityUnitPackagingContainer: CapacityUnitPackagingContainerKeyValue.Value,
|
||||
CapacityUnitPackagingBin: CapacityUnitPackagingBinKeyValue.Value,
|
||||
CapacityUnitPackagingCrate: CapacityUnitPackagingCrateKeyValue.Value,
|
||||
CapacityUnitPackagingBasket: CapacityUnitPackagingBasketKeyValue.Value,
|
||||
CapacityUnitPackagingCart: CapacityUnitPackagingCartKeyValue.Value,
|
||||
// 袋/包/捆类
|
||||
CapacityUnitPackagingBag: CapacityUnitPackagingBagKeyValue.Value,
|
||||
CapacityUnitPackagingSack: CapacityUnitPackagingSackKeyValue.Value,
|
||||
CapacityUnitPackagingPack: CapacityUnitPackagingPackKeyValue.Value,
|
||||
CapacityUnitPackagingBundle: CapacityUnitPackagingBundleKeyValue.Value,
|
||||
CapacityUnitPackagingBale: CapacityUnitPackagingBaleKeyValue.Value,
|
||||
CapacityUnitPackagingPacket: CapacityUnitPackagingPacketKeyValue.Value,
|
||||
// 瓶/罐/桶类
|
||||
CapacityUnitPackagingBottle: CapacityUnitPackagingBottleKeyValue.Value,
|
||||
CapacityUnitPackagingDrum: CapacityUnitPackagingDrumKeyValue.Value,
|
||||
CapacityUnitPackagingJar: CapacityUnitPackagingJarKeyValue.Value,
|
||||
CapacityUnitPackagingCan: CapacityUnitPackagingCanKeyValue.Value,
|
||||
CapacityUnitPackagingBarrel: CapacityUnitPackagingBarrelKeyValue.Value,
|
||||
CapacityUnitPackagingKeg: CapacityUnitPackagingKegKeyValue.Value,
|
||||
CapacityUnitPackagingTin: CapacityUnitPackagingTinKeyValue.Value,
|
||||
// 卷/轴/管类
|
||||
CapacityUnitPackagingRoll: CapacityUnitPackagingRollKeyValue.Value,
|
||||
CapacityUnitPackagingReel: CapacityUnitPackagingReelKeyValue.Value,
|
||||
CapacityUnitPackagingSpool: CapacityUnitPackagingSpoolKeyValue.Value,
|
||||
CapacityUnitPackagingTube: CapacityUnitPackagingTubeKeyValue.Value,
|
||||
CapacityUnitPackagingCoil: CapacityUnitPackagingCoilKeyValue.Value,
|
||||
// 板/片/块类
|
||||
CapacityUnitPackagingSheet: CapacityUnitPackagingSheetKeyValue.Value,
|
||||
CapacityUnitPackagingPanel: CapacityUnitPackagingPanelKeyValue.Value,
|
||||
CapacityUnitPackagingBlock: CapacityUnitPackagingBlockKeyValue.Value,
|
||||
CapacityUnitPackagingPlate: CapacityUnitPackagingPlateKeyValue.Value,
|
||||
CapacityUnitPackagingSlab: CapacityUnitPackagingSlabKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitPackagingValueByKey(key CapacityUnitPackaging) (value string) {
|
||||
value, exists := capacityUnitPackagingValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
92
consts/stock/capacity_unit_quantity.go
Normal file
92
consts/stock/capacity_unit_quantity.go
Normal file
@@ -0,0 +1,92 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitQuantity 数量单位枚举
|
||||
type CapacityUnitQuantity string
|
||||
|
||||
const (
|
||||
CapacityUnitQuantityPCS CapacityUnitQuantity = "PCS" // 件
|
||||
CapacityUnitQuantityPiece CapacityUnitQuantity = "PIECE" // 个
|
||||
CapacityUnitQuantityUnit CapacityUnitQuantity = "UNIT" // 单位
|
||||
CapacityUnitQuantityItem CapacityUnitQuantity = "ITEM" // 项
|
||||
CapacityUnitQuantityEach CapacityUnitQuantity = "EACH" // 每一个
|
||||
CapacityUnitQuantityPair CapacityUnitQuantity = "PAIR" // 双/对
|
||||
CapacityUnitQuantitySet CapacityUnitQuantity = "SET" // 套
|
||||
CapacityUnitQuantityKit CapacityUnitQuantity = "KIT" // 成套件
|
||||
CapacityUnitQuantityGroup CapacityUnitQuantity = "GROUP" // 组
|
||||
CapacityUnitQuantityLot CapacityUnitQuantity = "LOT" // 批
|
||||
CapacityUnitQuantityBatch CapacityUnitQuantity = "BATCH" // 批次
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitQuantities 获取所有数量单位
|
||||
func GetAllCapacityUnitQuantities() []CapacityUnitQuantity {
|
||||
return []CapacityUnitQuantity{
|
||||
CapacityUnitQuantityPCS,
|
||||
CapacityUnitQuantityPiece,
|
||||
CapacityUnitQuantityUnit,
|
||||
CapacityUnitQuantityItem,
|
||||
CapacityUnitQuantityEach,
|
||||
CapacityUnitQuantityPair,
|
||||
CapacityUnitQuantitySet,
|
||||
CapacityUnitQuantityKit,
|
||||
CapacityUnitQuantityGroup,
|
||||
CapacityUnitQuantityLot,
|
||||
CapacityUnitQuantityBatch,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitQuantityKeyValue struct {
|
||||
Key CapacityUnitQuantity
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitQuantityPCSKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityPCS, Value: "件"}
|
||||
CapacityUnitQuantityPieceKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityPiece, Value: "个"}
|
||||
CapacityUnitQuantityUnitKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityUnit, Value: "单位"}
|
||||
CapacityUnitQuantityItemKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityItem, Value: "项"}
|
||||
CapacityUnitQuantityEachKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityEach, Value: "每一个"}
|
||||
CapacityUnitQuantityPairKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityPair, Value: "双/对"}
|
||||
CapacityUnitQuantitySetKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantitySet, Value: "套"}
|
||||
CapacityUnitQuantityKitKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityKit, Value: "成套件"}
|
||||
CapacityUnitQuantityGroupKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityGroup, Value: "组"}
|
||||
CapacityUnitQuantityLotKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityLot, Value: "批"}
|
||||
CapacityUnitQuantityBatchKeyValue = CapacityUnitQuantityKeyValue{Key: CapacityUnitQuantityBatch, Value: "批次"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitQuantityKeyValue() []CapacityUnitQuantityKeyValue {
|
||||
return []CapacityUnitQuantityKeyValue{
|
||||
CapacityUnitQuantityPCSKeyValue,
|
||||
CapacityUnitQuantityPieceKeyValue,
|
||||
CapacityUnitQuantityUnitKeyValue,
|
||||
CapacityUnitQuantityItemKeyValue,
|
||||
CapacityUnitQuantityEachKeyValue,
|
||||
CapacityUnitQuantityPairKeyValue,
|
||||
CapacityUnitQuantitySetKeyValue,
|
||||
CapacityUnitQuantityKitKeyValue,
|
||||
CapacityUnitQuantityGroupKeyValue,
|
||||
CapacityUnitQuantityLotKeyValue,
|
||||
CapacityUnitQuantityBatchKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitQuantityValueMap = map[CapacityUnitQuantity]string{
|
||||
CapacityUnitQuantityPCS: CapacityUnitQuantityPCSKeyValue.Value,
|
||||
CapacityUnitQuantityPiece: CapacityUnitQuantityPieceKeyValue.Value,
|
||||
CapacityUnitQuantityUnit: CapacityUnitQuantityUnitKeyValue.Value,
|
||||
CapacityUnitQuantityItem: CapacityUnitQuantityItemKeyValue.Value,
|
||||
CapacityUnitQuantityEach: CapacityUnitQuantityEachKeyValue.Value,
|
||||
CapacityUnitQuantityPair: CapacityUnitQuantityPairKeyValue.Value,
|
||||
CapacityUnitQuantitySet: CapacityUnitQuantitySetKeyValue.Value,
|
||||
CapacityUnitQuantityKit: CapacityUnitQuantityKitKeyValue.Value,
|
||||
CapacityUnitQuantityGroup: CapacityUnitQuantityGroupKeyValue.Value,
|
||||
CapacityUnitQuantityLot: CapacityUnitQuantityLotKeyValue.Value,
|
||||
CapacityUnitQuantityBatch: CapacityUnitQuantityBatchKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitQuantityValueByKey(key CapacityUnitQuantity) (value string) {
|
||||
value, exists := capacityUnitQuantityValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
67
consts/stock/capacity_unit_type.go
Normal file
67
consts/stock/capacity_unit_type.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitType 容量单位类型枚举
|
||||
type CapacityUnitType string
|
||||
|
||||
const (
|
||||
CapacityUnitTypeQuantity CapacityUnitType = "quantity" // 数量单位
|
||||
CapacityUnitTypeWeight CapacityUnitType = "weight" // 重量单位
|
||||
CapacityUnitTypeVolume CapacityUnitType = "volume" // 体积单位
|
||||
CapacityUnitTypeArea CapacityUnitType = "area" // 面积单位
|
||||
CapacityUnitTypeLength CapacityUnitType = "length" // 长度单位
|
||||
CapacityUnitTypePackaging CapacityUnitType = "packaging" // 包装单位
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitTypes 获取所有容量单位类型
|
||||
func GetAllCapacityUnitTypes() []CapacityUnitType {
|
||||
return []CapacityUnitType{
|
||||
CapacityUnitTypeQuantity,
|
||||
CapacityUnitTypeWeight,
|
||||
CapacityUnitTypeVolume,
|
||||
CapacityUnitTypeArea,
|
||||
CapacityUnitTypeLength,
|
||||
CapacityUnitTypePackaging,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitTypeKeyValue struct {
|
||||
Key CapacityUnitType
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitTypeQuantityKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypeQuantity, Value: "数量单位"}
|
||||
CapacityUnitTypeWeightKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypeWeight, Value: "重量单位"}
|
||||
CapacityUnitTypeVolumeKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypeVolume, Value: "体积单位"}
|
||||
CapacityUnitTypeAreaKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypeArea, Value: "面积单位"}
|
||||
CapacityUnitTypeLengthKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypeLength, Value: "长度单位"}
|
||||
CapacityUnitTypePackagingKeyValue = CapacityUnitTypeKeyValue{Key: CapacityUnitTypePackaging, Value: "包装单位"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitTypeKeyValue() []CapacityUnitTypeKeyValue {
|
||||
return []CapacityUnitTypeKeyValue{
|
||||
CapacityUnitTypeQuantityKeyValue,
|
||||
CapacityUnitTypeWeightKeyValue,
|
||||
CapacityUnitTypeVolumeKeyValue,
|
||||
CapacityUnitTypeAreaKeyValue,
|
||||
CapacityUnitTypeLengthKeyValue,
|
||||
CapacityUnitTypePackagingKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitTypeValueMap = map[CapacityUnitType]string{
|
||||
CapacityUnitTypeQuantity: CapacityUnitTypeQuantityKeyValue.Value,
|
||||
CapacityUnitTypeWeight: CapacityUnitTypeWeightKeyValue.Value,
|
||||
CapacityUnitTypeVolume: CapacityUnitTypeVolumeKeyValue.Value,
|
||||
CapacityUnitTypeArea: CapacityUnitTypeAreaKeyValue.Value,
|
||||
CapacityUnitTypeLength: CapacityUnitTypeLengthKeyValue.Value,
|
||||
CapacityUnitTypePackaging: CapacityUnitTypePackagingKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitTypeValueByKey(key CapacityUnitType) (value string) {
|
||||
value, exists := capacityUnitTypeValueMap[key]
|
||||
if !exists {
|
||||
value = "未知类型"
|
||||
}
|
||||
return
|
||||
}
|
||||
62
consts/stock/capacity_unit_volume.go
Normal file
62
consts/stock/capacity_unit_volume.go
Normal file
@@ -0,0 +1,62 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitVolume 体积单位枚举
|
||||
type CapacityUnitVolume string
|
||||
|
||||
const (
|
||||
CapacityUnitVolumeCBM CapacityUnitVolume = "CBM" // 立方米
|
||||
CapacityUnitVolumeM3 CapacityUnitVolume = "M3" // 立方米
|
||||
CapacityUnitVolumeL CapacityUnitVolume = "L" // 升
|
||||
CapacityUnitVolumeML CapacityUnitVolume = "ML" // 毫升
|
||||
CapacityUnitVolumeGAL CapacityUnitVolume = "GAL" // 加仑
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitVolumes 获取所有体积单位
|
||||
func GetAllCapacityUnitVolumes() []CapacityUnitVolume {
|
||||
return []CapacityUnitVolume{
|
||||
CapacityUnitVolumeCBM,
|
||||
CapacityUnitVolumeM3,
|
||||
CapacityUnitVolumeL,
|
||||
CapacityUnitVolumeML,
|
||||
CapacityUnitVolumeGAL,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitVolumeKeyValue struct {
|
||||
Key CapacityUnitVolume
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitVolumeCBMKeyValue = CapacityUnitVolumeKeyValue{Key: CapacityUnitVolumeCBM, Value: "立方米"}
|
||||
CapacityUnitVolumeM3KeyValue = CapacityUnitVolumeKeyValue{Key: CapacityUnitVolumeM3, Value: "立方米"}
|
||||
CapacityUnitVolumeLKeyValue = CapacityUnitVolumeKeyValue{Key: CapacityUnitVolumeL, Value: "升"}
|
||||
CapacityUnitVolumeMLKeyValue = CapacityUnitVolumeKeyValue{Key: CapacityUnitVolumeML, Value: "毫升"}
|
||||
CapacityUnitVolumeGALKeyValue = CapacityUnitVolumeKeyValue{Key: CapacityUnitVolumeGAL, Value: "加仑"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitVolumeKeyValue() []CapacityUnitVolumeKeyValue {
|
||||
return []CapacityUnitVolumeKeyValue{
|
||||
CapacityUnitVolumeCBMKeyValue,
|
||||
CapacityUnitVolumeM3KeyValue,
|
||||
CapacityUnitVolumeLKeyValue,
|
||||
CapacityUnitVolumeMLKeyValue,
|
||||
CapacityUnitVolumeGALKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitVolumeValueMap = map[CapacityUnitVolume]string{
|
||||
CapacityUnitVolumeCBM: CapacityUnitVolumeCBMKeyValue.Value,
|
||||
CapacityUnitVolumeM3: CapacityUnitVolumeM3KeyValue.Value,
|
||||
CapacityUnitVolumeL: CapacityUnitVolumeLKeyValue.Value,
|
||||
CapacityUnitVolumeML: CapacityUnitVolumeMLKeyValue.Value,
|
||||
CapacityUnitVolumeGAL: CapacityUnitVolumeGALKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitVolumeValueByKey(key CapacityUnitVolume) (value string) {
|
||||
value, exists := capacityUnitVolumeValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
67
consts/stock/capacity_unit_weight.go
Normal file
67
consts/stock/capacity_unit_weight.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package stock
|
||||
|
||||
// CapacityUnitWeight 重量单位枚举
|
||||
type CapacityUnitWeight string
|
||||
|
||||
const (
|
||||
CapacityUnitWeightKG CapacityUnitWeight = "KG" // 千克
|
||||
CapacityUnitWeightTon CapacityUnitWeight = "TON" // 吨
|
||||
CapacityUnitWeightG CapacityUnitWeight = "G" // 克
|
||||
CapacityUnitWeightMG CapacityUnitWeight = "MG" // 毫克
|
||||
CapacityUnitWeightLB CapacityUnitWeight = "LB" // 磅
|
||||
CapacityUnitWeightOZ CapacityUnitWeight = "OZ" // 盎司
|
||||
)
|
||||
|
||||
// GetAllCapacityUnitWeights 获取所有重量单位
|
||||
func GetAllCapacityUnitWeights() []CapacityUnitWeight {
|
||||
return []CapacityUnitWeight{
|
||||
CapacityUnitWeightKG,
|
||||
CapacityUnitWeightTon,
|
||||
CapacityUnitWeightG,
|
||||
CapacityUnitWeightMG,
|
||||
CapacityUnitWeightLB,
|
||||
CapacityUnitWeightOZ,
|
||||
}
|
||||
}
|
||||
|
||||
type CapacityUnitWeightKeyValue struct {
|
||||
Key CapacityUnitWeight
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
CapacityUnitWeightKGKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightKG, Value: "千克"}
|
||||
CapacityUnitWeightTonKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightTon, Value: "吨"}
|
||||
CapacityUnitWeightGKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightG, Value: "克"}
|
||||
CapacityUnitWeightMGKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightMG, Value: "毫克"}
|
||||
CapacityUnitWeightLBKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightLB, Value: "磅"}
|
||||
CapacityUnitWeightOZKeyValue = CapacityUnitWeightKeyValue{Key: CapacityUnitWeightOZ, Value: "盎司"}
|
||||
)
|
||||
|
||||
func GetAllCapacityUnitWeightKeyValue() []CapacityUnitWeightKeyValue {
|
||||
return []CapacityUnitWeightKeyValue{
|
||||
CapacityUnitWeightKGKeyValue,
|
||||
CapacityUnitWeightTonKeyValue,
|
||||
CapacityUnitWeightGKeyValue,
|
||||
CapacityUnitWeightMGKeyValue,
|
||||
CapacityUnitWeightLBKeyValue,
|
||||
CapacityUnitWeightOZKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var capacityUnitWeightValueMap = map[CapacityUnitWeight]string{
|
||||
CapacityUnitWeightKG: CapacityUnitWeightKGKeyValue.Value,
|
||||
CapacityUnitWeightTon: CapacityUnitWeightTonKeyValue.Value,
|
||||
CapacityUnitWeightG: CapacityUnitWeightGKeyValue.Value,
|
||||
CapacityUnitWeightMG: CapacityUnitWeightMGKeyValue.Value,
|
||||
CapacityUnitWeightLB: CapacityUnitWeightLBKeyValue.Value,
|
||||
CapacityUnitWeightOZ: CapacityUnitWeightOZKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetCapacityUnitWeightValueByKey(key CapacityUnitWeight) (value string) {
|
||||
value, exists := capacityUnitWeightValueMap[key]
|
||||
if !exists {
|
||||
value = "未知单位"
|
||||
}
|
||||
return
|
||||
}
|
||||
45
consts/stock/discrepancy_type.go
Normal file
45
consts/stock/discrepancy_type.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package stock
|
||||
|
||||
// DiscrepancyType 差异类型枚举
|
||||
type DiscrepancyType int
|
||||
|
||||
const (
|
||||
DiscrepancyTypeNone DiscrepancyType = 0 // 无差异
|
||||
DiscrepancyTypeOverflow DiscrepancyType = 1 // 盘盈
|
||||
DiscrepancyTypeShortage DiscrepancyType = 2 // 盘亏
|
||||
DiscrepancyTypeWrongItem DiscrepancyType = 3 // 错货
|
||||
DiscrepancyTypeDamage DiscrepancyType = 4 // 损坏
|
||||
DiscrepancyTypeExpired DiscrepancyType = 5 // 过期
|
||||
)
|
||||
|
||||
// GetAllDiscrepancyTypes 获取所有差异类型
|
||||
func GetAllDiscrepancyTypes() []DiscrepancyType {
|
||||
return []DiscrepancyType{
|
||||
DiscrepancyTypeNone,
|
||||
DiscrepancyTypeOverflow,
|
||||
DiscrepancyTypeShortage,
|
||||
DiscrepancyTypeWrongItem,
|
||||
DiscrepancyTypeDamage,
|
||||
DiscrepancyTypeExpired,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取差异类型字符串表示
|
||||
func (d DiscrepancyType) String() string {
|
||||
switch d {
|
||||
case DiscrepancyTypeNone:
|
||||
return "无差异"
|
||||
case DiscrepancyTypeOverflow:
|
||||
return "盘盈"
|
||||
case DiscrepancyTypeShortage:
|
||||
return "盘亏"
|
||||
case DiscrepancyTypeWrongItem:
|
||||
return "错货"
|
||||
case DiscrepancyTypeDamage:
|
||||
return "损坏"
|
||||
case DiscrepancyTypeExpired:
|
||||
return "过期"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
38
consts/stock/expiry_message_type.go
Normal file
38
consts/stock/expiry_message_type.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package stock
|
||||
|
||||
// ExpiryMessageStatus 临期消息状态
|
||||
type ExpiryMessageStatus int
|
||||
|
||||
const (
|
||||
ExpiryMessageStatusPending ExpiryMessageStatus = 1 // 待处理
|
||||
ExpiryMessageStatusCompleted ExpiryMessageStatus = 2 // 已处理
|
||||
)
|
||||
|
||||
// ExpiryProcessMethod 临期处理方式
|
||||
type ExpiryProcessMethod int
|
||||
|
||||
const (
|
||||
ExpiryProcessMethodSupplierRecycle ExpiryProcessMethod = 1 // 供货商回收
|
||||
ExpiryProcessMethodReprocess ExpiryProcessMethod = 2 // 二次加工
|
||||
ExpiryProcessMethodScrap ExpiryProcessMethod = 3 // 报废
|
||||
ExpiryProcessMethodInternal ExpiryProcessMethod = 4 // 内部消化
|
||||
ExpiryProcessMethodPromotion ExpiryProcessMethod = 5 // 促销
|
||||
)
|
||||
|
||||
// GetProcessMethodName 获取处理方式名称
|
||||
func GetProcessMethodName(method ExpiryProcessMethod) string {
|
||||
switch method {
|
||||
case ExpiryProcessMethodSupplierRecycle:
|
||||
return "供货商回收"
|
||||
case ExpiryProcessMethodReprocess:
|
||||
return "二次加工"
|
||||
case ExpiryProcessMethodScrap:
|
||||
return "报废"
|
||||
case ExpiryProcessMethodInternal:
|
||||
return "内部消化"
|
||||
case ExpiryProcessMethodPromotion:
|
||||
return "促销"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
41
consts/stock/inventory_count_scope.go
Normal file
41
consts/stock/inventory_count_scope.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package stock
|
||||
|
||||
// InventoryCountScope 库存盘点范围枚举
|
||||
type InventoryCountScope int
|
||||
|
||||
const (
|
||||
InventoryCountScopeWarehouse InventoryCountScope = 1 // 按仓库盘点
|
||||
InventoryCountScopeZone InventoryCountScope = 2 // 按库区盘点
|
||||
InventoryCountScopeLocation InventoryCountScope = 3 // 按库位盘点
|
||||
InventoryCountScopeSku InventoryCountScope = 4 // 按SKU盘点
|
||||
InventoryCountScopeAsset InventoryCountScope = 5 // 按资产盘点
|
||||
)
|
||||
|
||||
// GetAllInventoryCountScopes 获取所有盘点范围
|
||||
func GetAllInventoryCountScopes() []InventoryCountScope {
|
||||
return []InventoryCountScope{
|
||||
InventoryCountScopeWarehouse,
|
||||
InventoryCountScopeZone,
|
||||
InventoryCountScopeLocation,
|
||||
InventoryCountScopeSku,
|
||||
InventoryCountScopeAsset,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取盘点范围字符串表示
|
||||
func (i InventoryCountScope) String() string {
|
||||
switch i {
|
||||
case InventoryCountScopeWarehouse:
|
||||
return "按仓库盘点"
|
||||
case InventoryCountScopeZone:
|
||||
return "按库区盘点"
|
||||
case InventoryCountScopeLocation:
|
||||
return "按库位盘点"
|
||||
case InventoryCountScopeSku:
|
||||
return "按SKU盘点"
|
||||
case InventoryCountScopeAsset:
|
||||
return "按资产盘点"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
33
consts/stock/inventory_count_status.go
Normal file
33
consts/stock/inventory_count_status.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package stock
|
||||
|
||||
// InventoryCountStatus 库存盘点状态枚举
|
||||
type InventoryCountStatus int
|
||||
|
||||
const (
|
||||
InventoryCountStatusInProgress InventoryCountStatus = 1 // 进行中
|
||||
InventoryCountStatusCompleted InventoryCountStatus = 2 // 已完成
|
||||
InventoryCountStatusCancelled InventoryCountStatus = 3 // 已取消
|
||||
)
|
||||
|
||||
// GetAllInventoryCountStatuses 获取所有盘点状态
|
||||
func GetAllInventoryCountStatuses() []InventoryCountStatus {
|
||||
return []InventoryCountStatus{
|
||||
InventoryCountStatusInProgress,
|
||||
InventoryCountStatusCompleted,
|
||||
InventoryCountStatusCancelled,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取盘点状态字符串表示
|
||||
func (i InventoryCountStatus) String() string {
|
||||
switch i {
|
||||
case InventoryCountStatusInProgress:
|
||||
return "进行中"
|
||||
case InventoryCountStatusCompleted:
|
||||
return "已完成"
|
||||
case InventoryCountStatusCancelled:
|
||||
return "已取消"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
29
consts/stock/inventory_count_type.go
Normal file
29
consts/stock/inventory_count_type.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package stock
|
||||
|
||||
// InventoryCountType 库存盘点类型枚举
|
||||
type InventoryCountType int
|
||||
|
||||
const (
|
||||
OpenPrice InventoryCountType = 1 // 明盘
|
||||
HiddenPrice InventoryCountType = 2 // 盲盘
|
||||
)
|
||||
|
||||
// GetAllInventoryCountTypes 获取所有盘点类型
|
||||
func GetAllInventoryCountTypes() []InventoryCountType {
|
||||
return []InventoryCountType{
|
||||
OpenPrice,
|
||||
HiddenPrice,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取盘点类型字符串表示
|
||||
func (i InventoryCountType) String() string {
|
||||
switch i {
|
||||
case OpenPrice:
|
||||
return "明盘"
|
||||
case HiddenPrice:
|
||||
return "盲盘"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
29
consts/stock/inventory_detail_status.go
Normal file
29
consts/stock/inventory_detail_status.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package stock
|
||||
|
||||
// InventoryDetailStatus 库存盘点明细状态枚举
|
||||
type InventoryDetailStatus int
|
||||
|
||||
const (
|
||||
InventoryDetailStatusPending InventoryDetailStatus = 1 // 待盘点(创建时默认)
|
||||
InventoryDetailStatusCompleted InventoryDetailStatus = 2 // 已完成(Excel导入后)
|
||||
)
|
||||
|
||||
// GetAllInventoryDetailStatuses 获取所有明细状态
|
||||
func GetAllInventoryDetailStatuses() []InventoryDetailStatus {
|
||||
return []InventoryDetailStatus{
|
||||
InventoryDetailStatusPending,
|
||||
InventoryDetailStatusCompleted,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取明细状态字符串表示
|
||||
func (i InventoryDetailStatus) String() string {
|
||||
switch i {
|
||||
case InventoryDetailStatusPending:
|
||||
return "待盘点"
|
||||
case InventoryDetailStatusCompleted:
|
||||
return "已完成"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
57
consts/stock/location_status.go
Normal file
57
consts/stock/location_status.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package stock
|
||||
|
||||
// LocationStatus 库位状态枚举
|
||||
type LocationStatus string
|
||||
|
||||
const (
|
||||
LocationStatusIdle LocationStatus = "idle" // 空闲
|
||||
LocationStatusOccupied LocationStatus = "occupied" // 占用
|
||||
LocationStatusDisabled LocationStatus = "disable" // 禁用
|
||||
LocationStatusReserved LocationStatus = "reserved" // 预留
|
||||
)
|
||||
|
||||
// GetAllLocationStatuses 获取所有库位状态
|
||||
func GetAllLocationStatuses() []LocationStatus {
|
||||
return []LocationStatus{
|
||||
LocationStatusIdle,
|
||||
LocationStatusOccupied,
|
||||
LocationStatusDisabled,
|
||||
LocationStatusReserved,
|
||||
}
|
||||
}
|
||||
|
||||
type LocationStatusKeyValue struct {
|
||||
Key LocationStatus
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
LocationStatusIdleKeyValue = LocationStatusKeyValue{Key: LocationStatusIdle, Value: "空闲"}
|
||||
LocationStatusOccupiedKeyValue = LocationStatusKeyValue{Key: LocationStatusOccupied, Value: "占用"}
|
||||
LocationStatusDisabledKeyValue = LocationStatusKeyValue{Key: LocationStatusDisabled, Value: "禁用"}
|
||||
LocationStatusReservedKeyValue = LocationStatusKeyValue{Key: LocationStatusReserved, Value: "预留"}
|
||||
)
|
||||
|
||||
func GetAllLocationStatusKeyValue() []LocationStatusKeyValue {
|
||||
return []LocationStatusKeyValue{
|
||||
LocationStatusIdleKeyValue,
|
||||
LocationStatusOccupiedKeyValue,
|
||||
LocationStatusDisabledKeyValue,
|
||||
LocationStatusReservedKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var locationStatusValueMap = map[LocationStatus]string{
|
||||
LocationStatusIdle: LocationStatusIdleKeyValue.Value,
|
||||
LocationStatusOccupied: LocationStatusOccupiedKeyValue.Value,
|
||||
LocationStatusDisabled: LocationStatusDisabledKeyValue.Value,
|
||||
LocationStatusReserved: LocationStatusReservedKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetLocationStatusValueByKey(key LocationStatus) (value string) {
|
||||
value, exists := locationStatusValueMap[key]
|
||||
if !exists {
|
||||
value = "未知状态"
|
||||
}
|
||||
return
|
||||
}
|
||||
72
consts/stock/location_type.go
Normal file
72
consts/stock/location_type.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package stock
|
||||
|
||||
// LocationType 库位类型枚举
|
||||
type LocationType string
|
||||
|
||||
const (
|
||||
LocationTypeShelf LocationType = "shelf" // 货架
|
||||
LocationTypeStack LocationType = "stack" // 堆垛
|
||||
LocationTypeCold LocationType = "cold" // 冷藏位
|
||||
LocationTypeFreeze LocationType = "freeze" // 冷冻位
|
||||
LocationTypeBin LocationType = "bin" // 料箱位
|
||||
LocationTypePallet LocationType = "pallet" // 托盘位
|
||||
LocationTypeFloor LocationType = "floor" // 地面堆放
|
||||
)
|
||||
|
||||
// GetAllLocationTypes 获取所有库位类型
|
||||
func GetAllLocationTypes() []LocationType {
|
||||
return []LocationType{
|
||||
LocationTypeShelf,
|
||||
LocationTypeStack,
|
||||
LocationTypeCold,
|
||||
LocationTypeFreeze,
|
||||
LocationTypeBin,
|
||||
LocationTypePallet,
|
||||
LocationTypeFloor,
|
||||
}
|
||||
}
|
||||
|
||||
type LocationTypeKeyValue struct {
|
||||
Key LocationType
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
LocationTypeShelfKeyValue = LocationTypeKeyValue{Key: LocationTypeShelf, Value: "货架"}
|
||||
LocationTypeStackKeyValue = LocationTypeKeyValue{Key: LocationTypeStack, Value: "堆垛"}
|
||||
LocationTypeColdKeyValue = LocationTypeKeyValue{Key: LocationTypeCold, Value: "冷藏位"}
|
||||
LocationTypeFreezeKeyValue = LocationTypeKeyValue{Key: LocationTypeFreeze, Value: "冷冻位"}
|
||||
LocationTypeBinKeyValue = LocationTypeKeyValue{Key: LocationTypeBin, Value: "料箱位"}
|
||||
LocationTypePalletKeyValue = LocationTypeKeyValue{Key: LocationTypePallet, Value: "托盘位"}
|
||||
LocationTypeFloorKeyValue = LocationTypeKeyValue{Key: LocationTypeFloor, Value: "地面堆放"}
|
||||
)
|
||||
|
||||
func GetAllLocationTypeKeyValue() []LocationTypeKeyValue {
|
||||
return []LocationTypeKeyValue{
|
||||
LocationTypeShelfKeyValue,
|
||||
LocationTypeStackKeyValue,
|
||||
LocationTypeColdKeyValue,
|
||||
LocationTypeFreezeKeyValue,
|
||||
LocationTypeBinKeyValue,
|
||||
LocationTypePalletKeyValue,
|
||||
LocationTypeFloorKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var locationTypeValueMap = map[LocationType]string{
|
||||
LocationTypeShelf: LocationTypeShelfKeyValue.Value,
|
||||
LocationTypeStack: LocationTypeStackKeyValue.Value,
|
||||
LocationTypeCold: LocationTypeColdKeyValue.Value,
|
||||
LocationTypeFreeze: LocationTypeFreezeKeyValue.Value,
|
||||
LocationTypeBin: LocationTypeBinKeyValue.Value,
|
||||
LocationTypePallet: LocationTypePalletKeyValue.Value,
|
||||
LocationTypeFloor: LocationTypeFloorKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetLocationTypeValueByKey(key LocationType) (value string) {
|
||||
value, exists := locationTypeValueMap[key]
|
||||
if !exists {
|
||||
value = "未知类型"
|
||||
}
|
||||
return
|
||||
}
|
||||
33
consts/stock/stock_location_type.go
Normal file
33
consts/stock/stock_location_type.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package stock
|
||||
|
||||
// StockLocationType 库存位置关联类型枚举
|
||||
type StockLocationType int
|
||||
|
||||
const (
|
||||
StockLocationTypeStockDetails StockLocationType = 1 // StockDetails库存的位置关联
|
||||
StockLocationTypePrivateStock StockLocationType = 2 // PrivateStock库存的位置关联
|
||||
StockLocationTypeStockBatch StockLocationType = 3 // StockBatch库存的位置关联
|
||||
)
|
||||
|
||||
// GetAllStockLocationTypes 获取所有库存位置关联类型
|
||||
func GetAllStockLocationTypes() []StockLocationType {
|
||||
return []StockLocationType{
|
||||
StockLocationTypeStockDetails,
|
||||
StockLocationTypePrivateStock,
|
||||
StockLocationTypeStockBatch,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取库存位置关联类型字符串表示
|
||||
func (s StockLocationType) String() string {
|
||||
switch s {
|
||||
case StockLocationTypeStockDetails:
|
||||
return "StockDetails库存"
|
||||
case StockLocationTypePrivateStock:
|
||||
return "PrivateStock库存"
|
||||
case StockLocationTypeStockBatch:
|
||||
return "StockBatch库存"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
17
consts/stock/stock_mode.go
Normal file
17
consts/stock/stock_mode.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package stock
|
||||
|
||||
// StockMode 库存管理模式枚举
|
||||
type StockMode int
|
||||
|
||||
const (
|
||||
StockModeDetail StockMode = 1 // 明细模式(每件一条记录)
|
||||
StockModeBatch StockMode = 2 // 批次模式(批次记录)
|
||||
)
|
||||
|
||||
// GetAllStockModes 获取所有库存管理模式
|
||||
func GetAllStockModes() []StockMode {
|
||||
return []StockMode{
|
||||
StockModeDetail,
|
||||
StockModeBatch,
|
||||
}
|
||||
}
|
||||
21
consts/stock/stock_status.go
Normal file
21
consts/stock/stock_status.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package stock
|
||||
|
||||
// StockStatus 库存状态枚举
|
||||
type StockStatus int
|
||||
|
||||
const (
|
||||
StockStatusAvailable StockStatus = 1 // 可用,未分配渠道
|
||||
StockStatusSold StockStatus = 2 // 已售出
|
||||
StockStatusReserved StockStatus = 3 // 预留
|
||||
StockStatusLocked StockStatus = 4 // 锁定
|
||||
)
|
||||
|
||||
// GetAllStockStatuses 获取所有库存状态
|
||||
func GetAllStockStatuses() []StockStatus {
|
||||
return []StockStatus{
|
||||
StockStatusAvailable,
|
||||
StockStatusSold,
|
||||
StockStatusReserved,
|
||||
StockStatusLocked,
|
||||
}
|
||||
}
|
||||
47
consts/stock/warehouse_status.go
Normal file
47
consts/stock/warehouse_status.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package stock
|
||||
|
||||
// WarehouseStatus 仓库状态枚举
|
||||
type WarehouseStatus string
|
||||
|
||||
const (
|
||||
WarehouseStatusEnabled WarehouseStatus = "enable" // 启用
|
||||
WarehouseStatusDisabled WarehouseStatus = "disable" // 停用
|
||||
)
|
||||
|
||||
// GetAllWarehouseStatuses 获取所有仓库状态
|
||||
func GetAllWarehouseStatuses() []WarehouseStatus {
|
||||
return []WarehouseStatus{
|
||||
WarehouseStatusEnabled,
|
||||
WarehouseStatusDisabled,
|
||||
}
|
||||
}
|
||||
|
||||
type WarehouseStatusKeyValue struct {
|
||||
Key WarehouseStatus
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
WarehouseStatusEnabledKeyValue = WarehouseStatusKeyValue{Key: WarehouseStatusEnabled, Value: "启用"}
|
||||
WarehouseStatusDisabledKeyValue = WarehouseStatusKeyValue{Key: WarehouseStatusDisabled, Value: "停用"}
|
||||
)
|
||||
|
||||
func GetAllWarehouseStatusKeyValue() []WarehouseStatusKeyValue {
|
||||
return []WarehouseStatusKeyValue{
|
||||
WarehouseStatusEnabledKeyValue,
|
||||
WarehouseStatusDisabledKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var warehouseStatusValueMap = map[WarehouseStatus]string{
|
||||
WarehouseStatusEnabled: WarehouseStatusEnabledKeyValue.Value,
|
||||
WarehouseStatusDisabled: WarehouseStatusDisabledKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetWarehouseStatusValueByKey(key WarehouseStatus) (value string) {
|
||||
value, exists := warehouseStatusValueMap[key]
|
||||
if !exists {
|
||||
value = "未知状态"
|
||||
}
|
||||
return
|
||||
}
|
||||
42
consts/stock/warning_type.go
Normal file
42
consts/stock/warning_type.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package stock
|
||||
|
||||
// WarningType 预警类型枚举
|
||||
type WarningType int
|
||||
|
||||
const (
|
||||
WarningTypeExpiry WarningType = 1 // 临期预警
|
||||
WarningTypeLowStock WarningType = 2 // 库存不足预警
|
||||
)
|
||||
|
||||
// GetAllWarningTypes 获取所有预警类型
|
||||
func GetAllWarningTypes() []WarningType {
|
||||
return []WarningType{
|
||||
WarningTypeExpiry,
|
||||
WarningTypeLowStock,
|
||||
}
|
||||
}
|
||||
|
||||
// String 获取预警类型字符串表示
|
||||
func (w WarningType) String() string {
|
||||
switch w {
|
||||
case WarningTypeExpiry:
|
||||
return "临期预警"
|
||||
case WarningTypeLowStock:
|
||||
return "库存不足预警"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
|
||||
type WarningTypeKeyValue struct {
|
||||
Key int `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// GetAllWarningTypeKeyValue 获取所有预警类型的键值对
|
||||
func GetAllWarningTypeKeyValue() []WarningTypeKeyValue {
|
||||
return []WarningTypeKeyValue{
|
||||
{Key: 1, Value: "临期预警"},
|
||||
{Key: 2, Value: "库存不足预警"},
|
||||
}
|
||||
}
|
||||
47
consts/stock/zone_status.go
Normal file
47
consts/stock/zone_status.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package stock
|
||||
|
||||
// ZoneStatus 库区状态枚举
|
||||
type ZoneStatus string
|
||||
|
||||
const (
|
||||
ZoneStatusEnabled ZoneStatus = "enable" // 启用
|
||||
ZoneStatusDisabled ZoneStatus = "disable" // 停用
|
||||
)
|
||||
|
||||
// GetAllZoneStatuses 获取所有库区状态
|
||||
func GetAllZoneStatuses() []ZoneStatus {
|
||||
return []ZoneStatus{
|
||||
ZoneStatusEnabled,
|
||||
ZoneStatusDisabled,
|
||||
}
|
||||
}
|
||||
|
||||
type ZoneStatusKeyValue struct {
|
||||
Key ZoneStatus
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
ZoneStatusEnabledKeyValue = ZoneStatusKeyValue{Key: ZoneStatusEnabled, Value: "启用"}
|
||||
ZoneStatusDisabledKeyValue = ZoneStatusKeyValue{Key: ZoneStatusDisabled, Value: "停用"}
|
||||
)
|
||||
|
||||
func GetAllZoneStatusKeyValue() []ZoneStatusKeyValue {
|
||||
return []ZoneStatusKeyValue{
|
||||
ZoneStatusEnabledKeyValue,
|
||||
ZoneStatusDisabledKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var zoneStatusValueMap = map[ZoneStatus]string{
|
||||
ZoneStatusEnabled: ZoneStatusEnabledKeyValue.Value,
|
||||
ZoneStatusDisabled: ZoneStatusDisabledKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetZoneStatusValueByKey(key ZoneStatus) (value string) {
|
||||
value, exists := zoneStatusValueMap[key]
|
||||
if !exists {
|
||||
value = "未知状态"
|
||||
}
|
||||
return
|
||||
}
|
||||
67
consts/stock/zone_type.go
Normal file
67
consts/stock/zone_type.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package stock
|
||||
|
||||
// ZoneType 库区类型枚举
|
||||
type ZoneType string
|
||||
|
||||
const (
|
||||
ZoneTypeNormal ZoneType = "normal" // 常温区
|
||||
ZoneTypeCold ZoneType = "cold" // 冷藏区
|
||||
ZoneTypeFreeze ZoneType = "freeze" // 冷冻区
|
||||
ZoneTypeFresh ZoneType = "fresh" // 保鲜区
|
||||
ZoneTypeHazardous ZoneType = "hazardous" // 危险品区
|
||||
ZoneTypeBonded ZoneType = "bonded" // 保税区
|
||||
)
|
||||
|
||||
// GetAllZoneTypes 获取所有库区类型
|
||||
func GetAllZoneTypes() []ZoneType {
|
||||
return []ZoneType{
|
||||
ZoneTypeNormal,
|
||||
ZoneTypeCold,
|
||||
ZoneTypeFreeze,
|
||||
ZoneTypeFresh,
|
||||
ZoneTypeHazardous,
|
||||
ZoneTypeBonded,
|
||||
}
|
||||
}
|
||||
|
||||
type ZoneTypeKeyValue struct {
|
||||
Key ZoneType
|
||||
Value string
|
||||
}
|
||||
|
||||
var (
|
||||
ZoneTypeNormalKeyValue = ZoneTypeKeyValue{Key: ZoneTypeNormal, Value: "常温区"}
|
||||
ZoneTypeColdKeyValue = ZoneTypeKeyValue{Key: ZoneTypeCold, Value: "冷藏区"}
|
||||
ZoneTypeFreezeKeyValue = ZoneTypeKeyValue{Key: ZoneTypeFreeze, Value: "冷冻区"}
|
||||
ZoneTypeFreshKeyValue = ZoneTypeKeyValue{Key: ZoneTypeFresh, Value: "保鲜区"}
|
||||
ZoneTypeHazardousKeyValue = ZoneTypeKeyValue{Key: ZoneTypeHazardous, Value: "危险品区"}
|
||||
ZoneTypeBondedKeyValue = ZoneTypeKeyValue{Key: ZoneTypeBonded, Value: "保税区"}
|
||||
)
|
||||
|
||||
func GetAllZoneTypeKeyValue() []ZoneTypeKeyValue {
|
||||
return []ZoneTypeKeyValue{
|
||||
ZoneTypeNormalKeyValue,
|
||||
ZoneTypeColdKeyValue,
|
||||
ZoneTypeFreezeKeyValue,
|
||||
ZoneTypeFreshKeyValue,
|
||||
ZoneTypeHazardousKeyValue,
|
||||
ZoneTypeBondedKeyValue,
|
||||
}
|
||||
}
|
||||
|
||||
var zoneTypeValueMap = map[ZoneType]string{
|
||||
ZoneTypeNormal: ZoneTypeNormalKeyValue.Value,
|
||||
ZoneTypeCold: ZoneTypeColdKeyValue.Value,
|
||||
ZoneTypeFreeze: ZoneTypeFreezeKeyValue.Value,
|
||||
ZoneTypeFresh: ZoneTypeFreshKeyValue.Value,
|
||||
ZoneTypeHazardous: ZoneTypeHazardousKeyValue.Value,
|
||||
ZoneTypeBonded: ZoneTypeBondedKeyValue.Value,
|
||||
}
|
||||
|
||||
func GetZoneTypeValueByKey(key ZoneType) (value string) {
|
||||
value, exists := zoneTypeValueMap[key]
|
||||
if !exists {
|
||||
value = "未知类型"
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user