瀏覽代碼

调整消息管理和通知管理相关功能。

wukai 2 年之前
父節點
當前提交
d499a038d9

+ 1 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocMsgController.java

@@ -47,6 +47,7 @@ public class DocMsgController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(DocMsg docMsg) {
         startPage();
+        docMsg.setCreated(SecurityUtils.getUserId());
         List<DocMsg> list = docMsgService.selectDocMsgList(docMsg);
         return getDataTable(list);
     }

+ 14 - 9
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/ElasticSearchController.java

@@ -214,17 +214,22 @@ public class ElasticSearchController {
 //            分组暂时没想好怎么做
         }
         esConfig.setIndexName(indexName);
-        List<SearchHit<EsDocInfo>> all = esDocInfoService.findByContent(content, PageRequest.of(page, size));
-        for (SearchHit<EsDocInfo> re : all) {
-            EsDocInfo esDocInfo = re.getContent();
-            DocInfo docInfo = new DocInfo();
-            docInfo.setDocId(esDocInfo.getId());
-            docInfo.setCreateYear(esDocInfo.getYear());
-            docInfo = infoService.selectDocInfoByDocInfo(docInfo);
-            esDocInfo.setInfo(docInfo);
+        try {
+            List<SearchHit<EsDocInfo>> all = esDocInfoService.findByContent(content, PageRequest.of(page, size));
+            for (SearchHit<EsDocInfo> re : all) {
+                EsDocInfo esDocInfo = re.getContent();
+                DocInfo docInfo = new DocInfo();
+                docInfo.setDocId(esDocInfo.getId());
+                docInfo.setCreateYear(esDocInfo.getYear());
+                docInfo = infoService.selectDocInfoByDocInfo(docInfo);
+                esDocInfo.setInfo(docInfo);
 //            re.getContent().
+            }
+            return JSON.toJSONString(all);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
         }
-        return JSON.toJSONString(all);
     }
 
     /**

+ 12 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/domain/DocMsg.java

@@ -55,6 +55,18 @@ public class DocMsg extends BaseEntity {
      */
     @TableField(exist = false)
     private String[] msgAcceptList;
