diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 5bc54a263..fc5ab3c29 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1297,8 +1297,12 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord order := &model.GoodsOrder{} order.VendorOrderID = utils.Int64ToStr(v.OrderID) dao.GetEntity(db, order, "VendorOrderID") + storeDeatil, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID) order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100) - dao.UpdateEntity(db, order, "TotalShopMoney") + if order.NewEarningPrice == 0 { + jxutils.RefreshOrderEarningPrice2(order, storeDeatil.PayPercentage) + } + dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice") } } return err diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index ff91ee17b..f49997f1d 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1159,6 +1159,10 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend } else { err = ErrCanNotFindVendor } + storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID) + if storeDetail != nil { + return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID) + } } else if vendorID == model.VendorIDJX { ReCalculateJxPriceLight(db, ctx, storeID) } else if vendorID == model.VendorIDYB { @@ -1186,10 +1190,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend } } } - storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID) - if storeDetail != nil { - return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID) - } storeMapList, err := dao.GetStoresMapList2(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", true) if len(storeMapList) > 0 { _, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index 42b31b0ca..0f994e1dd 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -660,7 +660,7 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j } attrBzq := &jdshopapi.CreateSkuParamAttrs{ AttrID: utils.Int2Str(attrIDs["保质期"]), - AttrValues: []string{"5天"}, + AttrValues: []string{"5"}, } attrsProp = append(attrsProp, attrZctj) attrsProp = append(attrsProp, attrJhl)