diff --git a/business/dao/print_temp_utils.go b/business/dao/print_temp_utils.go index 16bfc3bc7..7ac4fc759 100644 --- a/business/dao/print_temp_utils.go +++ b/business/dao/print_temp_utils.go @@ -421,7 +421,6 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj, rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint], param[model.CustcareRefundReasonPrint], utils.Time2DateStr(time.Now())) textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1) } - default: } voice := strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1) @@ -472,11 +471,11 @@ func PrintStoreStatus(param map[string]string, setting *model.PrintSettingObj) s case -9: printVoiceMsg += `%d` printVoiceValue = append(printVoiceValue, model.LoseTokenVoice) - textMsg += `
门店丢失授权通知

` - textMsg += `
门店:%s

` - textMsg += `
平台:%s

` - textMsg += `
下线时间:%s

` - textMsg += `
授权丢失,将无法继续打压订单!!!!

` + textMsg += `门店丢失授权通知
` + textMsg += `门店:%s
` + textMsg += `平台:%s
` + textMsg += `下线时间:%s
` + textMsg += `授权丢失,将无法继续打压订单!!!!
` textMsgValue = append(textMsgValue, param[model.StoreNamePrint], param[model.VendorNamePrint], utils.Time2DateStr(time.Now())) voice := strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1) msg := strings.Replace(fmt.Sprintf(strings.Replace(textMsg, "\n", "", -1), textMsgValue...), "\\n", "\r\n", -1) diff --git a/business/jxstore/cms/print.go b/business/jxstore/cms/print.go index 13a87952e..f92983b9f 100644 --- a/business/jxstore/cms/print.go +++ b/business/jxstore/cms/print.go @@ -383,7 +383,7 @@ func DelPrinterSeq(appID int, printNo string) (err error) { return err } -func DoPrint(appID int, msgID, printNo, content string, orderNo string) (err error) { +func DoPrintMsg(appID int, msgID, printNo, content string, orderNo string) (err error) { var ( db = dao.GetDB() ) diff --git a/controllers/api_controller.go b/controllers/api_controller.go index a3f1d6324..f5678c103 100644 --- a/controllers/api_controller.go +++ b/controllers/api_controller.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto/md5" "encoding/json" + "errors" "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/dao" @@ -367,9 +368,12 @@ func (c *ApiController) DoPrint(dataMap map[string]interface{}) (data, errCode s globals.SugarLogger.Debugf("MakePrintMsgOnTempVoice 4 err := %v", err) return "", model.ErrCodeGeneralFailed, err } + if printMsg == "" { + return "", model.ErrCodeGeneralFailed, errors.New("无打印数据") + } content = printMsg - if err = cms.DoPrint(appID, msgID, printNo, content, orderNo); err != nil { + if err = cms.DoPrintMsg(appID, msgID, printNo, content, orderNo); err != nil { globals.SugarLogger.Debugf("DoPrint 5 err := %v", err) return "", model.ErrCodeGeneralFailed, err }