This commit is contained in:
richboo111
2022-08-04 11:46:53 +08:00
3 changed files with 8 additions and 8 deletions

View File

@@ -371,7 +371,11 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) {
orderNoHexH, orderNoHexL, printData string
)
//写入数据
orderNoHexH, orderNoHexL = int2h8l8(int64(orderNo))
no, err := strconv.ParseInt(orderNo, 10, 64)
if err != nil {
globals.SugarLogger.Debug("order_msg Order_no 转换异常")
}
orderNoHexH, orderNoHexL = int2h8l8(no)
// 将数据与模板组装
printDataGBK, _ := jxutils.Utf8ToGbk([]byte(replaceContentOther(content)))
@@ -541,7 +545,7 @@ func checkPrintMsg(db *dao.DaoDB, printMsg *model.PrintMsg) (err error) {
if printMsg.PrintNo == "" {
return fmt.Errorf("此打印信息打印机编号为空printMsg printNo:[%v], orderNo :[%v]", printMsg.PrintNo, printMsg.OrderNo)
}
if printMsg.OrderNo == 0 {
if printMsg.OrderNo == "" {
return fmt.Errorf("此打印信息订单序号为空printMsg printNo:[%v], orderNo :[%v]", printMsg.PrintNo, printMsg.OrderNo)
}
if printer, err := dao.GetPrinter(db, printMsg.PrintNo); err == nil {

View File

@@ -17,7 +17,7 @@ func TestPrintMsg(t *testing.T) {
ModelIDCULD: model.ModelIDCULD{},
PrintNo: "20220707000002",
Content: "<sound>61</sound><sound>62</sound>",
OrderNo: 1,
OrderNo: "1",
Status: 0,
Comment: "",
MsgID: "1",
@@ -86,7 +86,3 @@ func toHex(ten int) string {
}
return strings.Join(hexStr, "")
}
func TestInt2Int64(t *testing.T) {
fmt.Println(int64(19930826391))
}