Compare commits
10 Commits
376a5b89c2
...
api
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e987ac99e | ||
|
|
99a073484b | ||
|
|
831a860ce2 | ||
|
|
610a7feeca | ||
|
|
6275b14570 | ||
|
|
b2bf89996f | ||
|
|
7b8be18bd6 | ||
|
|
14b55e118c | ||
|
|
fe59f8bca7 | ||
|
|
ede900560d |
@@ -4,7 +4,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// SelectUserDefaultTemp 查询用户默认模板
|
// SelectUserDefaultTemp 查询用户默认模板
|
||||||
@@ -26,7 +25,6 @@ func QuerySystemTemp() (*model.SystemTemp, error) {
|
|||||||
if len(result) > 0 {
|
if len(result) > 0 {
|
||||||
return result[0], nil
|
return result[0], nil
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("========模板获取异常")
|
|
||||||
return nil, errors.New("模板获取异常")
|
return nil, errors.New("模板获取异常")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
|
|||||||
if err != nil || !isHave {
|
if err != nil || !isHave {
|
||||||
userTemp, err = QuerySystemTemp()
|
userTemp, err = QuerySystemTemp()
|
||||||
}
|
}
|
||||||
if userTemp == nil || !isHave {
|
if userTemp == nil || !isHave || err != nil {
|
||||||
if userTemp.TempType != "" {
|
if userTemp.TempType != "" {
|
||||||
userTemp = SystemTempObj[userTemp.TempSize]
|
userTemp = SystemTempObj[userTemp.TempSize]
|
||||||
} else {
|
} else {
|
||||||
@@ -211,7 +211,13 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj,
|
|||||||
// 订单状态
|
// 订单状态
|
||||||
switch param[model.OrderStatusPrint] {
|
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 {
|
if setting.CallNameSetting == 64 || setting.CallNameSetting == 65 || setting.CallNameSetting == 66 {
|
||||||
// 老板
|
// 老板
|
||||||
|
|||||||
11
business/jxstore/cms/conn_test.go
Normal file
11
business/jxstore/cms/conn_test.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package cms
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestConn(t *testing.T) {
|
||||||
|
err := DelPrinterSeq(1000, "120220915001012")
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package cms
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/dao"
|
"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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,10 @@ type PrintBindStore struct {
|
|||||||
BindStatus int `orm:"type(int);size(2)" json:"bind_status" db:"bind_status"` // 绑定状态
|
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 {
|
func (v *PrintBindStore) TableIndex() [][]string {
|
||||||
return [][]string{
|
return [][]string{
|
||||||
[]string{"UserId", "PrintNo", "StoreID"},
|
[]string{"UserId", "PrintNo", "StoreID"},
|
||||||
[]string{"PrintNo", "StoreID"},
|
[]string{"PrintNo", "StoreID"},
|
||||||
|
[]string{"StoreID"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user