This commit is contained in:
邹宗楠
2022-05-25 18:07:48 +08:00
parent e535366e1b
commit 26ea876ed5

View File

@@ -82,17 +82,14 @@ func CheckUserExist(store *dao.StoreDetail2) (string, error) {
// 查询本门店所属省code
parentCityName := ""
for {
place, err := dao.GetPlaceByCode(dao.GetDB(), store.CityCode)
if err != nil {
return "", err
}
if place.Level != model.YES && place.ParentCode != 0 {
continue
}
parentCityName = place.Name
break
if store.CityCode == 0 {
return "", errors.New("门店位置不能为空")
}
parentCityName, err = GetCityCode(store.CityCode)
if err != nil {
return "", err
}
// 查询企业微信所有省份部门分类
departmentList, err := api.EnterpriseChatHeadApi.GetAllDepartmentList()
if err != nil {
@@ -116,6 +113,17 @@ func CheckUserExist(store *dao.StoreDetail2) (string, error) {
return enterpriseUserId, err
}
func GetCityCode(cityCode int) (string, error) {
place, err := dao.GetPlaceByCode(dao.GetDB(), cityCode)
if err != nil {
return "", err
}
if place.Level != model.YES && place.ParentCode != 0 {
GetCityCode(place.ParentCode)
}
return place.Name, nil
}
// 获取当前门店企业内部人员信息
func CheckBoosGroupChat(store *dao.StoreDetail2) ([]string, error) {
// 获取门店角色