|
@@ -1,116 +0,0 @@
|
|
|
-package com.miaxis.app.controller.area;
|
|
|
-
|
|
|
-import com.miaxis.common.constant.Constants;
|
|
|
-import java.util.List;
|
|
|
-import io.swagger.annotations.*;
|
|
|
-import com.miaxis.common.core.domain.Response;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
-import com.miaxis.common.annotation.Log;
|
|
|
-import com.miaxis.common.core.controller.BaseController;
|
|
|
-import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
-import com.miaxis.app.area.domain.AreaCode;
|
|
|
-import com.miaxis.app.area.service.IAreaCodeService;
|
|
|
-import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
-import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
-
|
|
|
-/**
|
|
|
- * 【区域编码】Controller
|
|
|
- *
|
|
|
- * @author zhangbin
|
|
|
- * @date 2020-12-28
|
|
|
- */
|
|
|
-@RestController
|
|
|
-@RequestMapping("/area/code")
|
|
|
-@Api(tags={"【app-区域编码】"})
|
|
|
-public class AreaCodeController extends BaseController{
|
|
|
- @Autowired
|
|
|
- private IAreaCodeService areaCodeService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询区域编码列表
|
|
|
- */
|
|
|
- //@PreAuthorize("@ss.hasPermi('area:code:list')")
|
|
|
- @GetMapping("/list")
|
|
|
- @ApiOperation("查询区域编码列表")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
- @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
- })
|
|
|
- public ResponsePageInfo<AreaCode> list(@ModelAttribute AreaCode areaCode){
|
|
|
- startPage();
|
|
|
- List<AreaCode> list = areaCodeService.selectAreaCodeList(areaCode);
|
|
|
- return toResponsePageInfo(list);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 导出区域编码列表
|
|
|
- */
|
|
|
- // @PreAuthorize("@ss.hasPermi('area:code:export')")
|
|
|
- @Log(title = "区域编码", businessType = BusinessTypeEnum.EXPORT)
|
|
|
- @GetMapping("/export")
|
|
|
- @ApiOperation("导出区域编码列表Excel")
|
|
|
- public Response<String> export(@ModelAttribute AreaCode areaCode){
|
|
|
- List<AreaCode> list = areaCodeService.selectAreaCodeList(areaCode);
|
|
|
- ExcelUtil<AreaCode> util = new ExcelUtil<AreaCode>(AreaCode.class);
|
|
|
- return util.exportExcel(list, "code");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取区域编码详细信息
|
|
|
- */
|
|
|
- //@PreAuthorize("@ss.hasPermi('area:code:query')")
|
|
|
- @GetMapping(value = "/{code}")
|
|
|
- @ApiOperation("获取区域编码详细信息")
|
|
|
- public Response<AreaCode> getInfo(
|
|
|
- @ApiParam(name = "code", value = "区域编码参数", required = true)
|
|
|
- @PathVariable("code") String code
|
|
|
- ){
|
|
|
- return Response.success(areaCodeService.selectAreaCodeById(code));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增区域编码
|
|
|
- */
|
|
|
- //@PreAuthorize("@ss.hasPermi('area:code:add')")
|
|
|
- @Log(title = "区域编码", businessType = BusinessTypeEnum.INSERT)
|
|
|
- @PostMapping
|
|
|
- @ApiOperation("新增区域编码")
|
|
|
- public Response<Integer> add(@RequestBody AreaCode areaCode){
|
|
|
- return toResponse(areaCodeService.insertAreaCode(areaCode));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改区域编码
|
|
|
- */
|
|
|
- //@PreAuthorize("@ss.hasPermi('area:code:edit')")
|
|
|
- @Log(title = "区域编码", businessType = BusinessTypeEnum.UPDATE)
|
|
|
- @PutMapping
|
|
|
- @ApiOperation("修改区域编码")
|
|
|
- public Response<Integer> edit(@RequestBody AreaCode areaCode){
|
|
|
- return toResponse(areaCodeService.updateAreaCode(areaCode));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除区域编码
|
|
|
- */
|
|
|
- //@PreAuthorize("@ss.hasPermi('area:code:remove')")
|
|
|
- @Log(title = "区域编码", businessType = BusinessTypeEnum.DELETE)
|
|
|
- @DeleteMapping("/{codes}")
|
|
|
- @ApiOperation("删除区域编码")
|
|
|
- public Response<Integer> remove(
|
|
|
- @ApiParam(name = "codes", value = "区域编码ids参数", required = true)
|
|
|
- @PathVariable String[] codes
|
|
|
- ){
|
|
|
- return toResponse(areaCodeService.deleteAreaCodeByIds(codes));
|
|
|
- }
|
|
|
-}
|