diff --git a/business/jxstore/cms/api_print.go b/business/jxstore/cms/api_print.go index d282cac94..ad8b71b55 100644 --- a/business/jxstore/cms/api_print.go +++ b/business/jxstore/cms/api_print.go @@ -424,21 +424,21 @@ func GetPrinterStatus(appID int, printNo string) (status int, err error) { return status, fmt.Errorf("该应用下未找到该打印机!print_no : %v", printNo) } else { return printers[0].Status + printers[0].IsOnline, nil // 当两个值都唯一时->在线正常 - server := "print.jxcs.net:8000" - tcpAddr, err := net.ResolveTCPAddr("tcp4", server) - if err != nil { - //os.Exit(1) - return status, err - } - conn, err := net.DialTCP("tcp", nil, tcpAddr) - if err != nil { - return status, err - } - status = connHandler(conn, &PrintInfo{ - PrintNo: printNo, - AppID: appID, - }) - return status, nil + //server := "print.jxcs.net:8000" + //tcpAddr, err := net.ResolveTCPAddr("tcp4", server) + //if err != nil { + // //os.Exit(1) + // return status, err + //} + //conn, err := net.DialTCP("tcp", nil, tcpAddr) + //if err != nil { + // return status, err + //} + //status = connHandler(conn, &PrintInfo{ + // PrintNo: printNo, + // AppID: appID, + //}) + //return status, nil } } diff --git a/business/jxstore/cms/temp.go b/business/jxstore/cms/temp.go index 0a0d8486b..5d2ac294f 100644 --- a/business/jxstore/cms/temp.go +++ b/business/jxstore/cms/temp.go @@ -1,66 +1 @@ package cms - -import ( - "fmt" - "git.rosy.net.cn/baseapi/utils" - "net" - "os" -) - -var ( - textChan chan string -) - -func TestTemp() { - server := "127.0.0.1:8000" - tcpAddr, err := net.ResolveTCPAddr("tcp4", server) - if err != nil { - fmt.Fprintf(os.Stderr, "Fatal error: %s", err.Error()) - os.Exit(1) - } - fmt.Println("tcpaddr", utils.Format4Output(tcpAddr, true)) - conn, err := net.DialTCP("tcp", nil, tcpAddr) - if err != nil { - fmt.Println("Dial err:", err) - return - } - textChan = make(chan string, 10) - connHandler(conn) -} - -func TestTemp2(data string) { - textChan <- data -} - -func connHandler(c net.Conn) { - //接收终端输入 - //reader := bufio.NewReader(os.Stdin) - //缓冲 - //buf := make([]byte, 1024) - fmt.Println("Please input data...") - go func() { - for { - //读取终端输入直到读取到\n - //input, err := reader.ReadString('\n') - //if err != nil { - // fmt.Println("ReadString err:", err) - // return - //} - s := <-textChan - //写入数据 - n, err := c.Write([]byte(s)) - if err != nil { - fmt.Println("Write err:", err, n) - return - } - //服务器端返回的数据写入buf - //cnt, err := c.Read(buf) - //if err != nil { - // fmt.Println("Read err:", err) - // return - //} - //服务器端回传的信息 - //fmt.Println("server response:", string(buf[0:cnt])) - } - }() -} diff --git a/business/model/const.go b/business/model/const.go index f4708566d..0f10cb444 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -278,13 +278,16 @@ const ( AfsOrderStatusFinished = 180 // 售后单成功完成 AfsOrderStatusFailed = 190 // 售后单失败 - ApplyOrderCancel = 140 // 申请取消 ApplyOrderRefund = 130 // 申请退款 + OrderStatusRejection = 132 // 客户拒收 + OrderStatusCustomerService = 131 // 客服退款 + ApplyOrderCancel = 140 // 申请取消 ApplyOrderRefundGoods = 150 // 申请退款 UserInStoreConsultingService = 160 // 进店咨询 BusinessCancelOrder = 170 // 商家取消打印 CancelOrderSuccess = 170 // 取消成功打印 OrderRefundMoneySuccess = 180 // 退款成功打印 + ) //联盟订单状态 diff --git a/controllers/api_controller.go b/controllers/api_controller.go index 9b7c9f784..a406da8eb 100644 --- a/controllers/api_controller.go +++ b/controllers/api_controller.go @@ -8,7 +8,6 @@ import ( "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxstore/cms" - "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/globals" @@ -48,7 +47,8 @@ const ( ) var ( - routerMap map[string]reflect.Value + routerMap map[string]reflect.Value + letterBytes = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ) func Init() { @@ -344,7 +344,7 @@ func (c *ApiController) DoPrint(dataMap map[string]interface{}) (data, errCode s } appID = utils.Str2Int(dataMap[keyAppID].(string)) - msgID := time.Now().Format("20060102150405") + "_" + jxutils.RandStringBytes(8) + msgID := time.Now().Format("20060102150405") + "_" + RandStringBytes(8) printNo = dataMap[keyPrintNo].(string) orderNo = dataMap[keyOrderNo].(string) content = dataMap[keyContent].(string)