Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -6059,3 +6059,28 @@ func AssistCreateFence(relInfo map[string][]tiktok_store.RelInfo) (string, error
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
//批量创建包邮运费模板
|
||||
func BatchCreateFreeShipTemplate(relInfo map[string][]tiktok_store.RelInfo, shipFee int64) (string, error) {
|
||||
errList := errlist.New()
|
||||
for k, v := range relInfo {
|
||||
for _, i := range v {
|
||||
if bindFreightID, err := tiktok_store.GetStoreFreight(k, utils.Str2Int64(i.VendorStoreID)); err != nil || bindFreightID == 0 || utils.IsNil(bindFreightID) {
|
||||
if err := tiktok_store.CreateBindFreeShipTemplate(utils.Str2Int(i.StoreID), shipFee); err != nil {
|
||||
errList.AddErr(err)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("进入更新包邮模板操作")
|
||||
if err := tiktok_store.ShopBindStoreFreight(k, utils.Str2Int64(i.VendorStoreID), bindFreightID); err == nil {
|
||||
if err := tiktok_store.UpdateFreeShipTemplate(utils.Str2Int(i.StoreID), shipFee); err != nil {
|
||||
errList.AddErr(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if errList.GetErrListAsOne() != nil {
|
||||
return fmt.Sprintf("%v", errList.GetErrListAsOne()), nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user