浏览代码

Merge branch 'dev' of http://94.191.59.107:3000/wukai/lzga-doc into dev

yxc 2 年之前
父节点
当前提交
03237ed701
共有 24 个文件被更改,包括 875 次插入551 次删除
  1. 11 23
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocMsgAccepterController.java
  2. 47 23
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocMsgController.java
  3. 3 2
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocShareController.java
  4. 86 52
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocMsg.java
  5. 3 3
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocMsgAccepter.java
  6. 14 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocShare.java
  7. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocMsgAccepterMapper.java
  8. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocMsgMapper.java
  9. 2 2
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocShareMapper.java
  10. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocMsgAccepterService.java
  11. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocMsgService.java
  12. 2 2
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocShareService.java
  13. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocInfoServiceImpl.java
  14. 1 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocMsgAccepterServiceImpl.java
  15. 40 16
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocMsgServiceImpl.java
  16. 12 3
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocShareServiceImpl.java
  17. 67 41
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocMsgMapper.xml
  18. 15 7
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocShareMapper.xml
  19. 58 90
      lzga-modules/lzga-system/src/main/java/com/jjt/system/service/impl/SysDeptServiceImpl.java
  20. 8 0
      lzga-ui/src/api/doc/msg.js
  21. 219 276
      lzga-ui/src/views/doc/msg/index.vue
  22. 278 0
      lzga-ui/src/views/doc/msg/msg.vue
  23. 3 3
      lzga-ui/src/views/doc/msgAccepter/index.vue
  24. 1 2
      lzga-ui/vue.config.js

+ 11 - 23
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocMsgAccepterController.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.io.IOException;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -24,24 +25,21 @@ import com.jjt.common.core.web.page.TableDataInfo;
 
 /**
  * 消息接收对象Controller
- * 
+ *
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 @RestController
 @RequestMapping("/msgAccepter")
-public class DocMsgAccepterController extends BaseController
-{
+public class DocMsgAccepterController extends BaseController {
     @Resource
     private IDocMsgAccepterService docMsgAccepterService;
 
     /**
      * 查询消息接收对象列表
      */
-    @RequiresPermissions("doc:msgAccepter:list")
     @GetMapping("/list")
