青羊经侦大队-数据平台
shiyue
2023-02-16 a5a0ff50ea4be9a7e7d0c6f805ed26809e3b183e
src/main/java/com/example/jz/controller/ReportController.java
@@ -21,9 +21,11 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@@ -105,6 +107,10 @@
    @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("?");
        String pic = report.getPic().substring(imgIndexFirst + 5, imgIndexEnd);
@@ -139,6 +145,15 @@
        return R.ok();
    }
    @ApiOperation(httpMethod = "POST", value = "案件台-案件录入-报案人员-报案人元导入")
    @PostMapping("/reporterUpload")
    @ApiResponse(message = "执行成功", code = 200)
    @SneakyThrows
    public R uploadReporter(@RequestParam(value = "multipartFile") MultipartFile multipartFile, Integer causeId) {
        reportService.loadFileReport(multipartFile,causeId);
        return R.ok();
    }
    @ApiOperation(httpMethod = "POST", value = "案件台-报案人员-报案材料导出")
    @PostMapping("/exportReporter")
    @ApiResponse(message = "执行成功", code = 200)