| | |
| | | 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); |
| | |
| | | return CollectionUtils.isNotEmpty(list); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean taskIsHangup(String taskId, String processInsId) { |
| | | Long num = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProcessLog::getProcessInsId, processInsId) |
| | | .eq(ProcessLog::getTaskId, taskId) |
| | | .in(ProcessLog::getEventType, ProcessLogEventTypeEnum.HANGUP, ProcessLogEventTypeEnum.CANCEL_HANGUP) |
| | | .count(); |
| | | return num % 2 != 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean taskIsTeamwork(String taskId, String processInsId) { |
| | | ProcessLog log = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProcessLog::getProcessInsId, processInsId) |
| | | .eq(ProcessLog::getTaskId, taskId) |
| | | .eq(ProcessLog::getEventType, ProcessLogEventTypeEnum.TEAM_WORK) |
| | | .one(); |
| | | if (Objects.isNull(log)) { |
| | | return Boolean.FALSE; |
| | | } else { |
| | | // 判断协同人是否全部完成了协同。TODO |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Result projectProcessLogPage(ProcessLogQuery query) { |
| | |
| | | } 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)); |
| | | } |
| | | } |
| | | }); |