| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- package com.dgtly.notice.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.dgtly.common.annotation.Log;
- import com.dgtly.common.enums.BusinessType;
- import com.dgtly.notice.domain.NoticeDemand;
- import com.dgtly.notice.service.INoticeDemandService;
- import com.dgtly.common.core.controller.BaseController;
- import com.dgtly.common.core.domain.AjaxResult;
- import com.dgtly.common.utils.poi.ExcelUtil;
- import com.dgtly.common.core.page.TableDataInfo;
- /**
- * 【请填写功能名称】Controller
- *
- * @author dgtly
- * @date 2020-02-13
- */
- @Controller
- @RequestMapping("/notice/demand")
- public class NoticeDemandController extends BaseController
- {
- private String prefix = "notice/demand";
- @Autowired
- private INoticeDemandService noticeDemandService;
- @RequiresPermissions("notice:demand:view")
- @GetMapping()
- public String demand()
- {
- return prefix + "/demand";
- }
- /**
- * 查询【请填写功能名称】列表
- */
- @RequiresPermissions("notice:demand:list")
- @PostMapping("/list")
- @ResponseBody
- public TableDataInfo list(NoticeDemand noticeDemand)
- {
- startPage();
- List<NoticeDemand> list = noticeDemandService.selectNoticeDemandList(noticeDemand);
- return getDataTable(list);
- }
- /**
- * 导出【请填写功能名称】列表
- */
- @RequiresPermissions("notice:demand:export")
- @PostMapping("/export")
- @ResponseBody
- public AjaxResult export(NoticeDemand noticeDemand)
- {
- List<NoticeDemand> list = noticeDemandService.selectNoticeDemandList(noticeDemand);
- ExcelUtil<NoticeDemand> util = new ExcelUtil<NoticeDemand>(NoticeDemand.class);
- return util.exportExcel(list, "demand");
- }
- /**
- * 新增【请填写功能名称】
- */
- @GetMapping("/add")
- public String add()
- {
- return prefix + "/add";
- }
- /**
- * 新增保存【请填写功能名称】
- */
- @RequiresPermissions("notice:demand:add")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
- @PostMapping("/add")
- @ResponseBody
- public AjaxResult addSave(NoticeDemand noticeDemand)
- {
- return toAjax(noticeDemandService.insertNoticeDemand(noticeDemand));
- }
- /**
- * 修改【请填写功能名称】
- */
- @GetMapping("/edit/{id}")
- public String edit(@PathVariable("id") Long id, ModelMap mmap)
- {
- NoticeDemand noticeDemand = noticeDemandService.selectNoticeDemandById(id);
- mmap.put("noticeDemand", noticeDemand);
- return prefix + "/edit";
- }
- /**
- * 修改【请填写功能名称】
- */
- @GetMapping("/see/{id}")
- public String see(@PathVariable("id") Long id, ModelMap mmap)
- {
- NoticeDemand noticeDemand = noticeDemandService.selectNoticeDemandById(id);
- mmap.put("noticeDemand", noticeDemand);
- return prefix + "/see";
- }
- /**
- * 修改保存【请填写功能名称】
- */
- @RequiresPermissions("notice:demand:edit")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- @ResponseBody
- public AjaxResult editSave(NoticeDemand noticeDemand)
- {
- return toAjax(noticeDemandService.updateNoticeDemand(noticeDemand));
- }
- /**
- * 删除【请填写功能名称】
- */
- @RequiresPermissions("notice:demand:remove")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
- @PostMapping( "/remove")
- @ResponseBody
- public AjaxResult remove(String ids)
- {
- return toAjax(noticeDemandService.deleteNoticeDemandByIds(ids));
- }
- }
|