123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- package com.fs.doc.controller;
- import java.util.List;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.fs.common.annotation.Log;
- import com.fs.common.core.controller.BaseController;
- import com.fs.common.core.domain.AjaxResult;
- import com.fs.common.enums.BusinessType;
- import com.fs.doc.domain.Doc;
- import com.fs.doc.service.IDocService;
- import com.fs.common.utils.poi.ExcelUtil;
- import com.fs.common.core.page.TableDataInfo;
- /**
- * 档案Controller
- *
- * @author fs
- * @date 2023-01-09
- */
- @RestController
- @RequestMapping("/doc/doc")
- public class DocController extends BaseController
- {
- @Autowired
- private IDocService docService;
- /**
- * 查询档案列表
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:list')")
- @GetMapping("/list")
- public TableDataInfo list(Doc doc)
- {
- startPage();
- List<Doc> list = docService.selectDocList(doc);
- return getDataTable(list);
- }
- /**
- * 导出档案列表
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:export')")
- @Log(title = "档案", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(Doc doc)
- {
- List<Doc> list = docService.selectDocList(doc);
- ExcelUtil<Doc> util = new ExcelUtil<Doc>(Doc.class);
- return util.exportExcel(list, "doc");
- }
- /**
- * 获取档案详细信息
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:query')")
- @GetMapping(value = "/{docId}")
- public AjaxResult getInfo(@PathVariable("docId") Long docId)
- {
- return AjaxResult.success(docService.selectDocById(docId));
- }
- /**
- * 新增档案
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:add')")
- @Log(title = "档案", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody Doc doc)
- {
- return toAjax(docService.insertDoc(doc));
- }
- /**
- * 修改档案
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:edit')")
- @Log(title = "档案", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody Doc doc)
- {
- return toAjax(docService.updateDoc(doc));
- }
- /**
- * 删除档案
- */
- @PreAuthorize("@ss.hasPermi('doc:doc:remove')")
- @Log(title = "档案", businessType = BusinessType.DELETE)
- @DeleteMapping("/{docIds}")
- public AjaxResult remove(@PathVariable Long[] docIds)
- {
- return toAjax(docService.deleteDocByIds(docIds));
- }
- }
|