1
This commit is contained in:
@@ -100,85 +100,88 @@ 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)
|
||||||
userTempMap := make(map[string]string, 0)
|
userTempMap := make(map[string]string, 0)
|
||||||
if err := json.Unmarshal([]byte(userTemp.Temp), userTempMap); err != nil {
|
if err := json.Unmarshal([]byte(userTemp.Temp), userTempMap); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
|
||||||
|
|
||||||
for _, v := range strings.Split(userTemp.TempRank, ",") {
|
|
||||||
switch v {
|
|
||||||
case "skuName", "skuNumber", "skuPrice", "skuAllPrice", "allSkuTypeCount", "allSkuCount":
|
|
||||||
continue
|
|
||||||
case "goodsListDetail":
|
|
||||||
printMsg += model.TempTag[v]
|
|
||||||
skuList := make([]*model.SkuListPrintOrder, 0, 0)
|
|
||||||
if err := json.Unmarshal([]byte(param[v]), skuList); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
for i := 0; i < len(skuList); i++ {
|
|
||||||
printMsg += userTempMap["skuName"]
|
|
||||||
printMsg += userTempMap["skuNumber"]
|
|
||||||
printMsg += userTempMap["skuPrice"]
|
|
||||||
printMsg += userTempMap["skuAllPrice"]
|
|
||||||
printValue = append(printValue, skuList[i].SkuName, skuList[i].SkuName, skuList[i].SalePrice, skuList[i].TotalCountPrice)
|
|
||||||
if skuList[i].Upc != "" {
|
|
||||||
printMsg += model.TempTag["sku"]
|
|
||||||
printValue = append(printValue, skuList[i].Upc)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
case "businessType":
|
|
||||||
if param[v] == "2" { // 是预订单
|
|
||||||
printMsg += userTempMap[v]
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
printMsg += userTempMap[v]
|
|
||||||
printValue = append(printValue, param[v])
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, v := range strings.Split(userTemp.TempRank, ",") {
|
||||||
|
switch v {
|
||||||
|
case "skuName", "skuNumber", "skuPrice", "skuAllPrice", "allSkuTypeCount", "allSkuCount":
|
||||||
|
continue
|
||||||
|
case "goodsListDetail":
|
||||||
|
printMsg += model.TempTag[v]
|
||||||
|
skuList := make([]*model.SkuListPrintOrder, 0, 0)
|
||||||
|
if err := json.Unmarshal([]byte(param[v]), skuList); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
for i := 0; i < len(skuList); i++ {
|
||||||
|
printMsg += userTempMap["skuName"]
|
||||||
|
printMsg += userTempMap["skuNumber"]
|
||||||
|
printMsg += userTempMap["skuPrice"]
|
||||||
|
printMsg += userTempMap["skuAllPrice"]
|
||||||
|
printValue = append(printValue, skuList[i].SkuName, skuList[i].SkuName, skuList[i].SalePrice, skuList[i].TotalCountPrice)
|
||||||
|
if skuList[i].Upc != "" {
|
||||||
|
printMsg += model.TempTag["sku"]
|
||||||
|
printValue = append(printValue, skuList[i].Upc)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
case "businessType":
|
||||||
|
if param[v] == "2" { // 是预订单
|
||||||
|
printMsg += userTempMap[v]
|
||||||
|
}
|
||||||
|
case "divider":
|
||||||
|
printMsg += userTempMap["divider"]
|
||||||
|
printValue = append(printValue, param[v])
|
||||||
|
default:
|
||||||
|
printMsg += userTempMap[v]
|
||||||
|
printValue = append(printValue, param[v])
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return strings.Replace(fmt.Sprintf(strings.Replace(printMsg, "\n", "", -1), printValue...), "\\n", "\r\n", -1), nil
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakePrintMsgOnTempVoice 制作平台语音
|
// MakePrintMsgOnTempVoice 制作平台语音
|
||||||
|
|||||||
Reference in New Issue
Block a user