From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 27 五月 2020 09:59:29 +0800
Subject: [PATCH] merage

---
 src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java |  200 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 181 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java b/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
index 5b11f14..0dbf36b 100644
--- a/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
+++ b/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
@@ -42,8 +42,6 @@
     @Autowired
     IMasterAuthorDetailService authorDetailService;
     @Autowired
-    ITUserRoleService userRoleService;
-    @Autowired
     ISysMenuService menuService;
     @Autowired
     ISysFieldService fieldService;
@@ -65,7 +63,15 @@
     TableInfoMapper tableInfoMapper;
     @Autowired
     RedisClient redisClient;
-
+    /**
+     *
+     * @description:  鏍规嵁鏉冮檺鑾峰彇鍒嗛〉瀵硅薄
+     * @param user 鐢ㄦ埛
+     * @param masterAuthor 鏉冮檺瀵硅薄
+     * @param maintain 鏁版嵁鐗堟湰
+     * @return: 鑾峰彇鍒嗛〉瀵硅薄
+     *
+     */
     @Override
     public Page getInitPageInfo(MasterAuthor masterAuthor, Maintain maintain, TUser user, boolean getIncrement) {
         String realRedisKey = RedisClient.getRealRedisKey(user.getUserId() + "-" + maintain.getId() + "-" + getIncrement);
@@ -116,7 +122,13 @@
         redisClient.putRedisValObj(realRedisKey, page);
         return page;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁瑙掕壊id鑾峰彇娣峰悎鍚庣殑鏉冮檺
+     * @param roleIds 瑙掕壊id
+     * @return: 娣峰悎鍚庣殑鏉冮檺
+     *
+     */
     @Override
     public HashMap<String, MasterAuthor> merageRoleAuthor(Set<String> roleIds) {
         List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds));
@@ -138,17 +150,37 @@
         }
         return resultMap;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛鑾峰彇鏈夋潈闄愮殑涓婚
