- 重构打印机流程,添加“外卖管家”打印

This commit is contained in:
gazebo
2019-04-09 11:35:27 +08:00
parent 358257c70d
commit 8c6b1bc067
14 changed files with 500 additions and 132 deletions

View File

@@ -17,6 +17,11 @@ const (
VendorIDMTPS = 102
VendorIDFengNiao = 103
VendorIDDeliveryEnd = VendorIDFengNiao
VendorIDPrinterBegin = 201
VendorIDFeiE = 201 // 飞鹅打印机
VendorIDXiaoWM = 202 // 外卖管家打印机
VendorIDPrinterEnd = 202
)
var (
@@ -29,6 +34,9 @@ var (
VendorIDDada: "Dada",
VendorIDMTPS: "Mtps",
VendorIDFeiE: "Feie",
VendorIDXiaoWM: "XiaoWM",
}
VendorChineseNames = map[int]string{
VendorIDJD: "京东到家",
@@ -39,6 +47,9 @@ var (
VendorIDDada: "达达众包",
VendorIDMTPS: "美团配送",
VendorIDFeiE: "飞鹅",
VendorIDXiaoWM: "外卖管家",
}
ShopChineseNames = map[int]string{
@@ -94,6 +105,19 @@ var (
VendorIDELM: 0,
VendorIDEBAI: 0,
}
PrinterVendorInfo = map[int][]string{
VendorIDFeiE: []string{
VendorChineseNames[VendorIDFeiE],
"序列号",
"KEY",
},
VendorIDXiaoWM: []string{
VendorChineseNames[VendorIDXiaoWM],
"打印机编号",
"不填",
},
}
)
const (
@@ -198,3 +222,8 @@ func IsDeliveryVendorExist(vendorID int) bool {
_, ok := VendorNames[vendorID]
return ok && vendorID >= VendorIDDeliveryBegin && vendorID <= VendorIDDeliveryEnd
}
func IsPrinterVendorExist(vendorID int) bool {
_, ok := VendorNames[vendorID]
return ok && vendorID >= VendorIDPrinterBegin && vendorID <= VendorIDPrinterEnd
}