Commit bbb3d606 authored by nie'hong's avatar nie'hong

完善工时统计

parent 041f9e52
......@@ -90,7 +90,7 @@ public class StatisticsServiceImpl implements StatisticsService {
// 用户权限名
List<String> userAuthority = this.getUserAuthority(param.getUserId());
if (!userAuthority.contains(LevelEnum.TIMEEXPORT.getLevelName())) {
if (CollectionUtil.isEmpty(userAuthority) || !userAuthority.contains(LevelEnum.TIMEEXPORT.getLevelName())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN);
}
//默认时间为当月
......@@ -155,7 +155,7 @@ public class StatisticsServiceImpl implements StatisticsService {
// 存放查询条件
Map<String, Object> map = new HashMap<>();
// 用户有审批权限
if (userAuthority.contains(LevelEnum.EXAMINE.getLevelName())) {
if (CollectionUtil.isNotEmpty(userAuthority) && userAuthority.contains(LevelEnum.EXAMINE.getLevelName())) {
//以审批人、审核状态、开始时间查询本月审批数量
map.put("reviewerId", userId);
map.put("startDay", firstDayOfMonth);
......@@ -269,7 +269,7 @@ public class StatisticsServiceImpl implements StatisticsService {
// 用户权限
List<String> userAuthority = this.getUserAuthority(userId);
// 没有审批权限
if (!userAuthority.contains(LevelEnum.EXAMINE.getLevelName())) {
if (CollectionUtil.isNotEmpty(userAuthority) || !userAuthority.contains(LevelEnum.EXAMINE.getLevelName())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN);
}
WorkUser user = workUserService.getById(userId);
......@@ -774,6 +774,9 @@ public class StatisticsServiceImpl implements StatisticsService {
List<Integer> list = UserRoleLevelUtils.getlevelIds(role);
// 获取权限对象
List<WorkLevel> workLevels = UserRoleLevelUtils.getlevelByIds(list);
if (CollectionUtil.isEmpty(workLevels)) {
return null;
}
// 获取权限名
List<String> collect = workLevels.stream().map(WorkLevel::getName).collect(Collectors.toList());
return collect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment