123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- package com.sooka.system.controller;
- import com.sooka.common.annotation.Log;
- import com.sooka.common.core.controller.BaseController;
- import com.sooka.common.core.domain.AjaxResult;
- import com.sooka.common.core.page.TableDataInfo;
- import com.sooka.common.enums.BusinessType;
- import com.sooka.common.utils.poi.ExcelUtil;
- 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 java.util.List;
- import com.sooka.system.domain.TgjjDwzhxx;
- import com.sooka.system.service.ITgjjDwzhxxService;
- /**
- * 【请填写功能名称】Controller
- *
- * @author lei
- * @date 2021-11-15
- */
- @Controller
- @RequestMapping("/system/dwzhxx")
- public class TgjjDwzhxxController extends BaseController
- {
- private String prefix = "system/dwzhxx";
- @Autowired
- private ITgjjDwzhxxService tgjjDwzhxxService;
- @RequiresPermissions("system:dwzhxx:view")
- @GetMapping()
- public String dwzhxx()
- {
- return prefix + "/dwzhxx";
- }
- /**
- * 查询【请填写功能名称】列表
- */
- @RequiresPermissions("system:dwzhxx:list")
- @PostMapping("/list")
- @ResponseBody
- public TableDataInfo list(TgjjDwzhxx tgjjDwzhxx)
- {
- startPage();
- List<TgjjDwzhxx> list = tgjjDwzhxxService.selectTgjjDwzhxxList(tgjjDwzhxx);
- return getDataTable(list);
- }
- /**
- * 导出【请填写功能名称】列表
- */
- @RequiresPermissions("system:dwzhxx:export")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- @ResponseBody
- public AjaxResult export(TgjjDwzhxx tgjjDwzhxx)
- {
- List<TgjjDwzhxx> list = tgjjDwzhxxService.selectTgjjDwzhxxList(tgjjDwzhxx);
- ExcelUtil<TgjjDwzhxx> util = new ExcelUtil<TgjjDwzhxx>(TgjjDwzhxx.class);
- return util.exportExcel(list, "dwzhxx");
- }
- /**
- * 新增【请填写功能名称】
- */
- @GetMapping("/add")
- public String add()
- {
- return prefix + "/add";
- }
- /**
- * 新增保存【请填写功能名称】
- */
- @RequiresPermissions("system:dwzhxx:add")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
- @PostMapping("/add")
- @ResponseBody
- public AjaxResult addSave(TgjjDwzhxx tgjjDwzhxx)
- {
- return toAjax(tgjjDwzhxxService.insertTgjjDwzhxx(tgjjDwzhxx));
- }
- /**
- * 修改【请填写功能名称】
- */
- @GetMapping("/edit/{ID}")
- public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
- {
- TgjjDwzhxx tgjjDwzhxx = tgjjDwzhxxService.selectTgjjDwzhxxById(ID);
- mmap.put("tgjjDwzhxx", tgjjDwzhxx);
- return prefix + "/edit";
- }
- /**
- * 修改保存【请填写功能名称】
- */
- @RequiresPermissions("system:dwzhxx:edit")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- @ResponseBody
- public AjaxResult editSave(TgjjDwzhxx tgjjDwzhxx)
- {
- return toAjax(tgjjDwzhxxService.updateTgjjDwzhxx(tgjjDwzhxx));
- }
- /**
- * 删除【请填写功能名称】
- */
- @RequiresPermissions("system:dwzhxx:remove")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
- @PostMapping( "/remove")
- @ResponseBody
- public AjaxResult remove(String ids)
- {
- return toAjax(tgjjDwzhxxService.deleteTgjjDwzhxxByIds(ids));
- }
- }
|