| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/base_case") |
| | | @Api(tags = "案件池") |
| | | @Slf4j |
| | | public class BaseCaseController extends BaseController { |
| | | |
| | | private IBaseCaseService baseCaseService; |
| | |
| | | @ApiOperation(value = "查询违规违建") |
| | | @GetMapping("/query") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "state", value = "处理状态(0-待处理1-误报2-上报3-再学习/再训练4暂不处理5立案6调度7处置8核查9结案)", dataType = "Integer"), |
| | | @ApiImplicitParam(name = "state", value = "处理状态(wait(0-待处理) handle(5立案6调度7处置8核查) finish(1-误报2-上报3-再学习/再训练4暂不处理 9结案)", dataType = "String"), |
| | | @ApiImplicitParam(name = "type", value = "1 违规,2 违建", dataType = "Integer"), |
| | | @ApiImplicitParam(name = "resource", value = "1 视频,2 手动", dataType = "Integer"), |
| | | @ApiImplicitParam(name = "code", dataType = "String"), |
| | |
| | | }) |
| | | public CommonResult searchViolation(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) Integer state, |
| | | @RequestParam(required = false) String state, |
| | | @RequestParam Integer type, |
| | | @RequestParam(required = false) Integer resource, |
| | | @RequestParam(required = false) String code, |
| | |
| | | @RequestParam(required = false) Integer videoId) { |
| | | |
| | | Page<Object> queryList; |
| | | // 处理状态(wait(0-待处理) handle(5立案6调度7处置8核查) finish(1-误报2-上报3-再学习/再训练4暂不处理 9结案) |
| | | List<Integer> stateList = new ArrayList<>(); |
| | | switch (state){ |
| | | case "wait": |
| | | stateList.add(0); |
| | | break; |
| | | case "handle": |
| | | stateList.add(5); |
| | | stateList.add(6); |
| | | stateList.add(7); |
| | | stateList.add(8); |
| | | break; |
| | | case "finish": |
| | | stateList.add(1); |
| | | stateList.add(2); |
| | | stateList.add(3); |
| | | stateList.add(4); |
| | | stateList.add(9); |
| | | break; |
| | | } |
| | | if (type == 1) { |
| | | queryList = baseCaseService.listViolationsPage(current, size, state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId, videoId); |
| | | queryList = baseCaseService.listViolationsPage(current, size, stateList, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId, videoId); |
| | | } else if (type == 2) { |
| | | queryList = baseCaseService.listIllegalBuilding(current, size, state, resource); |
| | | queryList = baseCaseService.listIllegalBuilding(current, size, stateList, resource); |
| | | } else { |
| | | return CommonResult.failed("bad request url"); |
| | | } |
| | |
| | | @PostMapping("/addition_violation") |
| | | @LogSave(operationType = "事项处置管理", contain = "新增违规案件") |
| | | public CommonResult addViolationCase(@RequestBody @Validated ViolationParam violationParam) { |
| | | log.info("---------------->参数,报警时间{},限时{},对象{}", violationParam.getAlarmTime(), violationParam.getLimitTime(), violationParam); |
| | | if (violationParam.getAlarmTime() != null) { |
| | | violationParam.setAlarmTime(violationParam.getAlarmTime().replace("/", "-")); |
| | | } |
| | | if (violationParam.getLimitTime() != null) { |
| | | violationParam.setLimitTime(violationParam.getLimitTime().replace("/", "-")); |
| | | } |
| | | Integer violation = 1; |
| | | Integer resource = 2; |
| | | BaseCase baseCase = new BaseCase(); |
| | |
| | | @PostMapping("/addition_illegal_building") |
| | | @LogSave(operationType = "事项处置管理", contain = "新增违建案件") |
| | | public CommonResult addIllegalBuildingCase(@RequestBody @Validated IllegalBuildingParam illegalBuildingParam) { |
| | | log.info("---------------->参数,报警时间{},限时{},对象{}", illegalBuildingParam.getAlarmTime(), illegalBuildingParam.getLimitTime(), illegalBuildingParam); |
| | | if (illegalBuildingParam.getAlarmTime() != null) { |
| | | illegalBuildingParam.setAlarmTime(illegalBuildingParam.getAlarmTime().replace("/", "-")); |
| | | } |
| | | if (illegalBuildingParam.getLimitTime() != null) { |
| | | illegalBuildingParam.setLimitTime(illegalBuildingParam.getLimitTime().replace("/", "-")); |
| | | } |
| | | Integer illegalBuilding = 2; |
| | | Integer resource = 2; |
| | | BaseCase baseCase = new BaseCase(); |
| | |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType("01"); |
| | | imageResources.setBelongToId(baseCase.getId()); |
| | | imageResources.setUrl(illegalBuildingParam.getImageUrls().get(i)); |
| | | imageResources.setUrl(illegalBuildingParam.getImageUrls().toString()); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResources.setCreateUser(user.getUserId()); |
| | | iImageResourcesService.save(imageResources); |
| | |
| | | @ApiOperation("预警研判") |
| | | public CommonResult searchVideoInspection(@RequestParam Integer current, |
| | | @RequestParam Integer pageSize, |
| | | @RequestParam(required = false) Integer type, |
| | | @RequestParam(required = false) Long gradeId, |
| | | @RequestParam(required = false) Long videoId, |
| | | @RequestParam(required = false) String beginTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return CommonResult.success(baseCaseService.selectVideoInspection(current, pageSize, gradeId, videoId, beginTime, endTime)); |
| | | return CommonResult.success(baseCaseService.selectVideoInspection(current, pageSize, gradeId, videoId, beginTime, endTime, type)); |
| | | } |
| | | |
| | | @GetMapping("/video_inspection/{id}") |