| | |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.AppealDetailVO; |
| | | import com.ruoyi.system.vo.system.AppealListVO; |
| | | import com.tencentcloudapi.es.v20180416.models.TaskDetail; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | TTask task = taskCleanService.getById(appeal.getTaskId()); |
| | | TLocation location = locationService.getById(task.getLocationId()); |
| | | TNotice tNotice = new TNotice(); |
| | | tNotice.setUserId(dto.getAppealPerson()); |
| | | tNotice.setUserId(appeal.getAppealPerson()); |
| | | tNotice.setStatus(1); |
| | | tNotice.setDataId(dto.getId()); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | TTaskDetail taskDetail = new TTaskDetail(); |
| | | taskDetail.setTaskId(appeal.getTaskId()); |
| | | Long count = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, appeal.getTaskId()) |
| | | .eq(TTaskDetail::getHandleType, 1).count(); |
| | | if (dto.getStatus()==2){ |
| | | taskDetail.setClearStatus(1); |
| | | taskDetail.setAuditTime(LocalDateTime.now()); |
| | | taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | taskDetail.setAuditStatus(1); |
| | | taskDetail.setAuditRemark(dto.getAuditRemark()); |
| | | taskDetail.setHandleType(5); |
| | | taskDetail.setAppealId(dto.getId()); |
| | | // 通过 |
| | | TTask byId = taskCleanService.getById(dto.getTaskId()); |
| | | if (count>1){ |
| | | byId.setStatus(5); |
| | | }else{ |
| | | byId.setStatus(6); |
| | | |
| | | } |
| | | |
| | | taskCleanService.updateById(byId); |
| | | tNotice.setNoticeType(5); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉通过"); |
| | | }else{ |
| | | taskDetail.setClearStatus(2); |
| | | taskDetail.setAuditTime(LocalDateTime.now()); |
| | | taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | taskDetail.setAuditStatus(2); |
| | | taskDetail.setAuditRemark(dto.getAuditRemark()); |
| | | taskDetail.setHandleType(6); |
| | | taskDetail.setAppealId(dto.getId()); |
| | | tNotice.setNoticeType(4); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉驳回"); |
| | | } |
| | | noticeService.save(tNotice); |
| | | dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | appealService.updateById(dto); |
| | | tTaskDetailService.save(taskDetail); |
| | | return R.ok(); |
| | | } |
| | | } |