1
This commit is contained in:
@@ -89,16 +89,16 @@ func CheckUserExist(store *dao.StoreDetail2) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
fmt.Println("=====================1",parentCityName)
|
||||
fmt.Println("=====================1", parentCityName)
|
||||
// 查询企业微信所有省份部门分类
|
||||
departmentList, err := api.EnterpriseChatHeadApi.GetAllDepartmentList()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
for _, v := range departmentList {
|
||||
fmt.Println("1===============",v.Name)
|
||||
fmt.Println("2===============",parentCityName[:6])
|
||||
fmt.Println("3===============",!strings.Contains(v.Name, parentCityName[:6]))
|
||||
fmt.Println("1===============", v.Name)
|
||||
fmt.Println("2===============", parentCityName[:6])
|
||||
fmt.Println("3===============", !strings.Contains(v.Name, parentCityName[:6]))
|
||||
if !strings.Contains(v.Name, parentCityName[:6]) {
|
||||
continue
|
||||
}
|
||||
@@ -117,14 +117,17 @@ func CheckUserExist(store *dao.StoreDetail2) (string, error) {
|
||||
}
|
||||
|
||||
func GetCityCode(cityCode int) (string, error) {
|
||||
place, err := dao.GetPlaceByCode(dao.GetDB(), cityCode)
|
||||
if err != nil {
|
||||
return "", err
|
||||
for i := 0; i < 4; i++ {
|
||||
place, err := dao.GetPlaceByCode(dao.GetDB(), cityCode)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if place.Level == model.YES && place.ParentCode == 0 {
|
||||
return place.Name, nil
|
||||
}
|
||||
cityCode = place.ParentCode
|
||||
}
|
||||
if place.Level != model.YES && place.ParentCode != 0 {
|
||||
GetCityCode(place.ParentCode)
|
||||
}
|
||||
return place.Name, nil
|
||||
return "", errors.New("未查询到目标城市")
|
||||
}
|
||||
|
||||
// 获取当前门店企业内部人员信息
|
||||
|
||||
Reference in New Issue
Block a user