+     * @param character 鐢ㄦ埛
+     * @return: 涓婚鍒楄〃
+     *
+     */
     @Override
     public List<SysMenu> getMenu(Character character) {
         return getMenu(character, false);
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛鑾峰彇鏈夋潈闄愮殑涓婚 涓嶅寘鎷埗涓婚
+     * @param character 鐢ㄦ埛
+     * @return: 涓嶅寘鎷か涓婚鐨勪富棰樺垪琛�
+     *
+     */
     @Override
     public List<SysMenu> getMenuUnParent(Character character) {
         return getMenuUnParent(character, false);
     }
 
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛鑾峰彇鏈夋潈闄愮殑涓婚 涓嶅寘鎷埗涓婚
+     * @param character 鐢ㄦ埛
+     * @param isTableMenu 鏄惁宸插瓨鍦ㄨ〃鐨勪富棰�
+     * @return: 涓嶅寘鎷か涓婚鐨勪富棰樺垪琛�
+     *
+     */
     @Override
     public List<SysMenu> getMenuUnParent(Character character, boolean isTableMenu) {
         String key = DbUtils.StrJoinLink(Constant.UnderLine,character.getId(),"menuUnParent",  String.valueOf(isTableMenu));
@@ -194,7 +226,14 @@
         redisClient.putRedisList(key, (sysMenus));
         return sysMenus;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛鑾峰彇鏈夋潈闄愮殑涓婚
+     * @param character 鐢ㄦ埛
+     * @param isTableMenu 鏄惁涓哄凡缁忕敓鎴愯〃鐨勪富棰�
+     * @return: 涓婚鍒楄〃
+     *
+     */
     @Override
     public List<SysMenu> getMenu(Character character, boolean isTableMenu) {
 
@@ -247,10 +286,27 @@
         redisClient.putRedisList(key, (sysMenus));
         return sysMenus;
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栨潈闄愬垪琛�
+     * @param characterId 鐢ㄦ埛id
+     * @param maintainField 瀛楁鐗堟湰
+     * @return: 涓嶅寘鎷か涓婚鐨勪富棰樺垪琛�
+     *
+     */
     @Override
     public List<MasterAuthor> getUserAuthor(String characterId, MaintainField maintainField) {
         return getUserAuthor(characterId, maintainField, null);
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栨潈闄愬垪琛�
+     * @param characterId 鐢ㄦ埛id
+     * @param maintainField 瀛楁鐗堟湰
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 鏉冮檺鍒楄〃
+     *
+     */
     @Override
     public List<MasterAuthor> getUserAuthor(String characterId, MaintainField maintainField, String uuid) {
         Date startDate = new Date();
@@ -305,7 +361,14 @@
         masterAuthors.addAll(groupAuthors);
         return masterAuthors;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁瑙掕壊锛屽瓧娈电増鏈幏鍙栨潈闄愬垪琛�
+     * @param characterId 瑙掕壊id
+     * @param maintainField 瀛楁鐗堟湰
+     * @return: 鏉冮檺鍒楄〃
+     *
+     */
     private List<MasterAuthor> getRoleAuthors(String characterId, MaintainField maintainField) {
         Wrapper<MasterAuthor> roleWrapper = new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).eq(MasterAuthorController.character_id, characterId);
         if (maintainField != null) {
@@ -321,10 +384,15 @@
         return selectList(roleWrapper);
     }
 
-    private List<MasterAuthor> getUserGroupAuthor(String userId, MaintainField maintainField) {
-        return getUserGroupAuthor(userId, maintainField, null);
-    }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栨潈闄愬垪琛�
+     * @param userId 鐢ㄦ埛id
+     * @param maintainField 瀛楁鐗堟湰
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 鏉冮檺鍒楄〃
+     *
+     */
         private List<MasterAuthor> getUserGroupAuthor(String userId, MaintainField maintainField, String uuid) {
         Set<String> groupIdList = DbUtils.getGroupByUser(userId, uuid);
         List<MasterAuthor> result = new ArrayList<>();
@@ -342,10 +410,27 @@
 
         return result;
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛缁勶紝瀛楁鐗堟湰鑾峰彇鏉冮檺鍒楄〃
+     * @param groupId 鐢ㄦ埛缁刬d
+     * @param maintainField 瀛楁鐗堟湰
+     * @return: 鏉冮檺鍒楄〃
+     *
+     */
     @Override
     public List<MasterAuthor> getOneGroupAuthors(String groupId, MaintainField maintainField) {
         return getOneGroupAuthors(groupId, maintainField, null);
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛缁勶紝瀛楁鐗堟湰鑾峰彇鏉冮檺鍒楄〃
+     * @param groupId 鐢ㄦ埛缁刬d
+     * @param maintainField 瀛楁鐗堟湰
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 鏉冮檺鍒楄〃
+     *
+     */
         @Override
     public List<MasterAuthor> getOneGroupAuthors(String groupId, MaintainField maintainField, String uuid) {
             Date startDate = new Date();
@@ -387,10 +472,27 @@
             }
         return groupAuthors;
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栧瓧娈靛垪琛�
+     * @param character 鐢ㄦ埛
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @Override
     public List<SysField> getField(Character character, String maintainId) {
         return getField(character, maintainId, null);
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栧瓧娈靛垪琛�
+     * @param character 鐢ㄦ埛
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 瀛楁鍒楄〃
+     *
+     */
     @Override
     public List<SysField> getField(Character character, String maintainId, String uuid) {
         String key = DbUtils.StrJoinLink(Constant.UnderLine, character.getId(),"field", maintainId);
@@ -466,7 +568,15 @@
         redisClient.putRedisList(key, ((fieldList)));
         return fieldList;
     }
-
+    /**
+     *
+     * @description:  妫�娴嬫槸鍚﹂渶瑕佺瓫閫夋暟鎹�
+     * @param character 鐢ㄦ埛
+     * @param tableName 琛ㄥ悕
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 鏄惁闇�瑕佺瓫閫夋暟鎹�
+     *
+     */
     private boolean checkUnFilterAuthor(Character character, String tableName, String uuid) {
         String key = DbUtils.StrJoinLink(Constant.UnderLine,  character.getId(),"checkUnFilterAuthor", tableName);
         String redisVal = redisClient.getRedisVal(key);
@@ -501,7 +611,14 @@
         }
 
     }
-
+    /**
+     *
+     * @description:  妫�楠岀敤鎴锋槸鍚︽嫢鏈夋暟鎹増鏈殑鏉冮檺
+     * @param character 鐢ㄦ埛
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @return: 鏄惁鏈夋潈闄�
+     *
+     */
     @Override
     public boolean checkMaintainAuthor(Character character, String maintainId) {
         return checkMaintainAuthor(character, maintainId, null);
@@ -546,11 +663,28 @@
             return true;
         }
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栫瓫閫夋潯浠�
+     * @param character 鐢ㄦ埛
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @return: 绛涢�夋潯浠�
+     *
+     */
     @Override
     public String getFilter(Character character, String maintainId) {
+
         return getFilter(character, maintainId, null);
     }
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栫瓫閫夋潯浠�
+     * @param character 鐢ㄦ埛
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @param uuid 鏃ュ織浣跨敤
+     * @return: 绛涢�夋潯浠�
+     *
+     */
     @Override
     public String getFilter(Character character, String maintainId, String uuid) {
         String key = DbUtils.StrJoinLink(Constant.UnderLine, character.getId(),"filter",maintainId);
@@ -643,7 +777,14 @@
         redisClient.putRedisVal(key, filter);
         return filter;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛鑾峰彇鏈�澶ф潈闄愮殑鏁版嵁鐗堟湰
+     * @param character 鐢ㄦ埛
+     * @param tableName 琛ㄥ悕
+     * @return: 鏈�澶ф潈闄愮殑鏁版嵁鐗堟湰
+     *
+     */
     @Override
     public Maintain getMaxVersionMaintain(Character character, String tableName) {
         List<Maintain> maintainList = maintainService.selectList(new EntityWrapper<Maintain>().eq("table_name", tableName).orderBy("order_no desc"));
@@ -659,7 +800,14 @@
         }
         return null;
     }
-
+    /**
+     *
+     * @description:  鏍规嵁鐢ㄦ埛锛屽瓧娈电増鏈幏鍙栨暟鎹増鏈垪琛�
+     * @param user 鐢ㄦ埛
+     * @param tableName 鏁版嵁鐗堟湰id
+     * @return: 鏁版嵁鐗堟湰鍒楄〃
+     *
+     */
     @Override
     public LinkedHashSet<Maintain> getMaintainSet(String tableName, TUser user) {
         List<MasterAuthor> userAuthor = this.getUserAuthor(user.getUserId(), null);
@@ -680,7 +828,14 @@
         }
         return maintainSet;
     }
-
+    /**
+     *
+     * @description:  鐢熸垚鐗堟湰鐨勯渶瑕佹娴嬪摢浜涢渶瑕佽嚜鍔ㄥ姞涓婃潈闄�
+     * @param status 娴佺▼鐘舵��
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @return:
+     *
+     */
     public void dealFlow(String maintainId, ActivitiStatus status) {
         Maintain maintain = maintainService.selectById(maintainId);
         MaintainField maintainFieldByMaintain = fieldService.getMaintainFieldByMaintain(maintainId);
@@ -696,7 +851,14 @@
         }
     }
 
-
+    /**
+     *
+     * @description:  涓や釜鏉冮檺娣峰悎
+     * @param preMerageMasterAuthor 娣峰悎鍓�
+     * @param masterAuthor 寰呮贩鍚�
+     * @return: 娣峰悎鍚庣殑鏉冮檺
+     *
+     */
     private MasterAuthor merage(MasterAuthor preMerageMasterAuthor, MasterAuthor masterAuthor) {
         // table name  masterField 涓�鏍� 鍙湁瀛楁涓嶅悓浜�
         List<MasterAuthorDetail> preFields = preMerageMasterAuthor.getFields();

--
Gitblit v1.8.0