This commit is contained in:
richboo111
2022-12-26 13:53:18 +08:00
parent 61e2b13d21
commit 0e3cac55c5
2 changed files with 5 additions and 2 deletions

View File

@@ -1709,7 +1709,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
globals.SugarLogger.Debugf("ddflag=========%v", DDFlag)
if DDFlag {
globals.SugarLogger.Debug("进入DDFlag 特殊处理运费模板、起送价、打包费")
if err := tiktok_store.SpecialTreat(storeMap.VendorOrgCode, utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.StoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix), userName); 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))
}
}

View File

@@ -253,7 +253,7 @@ func GetFence(appOrgCode string, outFenceID []string) ([]warehouse_getFences_res
}
//特殊处理
func SpecialTreat(vendorOrgCode string, vendorStoreID, storeID, deliveryFeeDeductionFee, minPrice int64, userName string) error {
func SpecialTreat(vendorOrgCode string, vendorStoreID, storeID, deliveryFeeDeductionFee, minPrice int64) error {
var (
db *dao.DaoDB
errList = errlist.New()
@@ -292,16 +292,19 @@ func SpecialTreat(vendorOrgCode string, vendorStoreID, storeID, deliveryFeeDeduc
}
//3.设置门店起送价 默认为0
if bindSaleLimitID, err := GetStoreSaleLimit(vendorOrgCode, vendorStoreID); err != nil {
globals.SugarLogger.Debugf("进入获取门店起送价限售模板")
errList.AddErr(fmt.Errorf("获取门店限售模板失败:%v", err))
} else {
if bindSaleLimitID == 0 || utils.IsNil(bindSaleLimitID) { //创建
if createSaleLimitID, err := CreateAndBindMinPriceTemplate(vendorOrgCode, vendorStoreID, minPrice); err != nil {
globals.SugarLogger.Debugf("进入创建门店起送价限售模板,minPrice=======%d", minPrice)
errList.AddErr(fmt.Errorf("设置门店起送价限售模板失败:%v", err))
} else {
FreightTemplate.TradeLimitID = createSaleLimitID
}
} else { //更新为起送价模板
if updateSaleLimitID, err := UpdateTradeLimitTemplate(vendorOrgCode, bindSaleLimitID, minPrice); err != nil {
globals.SugarLogger.Debugf("进入更新门店起送价限售模板,minPrice=======%d", minPrice)
errList.AddErr(fmt.Errorf("更新门店起送价限售模板失败:%v", err))
} else {
FreightTemplate.TradeLimitID = updateSaleLimitID