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