123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- package com.jjt.doc.controller;
- import com.jjt.common.core.utils.poi.ExcelUtil;
- import com.jjt.common.core.web.controller.BaseController;
- import com.jjt.common.core.web.domain.AjaxResult;
- import com.jjt.common.core.web.page.TableDataInfo;
- import com.jjt.common.log.annotation.Log;
- import com.jjt.common.log.enums.BusinessType;
- import com.jjt.common.security.annotation.RequiresPermissions;
- import com.jjt.common.security.utils.SecurityUtils;
- import com.jjt.doc.domain.DocGroup;
- import com.jjt.doc.service.IDocGroupService;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletResponse;
- import java.util.List;
- /**
- * 分组Controller
- *
- * @author wukai
- * @date 2023-04-20
- */
- @RestController
- @RequestMapping("/group")
- public class DocGroupController extends BaseController {
- @Resource
- private IDocGroupService docGroupService;
- /**
- * 查询分组列表
- */
- @GetMapping("/list")
- public TableDataInfo list(DocGroup docGroup) {
- startPage();
- List<DocGroup> list = docGroupService.selectDocGroupList(docGroup);
- return getDataTable(list);
- }
- /**
- * 查询分组列表
- */
- @GetMapping("/select")
- public TableDataInfo select(DocGroup docGroup) {
- startPage();
- docGroup.setGroupManager(SecurityUtils.getUserId());
- List<DocGroup> list = docGroupService.getGroupByUid(docGroup);
- return getDataTable(list);
- }
- /**
- * 查询分组列表
- */
- @GetMapping("/selectDoc")
- public TableDataInfo selectDoc(DocGroup docGroup) {
- startPage();
- docGroup.setGroupManager(SecurityUtils.getUserId());
- //传1则表示 分组成员的查询
- docGroup.setSearchValue("1");
- List<DocGroup> list = docGroupService.getGroupByUid(docGroup);
- return getDataTable(list);
- }
- /**
- * 导出分组列表
- */
- @Log(title = "分组", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, DocGroup docGroup) {
- List<DocGroup> list = docGroupService.selectDocGroupList(docGroup);
- ExcelUtil<DocGroup> util = new ExcelUtil<DocGroup>(DocGroup.class);
- util.exportExcel(response, list, "分组数据");
- }
- /**
- * 获取分组详细信息
- */
- @GetMapping(value = "/{groupId}")
- public AjaxResult getInfo(@PathVariable("groupId") Long groupId) {
- return success(docGroupService.selectDocGroupByGroupId(groupId));
- }
- /**
- * 新增分组
- */
- @Log(title = "分组", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody DocGroup docGroup) {
- return toAjax(docGroupService.insertDocGroup(docGroup));
- }
- /**
- * 修改分组
- */
- @Log(title = "分组", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody DocGroup docGroup) {
- return toAjax(docGroupService.updateDocGroup(docGroup));
- }
- /**
- * 删除分组
- */
- @Log(title = "分组", businessType = BusinessType.DELETE)
- @DeleteMapping("/{groupIds}")
- public AjaxResult remove(@PathVariable Long[] groupIds) {
- return toAjax(docGroupService.deleteDocGroupByGroupIds(groupIds));
- }
- }
|