青羊经侦大队-数据平台
wl
2022-07-25 39f55c08933e7f0292c325f41b0f55390a4acc69
src/main/java/com/example/jz/controller/CauseController.java
@@ -8,16 +8,19 @@
import com.example.jz.modle.dto.AddReportDto;
import com.example.jz.modle.dto.CauseDto;
import com.example.jz.modle.dto.ReportParamDto;
import com.example.jz.modle.entity.Report;
import com.example.jz.modle.vo.ReportListVo;
import com.example.jz.service.CauseService;
import com.example.jz.service.ReportService;
import com.example.jz.service.UserService;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
 * 案件表(Cause)表控制层
@@ -27,11 +30,12 @@
 */
@RestController
@RequestMapping("cause")
@Api(tags = "案件区")
@Api(tags = "案件区-案件录入")
public class CauseController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private CauseService causeService;
    private ReportService reportService;
@@ -46,15 +50,15 @@
    }
    @ApiOperation(httpMethod = "POST", value = "添加案件")
    @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 = "修改案件")
    @ApiOperation(httpMethod = "PUT", value = "案件台-案件录入-修改案件")
    @PutMapping("/updateCause")
    @ApiResponse(message = "执行成功", code = 200)
    public R updateCause(@RequestBody CauseDto causeDto, Integer id) {
@@ -62,39 +66,48 @@
    }
    @ApiOperation(httpMethod = "GET", value = "案件录入列表")
    @ApiOperation(httpMethod = "GET", value = "案件台-案件录入-案件录入列表")
    @GetMapping("/getCauseList")
    @ApiResponse(message = "执行成功", code = 200)
    public R getCauseList(String cause, Integer status, Integer size, Integer current) {
        return R.ok(causeService.getCauserListByCondition(cause, status, size, current));
    }
    @ApiOperation(httpMethod = "GET", value = "负责人查询")
    @ApiOperation(httpMethod = "GET", value = "案件台-案件录入-负责人查询")
    @GetMapping("/getManagerList")
    @ApiResponse(message = "执行成功", code = 200)
    public R getManagerList() {
        return R.ok(causeService.getManagerList());
    }
    @ApiOperation(httpMethod = "GET", value = "获取报案人员")
    @ApiOperation(httpMethod = "GET", value = "案件台-案件录入-获取案件报案人员")
    @GetMapping("/getReporterList")
    @ApiResponse(message = "执行成功", code = 200)
    public R getReporterList(Integer causeId) {
        return R.ok(causeService.getReporterList(causeId));
    }
    @ApiOperation(httpMethod = "GET", value = "获取案件群公告")
    @ApiOperation(httpMethod = "GET", value = "案件台-案件录入-获取案件群公告")
    @GetMapping("/getGroupAnnouncement")
    @ApiResponse(message = "执行成功", code = 200)
    public R getGroupAnnouncement(Integer groupId) {
        return R.ok(causeService.getGroupAnnouncement(groupId));
    }
    @ApiOperation(httpMethod = "DELETE", value = "案件删除")
    @ApiOperation(httpMethod = "DELETE", value = "案件台-案件录入-案件删除")
    @DeleteMapping("/deleteCause")
    @ApiResponse(message = "执行成功", code = 200)
    public R deleteCause(@RequestParam(value = "id") Integer id) {
        causeService.deleteCause(id);
        return R.ok();
    }
    @ApiOperation(httpMethod = "POST", value = "案件台-案件录入-案件导入")
    @PostMapping("/upload")
    @ApiResponse(message = "执行成功", code = 200)
    @SneakyThrows
    public R upload(@RequestParam(value = "multipartFile") MultipartFile multipartFile) {
        causeService.loadFile(multipartFile);
        return R.ok();
    }
@@ -120,5 +133,12 @@
        }
        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());
    }
}