| | |
| | | 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 org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.service.dict.IDataDictionaryService; |
| | | 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 org.springframework.web.bind.annotation.RestController; |
| | | import java.util.Arrays; |
| | | |
| | | |
| | | /** |
| | |
| | | * @since 2022-09-24 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/illegal-building") |
| | | @RequestMapping("/illegal_building") |
| | | @Api(tags = "违建事件类型设置") |
| | | public class IllegalBuildingController extends BaseController { |
| | | |
| | | } |
| | | @Autowired |
| | | IDataDictionaryService iDataDictionaryService; |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description 查询违建类型 |
| | | * @Param [size, current, keyWord] |
| | | **/ |
| | | @ApiOperation(value = "查询违建类型") |
| | | @GetMapping("/query") |
| | | public CommonResult searchIllegalBuilding(@RequestParam Integer size, |
| | | @RequestParam Integer current, |
| | | @RequestParam(required = false) String keyWord) { |
| | | |
| | | return CommonResult.success(iDataDictionaryService.listIllegalBuildingSettings(current, size, keyWord)); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description delete illegal building by id |
| | | * @Param [id] |
| | | **/ |
| | | @ApiOperation(value = "删除违建类型") |
| | | @DeleteMapping("/delete") |
| | | @LogSave(operationType = "运营基础设置", contain = "删除违建事项") |
| | | public CommonResult removeIllegalBuilding(@RequestParam Integer id) { |
| | | return CommonResult.success(iDataDictionaryService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description batch delete illegal building |
| | | * @Param [ids] |
| | | **/ |
| | | @ApiOperation(value = "批量删除违建类型") |
| | | @DeleteMapping("/batch_delete") |
| | | @LogSave(operationType = "运营基础设置", contain = "批量删除违建事项") |
| | | public CommonResult removeIllegalBuildings(@RequestParam String[] ids) { |
| | | return CommonResult.success(iDataDictionaryService.removeBatchByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search illegal building type first |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属类型") |
| | | @GetMapping("/query/type_first") |
| | | public CommonResult searchIllegalBuildingTypeFirst() { |
| | | String typeLevel = "1"; |
| | | String typeCode = "06"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description search illegal building type second |
| | | * @Param [] |
| | | **/ |
| | | @ApiOperation(value = "查询所属类别") |
| | | @GetMapping("/query/type_second") |
| | | public CommonResult searchIllegalBuildingTypeSecond() { |
| | | String typeLevel = "2"; |
| | | String typeCode = "06"; |
| | | return CommonResult.success(iDataDictionaryService |
| | | .list(new LambdaQueryWrapper<DataDictionary>() |
| | | .eq(DataDictionary::getLevel, typeLevel) |
| | | .eq(DataDictionary::getTypeCode, typeCode))); |
| | | } |
| | | |
| | | /** |
| | | * @return com.ycl.api.CommonResult |
| | | * @Description modify illegal building type |
| | | * @Param [typeFirst, id] |
| | | **/ |
| | | @ApiOperation(value = "修改所属类型/类别") |
| | | @PutMapping("/modification/type") |
| | | public CommonResult modifyIllegalBuildingType(@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 illegal building type |
| | | * @Param [dataDictionary] |
| | | **/ |
| | | @ApiOperation(value = "添加所属类型/类别") |
| | | @PostMapping("/addition/type") |
| | | @LogSave(operationType = "运营基础设置", contain = "添加违建事项") |
| | | public CommonResult addIllegalBuildingTypeFirst(@RequestBody @Validated DataDictionary dataDictionary) { |
| | | return CommonResult.success(iDataDictionaryService.save(dataDictionary)); |
| | | } |
| | | |
| | | } |