| | |
| | | import com.ycl.common.enums.business.HandlerTypeEnum; |
| | | import com.ycl.common.enums.business.ProcessLogEventTypeEnum; |
| | | import com.ycl.domain.entity.ProcessLog; |
| | | import com.ycl.domain.json.DelegateData; |
| | | import com.ycl.domain.json.JumpData; |
| | | import com.ycl.domain.json.RejectData; |
| | | import com.ycl.domain.json.SuperviseData; |
| | | import com.ycl.domain.json.*; |
| | | import com.ycl.domain.query.ProcessLogQuery; |
| | | import com.ycl.domain.vo.ProcessLogVO; |
| | | import com.ycl.framework.utils.PageUtil; |
| | |
| | | * @param eventDataJson json扩展内容 |
| | | */ |
| | | @Override |
| | | public void add(String taskId, String flowInsId, ProcessLogEventTypeEnum eventType, Long projectId, String eventDataJson) { |
| | | public void add(String taskId, String flowInsId, ProcessLogEventTypeEnum eventType, String projectId, String eventDataJson) { |
| | | ProcessLog log = new ProcessLog(); |
| | | log.setTaskId(taskId); |
| | | log.setProcessInsId(flowInsId); |
| | |
| | | } else if (ProcessLogEventTypeEnum.REJECT.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), RejectData.class)); |
| | | } else if (ProcessLogEventTypeEnum.SUPERVISE.equals(log.getEventType())) { |
| | | SuperviseData superviseData = JSON.parseObject(log.getEventDataJson(), SuperviseData.class); |
| | | SysUser user = userService.selectUserById(Long.parseLong(superviseData.getSenderId())); |
| | | if (Objects.nonNull(user)) { |
| | | superviseData.setSenderName(user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")"); |
| | | List<SuperviseData> superviseDataList = JSON.parseArray(log.getEventDataJson(), SuperviseData.class); |
| | | if (CollectionUtils.isNotEmpty(superviseDataList)) { |
| | | SysUser user = userService.selectUserById(Long.parseLong(superviseDataList.get(0).getSenderId())); |
| | | if (Objects.nonNull(user)) { |
| | | superviseDataList.get(0).setSenderName(user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")"); |
| | | } |
| | | log.setEventDataObj(superviseDataList.get(0)); |
| | | } |
| | | log.setEventDataObj(superviseData); |
| | | |
| | | } else if (ProcessLogEventTypeEnum.HANGUP.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), HangupData.class)); |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | } else if (HandlerTypeEnum.USER.equals(handlerType)) { |
| | | List<SysUser> users = userService.selectUserByIds(ids); |
| | | names = users.stream().map(user -> user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")").collect(Collectors.toList()); |
| | | names.addAll(users.stream().map(user -> user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")").collect(Collectors.toList())); |
| | | } else if (HandlerTypeEnum.DEPT.equals(handlerType)) { |
| | | List<SysDept> depts = deptService.selectDeptByIds(ids); |
| | | names = depts.stream().map(SysDept::getDeptName).collect(Collectors.toList()); |
| | | names.addAll(depts.stream().map(SysDept::getDeptName).collect(Collectors.toList())); |
| | | } else if (HandlerTypeEnum.ROLE.equals(handlerType)) { |
| | | List<SysRole> roles = roleService.selectRoleByIds(ids); |
| | | names = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList()); |
| | | names.addAll(roles.stream().map(SysRole::getRoleName).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |