This commit is contained in:
richboo111
2022-10-11 11:43:30 +08:00
parent a24d781657
commit 7280843851
2 changed files with 9 additions and 13 deletions

View File

@@ -82,7 +82,6 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
var (
storeIDs string
tempStoreID []int64
fences []string
lists []shop_batchCreateStore_request.StoreListItem
ShopBatchCreateStoreParam *shop_batchCreateStore_request.ShopBatchCreateStoreParam
FreightTemplate = &model.FreightTemplate{}
@@ -134,8 +133,7 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
}
globals.SugarLogger.Debug("Success createStore and return storeID=====", resp.ResultList[0].Store.StoreId, utils.Str2Int(storeIDs))
if utils.Str2Int(storeIDs) == 0 {
errList.AddErr(fmt.Errorf("storeIDs=0 %v", err))
//return "", errors.New(fmt.Sprintf("创建店铺失败原因storeIDs = 0:%v,%v", err, resp.ResultList[0].Msg))
return "", errors.New(fmt.Sprintf("创建店铺失败原因storeIDs = 0:%v,%v", err, resp.ResultList[0].Msg))
}
//创建并绑定运费模板
@@ -146,7 +144,7 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
} else {
if freightTemplateID == 0 {
globals.SugarLogger.Debug("freightTemplateID=========", freightTemplateID)
errList.AddErr(fmt.Errorf(" ", int64(storeDetail.Store.ID), freightTemplateID, err))
errList.AddErr(fmt.Errorf("创建运费模板失败:%d %d %v", int64(storeDetail.Store.ID), freightTemplateID, err))
}
err = P.ShopBindStoreFreight(int64(storeDetail.Store.ID), freightTemplateID)
if err != nil {
@@ -181,7 +179,7 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
if fenceID, err := CreateFenceByStore(int(resp.ResultList[0].Store.StoreId)); err != nil {
errList.AddErr(fmt.Errorf("创建电子围栏失败原因:%v", err))
} else {
fences = append(fences, fenceID)
fences := []string{utils.Int2Str(storeDetail.Store.ID)}
if err := BindFenceByStore(resp.ResultList[0].Store.StoreId, fences); err != nil {
errList.AddErr(fmt.Errorf("门店:%d 绑定电子围栏:%d 失败原因:%v", int64(storeDetail.Store.ID), warehouse, err))
} else {