wl
2022-10-10 96cd80f0eaa77b48b0eaf50d2e6c52f22d8429ab
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -6,10 +6,13 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.api.CommonResult;
import com.ycl.common.constant.BaseCaseStatus;
import com.ycl.common.util.UtilNumber;
import com.ycl.controller.BaseController;
import com.ycl.dto.casePool.IllegalBuildingParam;
import com.ycl.dto.casePool.ViolationParam;
import com.ycl.entity.caseHandler.BaseCase;
import com.ycl.entity.caseHandler.BaseCaseDetail;
import com.ycl.entity.caseHandler.DisposeRecord;
import com.ycl.service.caseHandler.IBaseCaseService;
import com.ycl.service.caseHandler.IDisposeRecordService;
@@ -52,6 +55,9 @@
    @Autowired
    IDisposeRecordService iDisposeRecordService;
    @Autowired
    UtilNumber utilNumber;
    @Autowired
    public void setBaseCaseService(IBaseCaseService baseCaseService) {
@@ -77,7 +83,7 @@
    @ApiOperation(value = "查询违规违建")
    @GetMapping("/query")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "state", value = "处理状态(0误报 1上报 2立案 3派遣 4处置 5核查 6结案7处理中)", dataType = "Integer"),
            @ApiImplicitParam(name = "state", value = "处理状态(0-待处理1-误报2-上报3-再学习/再训练4暂不处理5立案6调度7处置8核查9结案)", dataType = "Integer"),
            @ApiImplicitParam(name = "type", value = "1 违规,2 违建", dataType = "Integer"),
            @ApiImplicitParam(name = "resource", value = "1 视频,2 手动", dataType = "Integer")
    })
@@ -163,13 +169,12 @@
    public CommonResult addViolationCase(@RequestBody @Validated ViolationParam violationParam) {
        Integer violation = 1;
        Integer resource = 2;
        Integer state = 7;
        BaseCase baseCase = new BaseCase();
        BeanUtils.copyProperties(violationParam, baseCase);
        baseCase.setEventSource(resource);
        baseCase.setCategory(violation);
        baseCase.setCode(UUID.randomUUID().toString());
        baseCase.setState(state);
        baseCase.setCode(utilNumber.createCaseCode());
        baseCase.setState(BaseCaseStatus.PENDING);
        baseCaseService.save(baseCase);
        return CommonResult.success(baseCaseService.saveViolationCase(violationParam, baseCase.getId()));
    }
@@ -184,13 +189,12 @@
    public CommonResult addIllegalBuildingCase(@RequestBody @Validated IllegalBuildingParam illegalBuildingParam) {
        Integer illegalBuilding = 2;
        Integer resource = 2;
        Integer state = 7;
        BaseCase baseCase = new BaseCase();
        BeanUtils.copyProperties(illegalBuildingParam, baseCase);
        baseCase.setCategory(illegalBuilding);
        baseCase.setEventSource(resource);
        baseCase.setCode(UUID.randomUUID().toString());
        baseCase.setState(state);
        baseCase.setCode(utilNumber.createCaseCode());
        baseCase.setState(BaseCaseStatus.PENDING);
        baseCaseService.save(baseCase);
        return CommonResult.success(baseCaseService.saveIllegalBuildingCase(illegalBuildingParam, baseCase.getId()));
    }
@@ -200,7 +204,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", value = "事件编号")
    })
    public CommonResult baseCaseDetail(@PathVariable(value = "code") String code) {
    public CommonResult<BaseCaseDetail> baseCaseDetail(@PathVariable(value = "code") String code) {
        return CommonResult.success(baseCaseService.baseCaseDetail(code));
    }
@@ -221,7 +225,7 @@
    @ApiOperation(value = "案件状态修改")
    @PutMapping("/case_status_update")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "处理状态(0误报 1上报 2立案 3派遣 4处置 5核查 6结案7处理中8暂不处理)", name = "state")
            @ApiImplicitParam(value = "处理状态(0-待处理1-误报2-上报3-再学习/再训练4暂不处理5立案6调度7处置8核查9结案)", name = "state")
    })
    public CommonResult updateCaseStatus(@RequestParam Integer caseId, @RequestParam Integer state) {
        return CommonResult.success(baseCaseService
@@ -238,7 +242,7 @@
    @ApiOperation(value = "暂不处置重新处置")
    @PutMapping("/reset")
    public CommonResult resetCase(@RequestParam Integer caseId) {
        Integer firstNum = 0;
        Integer firstNum = 1;
        Integer state = iDisposeRecordService
                .list(new LambdaQueryWrapper<DisposeRecord>()
                        .eq(DisposeRecord::getBaseCaseId, caseId).
@@ -251,7 +255,7 @@
    @ApiOperation(value = "结案")
    @PutMapping("/end_case")
    public CommonResult endCase(@RequestParam Integer caseId, @RequestParam String result) {
    public CommonResult endCase(@RequestParam Long caseId, @RequestParam String result) {
        baseCaseService.endCase(caseId, result);
        return CommonResult.success("end case success~!");
    }