This commit is contained in:
苏尹岚
2020-08-05 11:21:48 +08:00
parent 8be85256d6
commit 0508fd922b
2 changed files with 22 additions and 4 deletions

View File

@@ -199,12 +199,24 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
waybill, _ := c.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
store, _ := c.LoadStoreDetail(jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
if waybill == nil {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100)
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100)
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage/2) / int64(100)
}
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100)
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100)
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage/2) / int64(100)
}
}
}
dao.UpdateEntity(db, order, "NewEarningPrice")

View File

@@ -1297,6 +1297,12 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
ShopInfo, _ := api.MtpsAPI.ShopQuery(strconv.Itoa(storeId))
if ShopInfo != nil {
ShopName = ShopInfo.ShopName
if ShopName == "" {
if StoreLists[0].Name[len(StoreLists[0].Name)-1:] == "店" {
}
ShopName = StoreLists[0].Name
}
StoreInfoList, _ = api.MtpsAPI.GetStoreStatus(ShopName)
if StoreInfoList != nil && StoreInfoList.DataList != nil {
goto ifExist