From f780a123e42ead67fa76880f4ca55ad7cc801a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 30 Nov 2022 10:26:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E6=A1=A9,=E6=B5=8B=E8=AF=95=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E9=85=8D=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/netprinter/netprinter.go | 1 + business/partner/delivery/mtps/waybill.go | 1 + business/partner/delivery/rider.go | 2 + .../partner/printer/yilianyun/yilianyun.go | 76 +++---------------- business/partner/printer/zhongwu/zhongwu.go | 2 +- 5 files changed, 15 insertions(+), 67 deletions(-) diff --git a/business/jxutils/netprinter/netprinter.go b/business/jxutils/netprinter/netprinter.go index 42054a42c..542f80c95 100644 --- a/business/jxutils/netprinter/netprinter.go +++ b/business/jxutils/netprinter/netprinter.go @@ -139,6 +139,7 @@ func PrintRefundOrCancelOrder(ctx *jxcontext.Context, printType int, order *mode }, nil } storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode) + printResult, err = handler.PrintCancelOrRefundOrder(ctx, printType, store, storeDetail, order) if err == nil { dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true) diff --git a/business/partner/delivery/mtps/waybill.go b/business/partner/delivery/mtps/waybill.go index cbc732ad9..33543e698 100644 --- a/business/partner/delivery/mtps/waybill.go +++ b/business/partner/delivery/mtps/waybill.go @@ -156,6 +156,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m result.LogisticsStatus = 0 result.LogisticsContext = model.RiderGetOrderDeliverOther } + globals.SugarLogger.Debugf("===========================mtps:%s", utils.Format4Output(result, false)) delivery.PullTiktokRiderInfo(result) if result.LogisticsStatus == model.WaybillStatusCourierArrived { result.LogisticsStatus = model.WaybillStatusDelivering diff --git a/business/partner/delivery/rider.go b/business/partner/delivery/rider.go index c00617bd4..48f927eab 100644 --- a/business/partner/delivery/rider.go +++ b/business/partner/delivery/rider.go @@ -151,6 +151,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) { } func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) { + globals.SugarLogger.Debugf("==================riderInfo:%s", utils.Format4Output(riderInfo, false)) switch riderInfo.LogisticsStatus { case 5: // 呼叫骑手 riderInfo.LogisticsStatus = 0 @@ -192,6 +193,7 @@ func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) { // 呼叫骑手的时候推送发货 // 抖店由于发配送时运单id已经固定了,我们系统在重新发货,或者运单号发生改变时去推送信息时.抖店只识别第一个运单号所以在这儿修改成发单时的第一个运单号! paramsMap := utils.Struct2Map(riderInfo, "", true) + globals.SugarLogger.Debugf("==================paramsMap:%s", utils.Format4Output(paramsMap, false)) if handler := partner.GetPurchaseOrderHandlerFromVendorID(model.VendorIDDD); handler != nil { if err := handler.GetOrderRider("", "", paramsMap); err != nil { globals.SugarLogger.Errorf("PullTiktokRiderInfo Err %s", err.Error()) diff --git a/business/partner/printer/yilianyun/yilianyun.go b/business/partner/printer/yilianyun/yilianyun.go index fc98c6efb..e09c0af71 100644 --- a/business/partner/printer/yilianyun/yilianyun.go +++ b/business/partner/printer/yilianyun/yilianyun.go @@ -206,7 +206,7 @@ func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder, if utils.IsTimeZero(expectedDeliveryTime) { expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour) } - orderParams := []interface{}{} + var orderParams []interface{} orderFmt := `` if storeDetail != nil { if storeDetail.BrandIsPrint == model.NO { @@ -219,64 +219,37 @@ func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder, } } + // 加载用户取消订单售后单 + title := `` - if printType == model.YES { // 退单 + if printType == model.YES { // 取消订单 title = `
取消订单详情
\n` - } else { + } else { // 售后订单 title = `
退款订单详情
\n` } + orderFmt += `--------------------------------\n 下单时间: %s\n -预计送达: %s\n 订单编号: %s\n ` orderFmt += ` \n %s #%d\n\n -客户: %s\n -电话: %s\n -地址: %s\n -\n -客户备注: \n -%s\n -\n \n ` + title + ` -商品明细: \n -品名 数量 小计\n --------------------------------\n` orderParams = append(orderParams, utils.Time2Str(order.OrderCreatedAt), - utils.Time2Str(expectedDeliveryTime), order.VendorOrderID, + jxutils.GetVendorName(order.VendorID), order.OrderSeq, - //order.VendorOrderID, - order.ConsigneeName, - order.ConsigneeMobile, - order.ConsigneeAddress, - order.BuyerComment, ) - - for _, sku := range order.Skus { - orderFmt += `%s\n` - orderFmt += `%20s%8s\n` - orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) - //标品需要打印条形码 - if sku.Upc != "" { - orderFmt += `upc码: %s\n` - orderParams = append(orderParams, sku.Upc) - } - } - orderFmt += `\n -共%d种%d件商品\n -实际支付:%s\n ---------------------------------\n + orderFmt += ` --------------------------------\n ` - // http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice)) return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1) } @@ -287,7 +260,7 @@ func (c *PrinterHandler) getCancelOrRefundOrderContentBig(order *model.GoodsOrde if utils.IsTimeZero(expectedDeliveryTime) { expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour) } - orderParams := []interface{}{} + var orderParams []interface{} orderFmt := `` if storeDetail != nil { if storeDetail.BrandIsPrint == model.NO { @@ -307,52 +280,23 @@ func (c *PrinterHandler) getCancelOrRefundOrderContentBig(order *model.GoodsOrde } orderFmt += `--------------------------------\n 下单时间: %s\n\n -预计送达: %s\n\n 订单编号: %s\n \n %s #%d\n\n -客户: %s\n -电话: %s\n -地址: %s\n -\n -客户备注: \n -%s\n -\n \n ` + title + ` -商品明细: \n -品名 数量 小计\n --------------------------------\n` orderParams = append(orderParams, utils.Time2Str(order.OrderCreatedAt), - utils.Time2Str(expectedDeliveryTime), order.VendorOrderID, jxutils.GetVendorName(order.VendorID), order.OrderSeq, //order.VendorOrderID, - order.ConsigneeName, - order.ConsigneeMobile, - order.ConsigneeAddress, - order.BuyerComment, ) - for _, sku := range order.Skus { - orderFmt += `%s\n` - orderFmt += `%15s%8s\n` - orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) - //标品需要打印条形码 - if sku.Upc != "" { - orderFmt += `upc码: %s\n` - orderParams = append(orderParams, sku.Upc) - } - } - orderFmt += `\n -共%d种%d件商品\n -实际支付:%s\n\n ---------------------------------\n + orderFmt += ` --------------------------------\n ` - // http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice)) return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1) } diff --git a/business/partner/printer/zhongwu/zhongwu.go b/business/partner/printer/zhongwu/zhongwu.go index 5c9c860f8..c4258008d 100644 --- a/business/partner/printer/zhongwu/zhongwu.go +++ b/business/partner/printer/zhongwu/zhongwu.go @@ -38,7 +38,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin if order.VendorID == model.VendorIDEBAI { getCode = fmt.Sprintf("饿百取货码:%s\n", jxutils.GetEbaiOrderGetCode(order)) } - orderParams := []interface{}{} + var orderParams []interface{} orderFmt := `` if storeDetail != nil { if storeDetail.BrandIsPrint == model.NO {