打桩,测试美团配送
This commit is contained in:
@@ -139,6 +139,7 @@ func PrintRefundOrCancelOrder(ctx *jxcontext.Context, printType int, order *mode
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode)
|
storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode)
|
||||||
|
|
||||||
printResult, err = handler.PrintCancelOrRefundOrder(ctx, printType, store, storeDetail, order)
|
printResult, err = handler.PrintCancelOrRefundOrder(ctx, printType, store, storeDetail, order)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true)
|
dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true)
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
|
|||||||
result.LogisticsStatus = 0
|
result.LogisticsStatus = 0
|
||||||
result.LogisticsContext = model.RiderGetOrderDeliverOther
|
result.LogisticsContext = model.RiderGetOrderDeliverOther
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("===========================mtps:%s", utils.Format4Output(result, false))
|
||||||
delivery.PullTiktokRiderInfo(result)
|
delivery.PullTiktokRiderInfo(result)
|
||||||
if result.LogisticsStatus == model.WaybillStatusCourierArrived {
|
if result.LogisticsStatus == model.WaybillStatusCourierArrived {
|
||||||
result.LogisticsStatus = model.WaybillStatusDelivering
|
result.LogisticsStatus = model.WaybillStatusDelivering
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) {
|
func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) {
|
||||||
|
globals.SugarLogger.Debugf("==================riderInfo:%s", utils.Format4Output(riderInfo, false))
|
||||||
switch riderInfo.LogisticsStatus {
|
switch riderInfo.LogisticsStatus {
|
||||||
case 5: // 呼叫骑手
|
case 5: // 呼叫骑手
|
||||||
riderInfo.LogisticsStatus = 0
|
riderInfo.LogisticsStatus = 0
|
||||||
@@ -192,6 +193,7 @@ func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) {
|
|||||||
// 呼叫骑手的时候推送发货
|
// 呼叫骑手的时候推送发货
|
||||||
// 抖店由于发配送时运单id已经固定了,我们系统在重新发货,或者运单号发生改变时去推送信息时.抖店只识别第一个运单号所以在这儿修改成发单时的第一个运单号!
|
// 抖店由于发配送时运单id已经固定了,我们系统在重新发货,或者运单号发生改变时去推送信息时.抖店只识别第一个运单号所以在这儿修改成发单时的第一个运单号!
|
||||||
paramsMap := utils.Struct2Map(riderInfo, "", true)
|
paramsMap := utils.Struct2Map(riderInfo, "", true)
|
||||||
|
globals.SugarLogger.Debugf("==================paramsMap:%s", utils.Format4Output(paramsMap, false))
|
||||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(model.VendorIDDD); handler != nil {
|
if handler := partner.GetPurchaseOrderHandlerFromVendorID(model.VendorIDDD); handler != nil {
|
||||||
if err := handler.GetOrderRider("", "", paramsMap); err != nil {
|
if err := handler.GetOrderRider("", "", paramsMap); err != nil {
|
||||||
globals.SugarLogger.Errorf("PullTiktokRiderInfo Err %s", err.Error())
|
globals.SugarLogger.Errorf("PullTiktokRiderInfo Err %s", err.Error())
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder,
|
|||||||
if utils.IsTimeZero(expectedDeliveryTime) {
|
if utils.IsTimeZero(expectedDeliveryTime) {
|
||||||
expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour)
|
expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour)
|
||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
var orderParams []interface{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
if storeDetail != nil {
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
@@ -219,64 +219,37 @@ func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载用户取消订单售后单
|
||||||
|
|
||||||
title := ``
|
title := ``
|
||||||
if printType == model.YES { // 退单
|
if printType == model.YES { // 取消订单
|
||||||
title = `<FS2><center>取消订单详情</center></FS2>\n`
|
title = `<FS2><center>取消订单详情</center></FS2>\n`
|
||||||
} else {
|
} else { // 售后订单
|
||||||
title = `<FS2><center>退款订单详情</center></FS2>\n`
|
title = `<FS2><center>退款订单详情</center></FS2>\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
orderFmt +=
|
orderFmt +=
|
||||||
`--------------------------------\n
|
`--------------------------------\n
|
||||||
下单时间: %s\n
|
下单时间: %s\n
|
||||||
预计送达: %s\n
|
|
||||||
订单编号: %s\n
|
订单编号: %s\n
|
||||||
`
|
`
|
||||||
|
|
||||||
orderFmt += `
|
orderFmt += `
|
||||||
\n
|
\n
|
||||||
<FS>%s <FS2>#%d</FS2></FS>\n\n
|
<FS>%s <FS2>#%d</FS2></FS>\n\n
|
||||||
客户: %s\n
|
|
||||||
电话: %s\n
|
|
||||||
地址: %s\n
|
|
||||||
\n
|
|
||||||
客户备注: \n
|
|
||||||
<FS>%s</FS>\n
|
|
||||||
\n
|
|
||||||
\n
|
\n
|
||||||
` + title + `
|
` + title + `
|
||||||
商品明细: \n
|
|
||||||
品名 数量 小计\n
|
|
||||||
--------------------------------\n`
|
--------------------------------\n`
|
||||||
orderParams = append(orderParams,
|
orderParams = append(orderParams,
|
||||||
utils.Time2Str(order.OrderCreatedAt),
|
utils.Time2Str(order.OrderCreatedAt),
|
||||||
utils.Time2Str(expectedDeliveryTime),
|
|
||||||
order.VendorOrderID,
|
order.VendorOrderID,
|
||||||
|
|
||||||
jxutils.GetVendorName(order.VendorID),
|
jxutils.GetVendorName(order.VendorID),
|
||||||
order.OrderSeq,
|
order.OrderSeq,
|
||||||
//order.VendorOrderID,
|
|
||||||
order.ConsigneeName,
|
|
||||||
order.ConsigneeMobile,
|
|
||||||
order.ConsigneeAddress,
|
|
||||||
order.BuyerComment,
|
|
||||||
)
|
)
|
||||||
|
orderFmt += `
|
||||||
for _, sku := range order.Skus {
|
|
||||||
orderFmt += `<FH>%s</FH>\n`
|
|
||||||
orderFmt += `<FH>%20s%8s</FH>\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
|
|
||||||
<FB>共%d种%d件商品</FB>\n
|
|
||||||
<FB>实际支付:%s</FB>\n
|
|
||||||
--------------------------------\n
|
|
||||||
--------------------------------\n
|
--------------------------------\n
|
||||||
`
|
`
|
||||||
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
|
|
||||||
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
|
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)
|
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) {
|
if utils.IsTimeZero(expectedDeliveryTime) {
|
||||||
expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour)
|
expectedDeliveryTime = order.OrderCreatedAt.Add(1 * time.Hour)
|
||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
var orderParams []interface{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
if storeDetail != nil {
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
@@ -307,52 +280,23 @@ func (c *PrinterHandler) getCancelOrRefundOrderContentBig(order *model.GoodsOrde
|
|||||||
}
|
}
|
||||||
orderFmt += `--------------------------------\n
|
orderFmt += `--------------------------------\n
|
||||||
<FS>下单时间: %s\n\n</FS>
|
<FS>下单时间: %s\n\n</FS>
|
||||||
<FS>预计送达: %s\n\n</FS>
|
|
||||||
<FS>订单编号: %s\n</FS>
|
<FS>订单编号: %s\n</FS>
|
||||||
\n
|
\n
|
||||||
<FS>%s <FS2>#%d</FS2></FS>\n\n
|
<FS>%s <FS2>#%d</FS2></FS>\n\n
|
||||||
<FS>客户: %s\n</FS>
|
|
||||||
<FS>电话: %s\n</FS>
|
|
||||||
<FS>地址: %s\n</FS>
|
|
||||||
\n
|
|
||||||
<FS>客户备注: \n</FS>
|
|
||||||
<FS>%s</FS>\n
|
|
||||||
\n
|
|
||||||
\n
|
\n
|
||||||
` + title + `
|
` + title + `
|
||||||
<FS>商品明细: \n</FS>
|
|
||||||
品名 数量 小计\n
|
|
||||||
--------------------------------\n`
|
--------------------------------\n`
|
||||||
orderParams = append(orderParams,
|
orderParams = append(orderParams,
|
||||||
utils.Time2Str(order.OrderCreatedAt),
|
utils.Time2Str(order.OrderCreatedAt),
|
||||||
utils.Time2Str(expectedDeliveryTime),
|
|
||||||
order.VendorOrderID,
|
order.VendorOrderID,
|
||||||
jxutils.GetVendorName(order.VendorID),
|
jxutils.GetVendorName(order.VendorID),
|
||||||
order.OrderSeq,
|
order.OrderSeq,
|
||||||
//order.VendorOrderID,
|
//order.VendorOrderID,
|
||||||
order.ConsigneeName,
|
|
||||||
order.ConsigneeMobile,
|
|
||||||
order.ConsigneeAddress,
|
|
||||||
order.BuyerComment,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for _, sku := range order.Skus {
|
orderFmt += `
|
||||||
orderFmt += `<FH2>%s\n</FH2>`
|
|
||||||
orderFmt += `<FS><FB>%15s%8s</FB>\n</FS>`
|
|
||||||
orderParams = append(orderParams, sku.SkuName, "X"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
|
|
||||||
//标品需要打印条形码
|
|
||||||
if sku.Upc != "" {
|
|
||||||
orderFmt += `<FS>upc码: %s\n</FS>`
|
|
||||||
orderParams = append(orderParams, sku.Upc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
orderFmt += `\n
|
|
||||||
<FS><FB>共%d种%d件商品</FB></FS>\n
|
|
||||||
<FS2><FB>实际支付:</FB>%s\n</FS2>\n
|
|
||||||
--------------------------------\n
|
|
||||||
--------------------------------\n
|
--------------------------------\n
|
||||||
`
|
`
|
||||||
// <QR>http://weixin.qq.com/r/tkkDGzTERmk5rXB49xyk</QR>
|
|
||||||
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
|
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)
|
return strings.Replace(fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...), "\\n", "\r\n", -1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
if order.VendorID == model.VendorIDEBAI {
|
if order.VendorID == model.VendorIDEBAI {
|
||||||
getCode = fmt.Sprintf("<S2>饿百取货码:%s</S2><RN>\n", jxutils.GetEbaiOrderGetCode(order))
|
getCode = fmt.Sprintf("<S2>饿百取货码:%s</S2><RN>\n", jxutils.GetEbaiOrderGetCode(order))
|
||||||
}
|
}
|
||||||
orderParams := []interface{}{}
|
var orderParams []interface{}
|
||||||
orderFmt := ``
|
orderFmt := ``
|
||||||
if storeDetail != nil {
|
if storeDetail != nil {
|
||||||
if storeDetail.BrandIsPrint == model.NO {
|
if storeDetail.BrandIsPrint == model.NO {
|
||||||
|
|||||||
Reference in New Issue
Block a user