This commit is contained in:
suyl
2021-07-15 10:45:06 +08:00
parent 802366f44c
commit 7e251151c6

View File

@@ -341,10 +341,11 @@ func (c *ApiController) DoPrint(dataMap map[string]interface{}) (data, errCode s
return buildParamErrCodeAndErr(keyContent)
}
}
if _, ok := dataMap[keyOrderNo].(int); !ok {
if _, ok := dataMap[keyOrderNo].(string); !ok {
return buildParamErrCodeAndErr(keyOrderNo)
} else {
if orderNo = dataMap[keyOrderNo].(int); orderNo == 0 {
orderNoStr := dataMap[keyOrderNo].(string)
if orderNo = utils.Str2Int(orderNoStr); orderNo == 0 {
return buildParamErrCodeAndErr(keyOrderNo)
}
}
@@ -385,30 +386,6 @@ func (c *ApiController) GetPrintMsg(dataMap map[string]interface{}) (data map[st
}
return data, errCode, err
}
func unicode2utf8(source string) string {
var res = []string{""}
sUnicode := strings.Split(source, "\\u")
var context = ""
for _, v := range sUnicode {
var additional = ""
if len(v) < 1 {
continue
}
if len(v) > 4 {
rs := []rune(v)
v = string(rs[:4])
additional = string(rs[4:])
}
temp, err := strconv.ParseInt(v, 16, 32)
if err != nil {
context += v
}
context += fmt.Sprintf("%c", temp)
context += additional
}
res = append(res, context)
return strings.Join(res, "")
}
//查询打印机状态
func (c *ApiController) GetPrinterStatus(dataMap map[string]interface{}) (data, errCode string, err error) {