-    public TableDataInfo list(DocMsgAccepter docMsgAccepter)
-    {
+    public TableDataInfo list(DocMsgAccepter docMsgAccepter) {
         startPage();
         List<DocMsgAccepter> list = docMsgAccepterService.selectDocMsgAccepterList(docMsgAccepter);
         return getDataTable(list);
@@ -50,11 +48,9 @@ public class DocMsgAccepterController extends BaseController
     /**
      * 导出消息接收对象列表
      */
-    @RequiresPermissions("doc:msgAccepter:export")
     @Log(title = "消息接收对象", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, DocMsgAccepter docMsgAccepter)
-    {
+    public void export(HttpServletResponse response, DocMsgAccepter docMsgAccepter) {
         List<DocMsgAccepter> list = docMsgAccepterService.selectDocMsgAccepterList(docMsgAccepter);
         ExcelUtil<DocMsgAccepter> util = new ExcelUtil<DocMsgAccepter>(DocMsgAccepter.class);
         util.exportExcel(response, list, "消息接收对象数据");
@@ -63,43 +59,35 @@ public class DocMsgAccepterController extends BaseController
     /**
      * 获取消息接收对象详细信息
      */
-    @RequiresPermissions("doc:msgAccepter:query")
     @GetMapping(value = "/{msgId}")
-    public AjaxResult getInfo(@PathVariable("msgId") Long msgId)
-    {
+    public AjaxResult getInfo(@PathVariable("msgId") Long msgId) {
         return success(docMsgAccepterService.selectDocMsgAccepterByMsgId(msgId));
     }
 
     /**
      * 新增消息接收对象
      */
-    @RequiresPermissions("doc:msgAccepter:add")
     @Log(title = "消息接收对象", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody DocMsgAccepter docMsgAccepter)
-    {
+    public AjaxResult add(@RequestBody DocMsgAccepter docMsgAccepter) {
         return toAjax(docMsgAccepterService.insertDocMsgAccepter(docMsgAccepter));
     }
 
     /**
      * 修改消息接收对象
      */
-    @RequiresPermissions("doc:msgAccepter:edit")
     @Log(title = "消息接收对象", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody DocMsgAccepter docMsgAccepter)
-    {
+    public AjaxResult edit(@RequestBody DocMsgAccepter docMsgAccepter) {
         return toAjax(docMsgAccepterService.updateDocMsgAccepter(docMsgAccepter));
     }
 
     /**
      * 删除消息接收对象
      */
-    @RequiresPermissions("doc:msgAccepter:remove")
     @Log(title = "消息接收对象", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{msgIds}")
-    public AjaxResult remove(@PathVariable Long[] msgIds)
-    {
+    @DeleteMapping("/{msgIds}")
+    public AjaxResult remove(@PathVariable Long[] msgIds) {
         return toAjax(docMsgAccepterService.deleteDocMsgAccepterByMsgIds(msgIds));
     }
 }

+ 47 - 23
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocMsgController.java

@@ -1,9 +1,16 @@
 package com.jjt.doc.controller;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.io.IOException;
+import java.util.Map;
+import java.util.logging.Handler;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+
+import com.jjt.common.security.utils.SecurityUtils;
+import com.jjt.system.api.domain.SysDept;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -24,24 +31,51 @@ import com.jjt.common.core.web.page.TableDataInfo;
 
 /**
  * 系统消息Controller
- * 
+ *
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 @RestController
 @RequestMapping("/msg")
-public class DocMsgController extends BaseController
-{
+public class DocMsgController extends BaseController {
     @Resource
     private IDocMsgService docMsgService;
 
     /**
      * 查询系统消息列表
      */
-    @RequiresPermissions("doc:msg:list")
     @GetMapping("/list")
-    public TableDataInfo list(DocMsg docMsg)
-    {
+    public TableDataInfo list(DocMsg docMsg) {
+        startPage();
+        List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
+        return getDataTable(list);
+    }
+
+    /**
+     * 我收到的通知
+     */
+    @GetMapping("/notice")
+    public TableDataInfo notice(DocMsg docMsg) {
+        startPage();
+        List<String> deptIds = new ArrayList<>();
+        SysDept dept = SecurityUtils.getLoginUser().getSysUser().getDept();
+        deptIds.add(dept.getDeptId() + "");
+        String[] ancestors = dept.getAncestors().split(",");
+        for (String deptId : ancestors) {
+            deptIds.add(deptId);
+        }
+        Map<String, Object> searchMap = new HashMap<>();
+        searchMap.put("deptIds", deptIds);
+        docMsg.setParams(searchMap);
+        List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
+        return getDataTable(list);
+    }
+
+    /**
+     * 我收到的消息
+     */
+    @GetMapping("/msg")
+    public TableDataInfo msg(DocMsg docMsg) {
         startPage();
         List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
         return getDataTable(list);
@@ -50,11 +84,9 @@ public class DocMsgController extends BaseController
     /**
      * 导出系统消息列表
      */
-    @RequiresPermissions("doc:msg:export")
     @Log(title = "系统消息", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, DocMsg docMsg)
-    {
+    public void export(HttpServletResponse response, DocMsg docMsg) {
         List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
         ExcelUtil<DocMsg> util = new ExcelUtil<DocMsg>(DocMsg.class);
         util.exportExcel(response, list, "系统消息数据");
@@ -63,43 +95,35 @@ public class DocMsgController extends BaseController
     /**
      * 获取系统消息详细信息
      */
-    @RequiresPermissions("doc:msg:query")
     @GetMapping(value = "/{msgId}")
-    public AjaxResult getInfo(@PathVariable("msgId") Long msgId)
-    {
+    public AjaxResult getInfo(@PathVariable("msgId") Long msgId) {
         return success(docMsgService.selectDocMsgByMsgId(msgId));
     }
 
     /**
      * 新增系统消息
      */
-    @RequiresPermissions("doc:msg:add")
     @Log(title = "系统消息", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody DocMsg docMsg)
-    {
+    public AjaxResult add(@RequestBody DocMsg docMsg) {
         return toAjax(docMsgService.insertDocMsg(docMsg));
     }
 
     /**
      * 修改系统消息
      */
-    @RequiresPermissions("doc:msg:edit")
     @Log(title = "系统消息", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody DocMsg docMsg)
-    {
+    public AjaxResult edit(@RequestBody DocMsg docMsg) {
         return toAjax(docMsgService.updateDocMsg(docMsg));
     }
 
     /**
      * 删除系统消息
      */
-    @RequiresPermissions("doc:msg:remove")
     @Log(title = "系统消息", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{msgIds}")
-    public AjaxResult remove(@PathVariable Long[] msgIds)
-    {
+    @DeleteMapping("/{msgIds}")
+    public AjaxResult remove(@PathVariable Long[] msgIds) {
         return toAjax(docMsgService.deleteDocMsgByMsgIds(msgIds));
     }
 }

+ 3 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocShareController.java

@@ -50,9 +50,10 @@ public class DocShareController extends BaseController {
      * 查询文档分享列表
      */
     @GetMapping("/receive")
-    public TableDataInfo receive() {
+    public TableDataInfo receive(DocShare docShare) {
         startPage();
-        List<DocShare> list = docShareService.selectDocShareReceive(SecurityUtils.getUserId());
+        docShare.setSearchValue(SecurityUtils.getUserId() + "");
+        List<DocShare> list = docShareService.selectDocShareReceive(docShare);
         return getDataTable(list);
     }
 

+ 86 - 52
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocMsg.java

@@ -1,112 +1,146 @@
 package com.jjt.doc.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jjt.common.core.annotation.Excel;
 import com.jjt.common.core.web.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 系统消息对象 doc_msg
- * 
+ *
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
-public class DocMsg extends BaseEntity
-{
+public class DocMsg extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 消息ID */
+    /**
+     * 消息ID
+     */
     private Long msgId;
 
-    /** 消息类型;1.通知 2.消息 */
-    @Excel(name = "消息类型;1.通知 2.消息")
+    /**
+     * 消息标题
+     */
+    @Excel(name = "消息标题")
+    private String msgTitle;
+
+    /**
+     * 消息类型
+     */
+    @Excel(name = "消息类型")
     private String msgType;
 
-    /** 消息内容 */
+    /**
+     * 消息内容
+     */
     @Excel(name = "消息内容")
     private String msgContent;
 
-    /** 接收对象类型;1.全部 2.按部门 3.按人员 */
-    @Excel(name = "接收对象类型;1.全部 2.按部门 3.按人员")
+    /**
+     * 对象类型
+     */
+    @Excel(name = "对象类型")
     private String msgAcceptType;
 
-    /** 已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔 */
-    @Excel(name = "已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔")
+    /**
+     * 已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔
+     */
     private String msgAcceptSelect;
-
-    /** 逻辑删除标志;1/非1 */
-    @Excel(name = "逻辑删除标志;1/非1")
+    /**
+     * 已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔
+     */
+    @TableField(exist = false)
+    private String[] msgAcceptList;
+
+    /**
+     * 逻辑删除标志;1/非1
+     */
     private String isDel;
 
-    public void setMsgId(Long msgId) 
-    {
+
+    public String[] getMsgAcceptList() {
+        return msgAcceptList;
+    }
+
+    public void setMsgAcceptList(String[] msgAcceptList) {
+        this.msgAcceptList = msgAcceptList;
+    }
+
+    public void setMsgId(Long msgId) {
         this.msgId = msgId;
     }
 
-    public Long getMsgId() 
-    {
+    public Long getMsgId() {
         return msgId;
     }
-    public void setMsgType(String msgType) 
-    {
+
+    public void setMsgTitle(String msgTitle) {
+        this.msgTitle = msgTitle;
+    }
+
+    public String getMsgTitle() {
+        return msgTitle;
+    }
+
+    public void setMsgType(String msgType) {
         this.msgType = msgType;
     }
 
-    public String getMsgType() 
-    {
+    public String getMsgType() {
         return msgType;
     }
-    public void setMsgContent(String msgContent) 
-    {
+
+    public void setMsgContent(String msgContent) {
         this.msgContent = msgContent;
     }
 
-    public String getMsgContent() 
-    {
+    public String getMsgContent() {
         return msgContent;
     }
-    public void setMsgAcceptType(String msgAcceptType) 
-    {
+
+    public void setMsgAcceptType(String msgAcceptType) {
         this.msgAcceptType = msgAcceptType;
     }
 
-    public String getMsgAcceptType() 
-    {
+    public String getMsgAcceptType() {
         return msgAcceptType;
     }
-    public void setMsgAcceptSelect(String msgAcceptSelect) 
-    {
+
+    public void setMsgAcceptSelect(String msgAcceptSelect) {
         this.msgAcceptSelect = msgAcceptSelect;
     }
 
-    public String getMsgAcceptSelect() 
-    {
+    public String getMsgAcceptSelect() {
         return msgAcceptSelect;
     }
-    public void setIsDel(String isDel) 
-    {
+
+    public void setIsDel(String isDel) {
         this.isDel = isDel;
     }
 
-    public String getIsDel() 
-    {
+    public String getIsDel() {
         return isDel;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("msgId", getMsgId())
-            .append("msgType", getMsgType())
-            .append("msgContent", getMsgContent())
-            .append("msgAcceptType", getMsgAcceptType())
-            .append("msgAcceptSelect", getMsgAcceptSelect())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("isDel", getIsDel())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("msgId", getMsgId())
+                .append("msgTitle", getMsgTitle())
+                .append("msgType", getMsgType())
+                .append("msgContent", getMsgContent())
+                .append("msgAcceptType", getMsgAcceptType())
+                .append("msgAcceptSelect", getMsgAcceptSelect())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .append("isDel", getIsDel())
+                .toString();
     }
 }

+ 3 - 3
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocMsgAccepter.java

@@ -9,7 +9,7 @@ import com.jjt.common.core.web.domain.BaseEntity;
  * 消息接收对象对象 doc_msg_accepter
  * 
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 public class DocMsgAccepter extends BaseEntity
 {
@@ -21,8 +21,8 @@ public class DocMsgAccepter extends BaseEntity
     /** 用户ID */
     private Long userId;
 
-    /** 已读状态;1.已读 非1.未读 */
-    @Excel(name = "已读状态;1.已读 非1.未读")
+    /** 已读状态 */
+    @Excel(name = "已读状态")
     private String msgStatus;
 
     public void setMsgId(Long msgId) 

+ 14 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocShare.java

@@ -8,6 +8,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jjt.common.core.annotation.Excel;
 import com.jjt.common.core.web.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 文档分享对象 doc_share
  *
@@ -67,6 +69,18 @@ public class DocShare extends BaseEntity {
      */
     @TableField(exist = false)
     private String user;
+    /**
+     * 文档标签
+     */
+    private List<DocTag> tagList;
+
+    public List<DocTag> getTagList() {
+        return tagList;
+    }
+
+    public void setTagList(List<DocTag> tagList) {
+        this.tagList = tagList;
+    }
 
     public String getDocType() {
         return docType;

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocMsgAccepterMapper.java

@@ -7,7 +7,7 @@ import com.jjt.doc.domain.DocMsgAccepter;
  * 消息接收对象Mapper接口
  * 
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 public interface DocMsgAccepterMapper 
 {

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocMsgMapper.java

@@ -7,7 +7,7 @@ import com.jjt.doc.domain.DocMsg;
  * 系统消息Mapper接口
  * 
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 public interface DocMsgMapper 
 {

+ 2 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocShareMapper.java

@@ -70,8 +70,8 @@ public interface DocShareMapper {
     /**
      * 最近接收文件
      *
-     * @param uid 用户ID
+     * @param docShare 用户ID
      * @return
      */
-    List<DocShare> selectDocShareReceive(Long uid);
+    List<DocShare> selectDocShareReceive(DocShare docShare);
 }

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocMsgAccepterService.java

@@ -7,7 +7,7 @@ import com.jjt.doc.domain.DocMsgAccepter;
  * 消息接收对象Service接口
  * 
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 public interface IDocMsgAccepterService 
 {

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocMsgService.java

@@ -7,7 +7,7 @@ import com.jjt.doc.domain.DocMsg;
  * 系统消息Service接口
  * 
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 public interface IDocMsgService 
 {

+ 2 - 2
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocShareService.java

@@ -70,8 +70,8 @@ public interface IDocShareService {
     /**
      * 最近接收文件
      *
-     * @param uid 用户ID
+     * @param docShare 用户ID
      * @return
      */
-    List<DocShare> selectDocShareReceive(Long uid);
+    List<DocShare> selectDocShareReceive(DocShare docShare);
 }

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocInfoServiceImpl.java

@@ -159,7 +159,7 @@ public class DocInfoServiceImpl implements IDocInfoService {
 
         //插入文档标签
         for (DocTag tag : docInfo.getTagList()) {
-            if (tag.getTagId() == null || tag.getTagId() == 0L) {
+            if (StringUtils.isNotEmpty(tag.getTagName()) && (tag.getTagId() == null || tag.getTagId() == 0L)) {
                 //如果没有tagId,则在tag列表中插入一条记录
                 tag.setCreater(docInfo.getOwner());
                 tagMapper.insertDocTag(tag);

+ 1 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocMsgAccepterServiceImpl.java

@@ -11,7 +11,7 @@ import com.jjt.doc.service.IDocMsgAccepterService;
  * 消息接收对象Service业务层处理
  *
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 @Service
 public class DocMsgAccepterServiceImpl implements IDocMsgAccepterService

+ 40 - 16
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocMsgServiceImpl.java

@@ -1,22 +1,26 @@
 package com.jjt.doc.service.impl;
 
 import java.util.List;
+
 import com.jjt.common.core.utils.DateUtils;
+import com.jjt.common.core.utils.StringUtils;
+import com.jjt.common.security.utils.SecurityUtils;
 import org.springframework.stereotype.Service;
 import com.jjt.doc.mapper.DocMsgMapper;
 import com.jjt.doc.domain.DocMsg;
+
 import javax.annotation.Resource;
+
 import com.jjt.doc.service.IDocMsgService;
 
 /**
  * 系统消息Service业务层处理
  *
  * @author wukai
- * @date 2023-03-27
+ * @date 2023-05-15
  */
 @Service
-public class DocMsgServiceImpl implements IDocMsgService
-{
+public class DocMsgServiceImpl implements IDocMsgService {
     @Resource
     private DocMsgMapper docMsgMapper;
 
@@ -27,9 +31,12 @@ public class DocMsgServiceImpl implements IDocMsgService
      * @return 系统消息
      */
     @Override
-    public DocMsg selectDocMsgByMsgId(Long msgId)
-    {
-        return docMsgMapper.selectDocMsgByMsgId(msgId);
+    public DocMsg selectDocMsgByMsgId(Long msgId) {
+        DocMsg docMsg = docMsgMapper.selectDocMsgByMsgId(msgId);
+        if (StringUtils.isNotEmpty(docMsg.getMsgAcceptSelect())) {
+            docMsg.setMsgAcceptList(docMsg.getMsgAcceptSelect().split(","));
+        }
+        return docMsg;
     }
 
     /**
@@ -39,8 +46,7 @@ public class DocMsgServiceImpl implements IDocMsgService
      * @return 系统消息
      */
     @Override
-    public List<DocMsg> selectDocMsgList(DocMsg docMsg)
-    {
+    public List<DocMsg> selectDocMsgList(DocMsg docMsg) {
         return docMsgMapper.selectDocMsgList(docMsg);
     }
 
@@ -51,9 +57,10 @@ public class DocMsgServiceImpl implements IDocMsgService
      * @return 结果
      */
     @Override
-    public int insertDocMsg(DocMsg docMsg)
-    {
+    public int insertDocMsg(DocMsg docMsg) {
         docMsg.setCreateTime(DateUtils.getNowDate());
+        docMsg.setCreateBy(SecurityUtils.getUsername());
+        combo(docMsg);
         return docMsgMapper.insertDocMsg(docMsg);
     }
 
@@ -64,21 +71,39 @@ public class DocMsgServiceImpl implements IDocMsgService
      * @return 结果
      */
     @Override
-    public int updateDocMsg(DocMsg docMsg)
-    {
+    public int updateDocMsg(DocMsg docMsg) {
         docMsg.setUpdateTime(DateUtils.getNowDate());
+        docMsg.setUpdateBy(SecurityUtils.getUsername());
+        combo(docMsg);
         return docMsgMapper.updateDocMsg(docMsg);
     }
 
     /**
+     * 组装部门选择数据
+     *
+     * @param docMsg
+     */
+    private void combo(DocMsg docMsg) {
+        if (docMsg.getMsgAcceptList() != null) {
+            String msgAcceptSelect = "";
+            for (String deptId : docMsg.getMsgAcceptList()) {
+                if (StringUtils.isNotEmpty(msgAcceptSelect)) {
+                    msgAcceptSelect += ",";
+                }
+                msgAcceptSelect += deptId;
+            }
+            docMsg.setMsgAcceptSelect(msgAcceptSelect);
+        }
+    }
+
+    /**
      * 批量删除系统消息
      *
      * @param msgIds 需要删除的系统消息主键
      * @return 结果
      */
     @Override
-    public int deleteDocMsgByMsgIds(Long[] msgIds)
-    {
+    public int deleteDocMsgByMsgIds(Long[] msgIds) {
         return docMsgMapper.deleteDocMsgByMsgIds(msgIds);
     }
 
@@ -89,8 +114,7 @@ public class DocMsgServiceImpl implements IDocMsgService
      * @return 结果
      */
     @Override
-    public int deleteDocMsgByMsgId(Long msgId)
-    {
+    public int deleteDocMsgByMsgId(Long msgId) {
         return docMsgMapper.deleteDocMsgByMsgId(msgId);
     }
 }

+ 12 - 3
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocShareServiceImpl.java

@@ -4,7 +4,9 @@ import java.util.List;
 
 import com.jjt.common.core.utils.DateUtils;
 import com.jjt.common.security.utils.SecurityUtils;
+import com.jjt.doc.domain.DocInfo;
 import com.jjt.doc.domain.DocShareAccepter;
+import com.jjt.doc.mapper.DocTagMapper;
 import org.springframework.stereotype.Service;
 import com.jjt.doc.mapper.DocShareMapper;
 import com.jjt.doc.domain.DocShare;
@@ -23,6 +25,8 @@ import com.jjt.doc.service.IDocShareService;
 public class DocShareServiceImpl implements IDocShareService {
     @Resource
     private DocShareMapper docShareMapper;
+    @Resource
+    private DocTagMapper tagMapper;
 
     /**
      * 查询文档分享
@@ -117,10 +121,15 @@ public class DocShareServiceImpl implements IDocShareService {
     /**
      * 最近接收文件
      *
-     * @param uid@return
+     * @param docShare
+     * @return
      */
     @Override
-    public List<DocShare> selectDocShareReceive(Long uid) {
-        return docShareMapper.selectDocShareReceive(uid);
+    public List<DocShare> selectDocShareReceive(DocShare docShare) {
+        List<DocShare> list = docShareMapper.selectDocShareReceive(docShare);
+        for (DocShare ds : list) {
+            ds.setTagList(tagMapper.selectDocTagList4docId(ds.getDocId()));
+        }
+        return list;
     }
 }

+ 67 - 41
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocMsgMapper.xml

@@ -1,54 +1,76 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.doc.mapper.DocMsgMapper">
-    
+
     <resultMap type="DocMsg" id="DocMsgResult">
-        <result property="msgId"    column="MSG_ID"    />
-        <result property="msgType"    column="MSG_TYPE"    />
-        <result property="msgContent"    column="MSG_CONTENT"    />
-        <result property="msgAcceptType"    column="MSG_ACCEPT_TYPE"    />
-        <result property="msgAcceptSelect"    column="MSG_ACCEPT_SELECT"    />
-        <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="isDel"    column="IS_DEL"    />
+        <result property="msgId" column="MSG_ID"/>
+        <result property="msgTitle" column="MSG_TITLE"/>
+        <result property="msgType" column="MSG_TYPE"/>
+        <result property="msgContent" column="MSG_CONTENT"/>
+        <result property="msgAcceptType" column="MSG_ACCEPT_TYPE"/>
+        <result property="msgAcceptSelect" column="MSG_ACCEPT_SELECT"/>
+        <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="isDel" column="IS_DEL"/>
     </resultMap>
 
     <sql id="selectDocMsgVo">
-        select MSG_ID, MSG_TYPE, MSG_CONTENT, MSG_ACCEPT_TYPE, MSG_ACCEPT_SELECT, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_msg
+        select MSG_ID,
+               MSG_TITLE,
+               MSG_TYPE,
+               MSG_CONTENT,
+               MSG_ACCEPT_TYPE,
+               MSG_ACCEPT_SELECT,
+               CREATE_BY,
+               CREATE_TIME,
+               UPDATE_BY,
+               UPDATE_TIME,
+               REMARK,
+               IS_DEL
+        from doc_msg
     </sql>
 
     <select id="selectDocMsgList" parameterType="DocMsg" resultMap="DocMsgResult">
         <include refid="selectDocMsgVo"/>
-        <where>  
-            <if test="msgType != null  and msgType != ''"> and MSG_TYPE = #{msgType}</if>
-            <if test="msgContent != null  and msgContent != ''"> and MSG_CONTENT = #{msgContent}</if>
-            <if test="msgAcceptType != null  and msgAcceptType != ''"> and MSG_ACCEPT_TYPE = #{msgAcceptType}</if>
-            <if test="msgAcceptSelect != null  and msgAcceptSelect != ''"> and MSG_ACCEPT_SELECT = #{msgAcceptSelect}</if>
-            <if test="createBy != null "> and CREATE_BY = #{createBy}</if>
-            <if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
-            <if test="updateBy != null "> and UPDATE_BY = #{updateBy}</if>
-            <if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
-            <if test="remark != null  and remark != ''"> and REMARK = #{remark}</if>
-            <if test="isDel != null  and isDel != ''"> and IS_DEL = #{isDel}</if>
+        <where>
+            <if test="msgTitle != null  and msgTitle != ''">and MSG_TITLE = #{msgTitle}</if>
+            <if test="msgType != null  and msgType != ''">and MSG_TYPE = #{msgType}</if>
+            <if test="msgContent != null  and msgContent != ''">and MSG_CONTENT = #{msgContent}</if>
+            <if test="msgAcceptType != null  and msgAcceptType != ''">and MSG_ACCEPT_TYPE = #{msgAcceptType}</if>
+            <if test="msgAcceptSelect != null  and msgAcceptSelect != ''">and MSG_ACCEPT_SELECT = #{msgAcceptSelect}
+            </if>
+            <if test="createBy != null  and createBy != ''">and CREATE_BY = #{createBy}</if>
+            <if test="createTime != null ">and CREATE_TIME = #{createTime}</if>
+            <if test="updateBy != null  and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
+            <if test="updateTime != null ">and UPDATE_TIME = #{updateTime}</if>
+            <if test="remark != null  and remark != ''">and REMARK = #{remark}</if>
+            <if test="params.deptIds!=null">
+                and (
+                <foreach item="item" index="index" collection="params.deptIds" separator=" or ">
+                    find_in_set(#{item},MSG_ACCEPT_SELECT)
+                </foreach>
+                )
+            </if>
         </where>
     </select>
-    
+
     <select id="selectDocMsgByMsgId" parameterType="Long" resultMap="DocMsgResult">
         <include refid="selectDocMsgVo"/>
         where MSG_ID = #{msgId}
     </select>
-        
+
     <insert id="insertDocMsg" parameterType="DocMsg" useGeneratedKeys="true" keyProperty="msgId">
         insert into doc_msg
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="msgType != null">MSG_TYPE,</if>
-            <if test="msgContent != null">MSG_CONTENT,</if>
-            <if test="msgAcceptType != null">MSG_ACCEPT_TYPE,</if>
+            <if test="msgTitle != null and msgTitle != ''">MSG_TITLE,</if>
+            <if test="msgType != null and msgType != ''">MSG_TYPE,</if>
+            <if test="msgContent != null and msgContent != ''">MSG_CONTENT,</if>
+            <if test="msgAcceptType != null and msgAcceptType != ''">MSG_ACCEPT_TYPE,</if>
             <if test="msgAcceptSelect != null">MSG_ACCEPT_SELECT,</if>
             <if test="createBy != null">CREATE_BY,</if>
             <if test="createTime != null">CREATE_TIME,</if>
@@ -56,11 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">UPDATE_TIME,</if>
             <if test="remark != null">REMARK,</if>
             <if test="isDel != null">IS_DEL,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="msgType != null">#{msgType},</if>
-            <if test="msgContent != null">#{msgContent},</if>
-            <if test="msgAcceptType != null">#{msgAcceptType},</if>
+            <if test="msgTitle != null and msgTitle != ''">#{msgTitle},</if>
+            <if test="msgType != null and msgType != ''">#{msgType},</if>
+            <if test="msgContent != null and msgContent != ''">#{msgContent},</if>
+            <if test="msgAcceptType != null and msgAcceptType != ''">#{msgAcceptType},</if>
             <if test="msgAcceptSelect != null">#{msgAcceptSelect},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -68,15 +91,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="isDel != null">#{isDel},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateDocMsg" parameterType="DocMsg">
         update doc_msg
         <trim prefix="SET" suffixOverrides=",">
-            <if test="msgType != null">MSG_TYPE = #{msgType},</if>
-            <if test="msgContent != null">MSG_CONTENT = #{msgContent},</if>
-            <if test="msgAcceptType != null">MSG_ACCEPT_TYPE = #{msgAcceptType},</if>
+            <if test="msgTitle != null and msgTitle != ''">MSG_TITLE = #{msgTitle},</if>
+            <if test="msgType != null and msgType != ''">MSG_TYPE = #{msgType},</if>
+            <if test="msgContent != null and msgContent != ''">MSG_CONTENT = #{msgContent},</if>
+            <if test="msgAcceptType != null and msgAcceptType != ''">MSG_ACCEPT_TYPE = #{msgAcceptType},</if>
             <if test="msgAcceptSelect != null">MSG_ACCEPT_SELECT = #{msgAcceptSelect},</if>
             <if test="createBy != null">CREATE_BY = #{createBy},</if>
             <if test="createTime != null">CREATE_TIME = #{createTime},</if>
@@ -89,11 +113,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteDocMsgByMsgId" parameterType="Long">
-        delete from doc_msg where MSG_ID = #{msgId}
+        delete
+        from doc_msg
+        where MSG_ID = #{msgId}
     </delete>
 
     <delete id="deleteDocMsgByMsgIds" parameterType="String">
-        delete from doc_msg where MSG_ID in 
+        delete from doc_msg where MSG_ID in
         <foreach item="msgId" collection="array" open="(" separator="," close=")">
             #{msgId}
         </foreach>

+ 15 - 7
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocShareMapper.xml

@@ -60,15 +60,23 @@
           and a.CREATE_BY = #{uid}
         order by a.update_time desc
     </select>
-    <select id="selectDocShareReceive" resultType="com.jjt.doc.domain.DocShare">
+    <select id="selectDocShareReceive" parameterType="DocShare" resultType="com.jjt.doc.domain.DocShare">
         select a.*, b.doc_name, b.doc_type, b.doc_path, b.create_by user
         from (select t.*
-            from doc_share t,
-            doc_share_accepter t1
-            where t.doc_id = t1.doc_id
-            and t1.user_id = #{uid}) a,
-            doc_info b
-        where a.doc_id = b.doc_id
+        from doc_share t,
+        doc_share_accepter t1
+        where t.doc_id = t1.doc_id
+        and t1.user_id = #{searchValue}) a,
+        doc_info b
+        <where>
+            a.doc_id = b.doc_id
+            <if test="docName != null  and docName != ''">and DOC_NAME like concat('%', #{docName}, '%')</if>
+            <if test="docType != null  and docType != ''">and DOC_TYPE = #{docType}</if>
+            <if test="createBy != null ">and CREATE_BY = #{createBy}</if>
+            <if test="params.tagId!=null and params.tagId!=''">and b.doc_id in(select doc_id from DOC_TAG_RELA where
+                tag_id=#{params.tagId})
+            </if>
+        </where>
         order by a.update_time desc
     </select>
 

+ 58 - 90
lzga-modules/lzga-system/src/main/java/com/jjt/system/service/impl/SysDeptServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.jjt.common.core.constant.UserConstants;
@@ -21,68 +22,63 @@ import com.jjt.system.mapper.SysDeptMapper;
 import com.jjt.system.mapper.SysRoleMapper;
 import com.jjt.system.service.ISysDeptService;
 
+import javax.annotation.Resource;
+
 /**
  * 部门管理 服务实现
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class SysDeptServiceImpl implements ISysDeptService
-{
-    @Autowired
+public class SysDeptServiceImpl implements ISysDeptService {
+    @Resource
     private SysDeptMapper deptMapper;
 
-    @Autowired
+    @Resource
     private SysRoleMapper roleMapper;
 
     /**
      * 查询部门管理数据
-     * 
+     *
      * @param dept 部门信息
      * @return 部门信息集合
      */
     @Override
     @DataScope(deptAlias = "d")
-    public List<SysDept> selectDeptList(SysDept dept)
-    {
+    public List<SysDept> selectDeptList(SysDept dept) {
         return deptMapper.selectDeptList(dept);
     }
 
     /**
      * 查询部门树结构信息
-     * 
+     *
      * @param dept 部门信息
      * @return 部门树信息集合
      */
     @Override
-    public List<TreeSelect> selectDeptTreeList(SysDept dept)
-    {
+    public List<TreeSelect> selectDeptTreeList(SysDept dept) {
         List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
         return buildDeptTreeSelect(depts);
     }
 
     /**
      * 构建前端所需要树结构
-     * 
+     *
      * @param depts 部门列表
      * @return 树结构列表
      */
     @Override
-    public List<SysDept> buildDeptTree(List<SysDept> depts)
-    {
+    public List<SysDept> buildDeptTree(List<SysDept> depts) {
         List<SysDept> returnList = new ArrayList<SysDept>();
         List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
-        for (SysDept dept : depts)
-        {
+        for (SysDept dept : depts) {
             // 如果是顶级节点, 遍历该父节点的所有子节点
-            if (!tempList.contains(dept.getParentId()))
-            {
+            if (!tempList.contains(dept.getParentId())) {
                 recursionFn(depts, dept);
                 returnList.add(dept);
             }
         }
-        if (returnList.isEmpty())
-        {
+        if (returnList.isEmpty()) {
             returnList = depts;
         }
         return returnList;
@@ -90,93 +86,85 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 构建前端所需要下拉树结构
-     * 
+     *
      * @param depts 部门列表
      * @return 下拉树结构列表
      */
     @Override
-    public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts)
-    {
+    public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) {
         List<SysDept> deptTrees = buildDeptTree(depts);
         return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
     /**
      * 根据角色ID查询部门树信息
-     * 
+     *
      * @param roleId 角色ID
      * @return 选中部门列表
      */
     @Override
-    public List<Long> selectDeptListByRoleId(Long roleId)
-    {
+    public List<Long> selectDeptListByRoleId(Long roleId) {
         SysRole role = roleMapper.selectRoleById(roleId);
         return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
     }
 
     /**
      * 根据部门ID查询信息
-     * 
+     *
      * @param deptId 部门ID
      * @return 部门信息
      */
     @Override
-    public SysDept selectDeptById(Long deptId)
-    {
+    public SysDept selectDeptById(Long deptId) {
         return deptMapper.selectDeptById(deptId);
     }
 
     /**
      * 根据ID查询所有子部门(正常状态)
-     * 
+     *
      * @param deptId 部门ID
      * @return 子部门数
      */
     @Override
-    public int selectNormalChildrenDeptById(Long deptId)
-    {
+    public int selectNormalChildrenDeptById(Long deptId) {
         return deptMapper.selectNormalChildrenDeptById(deptId);
     }
 
     /**
      * 是否存在子节点
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果
      */
     @Override
-    public boolean hasChildByDeptId(Long deptId)
-    {
+    public boolean hasChildByDeptId(Long deptId) {
         int result = deptMapper.hasChildByDeptId(deptId);
         return result > 0;
     }
 
     /**
      * 查询部门是否存在用户
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果 true 存在 false 不存在
      */
     @Override
-    public boolean checkDeptExistUser(Long deptId)
-    {
+    public boolean checkDeptExistUser(Long deptId) {
         int result = deptMapper.checkDeptExistUser(deptId);
         return result > 0;
     }
 
     /**
      * 校验部门名称是否唯一
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
     @Override
-    public boolean checkDeptNameUnique(SysDept dept)
-    {
+    public boolean checkDeptNameUnique(SysDept dept) {
         Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
         SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
-        if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -184,19 +172,16 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 校验部门是否有数据权限
-     * 
+     *
      * @param deptId 部门id
      */
     @Override
-    public void checkDeptDataScope(Long deptId)
-    {
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
-        {
+    public void checkDeptDataScope(Long deptId) {
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
             SysDept dept = new SysDept();
             dept.setDeptId(deptId);
             List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
-            if (StringUtils.isEmpty(depts))
-            {
+            if (StringUtils.isEmpty(depts)) {
                 throw new ServiceException("没有权限访问部门数据!");
             }
         }
@@ -204,17 +189,15 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 新增保存部门信息
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
     @Override
-    public int insertDept(SysDept dept)
-    {
+    public int insertDept(SysDept dept) {
         SysDept info = deptMapper.selectDeptById(dept.getParentId());
         // 如果父节点不为正常状态,则不允许新增子节点
-        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
-        {
+        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
             throw new ServiceException("部门停用,不允许新增");
         }
         dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
@@ -223,17 +206,15 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 修改保存部门信息
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
     @Override
-    public int updateDept(SysDept dept)
-    {
+    public int updateDept(SysDept dept) {
         SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
         SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());
-        if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
-        {
+        if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
             String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
             String oldAncestors = oldDept.getAncestors();
             dept.setAncestors(newAncestors);
@@ -241,8 +222,7 @@ public class SysDeptServiceImpl implements ISysDeptService
         }
         int result = deptMapper.updateDept(dept);
         if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
-                && !StringUtils.equals("0", dept.getAncestors()))
-        {
+                && !StringUtils.equals("0", dept.getAncestors())) {
             // 如果该部门是启用状态,则启用该部门的所有上级部门
             updateParentDeptStatusNormal(dept);
         }
@@ -251,11 +231,10 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 修改该部门的父级部门状态
-     * 
+     *
      * @param dept 当前部门
      */
-    private void updateParentDeptStatusNormal(SysDept dept)
-    {
+    private void updateParentDeptStatusNormal(SysDept dept) {
         String ancestors = dept.getAncestors();
         Long[] deptIds = Convert.toLongArray(ancestors);
         deptMapper.updateDeptStatusNormal(deptIds);
@@ -263,48 +242,41 @@ public class SysDeptServiceImpl implements ISysDeptService
 
     /**
      * 修改子元素关系
-     * 
-     * @param deptId 被修改的部门ID
+     *
+     * @param deptId       被修改的部门ID
      * @param newAncestors 新的父ID集合
      * @param oldAncestors 旧的父ID集合
      */
-    public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors)
-    {
+    public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
         List<SysDept> children = deptMapper.selectChildrenDeptById(deptId);
-        for (SysDept child : children)
-        {
+        for (SysDept child : children) {
             child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
         }
-        if (children.size() > 0)
-        {
+        if (children.size() > 0) {
             deptMapper.updateDeptChildren(children);
         }
     }
 
     /**
      * 删除部门管理信息
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果
      */
     @Override
-    public int deleteDeptById(Long deptId)
-    {
+    public int deleteDeptById(Long deptId) {
         return deptMapper.deleteDeptById(deptId);
     }
 
     /**
      * 递归列表
      */
-    private void recursionFn(List<SysDept> list, SysDept t)
-    {
+    private void recursionFn(List<SysDept> list, SysDept t) {
         // 得到子节点列表
         List<SysDept> childList = getChildList(list, t);
         t.setChildren(childList);
-        for (SysDept tChild : childList)
-        {
-            if (hasChild(list, tChild))
-            {
+        for (SysDept tChild : childList) {
+            if (hasChild(list, tChild)) {
                 recursionFn(list, tChild);
             }
         }
@@ -313,15 +285,12 @@ public class SysDeptServiceImpl implements ISysDeptService
     /**
      * 得到子节点列表
      */
-    private List<SysDept> getChildList(List<SysDept> list, SysDept t)
-    {
+    private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
         List<SysDept> tlist = new ArrayList<SysDept>();
         Iterator<SysDept> it = list.iterator();
-        while (it.hasNext())
-        {
+        while (it.hasNext()) {
             SysDept n = (SysDept) it.next();
-            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
-            {
+            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
                 tlist.add(n);
             }
         }
@@ -331,8 +300,7 @@ public class SysDeptServiceImpl implements ISysDeptService
     /**
      * 判断是否有子节点
      */
-    private boolean hasChild(List<SysDept> list, SysDept t)
-    {
+    private boolean hasChild(List<SysDept> list, SysDept t) {
         return getChildList(list, t).size() > 0 ? true : false;
     }
 }

+ 8 - 0
lzga-ui/src/api/doc/msg.js

@@ -42,3 +42,11 @@ export function delMsg(msgId) {
     method: 'delete'
   })
 }
+
+// 查询部门下拉树结构
+export function deptTreeSelect() {
+  return request({
+    url: '/system/user/deptTree',
+    method: 'get'
+  })
+}

+ 219 - 276
lzga-ui/src/views/doc/msg/index.vue

@@ -1,53 +1,8 @@
 <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="createBy">
-        <el-input
-          v-model="queryParams.createBy"
-          placeholder="请输入创建人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createTime">
-        <el-date-picker clearable
-          v-model="queryParams.createTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="请选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="更新人" prop="updateBy">
-        <el-input
-          v-model="queryParams.updateBy"
-          placeholder="请输入更新人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="更新时间" prop="updateTime">
-        <el-date-picker clearable
-          v-model="queryParams.updateTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="请选择更新时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="备注" prop="remark">
-        <el-input
-          v-model="queryParams.remark"
-          placeholder="请输入备注"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="逻辑删除标志;1/非1" prop="isDel">
-        <el-input
-          v-model="queryParams.isDel"
-          placeholder="请输入逻辑删除标志;1/非1"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="通知" prop="msgTitle">
+        <el-input v-model="queryParams.msgTitle" placeholder="请输入通知标题" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -57,114 +12,57 @@
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['doc:msg:add']"
-        >新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['doc:msg:add']">新增</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="['doc:msg:edit']"
-        >修改</el-button>
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
+          v-hasPermi="['doc:msg: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="['doc:msg: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="['doc:msg:export']"
-        >导出</el-button>
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+          v-hasPermi="['doc:msg:remove']">删除</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="msgList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="消息ID" align="center" prop="msgId" />
-      <el-table-column label="消息类型;1.通知 2.消息" align="center" prop="msgType" />
-      <el-table-column label="消息内容" align="center" prop="msgContent" />
-      <el-table-column label="接收对象类型;1.全部 2.按部门 3.按人员" align="center" prop="msgAcceptType" />
-      <el-table-column label="已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔" align="center" prop="msgAcceptSelect" />
-      <el-table-column label="创建人" align="center" prop="createBy" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="更新人" align="center" prop="updateBy" />
-      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="逻辑删除标志;1/非1" align="center" prop="isDel" />
+      <el-table-column label="通知标题" align="center" prop="msgTitle" />
+      <el-table-column label="通知内容" align="center" prop="msgContent" />
+      <el-table-column label="发布时间" align="center" prop="createTime" />
       <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="['doc:msg:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['doc:msg:remove']"
-          >删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+            v-hasPermi="['doc:msg:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+            v-hasPermi="['doc:msg: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"
-    />
 
-    <!-- 添加或修改系统消息对话框 -->
+    <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="消息内容">
-          <editor v-model="form.msgContent" :min-height="192"/>
-        </el-form-item>
-        <el-form-item label="已选择的接收对象;只存按部门选择的部门ID,以英文逗号分隔" prop="msgAcceptSelect">
-          <el-input v-model="form.msgAcceptSelect" type="textarea" placeholder="请输入内容" />
+        <el-form-item label="通知标题" prop="msgTitle">
+          <el-input v-model="form.msgTitle" placeholder="请输入通知标题" />
         </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
+        <el-form-item label="接收对象" prop="msgAcceptSelect">
+          <treeselect v-model="form.msgAcceptList" :multiple="true" :options="deptOptions" :show-count="true"
+            :disable-branch-nodes="false" placeholder="请选择部门"></treeselect>
         </el-form-item>
-        <el-form-item label="逻辑删除标志;1/非1" prop="isDel">
-          <el-input v-model="form.isDel" placeholder="请输入逻辑删除标志;1/非1" />
+        <el-form-item label="通知内容">
+          <editor v-model="form.msgContent" :min-height="192" />
         </el-form-item>
+        <!-- <el-form-item label="接收对象" prop="msgAcceptSelect">
+          <el-input v-model="form.msgAcceptSelect" type="textarea" placeholder="请输入内容" />
+        </el-form-item> -->
+        <!-- <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item> -->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -175,155 +73,200 @@
 </template>
 
 <script>
-import { listMsg, getMsg, delMsg, addMsg, updateMsg } from "@/api/doc/msg";
+  import {
+    listMsg,
+    getMsg,
+    delMsg,
+    addMsg,
+    updateMsg,
+    deptTreeSelect
+  } from "@/api/doc/msg";
+  import Treeselect from "@riophae/vue-treeselect";
+  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
-export default {
-  name: "Msg",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 系统消息表格数据
-      msgList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        msgType: null,
-        msgContent: null,
-        msgAcceptType: null,
-        msgAcceptSelect: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null,
-        remark: null,
-        isDel: null
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询系统消息列表 */
-    getList() {
-      this.loading = true;
-      listMsg(this.queryParams).then(response => {
-        this.msgList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+  export default {
+    name: "Msg",
+    dicts: ['msg_type'],
+    components: {
+      Treeselect
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        msgId: null,
-        msgType: null,
-        msgContent: null,
-        msgAcceptType: null,
-        msgAcceptSelect: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null,
-        remark: null,
-        isDel: null
+    data() {
+      return {
+        // 部门树选项
+        deptOptions: undefined,
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 系统通知表格数据
+        msgList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          msgTitle: null,
+          msgType: 1, //通知类型为通知
+          msgContent: null,
+          msgAcceptType: null,
+          msgAcceptSelect: null,
+          msgAcceptList: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          msgTitle: [{
+            required: true,
+            message: "通知标题不能为空",
+            trigger: "blur"
+          }],
+          msgType: [{
+            required: true,
+            message: "通知类型不能为空",
+            trigger: "change"
+          }],
+          msgContent: [{
+            required: true,
+            message: "通知内容不能为空",
+            trigger: "blur"
+          }],
+          msgAcceptType: [{
+            required: true,
+            message: "对象类型不能为空",
+            trigger: "change"
+          }],
+        },
       };
-      this.resetForm("form");
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
+    created() {
       this.getList();
+      this.getDeptTree();
     },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.msgId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加系统消息";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const msgId = row.msgId || this.ids
-      getMsg(msgId).then(response => {
-        this.form = response.data;
+    methods: {
+      /** 查询系统通知列表 */
+      getList() {
+        this.loading = true;
+        listMsg(this.queryParams).then(response => {
+          this.msgList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      /** 查询部门下拉树结构 */
+      getDeptTree() {
+        deptTreeSelect().then(response => {
+          this.deptOptions = response.data;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          msgId: null,
+          msgTitle: null,
+          msgType: 1, //通知类型为通知
+          msgContent: null,
+          msgAcceptType: null,
+          msgAcceptSelect: null,
+          msgAcceptList: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: 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.msgId)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
         this.open = true;
-        this.title = "修改系统消息";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.msgId != null) {
-            updateMsg(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addMsg(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+        this.title = "添加通知";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const msgId = row.msgId || this.ids
+        getMsg(msgId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改通知";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.msgId != null) {
+              updateMsg(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addMsg(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
           }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const msgIds = row.msgId || this.ids;
-      this.$modal.confirm('是否确认删除系统消息编号为"' + msgIds + '"的数据项?').then(function() {
-        return delMsg(msgIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('doc/msg/export', {
-        ...this.queryParams
-      }, `msg_${new Date().getTime()}.xlsx`)
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const msgIds = row.msgId || this.ids;
+        this.$modal.confirm('是否确认删除系统通知编号为"' + msgIds + '"的数据项?').then(function() {
+          return delMsg(msgIds);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        this.download('doc/msg/export', {
+          ...this.queryParams
+        }, `msg_${new Date().getTime()}.xlsx`)
+      }
     }
-  }
-};
+  };
 </script>

+ 278 - 0
lzga-ui/src/views/doc/msg/msg.vue

@@ -0,0 +1,278 @@
+<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="msgTitle">
+        <el-input v-model="queryParams.msgTitle" placeholder="请输入消息标题" clearable @keyup.enter.native="handleQuery" />
+      </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-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['doc:msg:add']">新增</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="['doc:msg: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="['doc:msg:remove']">删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="msgList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="消息标题" align="center" prop="msgTitle" />
+      <el-table-column label="消息内容" align="center" prop="msgContent" />
+      <el-table-column label="发布时间" align="center" prop="createTime" />
+      <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="['doc:msg:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+            v-hasPermi="['doc:msg: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="msgTitle">
+          <el-input v-model="form.msgTitle" placeholder="请输入消息标题" />
+        </el-form-item>
+        <el-form-item label="消息内容">
+          <editor v-model="form.msgContent" :min-height="192" />
+        </el-form-item>
+        <el-form-item label="对象类型" prop="msgAcceptType">
+          <el-select v-model="form.msgAcceptType" placeholder="请选择对象类型">
+            <el-option v-for="dict in dict.type.msg_type" :key="dict.value" :label="dict.label"
+              :value="dict.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="接收对象" prop="msgAcceptSelect">
+          <el-input v-model="form.msgAcceptSelect" type="textarea" placeholder="请输入内容" />
+        </el-form-item> -->
+        <el-form-item label="接收对象" prop="msgAcceptSelect">
+          <treeselect v-model="form.msgAcceptList" :multiple="true" :options="deptOptions" :show-count="true"
+            :disable-branch-nodes="false" placeholder="请选择部门"></treeselect>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" 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>
+  </div>
+</template>
+
+<script>
+  import {
+    listMsg,
+    getMsg,
+    delMsg,
+    addMsg,
+    updateMsg,
+    deptTreeSelect
+  } from "@/api/doc/msg";
+  import Treeselect from "@riophae/vue-treeselect";
+  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+  export default {
+    name: "Msg",
+    dicts: ['msg_type'],
+    components: {
+      Treeselect
+    },
+    data() {
+      return {
+        // 部门树选项
+        deptOptions: undefined,
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 系统消息表格数据
+        msgList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          msgTitle: null,
+          msgType: 2, //消息类型为消息
+          msgContent: null,
+          msgAcceptType: null,
+          msgAcceptSelect: null,
+          msgAcceptList: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          msgTitle: [{
+            required: true,
+            message: "消息标题不能为空",
+            trigger: "blur"
+          }],
+          msgType: [{
+            required: true,
+            message: "消息类型不能为空",
+            trigger: "change"
+          }],
+          msgContent: [{
+            required: true,
+            message: "消息内容不能为空",
+            trigger: "blur"
+          }],
+          msgAcceptType: [{
+            required: true,
+            message: "对象类型不能为空",
+            trigger: "change"
+          }],
+        },
+      };
+    },
+    created() {
+      this.getList();
+      this.getDeptTree();
+    },
+    methods: {
+      /** 查询系统消息列表 */
+      getList() {
+        this.loading = true;
+        listMsg(this.queryParams).then(response => {
+          this.msgList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      /** 查询部门下拉树结构 */
+      getDeptTree() {
+        deptTreeSelect().then(response => {
+          this.deptOptions = response.data;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          msgId: null,
+          msgTitle: null,
+          msgType: 2, //消息类型为消息
+          msgContent: null,
+          msgAcceptType: null,
+          msgAcceptSelect: null,
+          msgAcceptList: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: 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.msgId)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        this.open = true;
+        this.title = "添加系统消息";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const msgId = row.msgId || this.ids
+        getMsg(msgId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改系统消息";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.msgId != null) {
+              updateMsg(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addMsg(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const msgIds = row.msgId || this.ids;
+        this.$modal.confirm('是否确认删除系统消息编号为"' + msgIds + '"的数据项?').then(function() {
+          return delMsg(msgIds);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        this.download('doc/msg/export', {
+          ...this.queryParams
+        }, `msg_${new Date().getTime()}.xlsx`)
+      }
+    }
+  };
+</script>

+ 3 - 3
lzga-ui/src/views/doc/msgAccepter/index.vue

@@ -57,7 +57,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="消息ID" align="center" prop="msgId" />
       <el-table-column label="用户ID" align="center" prop="userId" />
-      <el-table-column label="已读状态;1.已读 非1.未读" align="center" prop="msgStatus" />
+      <el-table-column label="已读状态" align="center" prop="msgStatus" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -77,7 +77,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -233,4 +233,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 1 - 2
lzga-ui/vue.config.js

@@ -36,8 +36,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://192.168.188.99:8080`,
-        // target: `http://localhost:8080`,
-        target: `http://192.168.1.13:8080`,
+        target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''