Merge branch 'rsm' of https://e.coding.net/rosydev/jx-callback into rsm
This commit is contained in:
@@ -371,7 +371,11 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) {
|
|||||||
orderNoHexH, orderNoHexL, printData string
|
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)))
|
printDataGBK, _ := jxutils.Utf8ToGbk([]byte(replaceContentOther(content)))
|
||||||
@@ -541,7 +545,7 @@ func checkPrintMsg(db *dao.DaoDB, printMsg *model.PrintMsg) (err error) {
|
|||||||
if printMsg.PrintNo == "" {
|
if printMsg.PrintNo == "" {
|
||||||
return fmt.Errorf("此打印信息打印机编号为空!printMsg printNo:[%v], orderNo :[%v]", printMsg.PrintNo, printMsg.OrderNo)
|
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)
|
return fmt.Errorf("此打印信息订单序号为空!printMsg printNo:[%v], orderNo :[%v]", printMsg.PrintNo, printMsg.OrderNo)
|
||||||
}
|
}
|
||||||
if printer, err := dao.GetPrinter(db, printMsg.PrintNo); err == nil {
|
if printer, err := dao.GetPrinter(db, printMsg.PrintNo); err == nil {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func TestPrintMsg(t *testing.T) {
|
|||||||
ModelIDCULD: model.ModelIDCULD{},
|
ModelIDCULD: model.ModelIDCULD{},
|
||||||
PrintNo: "20220707000002",
|
PrintNo: "20220707000002",
|
||||||
Content: "<sound>61</sound><sound>62</sound>",
|
Content: "<sound>61</sound><sound>62</sound>",
|
||||||
OrderNo: 1,
|
OrderNo: "1",
|
||||||
Status: 0,
|
Status: 0,
|
||||||
Comment: "",
|
Comment: "",
|
||||||
MsgID: "1",
|
MsgID: "1",
|
||||||
@@ -86,7 +86,3 @@ func toHex(ten int) string {
|
|||||||
}
|
}
|
||||||
return strings.Join(hexStr, "")
|
return strings.Join(hexStr, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInt2Int64(t *testing.T) {
|
|
||||||
fmt.Println(int64(19930826391))
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ type PrintMsg struct {
|
|||||||
|
|
||||||
PrintNo string `json:"print_no" db:"print_no"` //打印机编号
|
PrintNo string `json:"print_no" db:"print_no"` //打印机编号
|
||||||
Content string `orm:"type(text)" json:"content" db:"content"` //订单内容
|
Content string `orm:"type(text)" json:"content" db:"content"` //订单内容
|
||||||
OrderNo int64 `json:"order_no" db:"order_no"` //订单序号
|
OrderNo string `json:"order_no" db:"order_no"` //订单序号
|
||||||
Status int `json:"status" db:"status"` //打印状态
|
Status int `json:"status" db:"status"` //打印状态
|
||||||
Comment string `json:"comment" db:"comment"` //失败原因
|
Comment string `json:"comment" db:"comment"` //失败原因
|
||||||
MsgID string `orm:"column(msg_id)" json:"msgID" db:"msg_id"`
|
MsgID string `orm:"column(msg_id)" json:"msgID" db:"msg_id"`
|
||||||
|
|||||||
Reference in New Issue
Block a user