From 7d7b42822d9a11f8fa107fc3bbbbd518f0a7ef91 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期六, 09 十一月 2024 01:17:28 +0800
Subject: [PATCH] 1、修复系统功能模块-》管理功能模块修改是否有效功能修改无效问题。 2、Action管理,Action分类删除报错问题修改。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java |  670 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 624 insertions(+), 46 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
index 3f6dd7e..aea8786 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
@@ -1,27 +1,25 @@
 package com.vci.frameworkcore.compatibility.impl;
 
-import com.vci.client.ClientSession;
-import com.vci.client.common.excel.ExcelDocumentUtils;
 import com.vci.common.exception.VciException;
 import com.vci.common.utility.ObjectUtility;
 import com.vci.corba.common.PLException;
 import com.vci.corba.common.data.UserEntityInfo;
-import com.vci.corba.framework.data.FuncOperationInfo;
-import com.vci.corba.framework.data.FunctionInfo;
-import com.vci.corba.framework.data.OperateInfo;
+import com.vci.corba.framework.data.*;
 import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI;
-import com.vci.pagemodel.MenuVO;
+import com.vci.pagemodel.*;
 import com.vci.starter.poi.bo.SheetDataSet;
 import com.vci.starter.poi.bo.SheetRowData;
 import com.vci.starter.poi.bo.WriteExcelData;
 import com.vci.starter.poi.bo.WriteExcelOption;
 import com.vci.starter.poi.util.ExcelUtil;
+import com.vci.starter.web.constant.VConstant;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.starter.web.pagemodel.SessionInfo;
 import com.vci.starter.web.util.LocalFileUtil;
 import com.vci.starter.web.util.VciBaseUtil;
 import com.vci.starter.web.util.WebThreadLocalUtil;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.util.Func;
 import com.vci.web.util.PlatformClientUtil;
 import org.slf4j.Logger;
@@ -32,6 +30,7 @@
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 棣栭〉绯荤粺妯″潡閰嶇疆娣诲姞鎸夐挳銆佹坊鍔犳搷浣滅被鍨嬬瓑鎺ュ彛鏈嶅姟
@@ -48,13 +47,22 @@
 
     private int count = 0;
 
+    /**
+     * 鍖呭惈淇濆瓨妯″潡鏂规硶绛夋搷浣滅被
+     */
     private static FunctionOperateDelegate foDelegate;
 
+    /**
+     * 鍒濆鍖杅oDelegate
+     */
     {
         if(Func.isEmpty(foDelegate)){
             foDelegate = new FunctionOperateDelegate();
         }
     }
+
+    @Autowired
+    private RedisService redisService;
 
     /**
      * 鏃ュ織
@@ -182,8 +190,8 @@
      * @return
      */
     @Override
