From 14fc936df708b4f40587418f73c1e290dbceb3f8 Mon Sep 17 00:00:00 2001 From: 15036302109 <zhp5211314> Date: Fri, 8 Dec 2023 09:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E6=96=87=E6=B5=81=E8=BD=AC=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ehs/EhsDocTransferController.java | 99 +++++ .../controller/ehs/EhsDocumentController.java | 128 ++++++ .../ehsDocTransfer/domain/EhsDocTransfer.java | 73 ++++ .../mapper/EhsDocTransferMapper.java | 36 ++ .../service/IEhsDocTransferService.java | 36 ++ .../impl/EhsDocTransferServiceImpl.java | 71 +++ .../ruoyi/ehsDocument/domain/EhsDocument.java | 74 ++++ .../ehsDocument/mapper/EhsDocumentMapper.java | 36 ++ .../service/IEhsDocumentService.java | 37 ++ .../service/impl/EhsDocumentServiceImpl.java | 70 +++ .../mapper/ehs/EhsDocTransferMapper.xml | 53 +++ .../mapper/ehs/EhsDocumentMapper.xml | 48 ++ ruoyi-ui/src/api/ehs/ehsDocTransfer.js | 44 ++ ruoyi-ui/src/api/ehs/ehsDocument.js | 60 +++ ruoyi-ui/src/views/ehs/ehsDocument/index.vue | 410 ++++++++++++++++++ 15 files changed, 1275 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocTransferController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/domain/EhsDocTransfer.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocument/domain/EhsDocument.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocument/mapper/EhsDocumentMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/IEhsDocumentService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsDocTransferMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml create mode 100644 ruoyi-ui/src/api/ehs/ehsDocTransfer.js create mode 100644 ruoyi-ui/src/api/ehs/ehsDocument.js create mode 100644 ruoyi-ui/src/views/ehs/ehsDocument/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocTransferController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocTransferController.java new file mode 100644 index 0000000..8fcd450 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocTransferController.java @@ -0,0 +1,99 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.List; +import java.util.Arrays; +import javax.servlet.http.HttpServletResponse; + +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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer; +import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 公文流转Controller + * + * @author ruoyi + * @date 2023-12-07 + */ +@Api(tags = "公文流转管理") +@RestController +@RequestMapping("/ehs/ehsDocTransfer") +public class EhsDocTransferController extends BaseController { + @Autowired + private IEhsDocTransferService ehsDocTransferService; + + /** + * 查询公文流转列表 + */ + @GetMapping("/list") + public TableDataInfo list(EhsDocTransfer ehsDocTransfer) { + startPage(); + List<EhsDocTransfer> list = ehsDocTransferService.selectEhsDocTransferList(ehsDocTransfer); + return getDataTable(list); + } + + /** + * 导出公文流转列表 + */ + @Log(title = "公文流转", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsDocTransfer ehsDocTransfer) { + List<EhsDocTransfer> list = ehsDocTransferService.selectEhsDocTransferList(ehsDocTransfer); + ExcelUtil<EhsDocTransfer> util = new ExcelUtil<EhsDocTransfer>(EhsDocTransfer.class); + util.exportExcel(response, list, "公文流转数据"); + } + + /** + * 获取公文流转详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(ehsDocTransferService.selectEhsDocTransferById(id)); + } + + /** + * 新增公文流转 + */ + @ApiOperation("新增公文流转") + @Log(title = "公文流转", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsDocTransfer ehsDocTransfer) { + return toAjax(ehsDocTransferService.save(ehsDocTransfer)); + } + + /** + * 修改公文流转 + */ + @ApiOperation("修改公文流转") + @Log(title = "公文流转", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsDocTransfer ehsDocTransfer) { + return toAjax(ehsDocTransferService.updateById(ehsDocTransfer)); + } + + /** + * 删除公文流转 + */ + @ApiOperation("删除公文流转") + @Log(title = "公文流转", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(ehsDocTransferService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java new file mode 100644 index 0000000..c850ad3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java @@ -0,0 +1,128 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.List; +import java.util.Arrays; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer; +import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService; +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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ehsDocument.domain.EhsDocument; +import com.ruoyi.ehsDocument.service.IEhsDocumentService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 公文管理Controller + * + * @author ruoyi + * @date 2023-12-07 + */ +@Api(tags = "公文管理管理") +@RestController +@RequestMapping("/ehs/ehsDocument") +public class EhsDocumentController extends BaseController { + @Autowired + private IEhsDocumentService ehsDocumentService; + + @Autowired + private IEhsDocTransferService transferService; + + /** + * 查询公文管理列表 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:list')") + @GetMapping("/list") + public TableDataInfo list(EhsDocument ehsDocument) { + startPage(); + List<EhsDocument> list = ehsDocumentService.selectEhsDocumentList(ehsDocument); + return getDataTable(list); + } + + /** + * 获取拟稿部门下拉列表 + */ + @GetMapping(value = "/getAllDraftDept") + public AjaxResult getAllDraftDept() { + return AjaxResult.success(ehsDocumentService.getAllDraftDept()); + } + + /** + * 导出公文管理列表 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:export')") + @Log(title = "公文管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsDocument ehsDocument) { + List<EhsDocument> list = ehsDocumentService.selectEhsDocumentList(ehsDocument); + ExcelUtil<EhsDocument> util = new ExcelUtil<EhsDocument>(EhsDocument.class); + util.exportExcel(response, list, "公文管理数据"); + } + + /** + * 获取公文管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(ehsDocumentService.selectEhsDocumentById(id)); + } + + /** + * 根据公文id获取公文流转信息 + */ + @GetMapping(value = "transfer/{id}") + public TableDataInfo getTransferInfoByDocId(@PathVariable("id") Long id) { + startPage(); + List<EhsDocTransfer> list = transferService.getTransferInfoByDocId(id); + return getDataTable(list); + } + + /** + * 新增公文管理 + */ + @ApiOperation("新增公文管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:add')") + @Log(title = "公文管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsDocument ehsDocument) { + return toAjax(ehsDocumentService.save(ehsDocument)); + } + + /** + * 修改公文管理 + */ + @ApiOperation("修改公文管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:edit')") + @Log(title = "公文管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsDocument ehsDocument) { + return toAjax(ehsDocumentService.updateById(ehsDocument)); + } + + /** + * 删除公文管理 + */ + @ApiOperation("删除公文管理") + @PreAuthorize("@ss.hasPermi('ehs:ehsDocument:remove')") + @Log(title = "公文管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(ehsDocumentService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/domain/EhsDocTransfer.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/domain/EhsDocTransfer.java new file mode 100644 index 0000000..a95084e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/domain/EhsDocTransfer.java @@ -0,0 +1,73 @@ +package com.ruoyi.ehsDocTransfer.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 公文流转对象 ehs_doc_transfer + * + * @author ruoyi + * @date 2023-12-07 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_doc_transfer") +public class EhsDocTransfer extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 流转人id + */ + private Long transferUserId; + + /** + * 流转人 + */ + @Excel(name = "流转人") + private String transferName; + + /** + * 流转时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "流转时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date transferTime; + + /** + * 公文流转状态 + */ + @Excel(name = "公文流转状态") + private Integer docTransferStatus; + + /** + * 公文id + */ + @Excel(name = "公文id") + private Long documentId; + + /** + * 公文名称 + */ + @Excel(name = "公文名称") + private String documentName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java new file mode 100644 index 0000000..e8de08c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java @@ -0,0 +1,36 @@ +package com.ruoyi.ehsDocTransfer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 公文流转Mapper接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface EhsDocTransferMapper extends BaseMapper<EhsDocTransfer> { + /** + * 查询公文流转 + * + * @param id 公文流转主键 + * @return 公文流转 + */ + public EhsDocTransfer selectEhsDocTransferById(Long id); + + /** + * 查询公文流转列表 + * + * @param ehsDocTransfer 公文流转 + * @return 公文流转集合 + */ + public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer); + + /** + * 根据公文id获取公文流转信息 + */ + List<EhsDocTransfer> getTransferInfoByDocId(@Param("id") Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java new file mode 100644 index 0000000..4e6dc4a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java @@ -0,0 +1,36 @@ +package com.ruoyi.ehsDocTransfer.service; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer; + +/** + * 公文流转Service接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface IEhsDocTransferService extends IService<EhsDocTransfer> { + + /** + * 查询公文流转 + * + * @param id 公文流转主键 + * @return 公文流转 + */ + public EhsDocTransfer selectEhsDocTransferById(Long id); + + /** + * 查询公文流转列表 + * + * @param ehsDocTransfer 公文流转 + * @return 公文流转集合 + */ + public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer); + + /** + * 根据公文id获取公文流转信息 + */ + List<EhsDocTransfer> getTransferInfoByDocId(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java new file mode 100644 index 0000000..229f417 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java @@ -0,0 +1,71 @@ +package com.ruoyi.ehsDocTransfer.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; + +import java.util.List; +import java.util.Map; + +import com.ruoyi.ehsDocTransfer.mapper.EhsDocTransferMapper; +import com.ruoyi.ehsDocTransfer.domain.EhsDocTransfer; +import com.ruoyi.ehsDocTransfer.service.IEhsDocTransferService; + +/** + * 公文流转Service业务层处理 + * + * @author ruoyi + * @date 2023-12-07 + */ +@Service +public class EhsDocTransferServiceImpl extends ServiceImpl<EhsDocTransferMapper, EhsDocTransfer> implements IEhsDocTransferService { + + @Autowired + private EhsDocTransferMapper ehsDocTransferMapper; + + /** + * 查询公文流转 + * + * @param id 公文流转主键 + * @return 公文流转 + */ + @Override + public EhsDocTransfer selectEhsDocTransferById(Long id) { + return ehsDocTransferMapper.selectEhsDocTransferById(id); + } + + /** + * 查询公文流转列表 + * + * @param ehsDocTransfer 公文流转 + * @return 公文流转 + */ + @Override + public List<EhsDocTransfer> selectEhsDocTransferList(EhsDocTransfer ehsDocTransfer) { + return ehsDocTransferMapper.selectEhsDocTransferList(ehsDocTransfer); + } + + /** + * 根据公文id获取公文流转信息 + */ + @Override + public List<EhsDocTransfer> getTransferInfoByDocId(Long id) { + return ehsDocTransferMapper.getTransferInfoByDocId(id); + } + + + private LambdaQueryWrapper<EhsDocTransfer> buildQueryWrapper(EhsDocTransfer query) { + Map<String, Object> params = query.getParams(); + LambdaQueryWrapper<EhsDocTransfer> lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(query.getTransferName()), EhsDocTransfer::getTransferName, query.getTransferName()); + lqw.eq(query.getTransferTime() != null, EhsDocTransfer::getTransferTime, query.getTransferTime()); + lqw.eq(query.getDocTransferStatus() != null, EhsDocTransfer::getDocTransferStatus, query.getDocTransferStatus()); + lqw.eq(query.getDocumentId() != null, EhsDocTransfer::getDocumentId, query.getDocumentId()); + lqw.orderByDesc(EhsDocTransfer::getCreateTime); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/domain/EhsDocument.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/domain/EhsDocument.java new file mode 100644 index 0000000..e6cf349 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/domain/EhsDocument.java @@ -0,0 +1,74 @@ +package com.ruoyi.ehsDocument.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 公文管理对象 ehs_document + * + * @author ruoyi + * @date 2023-12-07 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_document") +public class EhsDocument extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 公文名称 + */ + @Excel(name = "公文名称") + private String docName; + + /** + * 公文字号 + */ + @Excel(name = "公文字号") + private String docFont; + + /** + * 拟稿部门 + */ + @Excel(name = "拟稿部门") + private String draftDept; + + /** + * 公文类型 + */ + @Excel(name = "公文类型") + private Integer docType; + + /** + * 公文编号 + */ + @Excel(name = "公文编号") + private String docNumber; + + /** + * 收文日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "收文日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date receiveTime; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/mapper/EhsDocumentMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/mapper/EhsDocumentMapper.java new file mode 100644 index 0000000..195bdc3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/mapper/EhsDocumentMapper.java @@ -0,0 +1,36 @@ +package com.ruoyi.ehsDocument.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsDocument.domain.EhsDocument; + +import java.util.List; + +/** + * 公文管理Mapper接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface EhsDocumentMapper extends BaseMapper<EhsDocument> { + /** + * 查询公文管理 + * + * @param id 公文管理主键 + * @return 公文管理 + */ + public EhsDocument selectEhsDocumentById(Long id); + + /** + * 查询公文管理列表 + * + * @param ehsDocument 公文管理 + * @return 公文管理集合 + */ + public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument); + + /** + * 获取拟稿部门下拉列表 + * @return + */ + List<String> getAllDraftDept(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/IEhsDocumentService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/IEhsDocumentService.java new file mode 100644 index 0000000..15d3a1d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/IEhsDocumentService.java @@ -0,0 +1,37 @@ +package com.ruoyi.ehsDocument.service; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsDocument.domain.EhsDocument; + +/** + * 公文管理Service接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface IEhsDocumentService extends IService<EhsDocument> { + + /** + * 查询公文管理 + * + * @param id 公文管理主键 + * @return 公文管理 + */ + public EhsDocument selectEhsDocumentById(Long id); + + /** + * 查询公文管理列表 + * + * @param ehsDocument 公文管理 + * @return 公文管理集合 + */ + public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument); + + /** + * 获取拟稿部门下拉列表 + * @return + */ + List<String> getAllDraftDept(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java new file mode 100644 index 0000000..35f1271 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java @@ -0,0 +1,70 @@ +package com.ruoyi.ehsDocument.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; + +import java.util.List; +import java.util.Map; + +import com.ruoyi.ehsDocument.mapper.EhsDocumentMapper; +import com.ruoyi.ehsDocument.domain.EhsDocument; +import com.ruoyi.ehsDocument.service.IEhsDocumentService; + +/** + * 公文管理Service业务层处理 + * + * @author ruoyi + * @date 2023-12-07 + */ +@Service +public class EhsDocumentServiceImpl extends ServiceImpl<EhsDocumentMapper, EhsDocument> implements IEhsDocumentService { + + @Autowired + private EhsDocumentMapper ehsDocumentMapper; + + /** + * 查询公文管理 + * + * @param id 公文管理主键 + * @return 公文管理 + */ + @Override + public EhsDocument selectEhsDocumentById(Long id) { + return ehsDocumentMapper.selectEhsDocumentById(id); + } + + /** + * 查询公文管理列表 + * + * @param ehsDocument 公文管理 + * @return 公文管理 + */ + @Override + public List<EhsDocument> selectEhsDocumentList(EhsDocument ehsDocument) { + return ehsDocumentMapper.selectEhsDocumentList(ehsDocument); + } + + /** + * 获取拟稿部门下拉列表 + * @return + */ + @Override + public List<String> getAllDraftDept() { + return ehsDocumentMapper.getAllDraftDept(); + } + + + private LambdaQueryWrapper<EhsDocument> buildQueryWrapper(EhsDocument query) { + Map<String, Object> params = query.getParams(); + LambdaQueryWrapper<EhsDocument> lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(query.getDocName()), EhsDocument::getDocName, query.getDocName()); + lqw.eq(query.getDocType() != null, EhsDocument::getDocType, query.getDocType()); + lqw.orderByDesc(EhsDocument::getCreateTime); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsDocTransferMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocTransferMapper.xml new file mode 100644 index 0000000..bc72147 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocTransferMapper.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.ehsDocTransfer.mapper.EhsDocTransferMapper"> + + <resultMap type="EhsDocTransfer" id="EhsDocTransferResult"> + <result property="id" column="id" /> + <result property="transferUserId" column="transfer_user_id" /> + <result property="transferName" column="transfer_name" /> + <result property="transferTime" column="transfer_time" /> + <result property="docTransferStatus" column="doc_transfer_status" /> + <result property="documentId" column="document_id" /> + <result property="documentName" column="document_name" /> + + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="remark" column="remark" /> + <result property="deptId" column="dept_id" /> + <result property="createUserId" column="create_user_id" /> + <result property="updateUserId" column="update_user_id" /> + </resultMap> + + <sql id="selectEhsDocTransferVo"> + select id, transfer_user_id, transfer_name, transfer_time, doc_transfer_status, document_id, document_name, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_doc_transfer + </sql> + + <select id="selectEhsDocTransferList" parameterType="EhsDocTransfer" resultMap="EhsDocTransferResult"> + <include refid="selectEhsDocTransferVo"/> + <where> + <if test="transferUserId != null "> and transfer_user_id = #{transferUserId}</if> + <if test="transferName != null and transferName != ''"> and transfer_name like concat('%', #{transferName}, '%')</if> + <if test="transferTime != null "> and transfer_time = #{transferTime}</if> + <if test="docTransferStatus != null "> and doc_transfer_status = #{docTransferStatus}</if> + <if test="documentId != null "> and document_id = #{documentId}</if> + <if test="documentName != null and documentName != ''"> and document_name = #{documentName}</if> + </where> + </select> + + <select id="selectEhsDocTransferById" parameterType="Long" resultMap="EhsDocTransferResult"> + <include refid="selectEhsDocTransferVo"/> + where id = #{id} + </select> + <select id="getTransferInfoByDocId" resultMap="EhsDocTransferResult"> + SELECT t.* + FROM ehs_document d,ehs_doc_transfer t + WHERE d.id = t.document_id AND d.id = #{id} + </select> + + +</mapper> \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml new file mode 100644 index 0000000..df7c3f4 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.ehsDocument.mapper.EhsDocumentMapper"> + + <resultMap type="EhsDocument" id="EhsDocumentResult"> + <result property="id" column="id" /> + <result property="docName" column="doc_name" /> + <result property="docFont" column="doc_font" /> + <result property="draftDept" column="draft_dept" /> + <result property="docType" column="doc_type" /> + <result property="docNumber" column="doc_number" /> + <result property="receiveTime" column="receive_time" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="remark" column="remark" /> + <result property="deptId" column="dept_id" /> + <result property="createUserId" column="create_user_id" /> + <result property="updateUserId" column="update_user_id" /> + </resultMap> + + <sql id="selectEhsDocumentVo"> + select id, doc_name, doc_font, draft_dept, doc_type, doc_number, receive_time, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_document + </sql> + + <select id="selectEhsDocumentList" parameterType="EhsDocument" resultMap="EhsDocumentResult"> + <include refid="selectEhsDocumentVo"/> + <where> + <if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if> + <if test="docType != null "> and doc_type = #{docType}</if> + </where> + </select> + + <select id="selectEhsDocumentById" parameterType="Long" resultMap="EhsDocumentResult"> + <include refid="selectEhsDocumentVo"/> + where id = #{id} + </select> + + <select id="getAllDraftDept" resultType="java.lang.String"> + select dept_name + from sys_dept + </select> + + +</mapper> \ No newline at end of file diff --git a/ruoyi-ui/src/api/ehs/ehsDocTransfer.js b/ruoyi-ui/src/api/ehs/ehsDocTransfer.js new file mode 100644 index 0000000..ac3ceb6 --- /dev/null +++ b/ruoyi-ui/src/api/ehs/ehsDocTransfer.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询公文流转列表 +export function listEhsDocTransfer(query) { + return request({ + url: '/ehs/ehsDocTransfer/list', + method: 'get', + params: query + }) +} + +// 查询公文流转详细 +export function getEhsDocTransfer(id) { + return request({ + url: '/ehs/ehsDocTransfer/' + id, + method: 'get' + }) +} + +// 新增公文流转 +export function addEhsDocTransfer(data) { + return request({ + url: '/ehs/ehsDocTransfer', + method: 'post', + data: data + }) +} + +// 修改公文流转 +export function updateEhsDocTransfer(data) { + return request({ + url: '/ehs/ehsDocTransfer', + method: 'put', + data: data + }) +} + +// 删除公文流转 +export function delEhsDocTransfer(id) { + return request({ + url: '/ehs/ehsDocTransfer/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/ehs/ehsDocument.js b/ruoyi-ui/src/api/ehs/ehsDocument.js new file mode 100644 index 0000000..4442442 --- /dev/null +++ b/ruoyi-ui/src/api/ehs/ehsDocument.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询公文管理列表 +export function listEhsDocument(query) { + return request({ + url: '/ehs/ehsDocument/list', + method: 'get', + params: query + }) +} + +// 查询公文管理详细 +export function getEhsDocument(id) { + return request({ + url: '/ehs/ehsDocument/' + id, + method: 'get' + }) +} + +// 获取拟稿部门下拉列表 +export function getAllDraftDept() { + return request({ + url: '/ehs/ehsDocument/getAllDraftDept', + method: 'get' + }) +} + +// 根据公文id获取公文流转信息 +export function getDocTransferById(id) { + return request({ + url: '/ehs/ehsDocument/transfer/' + id, + method: 'get' + }) +} + +// 新增公文管理 +export function addEhsDocument(data) { + return request({ + url: '/ehs/ehsDocument', + method: 'post', + data: data + }) +} + +// 修改公文管理 +export function updateEhsDocument(data) { + return request({ + url: '/ehs/ehsDocument', + method: 'put', + data: data + }) +} + +// 删除公文管理 +export function delEhsDocument(id) { + return request({ + url: '/ehs/ehsDocument/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/ehs/ehsDocument/index.vue b/ruoyi-ui/src/views/ehs/ehsDocument/index.vue new file mode 100644 index 0000000..e0a2fd5 --- /dev/null +++ b/ruoyi-ui/src/views/ehs/ehsDocument/index.vue @@ -0,0 +1,410 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="公文名称" prop="docName"> + <el-input + v-model="queryParams.docName" + placeholder="请输入公文名称" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="公文类型" prop="docType"> + <el-select v-model="queryParams.docType" placeholder="请选择公文类型" clearable> + <el-option + v-for="dict in dict.type.doc_type" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-edit-outline" + size="mini" + @click="handleAdd" + v-hasPermi="['ehs:ehsDocument:add']" + >公文登记</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-document" + size="mini" + @click="" + >公文流转</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['ehs:ehsDocument:edit']" + >修改</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['ehs:ehsDocument:remove']" + >删除</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['ehs:ehsDocument:export']" + >导出</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="ehsDocumentList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <!--<el-table-column label="主键" align="center" prop="id" />--> + <el-table-column label="序号" align="center"> + <template slot-scope="scope"> + <span>{{ Number(scope.$index) + 1 }}</span> + </template> + </el-table-column> + <el-table-column label="公文名称" align="center" prop="docName" /> + <el-table-column label="公文字号" align="center" prop="docFont" /> + <el-table-column label="拟稿部门" align="center" prop="draftDept" /> + <el-table-column label="公文类型" align="center" prop="docType"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.doc_type" :value="scope.row.docType"/> + </template> + </el-table-column> + <el-table-column label="公文编号" align="center" prop="docNumber" /> + <el-table-column label="收文日期" align="center" prop="receiveTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.receiveTime, '{y}-{m}-{d}') }}</span> + </template> + </el-table-column> + <el-table-column label="备注" align="center" prop="remark" /> + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> +<!-- <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['ehs:ehsDocument:edit']" + >修改</el-button>--> + <el-button + size="middle" + type="primary" + @click="transferRecord(scope.row)" + >流转记录</el-button> + <!--<el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['ehs:ehsDocument:remove']" + >删除</el-button>--> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 添加或修改公文管理对话框 --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="公文名称" prop="docName"> + <el-input v-model="form.docName" placeholder="请输入公文名称" /> + </el-form-item> + <el-form-item label="公文字号" prop="docFont"> + <el-input v-model="form.docFont" placeholder="请输入公文字号" /> + </el-form-item> + <!--<el-form-item label="拟稿部门" prop="draftDept"> + <el-input v-model="form.draftDept" placeholder="请输入拟稿部门" /> + </el-form-item>--> + <el-form-item label="拟稿部门" prop="draftDept"> + <el-select + v-model="form.draftDept" + placeholder="请选择拟稿部门" + clearable + style="width: 180px" + > + <el-option + v-for="(item, index) in ngbmInfo" + :key="index" + :label="item" + :value="item" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="公文类型" prop="docType"> + <el-select v-model="form.docType" placeholder="请选择公文类型"> + <el-option + v-for="dict in dict.type.doc_type" + :key="dict.value" + :label="dict.label" + :value="parseInt(dict.value)" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="公文编号" prop="docNumber"> + <el-input v-model="form.docNumber" placeholder="请输入公文编号" /> + </el-form-item> + <el-form-item label="收文日期" prop="receiveTime"> + <el-date-picker clearable + v-model="form.receiveTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="请选择收文日期"> + </el-date-picker> + </el-form-item> + <el-form-item label="备注" prop="remark"> + <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">确 定</el-button> + <el-button @click="cancel">取 消</el-button> + </div> + </el-dialog> + + <el-dialog :title="title1" :visible.sync="open1" width="600px" append-to-body> + <el-table v-loading="loading" :data="ehsDocTransferList"> + <el-table-column label="序号" align="center"> + <template slot-scope="scope"> + <span>{{ Number(scope.$index) + 1 }}</span> + </template> + </el-table-column> + <el-table-column label="流转人" align="center" prop="transferName" /> + + <el-table-column label="流转时间" align="center" prop="transferTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.transferTime, '{y}-{m}-{d}') }}</span> + </template> + </el-table-column> + + <el-table-column label="流转状态" align="center" prop="docTransferStatus"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.doc_transfer_status" :value="scope.row.docTransferStatus"/> + </template> + </el-table-column> + + + </el-table> + </el-dialog> + </div> + +</template> + +<script> +import { listEhsDocument, getEhsDocument, delEhsDocument, addEhsDocument, updateEhsDocument, getAllDraftDept, getDocTransferById} from "@/api/ehs/ehsDocument"; +import { listEhsDocTransfer } from '@/api/ehs/ehsDocTransfer' +import { parseTime } from '../../../utils/ruoyi' +import dict from '@/utils/dict' + +export default { + name: "EhsDocument", + dicts: ['doc_type','doc_transfer_status'], + data() { + return { + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 拟稿部门下拉框 + ngbmInfo: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 显示搜索条件 + showSearch: true, + // 总条数 + total: 0, + // 公文管理表格数据 + ehsDocumentList: [], + // 公文流转记录数据 + ehsDocTransferList: [], + // 弹出层标题 + title: "", + title1: "", + // 是否显示弹出层 + open: false, + open1: false, + // 查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + docName: null, + docType: null, + }, + // 表单参数 + form: {}, + // 表单校验 + rules: { + } + }; + }, + created() { + this.getList(); + // 获取拟稿部门下拉列表 + this.getAllDraftDept(); + }, + methods: { + dict, + parseTime, + /** 查询公文管理列表 */ + getList() { + this.loading = true; + listEhsDocument(this.queryParams).then(response => { + this.ehsDocumentList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + + /** 获取拟稿部门下拉列表 */ + getAllDraftDept() { + getAllDraftDept().then((res) => { + console.log(res); + this.ngbmInfo = res.data; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.open1 = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: null, + docName: null, + docFont: null, + draftDept: null, + docType: null, + docNumber: null, + receiveTime: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + deptId: null, + createUserId: null, + updateUserId: null + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 新增按钮操作 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "公文登记"; + }, + /** 修改按钮操作 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getEhsDocument(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "修改公文"; + }); + }, + /** 流转记录按钮操作 */ + transferRecord(row) { + this.reset(); + const id = row.id || this.ids; + /** 查询公文流转记录 */ + getDocTransferById(id).then(response => { + this.open1 = true; + this.loading = true; + this.title1 = "流转记录"; + this.ehsDocTransferList = response.rows; + //this.total1 = response.total; + this.loading = false; + }); + }, + /** 提交按钮 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateEhsDocument(this.form).then(response => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } else { + addEhsDocument(this.form).then(response => { + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('是否确认删除公文管理编号为"' + ids + '"的数据项?').then(function() { + return delEhsDocument(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => {}); + }, + /** 导出按钮操作 */ + handleExport() { + this.download('ehs/ehsDocument/export', { + ...this.queryParams + }, `ehsDocument_${new Date().getTime()}.xlsx`) + } + } +}; +</script>