+    /**
+     * 创建人
+     */
+    private Long created;
+
+    public Long getCreated() {
+        return created;
+    }
+
+    public void setCreated(Long created) {
+        this.created = created;
+    }
 
     /**
      * 逻辑删除标志;1/非1

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

@@ -59,6 +59,7 @@ public class DocMsgServiceImpl implements IDocMsgService {
     @Override
     public int insertDocMsg(DocMsg docMsg) {
         docMsg.setCreateTime(DateUtils.getNowDate());
+        docMsg.setCreated(SecurityUtils.getUserId());
         docMsg.setCreateBy(SecurityUtils.getUsername());
         combo(docMsg);
         return docMsgMapper.insertDocMsg(docMsg);

+ 5 - 0
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocMsgMapper.xml

@@ -12,6 +12,7 @@
         <result property="msgAcceptType" column="MSG_ACCEPT_TYPE"/>
         <result property="msgAcceptSelect" column="MSG_ACCEPT_SELECT"/>
         <result property="createBy" column="CREATE_BY"/>
+        <result property="created" column="CREATED"/>
         <result property="createTime" column="CREATE_TIME"/>
         <result property="updateBy" column="UPDATE_BY"/>
         <result property="updateTime" column="UPDATE_TIME"/>
@@ -26,6 +27,7 @@
                MSG_CONTENT,
                MSG_ACCEPT_TYPE,
                MSG_ACCEPT_SELECT,
+               CREATED,
                CREATE_BY,
                CREATE_TIME,
                UPDATE_BY,
@@ -45,6 +47,7 @@
             <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="created != null  and created != ''">and CREATED = #{created}</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>
@@ -76,6 +79,7 @@
             <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="created != null">CREATED,</if>
             <if test="createBy != null">CREATE_BY,</if>
             <if test="createTime != null">CREATE_TIME,</if>
             <if test="updateBy != null">UPDATE_BY,</if>
@@ -89,6 +93,7 @@
             <if test="msgContent != null and msgContent != ''">#{msgContent},</if>
             <if test="msgAcceptType != null and msgAcceptType != ''">#{msgAcceptType},</if>
             <if test="msgAcceptSelect != null">#{msgAcceptSelect},</if>
+            <if test="created != null">#{created},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>

+ 33 - 37
lzga-ui/src/views1/Personal/Messages/MessagesView.vue

@@ -38,7 +38,7 @@
                 >
               </el-form-item>
             </el-form>
-  
+
             <el-row :gutter="10" class="mb8">
               <el-col :span="1.5">
                 <el-button
@@ -47,7 +47,6 @@
                   icon="el-icon-plus"
                   size="mini"
                   @click="handleAdd"
-                  v-hasPermi="['doc:msg:add']"
                   >新增</el-button
                 >
               </el-col>
@@ -59,7 +58,6 @@
                   size="mini"
                   :disabled="single"
                   @click="handleUpdate"
-                  v-hasPermi="['doc:msg:edit']"
                   >修改</el-button
                 >
               </el-col>
@@ -71,7 +69,6 @@
                   size="mini"
                   :disabled="multiple"
                   @click="handleDelete"
-                  v-hasPermi="['doc:msg:remove']"
                   >删除</el-button
                 >
               </el-col>
@@ -80,7 +77,7 @@
                 @queryTable="getList"
               ></right-toolbar>
             </el-row>
-  
+
             <el-table
               v-loading="loading"
               :data="msgList"
@@ -93,7 +90,7 @@
               <el-button size="small" @click="looks(scope.row)">查看</el-button>
               </template>
               </el-table-column>
-              
+
               <el-table-column
                 label="发布时间"
                 align="center"
@@ -125,7 +122,7 @@
                 </template>
               </el-table-column>
             </el-table>
-  
+
             <pagination
               v-show="total > 0"
               :total="total"
@@ -133,7 +130,7 @@
               :limit.sync="queryParams.pageSize"
               @pagination="getList"
             />
-  
+
             <!-- 添加或修改系统通知对话框 -->
             <el-dialog
               :title="title"
@@ -149,7 +146,7 @@
            <el-form-item label="消息内容">
              <textarea v-model="form.msgContent" cols="50px" rows="17px" style="background: transparent; color: #7ea4c8ff;border: 1px solid #006c9aff;">
 
-             </textarea>  
+             </textarea>
               </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -157,7 +154,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
             </el-dialog>
-  
+
             <!-- 通知内容 -->
             <el-dialog
               title="通知内容"
@@ -166,7 +163,7 @@
               custom-class="el-dialog6"
             >
               <div class="main" v-html="details">
-              
+
               </div>
               <span slot="footer" class="dialog-footer1">
                 <el-button type="primary" @click="look1 = false">确 定</el-button>
@@ -178,10 +175,10 @@
       </div>
     </div>
   </template>
-      
+
       <script>
   import "@/styles1/element-ui1.scss";
-  
+
   import {
     listMsg,
     getMsg,
@@ -189,7 +186,7 @@
     addMsg,
     updateMsg
   } from "@/api/doc/msg";
-  
+
   export default {
     name: "Msg",
     data() {
@@ -198,7 +195,7 @@
         look1: false,
         //通知内容
         details:"",
-  
+
        // 部门树选项
        deptOptions: undefined,
         // 遮罩层
@@ -369,7 +366,7 @@
     },
   };
   </script>
-      
+
       <style scoped lang='scss'>
   .containe {
     color: #7ea4c8;
@@ -456,19 +453,19 @@
           background: #016c9aa6;
           color: #2e8aec;
         }
-  
+
         ::v-deep .el-table tr {
           background: transparent;
         }
-  
+
         ::v-deep .el-table tbody tr:hover > td {
           background-color: #016c9a78 !important;
         }
-  
+
         ::v-deep .el-table td.el-table__cell {
           border-bottom: 1px solid #006c9aff;
         }
-  
+
         ::v-deep .el-table th.el-table__cell.is-leaf {
           border-bottom: 1px solid #006c9aff;
         }
@@ -500,32 +497,32 @@
       }
     }
   }
-  
+
   //新增/修改弹窗样式
   ::v-deep .el-dialog__title {
     color: white;
   }
-  
+
   ::v-deep .el-dialog .el-form-item {
     margin-top: calc(100vw * (30 / 1920));
   }
-  
+
   ::v-deep .el-upload-list__item:hover {
     background: #002659ff;
   }
-  
+
   //弹窗底部按钮的位置
   ::v-deep .el-dialog__footer {
     padding: 0;
   }
-  
+
   //弹窗关闭按钮
   ::v-deep .el-dialog__headerbtn {
     top: calc(100vh * (45 / 1080));
     right: calc(100vw * (20 / 1920));
     font-size: 20px;
   }
-  
+
   ::v-deep .el-dialog5 {
     width: calc(100vw * (800 / 1920)) !important;
     height: calc(100vh * (950 / 1080)) !important;
@@ -535,7 +532,7 @@
     ::v-deep .el-dialog:not(.is-fullscreen) {
       margin-top: 2vh !important;
     }
-  
+
     //弹窗中间内容
     .el-dialog__body {
       // width: calc(100vw * (620 / 1920)) ;
@@ -545,28 +542,28 @@
       padding-right: 50px;
       overflow: auto;
     }
-  
+
     .el-dialog__header {
       padding-bottom: 0;
     }
     .el-form-item__label {
       color: #2e8aecff;
     }
-  
+
     .el-upload__tip {
       font-size: 12px;
       color: #006c9aff;
       margin-top: 0px;
     }
-  
+
     .el-upload-list__item {
       margin: 0;
     }
-  
+
     .el-tag + .el-tag {
       margin-left: 10px;
     }
-  
+
     .button-new-tag {
       margin-left: 10px;
       height: 32px;
@@ -574,7 +571,7 @@
       padding-top: 0;
       padding-bottom: 0;
     }
-  
+
     .input-new-tag {
       width: 90px;
       margin-left: 10px;
@@ -630,7 +627,6 @@
     }
   }
   </style>
-      
-    
-    
-    
+
+
+

+ 9 - 9
lzga-ui/src/views1/Personal/Notice/NoticeView.vue

@@ -61,11 +61,11 @@
               <el-form-item label="通知标题" prop="msgTitle">
                 <el-input v-model="form.msgTitle" placeholder="请输入通知标题" />
               </el-form-item>
-              <el-form-item label="接收对象" prop="msgAcceptSelect">
+              <el-form-item label="接收对象" prop="msgAcceptList">
                 <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="通知内容">
+              <el-form-item label="通知内容" prop="msgContent">
                 <textarea v-model="form.msgContent" cols="50px" rows="17px"
                   style="background: transparent; color: #7ea4c8ff;border: 1px solid #006c9aff;">
 
@@ -165,22 +165,22 @@
             required: true,
             message: "通知标题不能为空",
             trigger: "blur",
-          }, ],
+          }],
           msgType: [{
             required: true,
             message: "通知类型不能为空",
             trigger: "change",
-          }, ],
+          }],
           msgContent: [{
             required: true,
             message: "通知内容不能为空",
             trigger: "blur",
-          }, ],
-          msgAcceptType: [{
+          }],
+          msgAcceptList: [{
             required: true,
-            message: "对象类型不能为空",
+            message: "接收对象不能为空",
             trigger: "change",
-          }, ],
+          }],
         },
       };
     },
@@ -608,4 +608,4 @@
       overflow: auto;
     }
   }
-</style>
+</style>