package com.ard.work.grid.controller;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import com.ard.common.core.utils.poi.ExcelUtil;
|
import com.ard.common.core.web.controller.BaseController;
|
import com.ard.common.core.web.domain.AjaxResult;
|
import com.ard.common.core.web.page.TableDataInfo;
|
import com.ard.common.log.annotation.Log;
|
import com.ard.common.log.enums.BusinessType;
|
import com.ard.common.security.annotation.RequiresPermissions;
|
import com.ard.work.grid.domain.ArdGridLibrayEntity;
|
import com.ard.work.grid.service.IArdGridLibrayEntityService;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.Operation;
|
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 java.util.List;
|
|
/**
|
* 网格库Controller
|
*
|
* @author XiaJiJian
|
* @date 2024-09-27
|
*/
|
@Tag(name = "网格库管理")
|
@RestController
|
@RequestMapping("/grid/libray")
|
public class ArdGridLibrayEntityController extends BaseController
|
{
|
@Autowired
|
private IArdGridLibrayEntityService ardGridLibrayEntityService;
|
|
/**
|
* 查询网格库列表
|
*/
|
@Operation(summary = "查询网格库列表")
|
@RequiresPermissions("grid:libray:list")
|
@GetMapping("/list")
|
public TableDataInfo list(ArdGridLibrayEntity ardGridLibrayEntity)
|
{
|
startPage();
|
List<ArdGridLibrayEntity> list = ardGridLibrayEntityService.selectArdGridLibrayEntityList(ardGridLibrayEntity);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出网格库列表
|
*/
|
@Operation(summary = "导出网格库列表")
|
@RequiresPermissions("grid:libray:export")
|
@Log(title = "网格库", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, ArdGridLibrayEntity ardGridLibrayEntity)
|
{
|
List<ArdGridLibrayEntity> list = ardGridLibrayEntityService.selectArdGridLibrayEntityList(ardGridLibrayEntity);
|
ExcelUtil<ArdGridLibrayEntity> util = new ExcelUtil<ArdGridLibrayEntity>(ArdGridLibrayEntity.class);
|
util.exportExcel(response, list, "网格库数据");
|
}
|
|
/**
|
* 获取网格库详细信息
|
*/
|
@Operation(summary = "获取网格库详细信息")
|
@RequiresPermissions("grid:libray:query")
|
@GetMapping(value = "/{gridId}")
|
public AjaxResult getInfo(@PathVariable("gridId") String gridId)
|
{
|
return success(ardGridLibrayEntityService.selectArdGridLibrayEntityByGridId(gridId));
|
}
|
|
/**
|
* 新增网格库
|
*/
|
@Operation(summary = "新增网格库")
|
@RequiresPermissions("grid:libray:add")
|
@Log(title = "网格库", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody ArdGridLibrayEntity ardGridLibrayEntity)
|
{
|
return toAjax(ardGridLibrayEntityService.insertArdGridLibrayEntity(ardGridLibrayEntity));
|
}
|
|
/**
|
* 修改网格库
|
*/
|
@Operation(summary = "修改网格库")
|
@RequiresPermissions("grid:libray:edit")
|
@Log(title = "网格库", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody ArdGridLibrayEntity ardGridLibrayEntity)
|
{
|
return toAjax(ardGridLibrayEntityService.updateArdGridLibrayEntity(ardGridLibrayEntity));
|
}
|
|
/**
|
* 删除网格库
|
*/
|
@Operation(summary = "删除网格库")
|
@RequiresPermissions("grid:libray:remove")
|
@Log(title = "网格库", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{gridIds}")
|
public AjaxResult remove(@PathVariable String[] gridIds)
|
{
|
return toAjax(ardGridLibrayEntityService.deleteArdGridLibrayEntityByGridIds(gridIds));
|
}
|
}
|