- send different wx msg when mt changed courier

This commit is contained in:
gazebo
2018-12-17 11:53:12 +08:00
parent 215cdd9533
commit cae7c6d372
2 changed files with 12 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ const (
//新订单模板消息文字颜色
WX_NEW_ORDER_TEMPLATE_COLOR = "#173177"
WX_HIGHLEVEL_TEMPLATE_COLOR = "#FF0000" //红色
WX_HIGHLEVEL_TEMPLATE_COLOR2 = "#333333" //黑色
WX_TEMPLATE_VENDERCOLOR_JDDJ = "#47B34F"
WX_TEMPLATE_VENDERCOLOR_MT = "#F4A800"
WX_TEMPLATE_VENDERCOLOR_ELM = "#0191EA" //蓝色
@@ -163,7 +164,7 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), data)
}
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder) error {
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlreadyCandidate bool) error {
globals.SugarLogger.Debugf("NotifyWaybillStatus orderID:%s bill:%v", order.VendorOrderID, bill)
if order.VendorID == model.VendorIDELM {
return nil
@@ -184,9 +185,14 @@ func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder) error {
} else if bill.WaybillVendorID == model.VendorIDDada {
templateID = WX_DADA_DELIVERY_GRABDONE_TEMPLATE_ID
}
titleColor = WX_HIGHLEVEL_TEMPLATE_COLOR
remark = FormatDeliveryTime(order)
title = fmt.Sprintf("%s 第%d号订单长时间无人配送我们已安排%s配送员%s电话号码%s负责配送。^_^", model.VendorChineseNames[bill.OrderVendorID], order.OrderSeq, model.VendorChineseNames[bill.WaybillVendorID], bill.CourierName, bill.CourierMobile)
if isBillAlreadyCandidate {
titleColor = WX_HIGHLEVEL_TEMPLATE_COLOR
title = fmt.Sprintf("%s 第%d号订单由于之前安排的配送员长时间没有取货我们已重新安排%s配送员%s负责配送。^_^", model.VendorChineseNames[bill.OrderVendorID], order.OrderSeq, model.VendorChineseNames[bill.WaybillVendorID], bill.CourierName)
} else {
titleColor = WX_HIGHLEVEL_TEMPLATE_COLOR2
title = fmt.Sprintf("%s 第%d号订单长时间无人配送我们已安排%s配送员%s负责配送。^_^", model.VendorChineseNames[bill.OrderVendorID], order.OrderSeq, model.VendorChineseNames[bill.WaybillVendorID], bill.CourierName)
}
case model.WaybillStatusDelivered:
if bill.WaybillVendorID == model.VendorIDMTPS {
templateID = WX_MTPS_DELIVERY_DONE_TEMPLATE_ID