| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | @RestController |
| | | @RequestMapping("/projectEntrust") |
| | |
| | | @Autowired |
| | | private UserFileService userFileService; |
| | | |
| | | @ApiOperation(value = "项目不分页列表", response = Project.class) |
| | | @GetMapping("/projectListAll") |
| | | public R<List<Project>> projectListAll(Integer clientId,Integer category) { |
| | | LambdaQueryWrapper<Project> projectLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | projectLambdaQueryWrapper.eq(Project::getClientId, clientId) |
| | | .eq(Project::getDeleted, false); |
| | | if (category==1){ |
| | | projectLambdaQueryWrapper.eq(Project::getStatus, 1); |
| | | } |
| | | if (category==2){ |
| | | projectLambdaQueryWrapper.eq(Project::getType,2); |
| | | } |
| | | List<Project> list = projectService.list(projectLambdaQueryWrapper); |
| | | return R.ok(list); |
| | | } |
| | | @ApiOperation(value = "项目列表", response = EntrustProjectVo.class) |
| | | @PostMapping("/projectList") |
| | | public R<Page<EntrustProjectVo>> projectList(@RequestBody EntrustListQuery query) { |
| | |
| | | |
| | | @ApiOperation(value = "获取重大隐患列表", response = DeviceListVo.class) |
| | | @PostMapping("/errorList") |
| | | public R<Page<ErrorListVo>> errorList(@RequestBody @Valid ErrorListQuery query) { |
| | | public R<Page<ErrorListVo>> errorList(@RequestBody @Valid ErrorListQuery query) throws ParseException { |
| | | Page<ErrorListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | List<ErrorListVo> list = deviceUsageService.errorList(page, query); |
| | | |
| | | for (ErrorListVo errorListVo : list) { |
| | | List<Integer> recordFileIds = recordImageService.lambdaQuery() |
| | | .eq(RecordImage::getRecordId, errorListVo.getId()).list() |
| | |
| | | page.setRecords(list); |
| | | return R.ok(page); |
| | | } |
| | | @ApiOperation(value = "委托方端隐患详情") |
| | | @GetMapping("/errorDetail") |
| | | public R<?> errorDetail(Integer id) { |
| | | Record record = recordService.getById(id); |
| | | Integer problemId = record.getProblemId(); |
| | | var res = recordService.getHiddenDangerDetail(problemId); |
| | | return R.ok(res); |
| | | } |
| | | @ApiOperation(value = "获取隐患详情") |
| | | @GetMapping("/getHiddenDangerDetail/{problemId}") |
| | | public R<?> getHiddenDangerDetail(@PathVariable Integer problemId) { |
| | | var record = recordService.getHiddenDangerDetail(problemId); |
| | | return R.ok(record); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置负责人") |
| | | @GetMapping("/setResponsiblePerson") |
| | | public R setResponsiblePerson(Integer id , String responsiblePerson) { |
| | |
| | | recordService.updateById(record); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "隐患详情") |
| | | @GetMapping("/errorDetail") |
| | | public R errorDetail(Integer id) { |
| | | Record record = recordService.getById(id); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取隐患详情") |
| | | @GetMapping("/getHiddenDangerDetail/{problemId}") |
| | | public R<?> getHiddenDangerDetail(@PathVariable Integer problemId) { |
| | | var record = recordService.getHiddenDangerDetail(problemId); |
| | | return R.ok(record); |
| | | } |
| | | |
| | | |
| | | |
| | | } |