This commit is contained in:
richboo111
2022-11-18 16:53:49 +08:00
parent 11b63862d1
commit a038f850c9
2 changed files with 25 additions and 14 deletions

View File

@@ -6015,15 +6015,24 @@ func GetVendorOrgCode(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID i
return storeMap, dao.GetEntitiesByKV(db, &storeMap, cond, false)
}
//辅助创建电子围栏
func AssistCreateFence(appOrgCode string, storeID int64) error {
//创建前检查 暂时不支持
if fenceID, err := tiktok_store.CreateFenceByStore(appOrgCode, storeID); err != nil {
return errors.New(fmt.Sprintf("创建电子围栏失败:%v", err))
} else {
if err := tiktok_store.BindFenceByStore(appOrgCode, storeID, []string{fenceID}); err != nil {
return errors.New(fmt.Sprintf("绑定电子围栏失败:%v", err))
//批量辅助创建电子围栏
func AssistCreateFence(relInfo map[string][]int64) (string, error) {
var (
errList = errlist.New()
)
for k, v := range relInfo {
for _, i := range v {
if fenceID, err := tiktok_store.CreateFenceByStore(k, i); err != nil {
errList.AddErr(fmt.Errorf("门店(%d)创建电子围栏失败:%v", i, err))
} else {
if err := tiktok_store.BindFenceByStore(k, i, []string{fenceID}); err != nil {
errList.AddErr(fmt.Errorf("门店(%d)绑定电子围栏失败:%v", i, err))
}
}
}
}
return nil
if errList.GetErrListAsOne() != nil {
return fmt.Sprintf("批量创建电子围栏提示信息:%v", errList.GetErrListAsOne()), nil
}
return "", nil
}