|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.nokia.common.R;
|
|
import com.nokia.common.R;
|
|
import com.nokia.common.exception.BizException;
|
|
import com.nokia.common.exception.BizException;
|
|
import com.nokia.constants.ClientEnum;
|
|
import com.nokia.constants.ClientEnum;
|
|
|
|
+import com.nokia.dao.AreaDao;
|
|
import com.nokia.dao.UserDao;
|
|
import com.nokia.dao.UserDao;
|
|
import com.nokia.dao.UserRoleCityDao;
|
|
import com.nokia.dao.UserRoleCityDao;
|
|
import com.nokia.dao.VerificationLogDao;
|
|
import com.nokia.dao.VerificationLogDao;
|
|
|
|
+import com.nokia.pojo.Area;
|
|
import com.nokia.pojo.Notice;
|
|
import com.nokia.pojo.Notice;
|
|
import com.nokia.pojo.User;
|
|
import com.nokia.pojo.User;
|
|
import com.nokia.pojo.UserRoleCity;
|
|
import com.nokia.pojo.UserRoleCity;
|
|
@@ -69,11 +71,13 @@ public class AclService {
|
|
private final UserRoleCityDao userRoleCityDao;
|
|
private final UserRoleCityDao userRoleCityDao;
|
|
private final NoticeService noticeService;
|
|
private final NoticeService noticeService;
|
|
private final FileService fileService;
|
|
private final FileService fileService;
|
|
|
|
+ private final AreaDao areaDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
public AclService(UserDao userDao, TopService topService, DopService dopService, WoyunweiService woyunweiService,
|
|
public AclService(UserDao userDao, TopService topService, DopService dopService, WoyunweiService woyunweiService,
|
|
RedisTemplate<String, Object> redisTemplate, VerificationLogDao verificationLogDao,
|
|
RedisTemplate<String, Object> redisTemplate, VerificationLogDao verificationLogDao,
|
|
- UserRoleCityDao userRoleCityDao, NoticeService noticeService, FileService fileService) {
|
|
|
|
|
|
+ UserRoleCityDao userRoleCityDao, NoticeService noticeService, FileService fileService,
|
|
|
|
+ AreaDao areaDao) {
|
|
this.userDao = userDao;
|
|
this.userDao = userDao;
|
|
this.topService = topService;
|
|
this.topService = topService;
|
|
this.dopService = dopService;
|
|
this.dopService = dopService;
|
|
@@ -83,6 +87,7 @@ public class AclService {
|
|
this.userRoleCityDao = userRoleCityDao;
|
|
this.userRoleCityDao = userRoleCityDao;
|
|
this.noticeService = noticeService;
|
|
this.noticeService = noticeService;
|
|
this.fileService = fileService;
|
|
this.fileService = fileService;
|
|
|
|
+ this.areaDao = areaDao;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -145,6 +150,22 @@ public class AclService {
|
|
// 前端需要对入口用户做特别的处理
|
|
// 前端需要对入口用户做特别的处理
|
|
userEntity = userDao.getByLoginName(tokenFlagVo.getLoginName());
|
|
userEntity = userDao.getByLoginName(tokenFlagVo.getLoginName());
|
|
if (userEntity == null || userEntity.getDeleted().equals(1)) {
|
|
if (userEntity == null || userEntity.getDeleted().equals(1)) {
|
|
|
|
+ // app查询acl_top_user,如果查不到返回省公司管理员联系电话,查到返回对应地市管理员联系电话
|
|
|
|
+ if ("app".equalsIgnoreCase(system)) {
|
|
|
|
+ Integer cityId = userDao.getAclTopUserCityId(tokenFlagVo.getLoginName());
|
|
|
|
+ // 省级用户提示,不想收短信手机号不正确,写死王玉龙手机号
|
|
|
|
+ if (cityId == null) {
|
|
|
|
+ return R.error().message("用户不存在,请联系省公司管理员 18631112100");
|
|
|
|
+ }
|
|
|
|
+ Area area = areaDao.selectById(cityId);
|
|
|
|
+ // 地市级用户提示
|
|
|
|
+ String cityName = area.getAreaName().replace("市", "");
|
|
|
|
+ // 查询地市管理员
|
|
|
|
+ List<User> managers = userDao.getManagersByCityId(cityId);
|
|
|
|
+ String phones = managers.stream().map(User::getPhone).filter(StringUtils::hasText)
|
|
|
|
+ .collect(Collectors.joining("/"));
|
|
|
|
+ return R.error().message("用户不存在,请联系" + cityName + "地市管理员 " + phones);
|
|
|
|
+ }
|
|
return R.error().data(map).message("用户不存在");
|
|
return R.error().data(map).message("用户不存在");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -235,7 +256,7 @@ public class AclService {
|
|
if (CollectionUtils.isEmpty(appFunctions)) {
|
|
if (CollectionUtils.isEmpty(appFunctions)) {
|
|
// 省级用户提示,不想收短信手机号不正确,写死王玉龙手机号
|
|
// 省级用户提示,不想收短信手机号不正确,写死王玉龙手机号
|
|
if (userEntity.getCityId() == -1) {
|
|
if (userEntity.getCityId() == -1) {
|
|
- return R.ok().data(appFunctions).message("用户无权限,请联系省公司管理员 18631112100");
|
|
|
|
|
|
+ return R.ok().message("用户无权限,请联系省公司管理员 18631112100");
|
|
}
|
|
}
|
|
// 地市级用户提示
|
|
// 地市级用户提示
|
|
String cityName = userEntity.getCity().getAreaName().replace("市", "");
|
|
String cityName = userEntity.getCity().getAreaName().replace("市", "");
|
|
@@ -243,7 +264,7 @@ public class AclService {
|
|
List<User> managers = userDao.getManagersByCityId(userEntity.getCityId());
|
|
List<User> managers = userDao.getManagersByCityId(userEntity.getCityId());
|
|
String phones = managers.stream().map(User::getPhone).filter(StringUtils::hasText)
|
|
String phones = managers.stream().map(User::getPhone).filter(StringUtils::hasText)
|
|
.collect(Collectors.joining("/"));
|
|
.collect(Collectors.joining("/"));
|
|
- return R.ok().data(appFunctions).message("用户无权限,请联系" + cityName + "地市管理员 " + phones);
|
|
|
|
|
|
+ return R.ok().message("用户无权限,请联系" + cityName + "地市管理员 " + phones);
|
|
}
|
|
}
|
|
return R.ok().data(appFunctions);
|
|
return R.ok().data(appFunctions);
|
|
case "web":
|
|
case "web":
|