eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceBusinessTravelServiceImpl.java
@@ -248,7 +248,7 @@ User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user1.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能修改自己的记录"); } @@ -405,7 +405,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能删除自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(attendanceBusinessTravel.get().getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能删除自己的记录"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceCardreplacementServiceImpl.java
@@ -192,7 +192,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if(!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))){ if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能修改自己的记录"); } @@ -408,7 +408,7 @@ //根据id查询记录 Optional<AttendanceCardreplacement> attendanceCardreplacement = attendanceCardreplacementRepository.findById(id); //除超管、总经理只能删除自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))){ if (!Long.valueOf(attendanceCardreplacement.get().getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能删除自己的记录"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
@@ -282,7 +282,7 @@ User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user1.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能修改自己的记录"); } @@ -458,7 +458,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能删除自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(attendanceGoOut.get().getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能删除自己的记录"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java
@@ -311,7 +311,7 @@ User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user1.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))){ if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能修改自己的记录"); } @@ -645,7 +645,7 @@ //根据id查询记录 Optional<AttendanceLeave> attendanceLeave1 = attendanceLeaveRepository.findById(id); //除超管、总经理只能删除自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if(!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))){ if (!Long.valueOf(attendanceLeave1.get().getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能删除自己的记录"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java
@@ -81,7 +81,7 @@ // 登录用户最大角色等级 int min = Collections.min(levels); // 判断角色等级 if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { criteria.setUserId(SecurityUtils.getCurrentUserId()); criteria.setIsPublicity(Constant.PUBLICITY_STATUS_YES); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceOvertimeServiceImpl.java
@@ -201,7 +201,7 @@ User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user1.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能修改自己的记录"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -147,7 +147,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能修改自己的记录"); } @@ -324,7 +324,7 @@ //根据id查询记录 Optional<Attendance> attendance = attendanceRepository.findById(id); //除超管、总经理只能删除自己信息 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(attendance.get().getUserId()).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能删除自己的记录"); } @@ -343,7 +343,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能补自己的卡 if(role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL){ if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(userId).equals(SecurityUtils.getCurrentUserId())){ throw new BadRequestException("只能补自己的卡"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/NewAttendanceServiceImpl.java
@@ -129,7 +129,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能修改自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能修改自己的记录"); } @@ -239,7 +239,7 @@ //根据id查询记录 Optional<NewAttendance> attendance = newAttendanceRepository.findById(id); //除超管、总经理只能删除自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(attendance.get().getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能删除自己的记录"); } @@ -258,7 +258,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); //除超管、总经理只能补自己的卡 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(userId).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能补自己的卡"); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/PreBusinessTravelServiceImpl.java
@@ -120,6 +120,12 @@ @Override @Transactional(rollbackFor = Exception.class) public PreBusinessTravelDto create(PreBusinessTravel resources) { // 默认数据 resources.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_REVIEWED); // 判断是否提交企微审批 List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList()); if (siteTypes.size() > 0) { // 获取当前登陆人信息,设置为请假发起人 User user = userRepository.getOne(resources.getUserId() == null ? SecurityUtils.getCurrentUserId() : resources.getUserId()); User approvalUser = userRepository.findById(resources.getApprovalUserId()).orElseGet(User::new); @@ -127,12 +133,7 @@ Project project = projectRepository.findById(resources.getProjectId()).orElseGet(Project::new); // 获取成员信息 String memberUserName = Arrays.stream(resources.getMemberUserId().split("-")).filter(StringUtils::isNotBlank).map(idStr -> userRepository.findById(Long.parseLong(idStr)).orElseGet(User::new).getNickName()).collect(Collectors.joining(",")); // 默认数据 resources.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_REVIEWED); // 判断是否提交企微审批 List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList()); if (siteTypes.size() > 0) { // 添加企微申请参数 resources.setWecomProjectName(project.getName()); resources.setWecomMemberName(memberUserName); @@ -160,16 +161,19 @@ ValidationUtil.isNull( preBusinessTravel.getId(),"PreBusinessTravel","id", resources.getId()); preBusinessTravel.copy(resources); // 审核通过或者退回不能修改 if (preBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_AGREE) || preBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_REFUSE)) { throw new BadRequestException("审核通过或退回的不能进行修改"); } // 获取当前登录者信息 User loginUser = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = loginUser.getRoles().iterator().next(); // 除超管、总经理只能修改自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { // 除超管、总经理、统括经理审核通过或者退回不能修改 if (!Constant.HIGH_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (preBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_AGREE) || preBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_REFUSE)) { throw new BadRequestException("审核通过或退回的不能进行修改"); } } // 除超管、总经理、统括经理只能修改自己信息 if (!Constant.HIGH_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(resources.getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能修改自己的记录"); } @@ -192,7 +196,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); // 除超管、总经理只能删除自己信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.HIGH_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (!Long.valueOf(preBusinessTravel.get().getUserId()).equals(SecurityUtils.getCurrentUserId())) { throw new BadRequestException("只能删除自己的记录"); } @@ -277,7 +281,7 @@ User user = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user.getRoles().iterator().next(); // 除超管、总经理只能查询自己作为成员的事前出差信息 if (role.getId() != Constant.ROLE_LEVEL_SUPER && role.getId() != Constant.ROLE_LEVEL_GENERAL) { if (!Constant.HIGH_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { criteria.setMemberUserIdLike(String.format("-%s-", SecurityUtils.getCurrentUserId().toString())); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/domain/BusinessExpense.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/domain/BusinessExpenseReimbursement.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/domain/BusinessPlan.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/domain/BusinessPlanPersonnel.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rabbit/BusinessExpenseRabbit.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/repository/BusinessExpenseReimbursementRepository.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/repository/BusinessExpenseRepository.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/repository/BusinessPlanPersonnelRepository.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/repository/BusinessPlanRepository.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rest/BusinessExpenseController.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rest/BusinessExpenseFlowableController.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rest/BusinessExpenseReimbursementController.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rest/BusinessPlanController.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/rest/BusinessPlanPersonnelController.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/BusinessExpenseFlowableService.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/BusinessExpenseReimbursementService.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/BusinessExpenseService.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/BusinessPlanPersonnelService.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/BusinessPlanService.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseDto.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseQueryCriteria.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseReimbursementDto.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessExpenseReimbursementQueryCriteria.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessPlanDto.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessPlanPersonnelDto.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessPlanPersonnelQueryCriteria.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/dto/BusinessPlanQueryCriteria.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessExpenseReimbursementServiceImpl.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessExpenseServiceFlowableImpl.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessExpenseServiceImpl.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessPlanPersonnelServiceImpl.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/impl/BusinessPlanServiceImpl.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/mapstruct/BusinessExpenseMapper.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/mapstruct/BusinessExpenseReimbursementMapper.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/mapstruct/BusinessPlanMapper.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/business/service/mapstruct/BusinessPlanPersonnelMapper.java
File was deleted eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/constant/Constant.java
@@ -1,22 +1,30 @@ package me.zhengjie.modules.constant; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; public class Constant { // 角色级别:超级管理员 public static final Long ROLE_LEVEL_SUPER = 1L; public static final Long ROLE_LEVEL_ADMIN = 999L; // 角色级别:总经理 public static final Long ROLE_LEVEL_SUPER = 1L; // 角色级别:统括经理 public static final Long ROLE_LEVEL_GENERAL = 2L; // 角色级别:项目经理 public static final Long ROLE_LEVEL_MANAGER = 3L; // 角色级别:项目组长 // 角色级别:项目组长、设备管理员、财务管理员、人力资源管理员 public static final Long ROLE_LEVEL_LEADER = 4L; // 角色级别:普通员工 public static final Long ROLE_LEVEL_ORDINARY = 5L; // 角色级别:设备管理员 public static final Long ROLE_LEVEL_DEVICE = 6L; // 角色级别:财务管理员 public static final Long ROLE_LEVEL_FINANCE = 7L; // 角色级别:合同管理员 public static final Long ROLE_LEVEL_CONTRACT = 6L; // 角色级别:超高级组合 public static final List<Long> SUPER_LEVEL_LIST = Arrays.asList(ROLE_LEVEL_ADMIN, ROLE_LEVEL_SUPER); // 角色级别:高级(含超高级)组合 public static final List<Long> HIGH_LEVEL_LIST = Arrays.asList(ROLE_LEVEL_ADMIN, ROLE_LEVEL_SUPER, ROLE_LEVEL_GENERAL); // 角色级别:基础组合 public static final List<Long> BASE_LEVEL_LIST = Arrays.asList(ROLE_LEVEL_MANAGER, ROLE_LEVEL_LEADER, ROLE_LEVEL_ORDINARY); // 日期类型 public static final String DATE_TYPE = "date_type"; eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
@@ -280,7 +280,7 @@ int min = Collections.min(levels); List<Long> projectIdList = new ArrayList<>(); // 判断角色等级 if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { // 根据用户ID查询参与的项目ID //List<Long> taskUserProjectIdList = taskDaliyRepository.findProjectIdByUserId(SecurityUtils.getCurrentUserId()); //如果当前用户属于一个任务,那么他也可以看见当前这个任务的项目 @@ -324,7 +324,7 @@ } } if (!(min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY)){ if (!Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))){ for (ProjectDto projectDto : projectDtoList) { projectDto.setFlag(true); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ContractMethod.java
@@ -50,7 +50,7 @@ // 获取用户角色 Role role = user.getRoles().iterator().next(); // 高级别 if (Long.valueOf(role.getLevel()).equals(Constant.ROLE_LEVEL_SUPER) || Long.valueOf(role.getLevel()).equals(Constant.ROLE_LEVEL_GENERAL)) { if (Constant.SUPER_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { if (StringUtils.isNotBlank(user.getWeComId())) { weComList.add(user.getWeComId()); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/NewSalaryServiceImpl.java
@@ -113,7 +113,7 @@ // 登录用户最大角色等级 int min = Collections.min(levels); // 判断角色等级 if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { // 工资查询类 criteria.setUserId(SecurityUtils.getCurrentUserId()); criteria.setPublicityStatus(Constant.PUBLICITY_STATUS_YES); eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/SalaryServiceImpl.java
@@ -114,7 +114,7 @@ // 登录用户最大角色等级 int min = Collections.min(levels); // 判断角色等级 if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { // 工资查询类 criteria.setUserId(SecurityUtils.getCurrentUserId()); criteria.setPublicityStatus(Constant.PUBLICITY_STATUS_YES); eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/CustomerResourcesServiceImpl.java
@@ -15,8 +15,6 @@ */ package me.zhengjie.modules.system.service.impl; import me.zhengjie.modules.business.service.BusinessPlanService; import me.zhengjie.modules.business.service.dto.BusinessPlanDto; import me.zhengjie.modules.constant.Constant; import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl; import me.zhengjie.modules.system.domain.CustomerResources; @@ -60,7 +58,6 @@ private final UserRepository userRepository; private final WeComServiceImpl weComService; private final CustomerResourcesUserRepository customerResourcesUserRepository; private final BusinessPlanService businessPlanService; @Override public Map<String, Object> queryAll(CustomerResourcesQueryCriteria criteria, Pageable pageable) { @@ -71,10 +68,6 @@ public CustomerResourcesDto apply(CustomerResources t) { // 将实体类转换成DTO CustomerResourcesDto customerResourcesDto = customerResourcesMapper.toDto(t); // 获取营业计划 BusinessPlanDto businessPlanDto = businessPlanService.findById(customerResourcesDto.getBusinessPlanId()); customerResourcesDto.setBusinessPlanContent(businessPlanDto.getBusinessContent()); // 返回处理好的DTO return customerResourcesDto; eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -427,8 +427,8 @@ //获取当前登入人信息 User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); Role role = user1.getRoles().iterator().next(); //超管、总经理,痛苦哦经理查看全部 if (Long.valueOf(role.getLevel()) == Constant.ROLE_LEVEL_SUPER || Long.valueOf(role.getLevel()) == Constant.ROLE_LEVEL_GENERAL) { // 超管、总经理、统括经理查看全部 if (Constant.HIGH_LEVEL_LIST.contains(Long.valueOf(role.getLevel()))) { userList = userRepository.findAllByEnabled(true); } else { userList = userRepository.findByUserId(user1.getId()); eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
@@ -591,7 +591,7 @@ // 登录用户最大角色等级 int min = Collections.min(levels); // 判断角色等级 if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { // 判断是否是自己的日报 if (SecurityUtils.getCurrentUserId().longValue() != resources.getUserId().longValue()) { throw new BadRequestException("只能新增修改自己的任务日报!"); eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
@@ -115,7 +115,7 @@ // 登录用户最大角色等级 int min = Collections.min(levels); if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { ArrayList<Long> projectList = new ArrayList<>(); Query query = Query.query(Criteria.where("containUserList").is(SecurityUtils.getCurrentUserId())); @@ -891,7 +891,7 @@ if (criteria.getProjectId() != null) { criteriaTask.and("projectId").is(criteria.getProjectId()); if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) { if (Constant.BASE_LEVEL_LIST.contains(Long.valueOf(min))) { //看看当前这个用户是不是这个项目的项目负责人,如果是项目负责人的话显示全部的任务 List<Long> projectIds = projectRepository.findIdByLiableUserId(userId); if (!projectIds.contains(criteria.getProjectId())) { eladmin-web-master/src/views/attendance/preBusinessTravel/index.vue
@@ -82,7 +82,7 @@ </el-select> </el-form-item> <el-form-item label="标题" prop="title"> <el-input v-model="form.title" placeholder="请输入" style="width: 370px;" /> <el-input v-model="form.title" placeholder="请输入" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;" /> </el-form-item> <el-form-item label="出差开始时间" prop="travelStartTime"> <el-date-picker @@ -98,7 +98,7 @@ } }" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" @change="handleCheckTime" /> </el-form-item> @@ -116,7 +116,7 @@ } }" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" @change="handleCheckTime" /> </el-form-item> @@ -126,21 +126,21 @@ </el-input> </el-form-item> <el-form-item label="出差原因" prop="travelReason"> <el-input v-model="form.travelReason" type="textarea" rows="3" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" style="width: 370px;" /> <el-input v-model="form.travelReason" type="textarea" rows="3" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;" /> </el-form-item> <el-form-item label="出发城市" prop="departureCity"> <el-input v-model="form.departureCity" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" style="width: 370px;" /> <el-input v-model="form.departureCity" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;" /> </el-form-item> <el-form-item label="到达城市" prop="arrivalCity"> <el-input v-model="form.arrivalCity" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" style="width: 370px;" /> <el-input v-model="form.arrivalCity" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;" /> </el-form-item> <el-form-item label="关联项目" prop="projectId"> <el-select v-model="form.projectId" filterable clearable placeholder="请选择" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn" style="width: 370px;"> <el-select v-model="form.projectId" filterable clearable placeholder="请选择" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;"> <el-option v-for="item in projects" :key="item.id" :label="item.name" :value="item.id" /> </el-select> </el-form-item> <el-form-item label="成员" prop="memberUserIds"> <el-select v-model="form.memberUserIds" filterable clearable multiple placeholder="请选择" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn" style="width: 370px;"> <el-select v-model="form.memberUserIds" filterable clearable multiple placeholder="请选择" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;"> <el-option v-for="item in users" :key="'memberUserId_' + item.id" :label="item.nickName" :value="item.id" /> </el-select> </el-form-item> @@ -148,7 +148,7 @@ <el-input v-model="form.approvalDescription" type="textarea" rows="3" disabled style="width: 370px;" /> </el-form-item> <el-form-item label="备注" prop="remarks"> <el-input v-model="form.remarks" type="textarea" rows="3" :disabled="form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null" style="width: 370px;" /> <el-input v-model="form.remarks" type="textarea" rows="3" :disabled="!checkPer(permission.forceEdit) && (form.approvalStatus == dictBussinessAppAgree || form.approvalStatus == dictBussinessAppReturn || form.wecomSpNo !== null)" style="width: 370px;" /> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -159,6 +159,9 @@ <!--审核组件--> <el-dialog :close-on-click-modal="false" :before-close="handleCloseApproval" :visible.sync="approvalDialog.visible" :title="approvalDialog.title" width="500px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> <el-form-item label="标题"> {{ form.title }} </el-form-item> <el-form-item label="申请人"> {{ form.userName }} </el-form-item> @@ -179,6 +182,9 @@ </el-form-item> <el-form-item label="出差原因"> {{ form.travelReason }} </el-form-item> <el-form-item label="成员"> {{ form.memberUserIds.map(userId => users.find(user => user.id == userId).nickName).join(',') }} </el-form-item> <el-form-item v-if="form.approvalStatus === dictBussinessAppReturn" label="退回原因" prop="approvalDescription"> <div style="color: red;"> @@ -234,7 +240,11 @@ <el-table-column prop="departureCity" label="出发城市" width="80" show-overflow-tooltip /> <el-table-column prop="arrivalCity" label="到达城市" width="80" show-overflow-tooltip /> <el-table-column prop="project.name" label="关联项目" width="80" show-overflow-tooltip /> <el-table-column prop="wecomMemberName" label="成员" /> <el-table-column prop="memberUserId" label="成员" width="120" show-overflow-tooltip> <template slot-scope="scope"> {{ scope.row.memberUserId.split('-').filter(Boolean).map(num => Number(num)).map(userId => users.find(user => user.id == userId).nickName).join(',') }} </template> </el-table-column> <el-table-column prop="approvalStatus" label="审批状态" width="80" show-overflow-tooltip> <template slot-scope="scope"> <el-tag v-if="scope.row.approvalStatus === dictBussinessAppRev" type="warning"> @@ -321,7 +331,7 @@ import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' import constant from '@/utils/constant' const defaultForm = { id: null, userId: null, approvalUserId: null, title: null, travelStartTime: null, travelEndTime: null, travelDuration: null, durationUnit: null, travelReason: null, departureCity: null, arrivalCity: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, projectId: null, memberUserId: null, wecomSpNo: null, wecomEventId: null, wecomLocation: null, wecomDateType: null, wecomDuration: null, wecomAttendanceType: null, wecomApproveWecomId: null, wecomProjectName: null, wecomMemberName: null } const defaultForm = { id: null, userId: null, approvalUserId: null, title: null, travelStartTime: null, travelEndTime: null, travelDuration: null, durationUnit: null, travelReason: null, departureCity: null, arrivalCity: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, projectId: null, memberUserId: null, wecomSpNo: null, wecomEventId: null, wecomLocation: null, wecomDateType: null, wecomDuration: null, wecomAttendanceType: null, wecomApproveWecomId: null, wecomProjectName: null, wecomMemberName: null, memberUserIds: [] } export default { name: 'PreBusinessTravel', components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, @@ -338,7 +348,8 @@ edit: ['admin', 'preBusinessTravel:edit'], del: ['admin', 'preBusinessTravel:del'], approval: ['admin', 'preBusinessTravel:approval'], batchApproval: ['admin', 'preBusinessTravel:batchApproval'] batchApproval: ['admin', 'preBusinessTravel:batchApproval'], forceEdit: ['admin', 'preBusinessTravel:forceEdit'] }, rules: { userId: [ @@ -429,32 +440,26 @@ // 钩子:新建 - 之前 [CRUD.HOOK.beforeToAdd]() { const that = this // that.form.durationUnit = that.dictLeaveTimeTypeDay // that.form.memberUserIds = [] that.$set(that.form, 'durationUnit', that.dictLeaveTimeTypeDay) that.$set(that.form, 'memberUserIds', []) // 判断用户最大角色级别是否大于总经理角色:赋值 if (that.userRolesLevelMin > that.roleLevelGenerl) { // 表单赋值 // that.form.userId = that.user.id that.$set(that.form, 'userId', that.user.id) } if (that.wecomApprovalVisible) { // this.form.approvalUserId = 0 that.$set(that.form, 'approvalUserId', 0) } }, // 钩子:编辑 - 之前 [CRUD.HOOK.beforeToEdit]() { const that = this // that.form.memberUserIds = that.form.memberUserId.split('-').filter(Boolean) that.$set(that.form, 'memberUserIds', that.form.memberUserId.split('-').filter(Boolean)) that.$set(that.form, 'memberUserIds', that.form.memberUserId.split('-').filter(Boolean).map(num => Number(num))) }, // 钩子:提交 - 之前 [CRUD.HOOK.beforeSubmit]() { const that = this // that.form.memberUserId = `-${that.form.memberUserIds.join('--')}-` that.$set(that.form, 'memberUserId', `-${that.form.memberUserIds.join('--')}-`) }, // 钩子:删除 - 之前 @@ -513,7 +518,6 @@ userId: that.form.userId }) crudPreBusinessTravel.getRemainingTime(data).then(res => { // that.form.travelDuration = res that.$set(that.form, 'travelDuration', res) }) } @@ -522,22 +526,8 @@ toApproval(data, opType) { const that = this if (opType !== '1') { // that.approvalDialog.visible = true that.$set(that.approvalDialog, 'visible', true) } // that.form.id = data.id // that.form.userId = data.userId // that.form.userName = data.userName // that.form.title = data.title // that.form.travelStartTime = data.travelStartTime // that.form.travelEndTime = data.travelEndTime // that.form.departureCity = data.departureCity // that.form.arrivalCity = data.arrivalCity // that.form.travelDuration = data.travelDuration // that.form.durationUnit = data.durationUnit // that.form.approvalStatus = data.approvalStatus // that.form.travelReason = data.travelReason // that.form.remarks = data.remarks that.$set(that.form, 'id', data.id) that.$set(that.form, 'userId', data.userId) that.$set(that.form, 'userName', data.userName) @@ -551,11 +541,11 @@ that.$set(that.form, 'approvalStatus', data.approvalStatus) that.$set(that.form, 'travelReason', data.travelReason) that.$set(that.form, 'remarks', data.remarks) that.$set(that.form, 'memberUserIds', data.memberUserId.split('-').filter(Boolean).map(num => Number(num))) }, // 审核提交功能 handleApproval(type, data) { const that = this // that.form.userId = data.userId that.$set(that.form, 'userId', data.userId) const msg = type === 2 ? '通过' : '拒绝' that.$refs['form'].validate(valid => { @@ -564,28 +554,21 @@ } // 判断通过状态 if (type === 2) { // that.form.approvalStatus = that.dictBussinessAppAgree that.$set(that.form, 'approvalStatus', that.dictBussinessAppAgree) } else { // 退回改状态显示退回原因 // that.form.approvalStatus = that.dictBussinessAppReturn that.$set(that.form, 'approvalStatus', that.dictBussinessAppReturn) if (that.form.approvalDescription == null) { return } } // that.approvalDialog.loading = true that.$set(that.approvalDialog, 'loading', true) crudPreBusinessTravel.approval(that.form).then(_res => { that.crud.refresh() // that.approvalDialog.visible = false // that.approvalDialog.loading = false that.$set(that.approvalDialog, 'visible', false) that.$set(that.approvalDialog, 'loading', false) that.$message({ type: 'success', message: '审核' + msg + '成功' }) }).catch(() => { // that.approvalDialog.visible = false // that.approvalDialog.loading = false that.$set(that.approvalDialog, 'visible', false) that.$set(that.approvalDialog, 'loading', false) }) @@ -626,13 +609,10 @@ handleRevoke(data) { const that = this that.toApproval(data, '1') // that.form.approvalStatus = that.dictBussinessAppRev that.$set(that.form, 'approvalStatus', that.dictBussinessAppRev) // that.approvalDialog.loading = true that.$set(that.approvalDialog, 'loading', true) crudPreBusinessTravel.approval(that.form).then(_res => { that.crud.refresh() // that.approvalDialog.loading = false that.$set(that.approvalDialog, 'loading', false) that.$message({ type: 'success', message: '撤销成功' }) that.$refs[`popover_${data.id}`].showPopper = false @@ -651,7 +631,6 @@ that.$refs['form'].resetFields() } that.crud.cancelCU() // that.approvalDialog.visible = false that.$set(that.approvalDialog, 'visible', false) }, // 取消撤销操作