package com.javaweb.geo.controller;
|
|
import java.util.List;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.ModelMap;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import com.javaweb.common.annotation.Log;
|
import com.javaweb.common.enums.BusinessType;
|
import com.javaweb.geo.domain.HoleQutu;
|
import com.javaweb.geo.service.IHoleQutuService;
|
import com.javaweb.common.core.controller.BaseController;
|
import com.javaweb.common.core.domain.AjaxResult;
|
import com.javaweb.common.utils.poi.ExcelUtil;
|
import com.javaweb.common.core.page.TableDataInfo;
|
|
/**
|
* 记录- 取土Controller
|
*
|
* @author zmk
|
* @date 2022-10-20
|
*/
|
@Controller
|
@RequestMapping("/geo/qutu")
|
public class HoleQutuController extends BaseController
|
{
|
private String prefix = "geo/qutu";
|
|
@Autowired
|
private IHoleQutuService holeQutuService;
|
|
@RequiresPermissions("geo:qutu:view")
|
@GetMapping()
|
public String qutu(String id, ModelMap mmap)
|
{
|
mmap.put("projectId", id);
|
return prefix + "/qutu";
|
}
|
|
/**
|
* 查询记录- 取土列表
|
*/
|
@RequiresPermissions("geo:qutu:list")
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(HoleQutu holeQutu)
|
{
|
startPage();
|
List<HoleQutu> list = holeQutuService.selectHoleQutuList(holeQutu);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出记录- 取土列表
|
*/
|
@RequiresPermissions("geo:qutu:export")
|
@Log(title = "记录- 取土", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(HoleQutu holeQutu)
|
{
|
List<HoleQutu> list = holeQutuService.selectHoleQutuList(holeQutu);
|
ExcelUtil<HoleQutu> util = new ExcelUtil<HoleQutu>(HoleQutu.class);
|
return util.exportExcel(list, "qutu");
|
}
|
|
/**
|
* 新增记录- 取土
|
*/
|
@GetMapping("/add")
|
public String add()
|
{
|
return prefix + "/add";
|
}
|
|
/**
|
* 新增保存记录- 取土
|
*/
|
@RequiresPermissions("geo:qutu:add")
|
@Log(title = "记录- 取土", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(HoleQutu holeQutu)
|
{
|
return toAjax(holeQutuService.insertHoleQutu(holeQutu));
|
}
|
|
/**
|
* 修改记录- 取土
|
*/
|
@GetMapping("/edit/{ids}")
|
public String edit(@PathVariable("ids") String ids, ModelMap mmap)
|
{
|
HoleQutu holeQutu = holeQutuService.selectHoleQutuById(ids);
|
mmap.put("holeQutu", holeQutu);
|
return prefix + "/edit";
|
}
|
|
/**
|
* 修改保存记录- 取土
|
*/
|
@RequiresPermissions("geo:qutu:edit")
|
@Log(title = "记录- 取土", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult editSave(HoleQutu holeQutu)
|
{
|
return toAjax(holeQutuService.updateHoleQutu(holeQutu));
|
}
|
|
/**
|
* 删除记录- 取土
|
*/
|
@RequiresPermissions("geo:qutu:remove")
|
@Log(title = "记录- 取土", businessType = BusinessType.DELETE)
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(holeQutuService.deleteHoleQutuByIds(ids));
|
}
|
}
|