| | |
| | | import io.swagger.annotations.ApiResponse; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | @ApiOperation(httpMethod = "POST", value = "案件台-案件录入-添加案件") |
| | | @PostMapping("/addCause") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R addCause(@RequestBody CauseDto causeDto) { |
| | | public R addCause(@RequestBody @Validated CauseDto causeDto) { |
| | | causeService.addCause(causeDto); |
| | | return R.ok(); |
| | | } |
| | |
| | | @ApiOperation(httpMethod = "PUT", value = "案件台-案件录入-修改案件") |
| | | @PutMapping("/updateCause") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R updateCause(@RequestBody CauseDto causeDto, Integer id) { |
| | | public R updateCause(@RequestBody @Validated CauseDto causeDto, Integer id) { |
| | | return R.ok(causeService.updateCause(causeDto, id)); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "案件台-案件录入-报案人员-报案人元导入") |
| | | @PostMapping("/reporterUpload") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | @SneakyThrows |
| | | public R uploadReporter(@RequestParam(value = "multipartFile") MultipartFile multipartFile,Integer causeId) { |
| | | causeService.loadFileReport(multipartFile,causeId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "GET", value = "根据群组id查询案件分页") |
| | | @GetMapping("/getAllReportList") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R<IPage<ReportListVo>> get(Page<ReportListVo> page, ReportParamDto reportParamDto, Integer groupId) { |
| | | return R.ok(reportService.getPageByGroupId(page, reportParamDto, groupId)); |
| | | public R<IPage<ReportListVo>> get(Page<ReportListVo> page, ReportParamDto reportParamDto, Integer causeId) { |
| | | return R.ok(reportService.getPageByGroupId(page, reportParamDto, causeId)); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "添加人员") |
| | | @PostMapping("/addReporter") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R<Boolean> get(AddReportDto addReportDto) { |
| | | if (addReportDto.getReporterName() == null || addReportDto.getReporterName().equals("")) { |
| | | return R.failed("报案人员不能为空"); |
| | | } |
| | | if (addReportDto.getMobile() == null || addReportDto.getMobile().equals("")) { |
| | | return R.failed("报案人员电话不能为空"); |
| | | } |
| | | if (addReportDto.getIdcard() == null || addReportDto.getIdcard().equals("")) { |
| | | return R.failed("报案人员身份证不能为空"); |
| | | } |
| | | public R<Boolean> get(@RequestBody AddReportDto addReportDto) { |
| | | return R.ok(causeService.addReportPeople(addReportDto)); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "GET", value = "获取案件的id和名称列表") |
| | | @GetMapping("/getCauseIdAndName") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R getCauseIdAndName() { |
| | | return R.ok(causeService.getCauseIdAndName()); |
| | | } |
| | | } |
| | | |