This commit is contained in:
邹宗楠
2022-08-22 11:30:08 +08:00
parent fec30ce3e7
commit 123c0971da

View File

@@ -100,43 +100,43 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
} else { } else {
userTemp = SystemTempObj[model.SystemTempSizeBig] userTemp = SystemTempObj[model.SystemTempSizeBig]
} }
// 需要打印数据 //// 需要打印数据
printMsg := "" //printMsg := ""
printValue := make([]interface{}, 0, 0) //printValue := make([]interface{}, 0, 0)
for _, v := range strings.Split(userTemp.TempRank, ",") { //for _, v := range strings.Split(userTemp.TempRank, ",") {
switch v { // switch v {
case "skuName", "skuNumber", "skuPrice", "skuAllPrice", "allSkuTypeCount", "allSkuCount": // case "skuName", "skuNumber", "skuPrice", "skuAllPrice", "allSkuTypeCount", "allSkuCount":
continue // continue
case "goodsListDetail": // case "goodsListDetail":
printMsg += model.TempTag[v] // printMsg += model.TempTag[v]
skuList := make([]*model.SkuListPrintOrder, 0, 0) // skuList := make([]*model.SkuListPrintOrder, 0, 0)
if err := json.Unmarshal([]byte(param[v]), skuList); err != nil { // if err := json.Unmarshal([]byte(param[v]), skuList); err != nil {
return "", err // return "", err
} // }
for i := 0; i < len(skuList); i++ { // for i := 0; i < len(skuList); i++ {
printMsg += model.TempTag["skuName"] // printMsg += model.TempTag["skuName"]
printMsg += model.TempTag["skuNumber"] // printMsg += model.TempTag["skuNumber"]
printMsg += model.TempTag["skuPrice"] // printMsg += model.TempTag["skuPrice"]
printMsg += model.TempTag["skuAllPrice"] // printMsg += model.TempTag["skuAllPrice"]
printValue = append(printValue, skuList[i].SkuName, skuList[i].SkuName, skuList[i].SalePrice, skuList[i].TotalCountPrice) // printValue = append(printValue, skuList[i].SkuName, skuList[i].SkuName, skuList[i].SalePrice, skuList[i].TotalCountPrice)
if skuList[i].Upc != "" { // if skuList[i].Upc != "" {
printMsg += model.TempTag["sku"] // printMsg += model.TempTag["sku"]
printValue = append(printValue, skuList[i].Upc) // printValue = append(printValue, skuList[i].Upc)
} // }
//
} // }
case "businessType": // case "businessType":
if param[v] == "2" { // 是预订单 // if param[v] == "2" { // 是预订单
printMsg += model.TempTag[v] // printMsg += model.TempTag[v]
} // }
default: // default:
printMsg += model.TempTag[v] // printMsg += model.TempTag[v]
printValue = append(printValue, param[v]) // printValue = append(printValue, param[v])
} // }
//
} //}
return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil //return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil
} else { } //else {
// 需要打印数据 // 需要打印数据
printMsg := "" printMsg := ""
printValue := make([]interface{}, 0, 0) printValue := make([]interface{}, 0, 0)
@@ -171,6 +171,9 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
if param[v] == "2" { // 是预订单 if param[v] == "2" { // 是预订单
printMsg += userTempMap[v] printMsg += userTempMap[v]
} }
case "divider":
printMsg += userTempMap["divider"]
printValue = append(printValue, param[v])
default: default:
printMsg += userTempMap[v] printMsg += userTempMap[v]
printValue = append(printValue, param[v]) printValue = append(printValue, param[v])
@@ -178,7 +181,7 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
} }
return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil
} //}
} }
// MakePrintMsgOnTempVoice 制作平台语音 // MakePrintMsgOnTempVoice 制作平台语音