- refactor GetJxStoreIDFromOrder
- add IsOrderPlatformWaybill
This commit is contained in:
@@ -54,13 +54,29 @@ func (m *SyncMapWithTimeout) Delete(key interface{}) {
|
||||
m.timers.Delete(key)
|
||||
}
|
||||
|
||||
func GetJxStoreIDFromOrder(order *model.GoodsOrder) (retVal int) {
|
||||
func getJxStoreIDFromOrder(order *model.GoodsOrder) (retVal int) {
|
||||
if order.JxStoreID != 0 {
|
||||
return order.JxStoreID
|
||||
}
|
||||
return order.StoreID
|
||||
}
|
||||
|
||||
// 此函数得到的是order的销售门店京西ID,与GetJxStoreIDFromOrder的区别是order.StoreID的解释不同,参考其它相关资料
|
||||
func GetSaleStoreIDFromOrder(order *model.GoodsOrder) (retVal int) {
|
||||
if order.VendorID != model.VendorIDWSC {
|
||||
return getJxStoreIDFromOrder(order)
|
||||
}
|
||||
return order.StoreID
|
||||
}
|
||||
|
||||
// 此函数得到的是order的商品的展示门店京西ID,与GetJxStoreIDFromOrder的区别是order.StoreID的解释不同,参考其它相关资料
|
||||
func GetShowStoreIDFromOrder(order *model.GoodsOrder) (retVal int) {
|
||||
if order.VendorID != model.VendorIDWSC {
|
||||
return getJxStoreIDFromOrder(order)
|
||||
}
|
||||
return order.JxStoreID
|
||||
}
|
||||
|
||||
func SplitUniversalOrderID(universalOrderID string) (orderID string, vendorID int) {
|
||||
index := strings.Index(universalOrderID, "|")
|
||||
if index != -1 {
|
||||
|
||||
@@ -199,7 +199,7 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
|
||||
"color": WX_NEW_ORDER_TEMPLATE_COLOR,
|
||||
},
|
||||
}
|
||||
storeID := jxutils.GetJxStoreIDFromOrder(order)
|
||||
storeID := jxutils.GetSaleStoreIDFromOrder(order)
|
||||
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlr
|
||||
"color": WX_NEW_ORDER_TEMPLATE_COLOR,
|
||||
},
|
||||
}
|
||||
return SendMsgToStore(jxutils.GetJxStoreIDFromOrder(order), templateID, "", "", data)
|
||||
return SendMsgToStore(jxutils.GetSaleStoreIDFromOrder(order), templateID, "", "", data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user