Sfoglia il codice sorgente

作者:张哲
时间:2023/08/18
类型:修改
描述:3.知识仓库分类和审核流程增加维护人功能(返回值增加维护人和创建人姓名)

zizg 1 anno fa
parent
commit
56295da736

+ 8 - 0
src/main/java/com/redxun/knowledge/entity/vo/KnowledgeApprovalNodeFlowerVo.java

@@ -26,4 +26,12 @@ public class KnowledgeApprovalNodeFlowerVo implements Serializable {
     private List<String> categoryName;
 
     private List<KnowledgeApprovalNodeVo> knowledgeApprovalNode;
+
+    private String createBy;
+
+    private String maintainer;
+
+    private String createByName;
+
+    private String maintainerName;
 }

+ 6 - 0
src/main/java/com/redxun/knowledge/entity/vo/KnowledgeCategoryAdminVo.java

@@ -35,6 +35,8 @@ public class KnowledgeCategoryAdminVo implements Serializable {
     private Integer isSys;
     //操作人
     private String updateBy;
+    private String createBy;
+    private String maintainer;
     //操作时间
     @DateTimeFormat(
             pattern = "yyyy-MM-dd HH:mm:ss"
@@ -56,4 +58,8 @@ public class KnowledgeCategoryAdminVo implements Serializable {
 
     // 操作人姓名
     private String operatorName;
+
+    private String createByName;
+
+    private String maintainerName;
 }

+ 6 - 0
src/main/java/com/redxun/knowledge/service/KnowledgeApprovalNodeServiceImpl.java

@@ -7,6 +7,7 @@ import com.redxun.common.base.db.BaseDao;
 import com.redxun.common.base.db.BaseService;
 import com.redxun.common.base.db.PageHelper;
 import com.redxun.common.base.search.QueryFilter;
+import com.redxun.common.model.JPaasUser;
 import com.redxun.common.service.impl.SuperServiceImpl;
 import com.redxun.common.tool.StringUtils;
 import com.redxun.knowledge.common.UserService;
@@ -189,6 +190,11 @@ public class KnowledgeApprovalNodeServiceImpl extends SuperServiceImpl<Knowledge
                     category.add(knowledgeCategory.getName());
                 }
             });
+            e.setCreateByName(userService.queryUser(e.getCreateBy()).getFullName());
+            JPaasUser jPaasUser = userService.queryUser(e.getMaintainer());
+            if (jPaasUser != null){
+                e.setMaintainerName(jPaasUser.getFullName());
+            }
             e.setCategoryName(category);
         });
         return result;

+ 19 - 2
src/main/java/com/redxun/knowledge/service/KnowledgeCategoryServiceImpl.java

@@ -7,6 +7,7 @@ import com.redxun.common.base.db.BaseDao;
 import com.redxun.common.base.db.BaseService;
 import com.redxun.common.base.db.PageHelper;
 import com.redxun.common.base.search.QueryFilter;
+import com.redxun.common.model.JPaasUser;
 import com.redxun.common.service.impl.SuperServiceImpl;
 import com.redxun.common.tool.BeanUtil;
 import com.redxun.common.tool.IdGenerator;
@@ -113,7 +114,9 @@ public class KnowledgeCategoryServiceImpl extends SuperServiceImpl<KnowledgeCate
                 } else {
                     e.setChildren(childrens);
                     childrens.forEach(h -> {
-                        h.setOperatorName(userService.queryUser(h.getUpdateBy()).getFullName());
+                        //h.setOperatorName(userService.queryUser(h.getUpdateBy()).getFullName());
+                        //h.setCreateByName(userService.queryUser(h.getCreateBy()).getFullName());
+                        //h.setMaintainerName(userService.queryUser(h.getMaintainer()).getFullName());
                         // 把孩子节点放入集合中
                         childrenList.add(h.getPkId());
                     });
@@ -127,12 +130,21 @@ public class KnowledgeCategoryServiceImpl extends SuperServiceImpl<KnowledgeCate
             knowledgeCategoryList.forEach(e -> {
                 e.setLevel(1);
                 e.setOperatorName(userService.queryUser(e.getUpdateBy()).getFullName());
+                e.setCreateByName(userService.queryUser(e.getCreateBy()).getFullName());
+                JPaasUser jPaasUser = userService.queryUser(e.getMaintainer());
+                if (jPaasUser != null){
+                    e.setMaintainerName(jPaasUser.getFullName());
+                }
                 List<KnowledgeCategoryAdminVo> childrens = findChildrens(e,userId);
                 if (childrens.size() == 0) {
                     e.setChildren(null);
                 } else {
                     e.setChildren(childrens);
-                    childrens.forEach(h -> h.setOperatorName(userService.queryUser(h.getUpdateBy()).getFullName()));
+                    //childrens.forEach(h -> {
+                    //    h.setOperatorName(userService.queryUser(h.getUpdateBy()).getFullName());
+                    //    h.setCreateByName(userService.queryUser(h.getCreateBy()).getFullName());
+                    //    h.setMaintainerName(userService.queryUser(h.getMaintainer()).getFullName());
+                    //});
                 }
             });
             page.setRecords(knowledgeCategoryList);
@@ -299,6 +311,11 @@ public class KnowledgeCategoryServiceImpl extends SuperServiceImpl<KnowledgeCate
                 sorted(Comparator.comparingInt(KnowledgeCategoryAdminVo::getSort)).
                 map(e -> {
                     e.setOperatorName(userService.queryUser(e.getUpdateBy()).getFullName());
+                    e.setCreateByName(userService.queryUser(e.getCreateBy()).getFullName());
+                    JPaasUser jPaasUser = userService.queryUser(e.getMaintainer());
+                    if (jPaasUser != null){
+                        e.setMaintainerName(jPaasUser.getFullName());
+                    }
                     return e;
                 }).
                 collect(Collectors.toList());

+ 5 - 1
src/main/resources/mapper/knowledge/KnowledgeApprovalNodeFlowerMapper.xml

@@ -30,6 +30,8 @@
     <resultMap id="findAllNodes" type="com.redxun.knowledge.entity.vo.KnowledgeApprovalNodeFlowerVo">
         <id property="pkId" column="pkId"/>
         <result property="flowerName" column="flowerName"/>
+        <result property="createBy" column="flowerCreateBy"/>
+        <result property="maintainer" column="maintainer"/>
         <collection property="category" ofType="string">
             <constructor>
                 <arg column="categoryId"/>
@@ -53,7 +55,9 @@
                node.APPROVER_NAME approverName,
                node.IS_FINAL isFinal,
                node.APPROVER_ID approverId,
-               category.CATEGORY_ID as categoryId
+               category.CATEGORY_ID as categoryId,
+               MAINTAINER as maintainer,
+               flower.CREATE_BY_ as flowerCreateBy
         from KM_KNOWLEDGE_APPROVAL_NODE_FLOWER flower
                  left join KM_KNOWLEDGE_APPROVAL_NODE node
                            on flower.PK_ID = node.FLOWER_ID and node.IS_DEL = 0

+ 1 - 1
src/main/resources/mapper/knowledge/KnowledgeCategoryMapper.xml

@@ -20,7 +20,7 @@
 
     <sql id="COLUMNS">
         PK_ID,PARENT,NAME,SORT,IS_SYS,IS_DEL,COMPANY_ID_,
-        CREATE_DEP_ID_,TENANT_ID_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_
+        CREATE_DEP_ID_,TENANT_ID_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,MAINTAINER
     </sql>