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 org.springframework.web.multipart.MultipartFile;
|
|
import com.javaweb.common.annotation.Log;
|
import com.javaweb.common.enums.BusinessType;
|
import com.javaweb.platform.domain.ProjectInfo;
|
import com.javaweb.platform.service.IProjectInfoService;
|
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-08
|
*/
|
@Controller
|
@RequestMapping("/project/projectInfo")
|
public class ProjectInfoController extends BaseController
|
{
|
private String prefix = "platform/projectInfo";
|
|
@Autowired
|
private IProjectInfoService projectInfoService;
|
|
@RequiresPermissions("project:projectInfo:view")
|
@GetMapping()
|
public String projectInfo()
|
{
|
return prefix + "/projectInfo";
|
}
|
|
/**
|
* 查询项目信息列表
|
*/
|
@RequiresPermissions("project:projectInfo:list")
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(ProjectInfo projectInfo)
|
{
|
startPage();
|
List<ProjectInfo> list = projectInfoService.selectProjectInfoList(projectInfo);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出项目信息列表
|
*/
|
@RequiresPermissions("project:projectInfo:export")
|
@Log(title = "项目信息", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(ProjectInfo projectInfo)
|
{
|
List<ProjectInfo> list = projectInfoService.selectProjectInfoList(projectInfo);
|
ExcelUtil<ProjectInfo> util = new ExcelUtil<ProjectInfo>(ProjectInfo.class);
|
return util.exportExcel(list, "projectInfo");
|
}
|
|
@Log(title = "项目导入", businessType = BusinessType.IMPORT)
|
@PostMapping("/importData")
|
@ResponseBody
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
{
|
|
String msg= projectInfoService.importData(file,true);
|
return AjaxResult.success(msg);
|
|
}
|
|
|
/**
|
* 新增项目信息
|
*/
|
@GetMapping("/add")
|
public String add()
|
{
|
return prefix + "/add";
|
}
|
|
/**
|
* 新增保存项目信息
|
*/
|
@RequiresPermissions("project:projectInfo:add")
|
@Log(title = "项目信息", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(ProjectInfo projectInfo)
|
{
|
return toAjax(projectInfoService.insertProjectInfo(projectInfo));
|
}
|
|
/**
|
* 修改项目信息
|
*/
|
@GetMapping("/edit/{id}")
|
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
{
|
ProjectInfo projectInfo = projectInfoService.selectProjectInfoById(id);
|
mmap.put("projectInfo", projectInfo);
|
return prefix + "/edit";
|
}
|
|
/**
|
* 修改保存项目信息
|
*/
|
@RequiresPermissions("project:projectInfo:edit")
|
@Log(title = "项目信息", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult editSave(ProjectInfo projectInfo)
|
{
|
return toAjax(projectInfoService.updateProjectInfo(projectInfo));
|
}
|
|
/**
|
* 删除项目信息
|
*/
|
@RequiresPermissions("project:projectInfo:remove")
|
@Log(title = "项目信息", businessType = BusinessType.DELETE)
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(projectInfoService.deleteProjectInfoByIds(ids));
|
}
|
|
}
|