| | |
| | | query.setLocationIds(collect); |
| | | return R.ok(new PageInfo<>()); |
| | | }else{ |
| | | if (query.getLocationIds()!=null){ |
| | | collect = collect.stream().filter(query.getLocationIds()::contains).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | return R.ok(new PageInfo<>()); |
| | | } |
| | | } |
| | | query.setLocationIds(collect); |
| | | } |
| | |
| | | return R.ok(inspectorService.pageList(query)); |
| | | } |
| | | |
| | | @Log(title = "督察记录导出", businessType = BusinessType.EXPORT) |
| | | @Log(title = "督察记录导出", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "督察记录导出") |
| | | @PostMapping(value = "/exportExcel") |
| | | public void exportExcel(@RequestBody InsepectorListQuery query) { |
| | |
| | | public R<Boolean> audit(@RequestBody TInspectorAuditDTO dto) { |
| | | TTaskAuditDTO tTaskAuditDTO = new TTaskAuditDTO(); |
| | | BeanUtils.copyProperties(dto, tTaskAuditDTO); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | TTask task = taskCleanerService.getById(dto.getTaskId()); |
| | | TLocation location = locationService.getById(task.getLocationId()); |
| | | TNotice tNotice = new TNotice(); |
| | |
| | | tNotice.setStatus(1); |
| | | tNotice.setDataId(task.getId()); |
| | | tNotice.setNoticeSetType(noticeSet.getNoticeType()); |
| | | if (dto.getAuditStatus()==2){ |
| | | if (dto.getAuditStatus()==1){ |
| | | if (dto.getClearStatus()==2){ |
| | | tTaskAuditDTO.setHandleType(3); |
| | | // 将任务修改为待整改 |
| | | task.setStatus(4); |
| | | taskCleanerService.updateById(task); |
| | | // 增加消息 |
| | | tNotice.setNoticeType(1); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!"); |
| | | |
| | | }else{ |
| | | tTaskAuditDTO.setHandleType(2); |
| | | // 如果是初次审核就通过 将状态设置为已完成 |
| | | List<TTaskDetail> list = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId()).list(); |
| | | if (list.isEmpty()){ |
| | | if (dto.getClearStatus()==1){ |
| | | task.setStatus(6); |
| | | dto.setStatus(4); |
| | | taskCleanerService.updateById(task); |
| | | }else{ |
| | | dto.setStatus(2); |
| | | task.setStatus(4); |
| | | taskCleanerService.updateById(task); |
| | | // 增加消息 |
| | | tNotice.setNoticeType(1); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!"); |
| | | } |
| | | |
| | | }else{ |
| | | if (dto.getClearStatus()==1){ |
| | | dto.setStatus(3); |
| | | task.setStatus(5); |
| | | taskCleanerService.updateById(task); |
| | | // 增加消息 |
| | | tNotice.setNoticeType(2); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务已通过"); |
| | | }else{ |
| | | dto.setStatus(2); |
| | | task.setStatus(4); |
| | | taskCleanerService.updateById(task); |
| | | // 增加消息 |
| | | tNotice.setNoticeType(1); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】督察任务不合格,请重新上传!"); |
| | | noticeService.save(tNotice); |
| | | }else{ |
| | | if (dto.getAuditTime()!=null){ |
| | | dto.setStatus(3); |
| | | }else{ |
| | | dto.setStatus(4); |
| | | } |
| | | } |
| | | } |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | |
| | | dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | inspectorService.updateById(dto); |
| | | tTaskDetailService.save(tTaskAuditDTO); |
| | | return R.ok(); |
| | | } |
| | | } |