This commit is contained in:
邹宗楠
2024-03-26 18:10:09 +08:00
parent 4dd488c0ec
commit ed9aa6ce5e
2 changed files with 312 additions and 0 deletions

View File

@@ -6456,6 +6456,7 @@ func SingleBindTaoVegetable(ctx *jxcontext.Context, bind []TaoBindInfo, vendorOr
if len(bind) == 0 {
return fmt.Errorf("绑定门店数据为空,请检查"), ""
}
globals.SugarLogger.Debugf("==========bind : %s", utils.Format4Output(bind, false))
for _, v := range bind {
if len(v.VendorStoreID) == 0 || len(v.VendorStoreName) == 0 {
errIDName = append(errIDName, v.VendorStoreID)
@@ -6494,6 +6495,8 @@ func SingleBindTaoVegetable(ctx *jxcontext.Context, bind []TaoBindInfo, vendorOr
}
storeMaps = append(storeMaps, storeMap)
}
globals.SugarLogger.Debugf("==========storeMaps : %s", utils.Format4Output(storeMaps, false))
userName := ctx.GetUserName()
for _, k := range storeMaps {
dao.WrapAddIDCULDEntity(k, userName)
@@ -6508,9 +6511,11 @@ func SingleBindTaoVegetable(ctx *jxcontext.Context, bind []TaoBindInfo, vendorOr
}
}()
if err := dao.CreateEntity(db, k); err == nil {
globals.SugarLogger.Debugf("==========err1 : %v", err)
errList.AddErr(fmt.Errorf("%s:%v", k.VendorStoreID, err))
dao.Commit(db, txDB)
} else {
globals.SugarLogger.Debugf("==========err2 : %v", err)
dao.Rollback(db, txDB)
}
}