package com.javaweb.platform.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.platform.domain.ProjectApplyHole;
|
import com.javaweb.platform.service.IProjectApplyHoleService;
|
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-03-25
|
*/
|
@Controller
|
@RequestMapping("/platform/applyHoles")
|
public class ProjectApplyHoleController extends BaseController
|
{
|
private String prefix = "platform/applyHoles";
|
|
@Autowired
|
private IProjectApplyHoleService projectApplyHoleService;
|
|
@RequiresPermissions("platform:applyHoles:view")
|
@GetMapping()
|
public String applyHoles()
|
{
|
return prefix + "/applyHoles";
|
}
|
|
/**
|
* 查询钻孔申请记录表列表
|
*/
|
@RequiresPermissions("platform:applyHoles:list")
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(ProjectApplyHole projectApplyHole)
|
{
|
startPage();
|
List<ProjectApplyHole> list = projectApplyHoleService.selectProjectApplyHoleList(projectApplyHole);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出钻孔申请记录表列表
|
*/
|
@RequiresPermissions("platform:applyHoles:export")
|
@Log(title = "钻孔申请记录表", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(ProjectApplyHole projectApplyHole)
|
{
|
List<ProjectApplyHole> list = projectApplyHoleService.selectProjectApplyHoleList(projectApplyHole);
|
ExcelUtil<ProjectApplyHole> util = new ExcelUtil<ProjectApplyHole>(ProjectApplyHole.class);
|
return util.exportExcel(list, "applyHoles");
|
}
|
|
/**
|
* 新增钻孔申请记录表
|
*/
|
@GetMapping("/add")
|
public String add()
|
{
|
return prefix + "/add";
|
}
|
|
/**
|
* 新增保存钻孔申请记录表
|
*/
|
@RequiresPermissions("platform:applyHoles:add")
|
@Log(title = "钻孔申请记录表", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(ProjectApplyHole projectApplyHole)
|
{
|
return toAjax(projectApplyHoleService.insertProjectApplyHole(projectApplyHole));
|
}
|
|
/**
|
* 修改钻孔申请记录表
|
*/
|
@GetMapping("/edit/{id}")
|
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
{
|
ProjectApplyHole projectApplyHole = projectApplyHoleService.selectProjectApplyHoleById(id);
|
mmap.put("projectApplyHole", projectApplyHole);
|
return prefix + "/edit";
|
}
|
|
/**
|
* 修改保存钻孔申请记录表
|
*/
|
@RequiresPermissions("platform:applyHoles:edit")
|
@Log(title = "钻孔申请记录表", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult editSave(ProjectApplyHole projectApplyHole)
|
{
|
return toAjax(projectApplyHoleService.updateProjectApplyHole(projectApplyHole));
|
}
|
|
/**
|
* 删除钻孔申请记录表
|
*/
|
@RequiresPermissions("platform:applyHoles:remove")
|
@Log(title = "钻孔申请记录表", businessType = BusinessType.DELETE)
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(projectApplyHoleService.deleteProjectApplyHoleByIds(ids));
|
}
|
}
|