判断
This commit is contained in:
@@ -6065,11 +6065,12 @@ func BatchCreateFreeShipTemplate(relInfo map[string][]tiktok_store.RelInfo, ship
|
||||
errList := errlist.New()
|
||||
for k, v := range relInfo {
|
||||
for _, i := range v {
|
||||
if bindFreight, err := tiktok_store.GetStoreFreight(k, utils.Str2Int64(i.StoreID)); err != nil || utils.IsNil(bindFreight) {
|
||||
if bindFreightID, err := tiktok_store.GetStoreFreight(k, utils.Str2Int64(i.StoreID)); 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.UpdateFreeShipTemplate(utils.Str2Int(i.StoreID), shipFee); err != nil {
|
||||
errList.AddErr(err)
|
||||
}
|
||||
|
||||
@@ -702,23 +702,6 @@ func CreateBindFreeShipTemplate(storeID int, shipFee int64) error {
|
||||
//}
|
||||
} else {
|
||||
param.Template.ProductCity = int64(storeDetail.CityCode)
|
||||
//param.Columns[0].ProvinceInfos = []freightTemplate_create_request.ProvinceInfosItem{
|
||||
// {
|
||||
// Id: utils.Str2Int64(utils.Int2Str(storeDetail.ProvinceCode)[:2]),
|
||||
// Children: []freightTemplate_create_request.ChildrenItem_4{
|
||||
// {
|
||||
// Id: int64(storeDetail.CityCode),
|
||||
// Children: []freightTemplate_create_request.ChildrenItem_5{
|
||||
// {
|
||||
// Id: int64(storeDetail.DistrictCode),
|
||||
// Children: []freightTemplate_create_request.ChildrenItem{
|
||||
// {Id: 0},
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// }},
|
||||
//}
|
||||
}
|
||||
if resp, err := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).FreightTemplateCreate(param); err != nil {
|
||||
return errors.New(fmt.Sprintf("平台门店(%s) 京西门店(%d) 创建包邮模板失败:%v,根据提示处理", storeDetail.VendorStoreID, storeID, err))
|
||||
|
||||
Reference in New Issue
Block a user