| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 报案表(Report)表控制层 |
| | |
| | | return R.ok(reportService.audit(report)); |
| | | } |
| | | |
| | | @PostMapping("/reject") |
| | | @ApiOperation(value = "驳回") |
| | | public R<Boolean> reject(@RequestBody Map map) { |
| | | return R.ok(reportService.reject((Integer) map.get("id"), (String) map.get("reason"))); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "PUT", value = "案件台-报案人员-编辑") |
| | | @PutMapping("/updateReport") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R updateReport(@RequestBody AddReportDto report) { |
| | | Integer causeId = report.getCauseId(); |
| | | if(causeId==null){ |
| | | return R.failed("关联案件不能为空"); |
| | | } |
| | | int imgIndexFirst = report.getPic().indexOf("/img"); |
| | | int imgIndexEnd = report.getPic().indexOf("?"); |
| | | int imgIndexEnd = report.getPic().length(); |
| | | if(report.getPic().indexOf("?") != -1){ |
| | | imgIndexEnd = report.getPic().indexOf("?"); |
| | | } |
| | | String pic = report.getPic().substring(imgIndexFirst + 5, imgIndexEnd); |
| | | report.setPic(pic); |
| | | reportService.updateById(report); |