| | |
| | | package com.ycl.controller.caseHandler; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | |
| | | /** |
| | |
| | | IDataDictionaryService iDataDictionaryService; |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description 查询违建类型 |
| | | * @Param [size, current, keyWord] |
| | | * @return com.ycl.api.CommonResult |
| | | **/ |
| | | @ApiOperation(value = "查询违规类型") |
| | | @GetMapping("/query") |
| | | public CommonResult searchIllegalBuilding(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) String keyWord) { |
| | | Page<ViolationSettingVO> dataDictionaryPage = new Page<>(); |
| | | dataDictionaryPage.setSize(size); |
| | | dataDictionaryPage.setCurrent(current); |
| | | return CommonResult.success(iDataDictionaryService.listViolations(dataDictionaryPage,keyWord)); |
| | | public CommonResult searchViolations(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) String keyWord) { |
| | | |
| | | return CommonResult.success(iDataDictionaryService.listViolations(current, size, keyWord)); |
| | | } |
| | | |
| | | /** |
| | | * @Description delete illegal building by id |
| | | * @Param [id] |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description delete illegal building by id |
| | | * @Param [id] |
| | | **/ |
| | | @ApiOperation(value = "删除违规类型") |
| | | @DeleteMapping("/delete") |
| | | public CommonResult removeIllegalBuilding(@RequestParam Integer id){ |
| | | @LogSave(operationType = "运营基础设置", contain = "删除违规事项") |
| | | public CommonResult removeViolation(@RequestParam Integer id) { |
| | | return CommonResult.success(iDataDictionaryService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description batch delete violations |
| | | * @Param [ids] |
| | | **/ |
| | | @ApiOperation(value = "批量删除违规类型") |
| | | @DeleteMapping("/batch_delete") |
| | | @LogSave(operationType = "运营基础设置", contain = "批量删除违规事项") |
| | | public CommonResult removeViolations(@RequestParam String[] ids) { |
| | | |
| | | return CommonResult.success(iDataDictionaryService.removeBatchByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search violation type first |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属类型") |
| | | @GetMapping("/query/type_first") |
| | | public CommonResult searchViolationsTypeFirst() { |
| | | String typeLevel = "1"; |
| | | String typeCode = "01"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search violation type second |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属大类") |
| | | @GetMapping("/query/type_second") |
| | | public CommonResult searchViolationsTypeSecond() { |
| | | String typeLevel = "2"; |
| | | String typeCode = "01"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search violation type third |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属小类") |
| | | @GetMapping("/query/type_third") |
| | | public CommonResult searchViolationsTypeThird() { |
| | | String typeLevel = "3"; |
| | | String typeCode = "01"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search violation type four |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属案由") |
| | | @GetMapping("/query/type_four") |
| | | public CommonResult searchViolationsTypeFour() { |
| | | String typeLevel = "4"; |
| | | String typeCode = "01"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search violation event type |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询事件等级类型") |
| | | @GetMapping("/query/event_type") |
| | | public CommonResult searchViolationsEventType() { |
| | | String typeLevel = "1"; |
| | | String typeCode = "02"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description modify violation type |
| | | * @Param [typeFirst, id] |
| | | **/ |
| | | @ApiOperation(value = "修改所属类型/大类/小类/案由") |
| | | @PutMapping("/modification/type") |
| | | public CommonResult modifyViolationTypeFirst(@RequestParam String type, @RequestParam Integer id) { |
| | | return CommonResult.success(iDataDictionaryService |
| | | .update(new LambdaUpdateWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getId, id) |
| | | .set(StringUtils.isNotBlank(type), DataDictionary::getName, type))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description addition violation type |
| | | * @Param [dataDictionary] |
| | | **/ |
| | | @ApiOperation(value = "添加所属类型/大类/小类/案由") |
| | | @PostMapping("/addition/type") |
| | | @LogSave(operationType = "运营基础设置", contain = "添加违规事项") |
| | | public CommonResult addViolationType(@RequestBody @Validated DataDictionary dataDictionary) { |
| | | return CommonResult.success(iDataDictionaryService.save(dataDictionary)); |
| | | } |
| | | |
| | | |
| | | } |