门店审核状态,增加电子围栏限制

This commit is contained in:
richboo111
2022-12-02 16:21:11 +08:00
parent ba30ec2ed5
commit c8c33d38c1
2 changed files with 31 additions and 4 deletions

View File

@@ -6019,6 +6019,9 @@ func GetVendorOrgCode(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID i
func AssistCreateFence(relInfo map[string][]tiktok_store.RelInfo) (string, error) {
var (
tempFenceID string
tStr1 = ""
tStr2 = ""
endStr = ""
db = dao.GetDB()
errList = errlist.New()
FreightTemplate = &model.FreightTemplate{}
@@ -6027,6 +6030,19 @@ func AssistCreateFence(relInfo map[string][]tiktok_store.RelInfo) (string, error
for _, i := range v {
tempStoreID := utils.Str2Int64(i.StoreID)
tempVendorStoreID := utils.Str2Int64(i.VendorStoreID)
//预处理门店无配送范围情况
if localStore, err := dao.GetStoreDetail(db, utils.Str2Int(i.StoreID), model.VendorIDDD, k); err == nil {
if localStore.DeliveryRangeType == tiktok_store.LocalShapeCircular && utils.Str2Int(localStore.DeliveryRange) <= 0 {
tStr1 += i.StoreID + ","
} else if localStore.DeliveryRangeType == tiktok_store.LocalShapePolygon {
tempStr := strings.Split(localStore.DeliveryRange, ";")
if len(tempStr) < 3 {
tStr2 += i.StoreID + ","
}
}
endStr = tStr1 + "," + tStr2
globals.SugarLogger.Debugf("京西平台没有配送范围的门店ID=%s", endStr)
}
//暂时逻辑直接使用storeID
if ifBindFence, err := tiktok_store.GetFence(k, i.StoreID); err == nil && len(ifBindFence.OutFenceId) != 0 {
tempFenceID = i.StoreID
@@ -6054,8 +6070,11 @@ func AssistCreateFence(relInfo map[string][]tiktok_store.RelInfo) (string, error
}
}
if errList.GetErrListAsOne() != nil {
globals.SugarLogger.Debugf("errList.GetErrListAsOne()===========%v", errList.GetErrListAsOne())
return fmt.Sprintf("批量创建电子围栏错误,请根据提示处理:%v", errList.GetErrListAsOne()), nil
if len(endStr) > 0 {
return fmt.Sprintf("批量创建电子围栏错误,请根据提示处理:%v,#门店%s的配送范围不合法请处理后再进行创建#", errList.GetErrListAsOne(), endStr), nil
} else {
return fmt.Sprintf("批量创建电子围栏错误,请根据提示处理:%v", errList.GetErrListAsOne()), nil
}
}
return "", nil
}