| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean rejectClueEvent(GdClueEventRejectParam rejectParam) { |
| | | public boolean handleClueEvent(GdClueEventRejectParam rejectParam) { |
| | | GdClueEventEntity clueEvent = getById(rejectParam.getEventId()); |
| | | if (clueEvent == null || (clueEvent.getIsDeleted() != null && clueEvent.getIsDeleted() != 0)) { |
| | | throw new RuntimeException("事件不存在"); |
| | | } |
| | | if (clueEvent.getEventStatus() == null || clueEvent.getEventStatus() != 1) { |
| | | throw new RuntimeException("事件当前状态无法驳回"); |
| | | throw new RuntimeException("事件当前状态无法处理"); |
| | | } |
| | | clueEvent.setEventStatus(2); |
| | | Integer operateStatus = rejectParam.getEventStatus(); |
| | | if (operateStatus == null || (operateStatus != 0 && operateStatus != 1)) { |
| | | throw new RuntimeException("事件状态不正确"); |
| | | } |
| | | int targetStatus = operateStatus == 0 ? 2 : 3; |
| | | clueEvent.setEventStatus(targetStatus); |
| | | clueEvent.setUpdateUser(AuthUtil.getUserId()); |
| | | clueEvent.setUpdateTime(new Date()); |
| | | if (!updateById(clueEvent)) { |
| | | throw new RuntimeException("事件驳回失败"); |
| | | throw new RuntimeException("事件处理失败"); |
| | | } |
| | | GdTaskResultEntity taskResult = gdTaskResultService.getById(clueEvent.getResultId()); |
| | | if (taskResult == null || (taskResult.getIsDeleted() != null && taskResult.getIsDeleted() != 0)) { |
| | | throw new RuntimeException("成果不存在"); |
| | | } |
| | | taskResult.setDistributeStatus(2); |
| | | taskResult.setDistributeStatus(targetStatus); |
| | | taskResult.setUpdateUser(AuthUtil.getUserId()); |
| | | taskResult.setUpdateTime(new Date()); |
| | | if (!gdTaskResultService.updateById(taskResult)) { |