-    public boolean addOperationType(List<FuncOperationInfo> funcOperationInfoList) {
-        VciBaseUtil.alertNotNull(funcOperationInfoList,"娣诲姞鎿嶄綔绫诲瀷鐨勫垪琛�");//灏嗘搷浣滅被鍨嬬粍瑁呮垚闇�瑕佸瓨鍌ㄧ殑瀵硅薄
+    public boolean addFuncOperationType(List<FuncOperationInfo> funcOperationInfoList) {
+        VciBaseUtil.alertNotNull(funcOperationInfoList,"娣诲姞鐨勬搷浣滅被鍨嬪垪琛�");//灏嗘搷浣滅被鍨嬬粍瑁呮垚闇�瑕佸瓨鍌ㄧ殑瀵硅薄
         List<FuncOperationInfo> objs = new ArrayList<>();
         funcOperationInfoList.stream().forEach(info -> {
             if(Func.isBlank(info.funcId)){
@@ -209,6 +217,120 @@
             throw new VciBaseException(exceptionMessage);
         }
         return res;
+    }
+
+    /**
+     * 澧炲姞鎿嶄綔绫诲瀷
+     * @return
+     */
+    @Override
+    public OperateInfo addOperationType(OperateInfo operateInfo) throws VciBaseException {
+        try {
+            //鏍¢獙
+            this.checkItem(operateInfo);
+            String s = foDelegate.saveOperate(operateInfo);
+            /**杩斿洖1琛ㄧず鍚嶇О鏈夐噸澶嶏紝杩斿洖2琛ㄧず鏍囪瘑鏈夐噸澶�,杩斿洖3琛ㄧず椤哄簭鏈夐噸澶�**/
+            if (s.equals("1")) {
+                throw new VciBaseException("鍚嶇О瀛樺湪閲嶅锛�");
+            } else if (s.equals("2")) {
+                throw new VciBaseException("鏍囪瘑瀛樺湪閲嶅锛�");
+            } else if (s.equals("3")) {
+                throw new VciBaseException("椤哄簭瀛樺湪閲嶅锛�");
+            }
+            operateInfo.id = s;
+            return operateInfo;
+        }catch (Exception e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
+    }
+
+    /**
+     * 淇敼鎿嶄綔绫诲瀷
+     * @param operateInfo
+     * @return
+     */
+    @Override
+    public OperateInfo updateOperationType(OperateInfo operateInfo) throws VciBaseException {
+        try {
+            this.checkItem(operateInfo);
+            String res = foDelegate.updateOperate(operateInfo);
+            /**杩斿洖1琛ㄧず鍚嶇О鏈夐噸澶嶏紝杩斿洖2琛ㄧず鏍囪瘑鏈夐噸澶�,杩斿洖3琛ㄧず椤哄簭鏈夐噸澶�**/
+            if (res.equals("1")) {
+                throw new VciBaseException("鍚嶇О瀛樺湪閲嶅锛�");
+            } else if (res.equals("2")) {
+                throw new VciBaseException("鏍囪瘑瀛樺湪閲嶅锛�");
+            } else if (res.equals("3")) {
+                throw new VciBaseException("椤哄簭瀛樺湪閲嶅锛�");
+            }
+            return operateInfo;
+        } catch (Exception e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
+    }
+
+    /**
+     * 鍒犻櫎鎿嶄綔绫诲瀷
+     * @param operateInfo
+     * @return
+     */
+    @Override
+    public boolean delOperationType(OperateInfo operateInfo) throws VciBaseException {
+        try {
+            /**妫�鏌ュ綋鍓嶆搷浣滄槸鍚﹁寮曠敤,0琛ㄧず鏃犲紩鐢紝1琛ㄧず琚ā鍧楀紩鐢紝2琛ㄧず宸叉湁鏉冮檺淇℃伅**/
+            int res = foDelegate.checkOperateIsReferenced(operateInfo.id);
+            if(res == 1){
+                throw new VciBaseException("褰撳墠鎿嶄綔宸茶妯″潡寮曠敤锛屽垹闄よ鎿嶄綔鐨勫悓鏃朵細灏嗗叾浠庢ā鍧椾笅绉婚櫎锛岀‘璁ゆ墽琛屽垹闄ゅ悧锛�");
+            }else if(res == 2){
+                throw new VciBaseException("褰撳墠鎿嶄綔宸茬粡鍦ㄦ潈闄愭ā鍧楄鍒嗛厤杩囨潈闄愶紝鍒犻櫎璇ユ搷浣滅殑鍚屾椂浼氬皢鍏朵粠鐢ㄦ埛鐨勬潈闄愪腑绉婚櫎锛岀‘璁ゆ墽琛屽垹闄ゅ悧锛�");
+            }
+            return foDelegate.deleteOperate(operateInfo.id);
+        } catch (VciBaseException e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
+    }
+
+    /**
+     * 鏍¢獙
+     * @param operateInfo
+     * @return
+     */
+    private void checkItem(OperateInfo operateInfo) {
+        if (Func.isBlank(operateInfo.name)) {
+            throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�");
+        }
+        if (Func.isBlank(operateInfo.identify)) {
+            throw new VciBaseException("鏍囪瘑涓嶈兘涓虹┖锛�");
+        }
+        if (Func.isBlank(operateInfo.alias)) {
+            throw new VciBaseException("鍒悕涓嶈兘涓虹┖锛�");
+        }
+        /*if (operateInfo.seq > -1){
+            throw new VciBaseException("璇疯緭鍏ユ纭殑鎿嶄綔椤哄簭鍊硷紒");
+        }*/
+        /*long seq = operateInfo.seq;
+        Pattern pattern = Pattern.compile("[0-9]*");
+        Matcher isNum = pattern.matcher(seq);
+        if( !isNum.matches() ){
+            throw new VciBaseException("鎿嶄綔鐨勯『搴忓�煎彧鑳芥槸[0-9]涔嬮棿鐨勬暟瀛�,骞朵笖蹇呴』鏄鏁存暟.\n闀垮害涓嶅厑璁歌緭鍏ュ皬鏁版垨鑰呰礋鏁�!");
+        }*/
+        if (operateInfo.name.length() > 128) {
+            throw new VciBaseException("鍚嶇О闀垮害涓嶈兘瓒呰繃128锛�");
+        }
+        if (operateInfo.desc.length() > 255) {
+            throw new VciBaseException("鎻忚堪闀垮害涓嶈兘瓒呰繃255锛�");
+        }
+        if (operateInfo.alias.length() > 128) {
+            throw new VciBaseException("鍒悕闀垮害涓嶈兘瓒呰繃255锛�");
+        }
     }
 
     /**
@@ -348,11 +470,10 @@
         boolean isSuccess = collectionDatas(files);
         logger.info("姝e湪瀵煎叆琛ㄥ崟浜哄憳淇℃伅......");
         logger.info("count==="+count);
-        boolean resBoolean = false;
         if(isSuccess == false){
-            resBoolean = importExcelData(count);
+            isSuccess = importExcelData(count);
         }
-        return resBoolean ? BaseResult.success("瀵煎叆鎴愬姛锛�"):BaseResult.fail("瀵煎叆澶辫触锛�");
+        return isSuccess ? BaseResult.success("瀵煎叆鎴愬姛锛�"):BaseResult.fail("瀵煎叆澶辫触锛�");
     }
 
     /**
@@ -360,7 +481,7 @@
      * @return
      */
     @Override
-    public boolean updateAlias(MenuVO menuVO) throws VciException {
+    public boolean updateAlias(MenuVO menuVO) throws VciBaseException {
         String alias = menuVO.getAlias();
         if ("".equals(alias)){
             throw new VciBaseException("璇峰~鍐欐搷浣滃埆鍚�!");
@@ -370,29 +491,306 @@
         return foDelegate.updateFuncOperation(id , alias, isValid);
     }
 
+    /**
+     * 鏌ヨ绯荤粺閰嶇疆鏍�
+     * @return
+     */
     @Override
-    public List<Object> getSysConfTree() {
-        return null;
+    public List<AppConfigCategoryInfo> getAppConfigCategoryInfo() {
+        try {
+            AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys();
+            return Arrays.asList(appConfigCategorys);
+        } catch (VciBaseException e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
     }
 
+    /**
+     * 鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄
+     * @return
+     */
     @Override
-    public boolean addSysConf() {
+    public List<AppConfigDetailInfo> getAppConfigDetailsByID(String clsId) {
+        try {
+            AppConfigDetailInfo[] appConfigDetailInfos = foDelegate.getAppConfigDetailsByID(clsId);
+            return Arrays.asList(appConfigDetailInfos);
+        } catch (VciBaseException e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
+    }
+
+    /**
+     * 澧炲姞閰嶇疆椤瑰垎绫绘垨閰嶇疆椤�
+     * @return
+     */
+    @Override
+    public boolean addAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) {
+        VciBaseUtil.alertNotNull(appConfigDetailInfo,"娣诲姞鐨勬搷浣滅被鍨�");
+        boolean rs = false;
+        try {
+            String id = "";
+            if(isConfCategorys){
+                AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo();
+                appConfigCategoryInfo.name = appConfigDetailInfo.name;
+                appConfigCategoryInfo.desc = appConfigDetailInfo.desc;
+                this.checkConf(appConfigCategoryInfo);
+                id = foDelegate.saveAppConfigCategory(appConfigCategoryInfo);
+            }else{
+                this.checkConfItem(appConfigDetailInfo);
+                id = foDelegate.saveAppConfigDetail(appConfigDetailInfo);
+            }
+            appConfigDetailInfo.id = id;
+            rs = true;
+        } catch (VciBaseException e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            rs = false;
+            throw new VciBaseException(exceptionMessage);
+        }
+        return rs;
+    }
+
+    /**
+     * 淇敼閰嶇疆椤瑰垎绫绘垨閰嶇疆椤�
+     * @return
+     */
+    @Override
+    public boolean updateAppConf(AppConfigDetailInfo appConfigDetailInfo,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) {
+        VciBaseUtil.alertNotNull(appConfigDetailInfo,"娣诲姞鐨勬搷浣滅被鍨�");
+        boolean rs = false;
+        try {
+            if(isConfCategorys){
+                AppConfigCategoryInfo appConfigCategoryInfo = new AppConfigCategoryInfo();
+                appConfigCategoryInfo.id = appConfigDetailInfo.id;
+                appConfigCategoryInfo.name = appConfigDetailInfo.name;
+                appConfigCategoryInfo.desc = appConfigDetailInfo.desc;
+                this.checkConf(appConfigCategoryInfo);
+                rs = foDelegate.updateAppConfigCategory(appConfigCategoryInfo);
+            }else{
+                this.checkConfItem(appConfigDetailInfo);
+                rs = foDelegate.updateAppConfigDetail(appConfigDetailInfo);
+            }
+        } catch (VciBaseException e) {
+            e.printStackTrace();
+            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+            logger.error(exceptionMessage);
+            throw new VciBaseException(exceptionMessage);
+        }
+        return rs;
+    }
+
+    /**
+     * 鍒犻櫎閰嶇疆椤瑰垎绫绘垨閰嶇疆椤�
+     * @return
+     */
+    @Override
+    public boolean delAppConf(String[] ids,boolean isConfCategorys/*鏄惁涓烘搷浣滈厤缃」鍒嗛厤*/) {
+        VciBaseUtil.alertNotNull(ids,"寰呭垹闄ょ殑涓婚敭鍒楄〃");
+        boolean res = false;
+        if(isConfCategorys){
+            if (this.hasAppConfigDetail(ids)) {
+                throw new VciBaseException("鍒犻櫎鐨勯厤缃」鍒嗙被涓嬪瓨鍦ㄥ叧鑱旀暟鎹紒");
+            }
+            res = foDelegate.deleteAppConfigCategory(ids);
+        }else {
+            res = foDelegate.deleteAppConfigDetail(ids);
+        }
+        return res;
+    }
+
+    /**
+     * 妫�鏌ユ槸鍚﹀瓨鍦ㄥ紩鐢ㄥ叧绯�
+     * @param ids
+     * @return
+     */
+    private boolean hasAppConfigDetail(final String[] ids){
+        for (int i = 0; i < ids.length; i++) {
+            AppConfigDetailInfo[] appConfigDetailsByID = foDelegate.getAppConfigDetailsByID(ids[i]);
+            if(Func.isNotEmpty(appConfigDetailsByID)){
+                return true;
+            }
+        }
         return false;
     }
 
-    @Override
-    public boolean updateSysConf() {
-        return false;
+    /**
+     * 閰嶇疆椤瑰垎绫绘牎楠�
+     * @param obj
+     */
+    private void checkConf(AppConfigCategoryInfo obj) {
+        if ("".equals(obj.name)) {
+            throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�");
+        }
     }
 
-    @Override
-    public boolean delSysConf() {
-        return false;
+    /**
+     * 閰嶇疆椤规牎楠�
+     * @param obj
+     */
+    private void checkConfItem(AppConfigDetailInfo obj) {
+        if ("".equals(obj.name)) {
+            throw new VciBaseException("鍚嶇О涓嶈兘涓虹┖锛�");
+        }
+        /*AppConfigDetailInfo[] appConfigDetailInfoByName = foDelegate.getAppConfigDetailInfoByName(obj.name);
+        if(appConfigDetailInfoByName != null && appConfigDetailInfoByName.length > 0){
+            throw new VciBaseException("閰嶇疆椤瑰悕绉伴噸澶嶏紒");
+        }*/
+        if ("".equals(obj.key)){
+            throw new VciBaseException("涓婚敭涓嶈兘涓虹┖锛�");
+        }
+        if ("".equals(obj.value)){
+            throw new VciBaseException("閿�间笉鑳戒负绌�!");
+        }
     }
 
+    /**
+     * 瀵煎嚭绯荤粺閰嶇疆
+     * @param response
+     * @return
+     */
     @Override
-    public String exportSysConf(HttpServletResponse response) {
-        return null;
+    public String exportSysConf(ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) throws IOException {
+        //璁剧疆鏂囦欢鍚嶅拰璺緞
+        String expFileName = expExcelConditionVO.getExpFileName();
+        if(Func.isNotBlank(expFileName) && expFileName.contains(".xls")){
+            throw new VciBaseException("璁剧疆鐨勬枃浠跺悕涓湭璁剧疆鏂囦欢鍚庣紑锛屾垨鍚庣紑璁剧疆鏈夎锛屽綋鍓嶄粎鏀寔瀵煎嚭.xls鏍煎紡锛�");
+        }
+        expFileName = Func.isBlank(expFileName) ? "appConfig.xls":expFileName;
+        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
+        //鍐檈xcel
+        String excelPath = defaultTempFolder + File.separator + expFileName;
+        //鍏堝垽鏂槸鍏ㄩ儴瀵煎嚭杩樻槸閫夋嫨鏁版嵁瀵煎嚭
+        Map<String, Object> conditionMap = expExcelConditionVO.getConditionMap();
+        if (Func.isEmpty(conditionMap)) {
+            throw new VciBaseException("缂哄皯蹇呰瀵煎嚭鏉′欢锛�");
+        }
+        //鎸囧畾瀵煎嚭鐨勫睘鎬у悕
+        List<String> expAttrNames = expExcelConditionVO.getExpAttrNames();
+        if(Func.isEmpty(expAttrNames)){
+            throw new VciBaseException("璇烽�夋嫨鎮ㄨ瀵煎嚭鐨勫睘鎬э紒");
+        }
+        //鍏堝尯鍒嗘槸瀵煎嚭鐨勯厤缃」鍒嗙被杩樻槸閰嶇疆椤硅鎯�
+        boolean isExpAppConfDetail = (boolean) conditionMap.get("isExpAppConfDetail");
+        //鍥犱负AppConfigDetailInfo涓殑灞炴�у寘鍚簡AppConfigCategoryInfo涓殑灞炴�ф墍浠ュ厛閫氱敤浜�
+        List<AppConfigDetailInfo> appConfigDetailInfos = new ArrayList<>();
+        //閫変腑瀵煎嚭鏁版嵁鐨勫敮涓�鏍囪瘑
+        List<String> selectDataIdentify = expExcelConditionVO.getSelectDataIdentify();
+        //褰撳墠鐣岄潰瀵煎嚭閫昏緫锛屽彧瀛樺湪鍏ㄩ儴鍜岄�夋嫨瀵煎嚭
+        String expType = expExcelConditionVO.getExpType();
+        if(!isExpAppConfDetail){
+            AppConfigCategoryInfo[] appConfigCategorys = foDelegate.getAppConfigCategorys();
+            List<AppConfigCategoryInfo> filterAppConfigInfo = null;
+            if("select".equals(expType)){
+                filterAppConfigInfo = Arrays.stream(appConfigCategorys).filter(item -> {
+                    if (selectDataIdentify.contains(item.id)) {
+                        return true;
+                    }
+                    return false;
+                }).collect(Collectors.toList());
+            }else{
+                filterAppConfigInfo = new ArrayList<>(Arrays.asList(appConfigCategorys));
+            }
+            if (Func.isNotEmpty(filterAppConfigInfo)) {
+                filterAppConfigInfo.stream().forEach(item->{
+                    AppConfigDetailInfo appConfigDetailInfo = new AppConfigDetailInfo();
+                    appConfigDetailInfo.id = item.id;
+                    appConfigDetailInfo.name = item.name;
+                    appConfigDetailInfo.desc = item.desc;
+                    appConfigDetailInfos.add(appConfigDetailInfo);
+                });
+            }
+        }else{
+            String clsId = (String)conditionMap.get("clsId");
+            if(Func.isBlank(clsId)){
+                throw new VciBaseException("鏈幏鍙栧埌鏌ヨ閰嶇疆椤圭殑閰嶇疆椤瑰垎绫讳富閿�");
+            }
+            AppConfigDetailInfo[] configDetailInfos = foDelegate.getAppConfigDetailsByID(clsId);
+            List<AppConfigDetailInfo> filterAppConfigInfo = null;
+            if("select".equals(expType)){
+                filterAppConfigInfo = Arrays.stream(configDetailInfos).filter(item -> {
+                    if (selectDataIdentify.contains(item.id)) {
+                        return true;
+                    }
+                    return false;
+                }).collect(Collectors.toList());
+            }else{
+                filterAppConfigInfo = new ArrayList<>(Arrays.asList(configDetailInfos));
+            }
+            if (Func.isNotEmpty(filterAppConfigInfo)) {
+                appConfigDetailInfos.addAll(filterAppConfigInfo);
+            }
+        }
+        //璁剧疆鍒楀悕
+        List<String> columns = new ArrayList<>();
+        //鏍规嵁瀵煎嚭鍒楄缃垪鍚�
+        Map<String,Integer> colAttrMap = new HashMap<>(); //瀵煎嚭鐨勫垪鍜屽睘鎬ф槧灏�
+        for (int i = 0; i < expAttrNames.size(); i++) {
+            String attrName = expAttrNames.get(i);
+            switch (attrName){
+                case "name":
+                    columns.add("鍚嶇О");
+                    break;
+                case "key":
+                    columns.add("key");
+                    break;
+                case "value":
+                    columns.add("value");
+                    break;
+                case "desc":
+                    columns.add("鎻忚堪");
+                    break;
+            }
+            colAttrMap.put(attrName,i);
+        }
+
+        new File(excelPath).createNewFile();
+        //璁剧疆鍒�
+        List<WriteExcelData> excelDataList = new ArrayList<>();
+        //璁剧疆鍒楀ご
+        for (int index = 0; index < columns.size(); index++) {
+            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
+        }
+        //澶勭悊鏁版嵁瀵煎嚭
+        if(Func.isEmpty(appConfigDetailInfos)){
+            excelDataList.add(new WriteExcelData(1,1, "鏈幏鍙栧埌瑕佸鍑虹殑鏁版嵁锛岃鍒锋柊鍚庡皾璇曢噸鏂板鍑猴紒"));
+        }else{
+            for (int i = 0; i < appConfigDetailInfos.size(); i++) {
+                AppConfigDetailInfo appConfigDetailInfo = appConfigDetailInfos.get(i);
+                int row = i+1;
+                if(Func.isNotEmpty(colAttrMap.get("name"))){
+                    excelDataList.add(new WriteExcelData(row,colAttrMap.get("name"), appConfigDetailInfo.name));
+                }
+                if(Func.isNotEmpty(colAttrMap.get("key"))){
+                    excelDataList.add(new WriteExcelData(row,colAttrMap.get("key"), appConfigDetailInfo.key));
+                }
+                if(Func.isNotEmpty(colAttrMap.get("value"))){
+                    excelDataList.add(new WriteExcelData(row,colAttrMap.get("value"), appConfigDetailInfo.value));
+                }
+                if(Func.isNotEmpty(colAttrMap.get("desc"))){
+                    excelDataList.add(new WriteExcelData(row,colAttrMap.get("desc"), appConfigDetailInfo.desc));
+                }
+            }
+        }
+        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
+        ExcelUtil.writeDataToFile(excelPath, excelOption);
+        return excelPath;
+    }
+
+    /**
+     * 鑾峰彇褰撳墠鍦ㄧ嚎浜烘暟
+     * @return
+     */
+    @Override
+    public long getOnlineUsersNum() {
+        long currentLoggedUserCount = redisService.getCurrentOnlineUserCount(VConstant.CURRENT_LOGGED_USERS_KEY);
+        return currentLoggedUserCount;
     }
 
     /**
@@ -428,7 +826,7 @@
                             if(oneData.get(14).equals("1")) {
                                 try {
                                     onebl = foDelegate.firstLevel(plName);
-                                } catch (VciException e) {
+                                } catch (VciBaseException e) {
                                     // TODO Auto-generated catch block
                                     e.printStackTrace();
                                 }
@@ -438,14 +836,13 @@
                                     try {
                                         fParentId = foDelegate.changeFirstLevel(funObj,plName);
                                         pd[2]=fParentId;
-                                    } catch (VciException e) {
+                                    } catch (VciBaseException e) {
                                         // TODO Auto-generated catch block
                                         e.printStackTrace();
                                     }
                                     funObj.id = fParentId;
                                     fileFunctionDatas.add(funObj);
                                     first=true;
-
 
                                 } else {
                                     funObj.id = id;
@@ -466,7 +863,7 @@
                                                 pd[jibie]="";
                                             }
                                             twobl=foDelegate.secondLevel(plName,pd[jibie]);
-                                        } catch (VciException e) {
+                                        } catch (VciBaseException e) {
                                             // TODO Auto-generated catch block
                                             e.printStackTrace();
                                         }
@@ -512,7 +909,7 @@
                                     try {
                                         OperateInfo operObj = foDelegate.fetchOperateTypeByName(oneData.get(18));
                                         foObj.operId = operObj.id;
-                                    } catch (VciException e) {
+                                    } catch (VciBaseException e) {
                                         // TODO Auto-generated catch block
                                         e.printStackTrace();
                                     }
@@ -521,7 +918,7 @@
                                     foObj.isValid = Integer.parseInt(oneData.get(17)) != 0;
                                     try {
                                         foDelegate.saveFuncOperation2(foObj);
-                                    } catch (VciException e) {
+                                    } catch (VciBaseException e) {
                                         // TODO Auto-generated catch block
                                         e.printStackTrace();
                                     }
@@ -532,7 +929,7 @@
                                     foObj.isValid = Integer.parseInt(oneData.get(17)) != 0;
                                     try {
                                         foDelegate.updateOperation(foObj,dataOperName,plFuncOid);
-                                    } catch (VciException e) {
+                                    } catch (VciBaseException e) {
                                         // TODO Auto-generated catch block
                                         e.printStackTrace();
                                     }
@@ -713,12 +1110,12 @@
          * @return
          * @throws VciException
          */
-        public boolean firstLevel(String plName) throws VciException{
+        public boolean firstLevel(String plName) throws VciBaseException{
             try{
                 return platformClientUtil.getFrameworkService().firstLevel(plName);
             }catch (PLException e) {
                 e.printStackTrace();
-                throw new VciException(String.valueOf(e.code), e.messages);
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
             }
         }
 
@@ -726,7 +1123,7 @@
          * 瑕嗙洊閲嶅悕鐨勭涓�绾ф暟鎹�
          * add by caill
          * */
-        public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciException{
+        public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciBaseException{
             String fParentId="";
             try {
                 fParentId= platformClientUtil.getFrameworkService().changeFirstLevel(functionInfo, plName);
@@ -734,7 +1131,6 @@
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             }
-
             return fParentId;
         }
 
@@ -742,12 +1138,12 @@
          * 鍒ゆ柇绗簩绾ф暟鎹湁娌℃湁閲嶅悕鐨�
          * add by caill
          * */
-        public boolean secondLevel(String plName,String fParentId) throws VciException{
+        public boolean secondLevel(String plName,String fParentId) throws VciBaseException{
             try{
                 return platformClientUtil.getFrameworkService().secondLevel(plName,fParentId);
             }catch (PLException e) {
                 e.printStackTrace();
-                throw new VciException(String.valueOf(e.code), e.messages);
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
             }
         }
 
@@ -849,7 +1245,7 @@
             //info.suffixB = object.getSuffixB() == null ? "" : object.getSuffixB();
             info.desc = object.getRemark() == null ? "" : object.getRemark();
             info.seq = object.getSort();
-            info.image = object.getSource() == null ? "" : object.getSource();
+            info.icon = object.getSource() == null ? "" : object.getSource();
             info.isValid = object.getIsValid();
             info.aliasName = object.getAlias() == null ? "" : object.getAlias();
             info.resourceDotNet = object.getResourceDotNet() == null ? "" : object.getResourceDotNet();
@@ -916,8 +1312,8 @@
             /*obj.suffixC = "";
             obj.suffixB = "";*/
             obj.seq = sequence;
-            obj.image = menuVO.getSource();
-            obj.isValid = Func.isNotEmpty(menuVO.getValid()) ? menuVO.getValid():false;
+            obj.icon = menuVO.getSource();
+            obj.isValid = Func.isNotEmpty(menuVO.getIsValid()) ? menuVO.getIsValid():false;
             obj.aliasName = aliasName;
             obj.resourceDotNet = resDotNet;
             obj.resourceMobile = resMobile;
@@ -943,7 +1339,7 @@
             int len = funObject.length;
             List<FunctionInfo> funInfoList = new ArrayList<FunctionInfo>();
             for(int i = count ; i<len ; i++){
-                if(funObject[i].parentId!=null){
+                if(Func.isNotBlank(funObject[i].parentId)){
                     FunctionInfo funInfo = funObject[i];
                     funInfoList.add(funInfo);
                 }
@@ -978,7 +1374,7 @@
             return same;
         }
 
-        public OperateInfo fetchOperateTypeByName(String name) throws VciException {
+        public OperateInfo fetchOperateTypeByName(String name) throws VciBaseException {
             try{
                 OperateInfo info =  platformClientUtil.getFrameworkService().fetchOperateTypeByName(name);
                 return info;
@@ -992,12 +1388,13 @@
          * 淇濆瓨鎿嶄綔绫诲瀷
          * add by caill
          * */
-        public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciException{
+        public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciBaseException{
             try {
                 platformClientUtil.getFrameworkService().saveFuncOperation2(funcOperationInfo,this.getUserEntityInfo());
             } catch (PLException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
             }
             return true;
         }
@@ -1006,27 +1403,208 @@
          * 瑕嗙洊鎿嶄綔绫诲瀷
          * add by caill
          * */
-        public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciException{
+        public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciBaseException{
             try {
                 platformClientUtil.getFrameworkService().updateOperation(funcOperationInfo,this.getUserEntityInfo(),dataOperName,plFuncOid);
             } catch (PLException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
             }
             return null;
         }
 
-        public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciException {
+        public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciBaseException {
             boolean res = false;
             try{
                 res = platformClientUtil.getFrameworkService().updateFuncOperation(id, alias, isSelected, this.getUserEntityInfo());
             }catch(PLException e){
-                throw new VciException(String.valueOf(e.code), e.messages);
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
             }
             return res;
         }
 
-    }
+        /**
+         * 淇濆瓨鎿嶄綔绫诲瀷
+         *
+         * @param operateInfo
+         * @return
+         * @throws VciException
+         */
+        public String saveOperate(OperateInfo operateInfo) throws VciBaseException {
+            String res = "";
+            try{
+                res = platformClientUtil.getFrameworkService().saveOperate(operateInfo,this.getUserEntityInfo());
+            }catch (PLException e) {
+                e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+            return res;
+        }
 
+        /**
+         * 淇敼鎿嶄綔绫诲瀷
+         *
+         * @param operateInfo
+         * @return
+         * @throws VciException
+         */
+        public String updateOperate(OperateInfo operateInfo) throws VciBaseException {
+            String res = "";
+            try{
+                res = platformClientUtil.getFrameworkService().updateOperate(operateInfo,this.getUserEntityInfo());
+            }catch (PLException e) {
+                e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+            return res;
+        }
+
+        /**
+         * 鍒犻櫎鎿嶄綔绫诲瀷
+         *
+         * @param id
+         * @return
+         * @throws VciException
+         */
+        public boolean deleteOperate(String id) throws VciBaseException {
+            boolean res = true;
+            try{
+                res = platformClientUtil.getFrameworkService().deleteOperate(id,this.getUserEntityInfo());
+            }catch (PLException e) {
+                e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+            return res;
+        }
+
+        /**
+         * 妫�鏌ユ搷浣滄槸鍚﹁寮曠敤
+         * @param operateId
+         * @return 0琛ㄧず鏃犲紩鐢紝1琛ㄧず琚ā鍧楀紩鐢紝2琛ㄧず鏈夋潈闄愪俊鎭�
+         * @throws VciException
+         */
+        public int checkOperateIsReferenced(String operateId) throws VciBaseException {
+            try{
+                return (int)platformClientUtil.getFrameworkService().checkOperateIsReferenced(operateId);
+            }catch (PLException e) {
+                e.printStackTrace();
+                throw new VciBaseException(String.valueOf(e.code),e.messages);
+            }
+        }
+
+        /**
+         * 杩斿洖鍏ㄩ儴鐨� AppConfigCategory 瀵硅薄
+         * @return
+         * @throws VciException
+         */
+        public AppConfigCategoryInfo[] getAppConfigCategorys() throws VciBaseException{
+            try{
+                AppConfigCategoryInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigCategorys(this.getUserEntityInfo());
+                return infos;
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 鏍规嵁鍒嗙被ID杩斿洖鍏ㄩ儴鐨� AppConfigDetail 瀵硅薄
+         */
+        public AppConfigDetailInfo[] getAppConfigDetailsByID(String clsfId) throws VciBaseException{
+            try{
+                AppConfigDetailInfo[] infos = platformClientUtil.getFrameworkService().getAppConfigDetailsByCatId(clsfId, this.getUserEntityInfo());
+                return infos;
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 娣诲姞銆佷繚瀛� AppConfigCategory 瀵硅薄
+         * @param object AppConfigCategoryInfo 瀵硅薄
+         */
+        public String saveAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().saveAppConfigCategory(object, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 淇敼銆佹洿鏂� AppConfigCategory 瀵硅薄
+         * @param object AppConfigCategoryInfo 瀵硅薄
+         */
+        public boolean updateAppConfigCategory(AppConfigCategoryInfo object) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().updateAppConfigCategory(object, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 鏍规嵁鍚嶇О鏌ヨ閰嶇疆椤�
+         * @param name
+         * @return
+         * @throws VciBaseException
+         */
+        public AppConfigDetailInfo[] getAppConfigDetailInfoByName(String name) throws VciBaseException{
+            try{
+                AppConfigDetailInfo[] appConfigDetailsByName = platformClientUtil.getFrameworkService().getAppConfigDetailsByName(name, this.getUserEntityInfo());
+                return appConfigDetailsByName;
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 鏍规嵁 ID 鍒犻櫎 AppConfigCategory 瀵硅薄锛堟壒閲忥級
+         * @param ids AppConfigCategory 瀵硅薄鐨� ID 鍒楄〃
+         */
+        public boolean deleteAppConfigCategory(String[] ids) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().deleteAppConfigCategory(ids, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /** 娣诲姞銆佷繚瀛� AppConfigDetail 瀵硅薄
+		* @param info AppConfigDetailInfo 瀵硅薄
+		*/
+        public String saveAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().saveAppConfigDetail(info, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 淇敼銆佹洿鏂� AppConfigDetail 瀵硅薄
+         * @param info AppConfigDetailInfo 瀵硅薄
+         */
+        public boolean updateAppConfigDetail(AppConfigDetailInfo info) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().updateAppConfigDetail(info, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+        /**
+         * 鏍规嵁 ID 鍒犻櫎 AppConfigDetail 瀵硅薄锛堟壒閲忥級
+         * @param ids AppConfigDetail 瀵硅薄鐨� ID 鍒楄〃
+         */
+        public boolean deleteAppConfigDetail(String[] ids) throws VciBaseException{
+            try{
+                return platformClientUtil.getFrameworkService().deleteAppConfigDetail(ids, this.getUserEntityInfo());
+            }catch(PLException e){
+                throw new VciBaseException(String.valueOf(e.code), e.messages);
+            }
+        }
+
+    }
 
 }

--
Gitblit v1.9.3