打包费以及起送价

This commit is contained in:
richboo111
2022-11-03 17:38:18 +08:00
parent e2e11949e9
commit 3774561b54
4 changed files with 97 additions and 44 deletions

View File

@@ -1524,17 +1524,17 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
}
if vendorID == model.VendorIDDD { //抖店绑定店铺时 检查并补充创建
globals.SugarLogger.Debugf("vendorID ==============%d", vendorID)
if str, err2 := tiktok_store.CreateOrUpdateAll(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID)); err2 != nil {
errList.AddErr(fmt.Errorf("wrongAns=%s,err=%v", str, err2))
if err2 := tiktok_store.CreateOrUpdateAll(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID)); err2 != nil {
errList.AddErr(err2)
}
}
} else if vendorID == model.VendorIDJX {
ReCalculateJxPriceLight(db, ctx, storeID)
} else if vendorID == model.VendorIDYB {
err = checkYbParams(db, storeMap, storeID)
if err != nil {
return nil, err
}
//} else if vendorID == model.VendorIDYB {
// err = checkYbParams(db, storeMap, storeID)
// if err != nil {
// return nil, err
// }
} else if vendorID == model.VendorIDJDShop {
if storeMap.VendorStoreID == "" {
storeMap.SyncStatus = model.SyncFlagNewMask //京东商城要去建店
@@ -1698,12 +1698,12 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
//增加同步到抖店厂商的同步标志
DDFlag := false
errList := errlist.ErrList{}
if valid["deliveryFeeDeductionSill"] != nil && vendorID == model.VendorIDDD {
if (valid["deliveryFeeDeductionSill"] != nil || valid["deliveryFeeDeductionFee"] != nil || valid["ybStorePrefix"]) && vendorID == model.VendorIDDD {
DDFlag = true
} //特殊处理抖店运费模板
} //特殊处理抖店运费模板、打包费
if DDFlag {
globals.SugarLogger.Debug("进入DDFlag 特殊处理运费模板")
if err := tiktok_store.FreightSpecialTreat(storeMap.VendorOrgCode, utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.StoreID)); err != nil {
if err := tiktok_store.SpecialTreat(storeMap.VendorOrgCode, utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.StoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix)); err != nil {
errList.AddErr(fmt.Errorf("抖店运费模板相关处理错误:%v", err))
}
}