Compare commits

...

10 Commits

Author SHA1 Message Date
邹宗楠
5e987ac99e 1 2023-03-21 18:29:04 +08:00
邹宗楠
99a073484b 1 2023-03-21 18:22:19 +08:00
邹宗楠
831a860ce2 饿百订单打印失败 2023-03-21 17:30:10 +08:00
邹宗楠
610a7feeca 1 2023-02-24 14:51:32 +08:00
邹宗楠
6275b14570 1 2022-12-30 10:22:52 +08:00
邹宗楠
b2bf89996f 1 2022-12-30 09:50:19 +08:00
邹宗楠
7b8be18bd6 1 2022-12-30 09:48:24 +08:00
邹宗楠
14b55e118c 1 2022-12-29 18:35:46 +08:00
邹宗楠
fe59f8bca7 1 2022-12-27 14:07:48 +08:00
邹宗楠
ede900560d 1 2022-12-27 14:02:33 +08:00
5 changed files with 42 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals"
)
// SelectUserDefaultTemp 查询用户默认模板
@@ -26,7 +25,6 @@ func QuerySystemTemp() (*model.SystemTemp, error) {
if len(result) > 0 {
return result[0], nil
}
globals.SugarLogger.Debugf("========模板获取异常")
return nil, errors.New("模板获取异常")
}

View File

@@ -85,7 +85,7 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
if err != nil || !isHave {
userTemp, err = QuerySystemTemp()
}
if userTemp == nil || !isHave {
if userTemp == nil || !isHave || err != nil {
if userTemp.TempType != "" {
userTemp = SystemTempObj[userTemp.TempSize]
} else {
@@ -211,7 +211,13 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj,
// 订单状态
switch param[model.OrderStatusPrint] {
// 新订单(待接单)
case utils.Int2Str(model.OrderStatusNew):
case utils.Int2Str(model.OrderStatusNew): // utils.Int2Str(model.OrderStatusFinishedPickup), utils.Int2Str(model.OrderStatusAccepted)
//if param[model.OrderStatusPrint] != utils.Int2Str(model.OrderStatusNew) && param[model.VendorIDPrint] == utils.Int64ToStr(model.VendorIDMTWM) {
// return "", err
//}
//if param[model.OrderStatusPrint] == utils.Int2Str(model.OrderStatusFinishedPickup) && param[model.VendorIDPrint] == utils.Int64ToStr(model.VendorIDEBAI) {
// return "", err
//}
// 称谓设置/平台语音设置
if setting.CallNameSetting == 64 || setting.CallNameSetting == 65 || setting.CallNameSetting == 66 {
// 老板

View File

@@ -0,0 +1,11 @@
package cms
import (
"fmt"
"testing"
)
func TestConn(t *testing.T) {
err := DelPrinterSeq(1000, "120220915001012")
fmt.Println(err)
}

View File

@@ -2,6 +2,7 @@ package cms
import (
"encoding/json"
"errors"
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/dao"
@@ -340,6 +341,27 @@ func DelPrinterSeq(appID int, printNo string) (err error) {
}
}
}
// 简历连接
conn, err := net.Dial("tcp", "www.jxcs.net:8000")
if err != nil {
return err
}
clearPrint := fmt.Sprintf(`{"print_no_clear":%s}`, printNo)
// 发送数据
if _, err := conn.Write([]byte(clearPrint)); err != nil {
return err
}
// 等待数据
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
return err
}
if string(buf[:n]) != "ok" {
return errors.New("缓存清理失败")
}
defer conn.Close()
return err
}

View File

@@ -15,15 +15,10 @@ type PrintBindStore struct {
BindStatus int `orm:"type(int);size(2)" json:"bind_status" db:"bind_status"` // 绑定状态
}
func (v *PrintBindStore) TableUnique() [][]string {
return [][]string{
[]string{"StoreID"},
}
}
func (v *PrintBindStore) TableIndex() [][]string {
return [][]string{
[]string{"UserId", "PrintNo", "StoreID"},
[]string{"PrintNo", "StoreID"},
[]string{"StoreID"},
}
}