This commit is contained in:
gazebo
2019-10-31 14:20:50 +08:00
parent ae58b41ac6
commit a2c3107ee0

View File

@@ -13,8 +13,8 @@ import (
)
const (
minCSOrderPayment = 0 // 供货订单的最小金额
maxUnitPrice = 3000 // 为防止误填单价,限制单价最高
minCSOrderPayment = 0 // 供货订单的最小金额(单位为元)
maxUnitPrice = 3000 // 为防止误填单价,限制单价最高(单位为分)
)
func OnCallbackMsg(msg *weimobapi.CallbackMsg) (response *weimobapi.CallbackResponse) {
@@ -33,6 +33,7 @@ func onOrderMsg(msg *weimobapi.CallbackMsg) (response *weimobapi.CallbackRespons
changeStoreSkusByOrder(orderDetail)
}
} else {
globals.SugarLogger.Debugf("onOrderMsg order:%s failed with err:%v", msg.OrderNo, err)
response = weimobapi.Err2CallbackResponse(err, "")
}
}
@@ -40,6 +41,7 @@ func onOrderMsg(msg *weimobapi.CallbackMsg) (response *weimobapi.CallbackRespons
}
func changeStoreSkusByOrder(order *weimobapi.OrderDetail) {
globals.SugarLogger.Debugf("changeStoreSkusByOrder order:%s", utils.Format4Output(order, true))
receiverMobile := order.DeliveryDetail.LogisticsDeliveryDetail.ReceiverMobile
storeList, err := dao.GetStoreList(dao.GetDB(), nil, []string{receiverMobile}, "")
if err != nil {
@@ -64,9 +66,13 @@ func changeStoreSkusByOrder(order *weimobapi.OrderDetail) {
}
if len(skuBindInfos) > 0 {
cms.UpdateStoreSkus(jxcontext.NewWithUserName(nil, utils.LimitStringLen(utils.Int64ToStr(order.OrderNo), 32), nil, nil), storeID, skuBindInfos, true, true)
} else {
globals.SugarLogger.Debugf("changeStoreSkusByOrder storeID:%d is empty", storeID)
}
} else {
globals.SugarLogger.Infof("[运营],微商城订单:%s手机:%s找不到唯一一个京西门店%d", order.OrderNo, receiverMobile, len(storeList))
}
} else {
globals.SugarLogger.Warnf("changeStoreSkusByOrder receiverMobile:%s failed with err:%v", receiverMobile, err)
}
}