| | |
| | | import com.ruoyi.system.vo.system.AppealListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private TLocationTypeService locationTypeService; |
| | | @Resource |
| | | private TLocationService locationService; |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | |
| | | @Resource |
| | | private TTaskDetailService tTaskDetailService; |
| | | @Resource |
| | | private TProjectDeptService projectDeptService; |
| | | @Resource |
| | | private TDeptService deptService; |
| | | @Resource |
| | |
| | | List<Long> patrolInspectorIds = sysUsers.stream().filter(sysUser -> |
| | | sysUser.getPhonenumber().equals(query.getPhonenumber()) |
| | | ).map(SysUser::getUserId).collect(Collectors.toList()); |
| | | if (!query.getPatrolInspectorIds().isEmpty()){ |
| | | if (!CollectionUtils.isEmpty(query.getPatrolInspectorIds())){ |
| | | // 取交集 |
| | | patrolInspectorIds = patrolInspectorIds.stream().filter(query.getPatrolInspectorIds()::contains).collect(Collectors.toList()); |
| | | } |
| | |
| | | appealDetailVO.setLocationIcon(byId2.getLocationIcon()); |
| | | appealDetailVO.setLocationName(byId2.getLocationName()); |
| | | appealDetailVO.setTaskId(byId.getId()); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson())); |
| | | if (sysUser!=null){ |
| | | appealDetailVO.setAuditPersonName(sysUser.getUserName()); |
| | | if (appeal.getAuditPerson()!=null){ |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(appeal.getAuditPerson())); |
| | | if (sysUser!=null){ |
| | | appealDetailVO.setAuditPersonName(sysUser.getUserName()); |
| | | } |
| | | } |
| | | appealDetailVO.setTaskName(byId.getTaskName()); |
| | | appealDetailVO.setTaskCode(byId.getTaskCode()); |
| | | return R.ok(appealDetailVO); |
| | | } |
| | | @Resource |
| | | private TNoticeService noticeService; |
| | | @Log(title = "审核申诉记录", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "审核申诉记录") |
| | | @PostMapping(value = "/audit") |
| | | public R<Boolean> audit(@RequestBody @Valid TAppealAuditDTO dto) { |
| | | TAppeal appeal = appealService.getById(dto.getId()); |
| | | dto.setStatus(dto.getStatus()); |
| | | dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | TTask task = taskCleanService.getById(appeal.getTaskId()); |
| | | TLocation location = locationService.getById(task.getLocationId()); |
| | | TNotice tNotice = new TNotice(); |
| | | tNotice.setUserId(dto.getAppealPerson()); |
| | | tNotice.setStatus(1); |
| | | tNotice.setDataId(dto.getId()); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | if (dto.getStatus()==2){ |
| | | // 通过 |
| | | TTask byId = taskCleanService.getById(dto.getTaskId()); |
| | | byId.setStatus(6); |
| | | taskCleanService.updateById(byId); |
| | | tNotice.setNoticeType(5); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉通过"); |
| | | }else{ |
| | | tNotice.setNoticeType(4); |
| | | tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉驳回"); |
| | | } |
| | | noticeService.save(tNotice); |
| | | dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); |
| | | appealService.updateById(dto); |
| | | return R.ok(); |