| | |
| | | |
| | | |
| | | import com.alibaba.druid.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonResult; |
| | |
| | | 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; |
| | | import com.ycl.service.caseHandler.IIllegalBuildingService; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | * @Description delete illegal buildings or violations |
| | | * @Param [ids, type] |
| | | **/ |
| | | @ApiOperation(value = "删除违规/违建案件") |
| | | @ApiOperation(value = "批处理-删除违规/违建案件") |
| | | @DeleteMapping("/batch_deletion") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "1 违规,2 违建", dataType = "Integer") |
| | | }) |
| | | public CommonResult removeCases(@RequestParam String[] ids, @RequestParam Integer type) { |
| | | public CommonResult removeCases(@RequestParam List<Long> ids, @RequestParam Integer type) { |
| | | Integer violationType = 1; |
| | | Integer illegalBuildingType = 2; |
| | | List<String> idList = Arrays.asList(ids); |
| | | if (!idList.isEmpty()) { |
| | | if (!ids.isEmpty()) { |
| | | CommonResult.success(baseCaseService.removeBatchByIds(ids)); |
| | | if (type == violationType) { |
| | | return CommonResult.success(violationsService.removeBatchByIds(idList)); |
| | | return CommonResult.success(violationsService.removeBatchByIds(ids)); |
| | | } else if (type == illegalBuildingType) { |
| | | return CommonResult.success(illegalBuildingService.removeBatchByIds(idList)); |
| | | return CommonResult.success(illegalBuildingService.removeBatchByIds(ids)); |
| | | } |
| | | return CommonResult.success(baseCaseService.removeBatchByIds(idList)); |
| | | } |
| | | return CommonResult.failed("request parameter is null"); |
| | | } |
| | |
| | | @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)); |
| | | } |
| | | |
| | | @ApiOperation("人工路径案件图片展示") |
| | | @ApiOperation(value = "人工路径案件图片展示") |
| | | @GetMapping("/hand_work_case_images") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "01 违规,02 违建", dataType = "Integer") |
| | |
| | | return CommonResult.success(baseCaseService.listCaseImages(id, type)); |
| | | } |
| | | |
| | | @ApiOperation("案件暂不处理") |
| | | @PutMapping("/case_leave") |
| | | public CommonResult updateCaseStatus(@RequestParam Integer caseId) { |
| | | Integer leaveType = 8; |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description case status update |
| | | * @Param [caseId, status] |
| | | **/ |
| | | @ApiOperation(value = "案件状态修改") |
| | | @PutMapping("/case_status_update") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "处理状态(0误报 1上报 2立案 3派遣 4处置 5核查 6结案7处理中8暂不处理)", name = "state") |
| | | }) |
| | | public CommonResult updateCaseStatus(@RequestParam Integer caseId, @RequestParam Integer state) { |
| | | return CommonResult.success(baseCaseService |
| | | .update(new LambdaUpdateWrapper<BaseCase>() |
| | | .eq(BaseCase::getId, caseId) |
| | | .set(BaseCase::getState, leaveType))); |
| | | .set(BaseCase::getState, state))); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description reset case |
| | | * @Param [caseId] |
| | | **/ |
| | | @ApiOperation(value = "暂不处置重新处置") |
| | | @PutMapping("/reset") |
| | | public CommonResult resetCase(@RequestParam Integer caseId) { |
| | | Integer firstNum = 0; |
| | | Integer state = iDisposeRecordService |
| | | .list(new LambdaQueryWrapper<DisposeRecord>() |
| | | .eq(DisposeRecord::getBaseCaseId, caseId). |
| | | orderByDesc(DisposeRecord::getCreateTime)).get(firstNum).getState(); |
| | | return CommonResult.success(baseCaseService |
| | | .update(new LambdaUpdateWrapper<BaseCase>() |
| | | .eq(BaseCase::getId, caseId) |
| | | .set(BaseCase::getState, state))); |
| | | } |
| | | |
| | | @ApiOperation(value = "结案") |
| | | @PutMapping("/end_case") |
| | | public CommonResult endCase(@RequestParam Integer caseId, @RequestParam String result) { |
| | | baseCaseService.endCase(caseId, result); |
| | | return CommonResult.success("end case success~!"); |
| | | } |
| | | } |