首页系统配置接口测试修改,菜单查询相关修改:PLMODULENO字段因平台已停用,所有将对象中的moduleNo删除。
已修改8个文件
已添加3个文件
1645 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/SmFunctionForPlatform1.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java 1028 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/properties/JsonConfigReader.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/SmFunctionForPlatform1.java
@@ -52,9 +52,9 @@
    private String plsuffixb;
    /**
     * åŠŸèƒ½ç¼–å·
     * åŠŸèƒ½ç¼–å· TODO:20240822确认平台已经去掉这个字段了,所以表中也删掉了该字段并将这儿注释掉了
     */
    private Integer plmoduleno;
    //private Integer plmoduleno;
    /**
     * æè¿°
@@ -152,13 +152,13 @@
        this.plsuffixb = plsuffixb == null ? null : plsuffixb.trim();
    }
    public Integer getPlmoduleno() {
    /*public Integer getPlmoduleno() {
        return plmoduleno;
    }
    public void setPlmoduleno(Integer plmoduleno) {
        this.plmoduleno = plmoduleno;
    }
    }*/
    public String getPldesc() {
        return pldesc;
@@ -234,7 +234,7 @@
                ", plsuffixc='" + plsuffixc + '\'' +
                ", plresourceb='" + plresourceb + '\'' +
                ", plsuffixb='" + plsuffixb + '\'' +
                ", plmoduleno=" + plmoduleno +
                //", plmoduleno=" + plmoduleno +
                ", pldesc='" + pldesc + '\'' +
                ", plisvalid=" + plisvalid +
                ", plimage='" + plimage + '\'' +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java
@@ -2,6 +2,7 @@
package com.vci.pagemodel;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
@@ -10,7 +11,7 @@
 *
 * @author Chill
 */
public class MenuVO  {
public class MenuVO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
@@ -49,9 +50,24 @@
    private String alias;
    /**
     * è¯·æ±‚地址
     * è¯·æ±‚地址,界面路径
     */
    private String path;
    /**
     * å®¢æˆ·ç«¯åœ°å€
     */
    private String pathC;
    /**
     * resourceDotNet
     */
    private String resourceDotNet;
    /**
     * resourceDotMobile
     */
    private String resourceMobile;
    /**
     * èœå•资源
@@ -109,10 +125,68 @@
    private String modeType;
    /**
     * æ˜¯æ¨¡å—下子对象是模块还是操作:0表示无子节点,1表示是模块,2表示是操作
     */
    private Integer childType;
    /**
     * 1有效0无效:无效时,在功能权限界面不显示
     */
    private Boolean isValid;
    /**
     * å‰ç«¯æ˜¯å¦éšè—
     */
    private HashMap<String,Boolean> meta = new HashMap<>();
    public void setPathC(String pathC) {
        this.pathC = pathC;
    }
    public void setResourceDotNet(String resourceDotNet) {
        this.resourceDotNet = resourceDotNet;
    }
    public void setResourceMobile(String resourceMobile) {
        this.resourceMobile = resourceMobile;
    }
    public void setValid(Boolean valid) {
        isValid = valid;
    }
    public String getPathC() {
        return pathC;
    }
    public String getResourceDotNet() {
        return resourceDotNet;
    }
    public String getResourceMobile() {
        return resourceMobile;
    }
    public Boolean getValid() {
        return isValid;
    }
    public void setIsValid(Boolean isValid) {
        this.isValid = isValid;
    }
    public Boolean getIsValid() {
        return isValid;
    }
    public void setChildType(Integer childType) {
        this.childType = childType;
    }
    public Integer getChildType() {
        return childType;
    }
    public String getModeType() {
        return modeType;
    }
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
@@ -56,11 +56,12 @@
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param modeType æ¨¡å—类型
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    List<MenuVO> getSysModelTreeMenuByPID(String parentId,boolean isAll) throws VciBaseException;
    List<MenuVO> getSysModelTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException;
    int checkChildObject(String moduleId) throws VciException;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,123 @@
package com.vci.frameworkcore.compatibility;
import com.vci.common.exception.VciException;
import com.vci.corba.common.PLException;
import com.vci.pagemodel.MenuVO;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
/**
 * é¦–页系统模块配置添加按钮、添加操作类型等接口服务
 * @author ludc
 * @date 2024/8/19 12:42
 */
public interface SmHMSysModConfigServiceI {
    /**
     * æ·»åŠ æ¨¡å—
     * @param menuVO
     * @return
     */
    MenuVO addModule(MenuVO menuVO) throws VciBaseException;
    /**
     * ä¿®æ”¹æ¨¡å—
     * @param menuVO
     * @return
     */
    MenuVO updateModule(MenuVO menuVO) throws VciBaseException;
    /**
     * åˆ é™¤æ¨¡å—
     * @param menuVO
     * @return
     */
    boolean delModule(MenuVO menuVO);
    /**
     * å¢žåŠ æ“ä½œç±»åž‹
     * @return
     */
    boolean addOperationType(List<MenuVO> menuVOList);
    /**
     * åˆ é™¤éžç³»ç»Ÿæ¨¡å—
     * @return
     */
    boolean delNonsysModule();
    /**
     * åˆ é™¤ä¸šåŠ¡æ¨¡å—
     * @return
     */
    boolean delBusinessModule();
    /**
     * å¯¼å‡ºç®¡ç†åŠŸèƒ½æ¨¡å—æˆ–æ“ä½œç±»åž‹ç®¡ç†æ¨¡å—sql
     * @param exportPath å¯¼å‡ºè·¯å¾„
     * @param isFunction æ˜¯å¦æ˜¯å¯¼å‡ºç®¡ç†åŠŸèƒ½æ¨¡å—sql
     * @return
     * @throws PLException
     */
    File exportFunctionSql(HttpServletResponse response,String exportPath,boolean isFunction/*是否是导出管理功能模块sql*/) throws PLException;
    /**
     * å¯¼å‡º
     * @return
     */
    String exportModule(HttpServletResponse response) throws PLException, IOException;
    /**
     * å¯¼å…¥
     * @param files
     * @return
     * @throws PLException
     */
    BaseResult importModule(LinkedList<File> files) throws PLException, IOException;
    /**
     * ç®¡ç†åŠŸèƒ½æ¨¡å—ã€ä¸šåŠ¡åŠŸèƒ½æ¨¡å—ä¸‹çš„å¶å­èŠ‚ç‚¹â€”ä¿®æ”¹æ“ä½œåˆ«åæŽ¥å£
     * @param menuVO
     * @return
     * @throws VciException
     */
    boolean updateAlias(MenuVO menuVO) throws VciException;
    //系统配置相关接口
    /**
     * æŸ¥è¯¢ç³»ç»Ÿé…ç½®åˆ†ç±»
     */
    List<Object>getSysConfTree();
    /**
     * å¢žåŠ ç³»ç»Ÿé…ç½®
     * @return
     */
    boolean addSysConf();
    /**
     * ä¿®æ”¹ç³»ç»Ÿé…ç½®
     * @return
     */
    boolean updateSysConf();
    /**
     * åˆ é™¤ç³»ç»Ÿé…ç½®
     * @return
     */
    boolean delSysConf();
    /**
     * å¯¼å‡ºç³»ç»Ÿé…ç½®
     * @param response
     * @return
     */
    String exportSysConf(HttpServletResponse response);
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONReader;
import com.vci.client.ClientSession;
import com.vci.common.exception.VciException;
import com.vci.common.locale.LocaleDisplay;
@@ -176,7 +177,7 @@
    private SmFunctionVO functionForPlatform1ToFunctionVO(SmFunctionForPlatform1 functionForPlatform1){
        SmFunctionVO functionVO = new SmFunctionVO();
        functionVO.setOid(functionForPlatform1.getPloid());
        functionVO.setId(String.valueOf(functionForPlatform1.getPlmoduleno()));
        //functionVO.setId(String.valueOf(functionForPlatform1.getPlmoduleno()));
        functionVO.setName(functionForPlatform1.getPlname());
        functionVO.setLogName(functionForPlatform1.getPlaliasname());
        if(StringUtils.isNotBlank(functionForPlatform1.getPlresourceb())){
@@ -287,8 +288,10 @@
        //如果是开发或者测试用户,需哟获取系统模块配置菜单
        if(adminOrDeveloperOrRoot){
            //获取首页系统模块配置菜单
            MenuVO menuVO = JsonConfigReader.getMenuVO();
            functionVOList.add(menuVO);
            MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode();
            if(Func.isNotEmpty(menuVO)){
                functionVOList.add(menuVO);
            }
        }
        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
@@ -296,27 +299,30 @@
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param modeType æ¨¡å—类型
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    @Override
    public List<MenuVO> getSysModelTreeMenuByPID(String parentId,boolean isAll) throws VciBaseException{
    public List<MenuVO> getSysModelTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException{
        List<MenuVO> menuVOList = new ArrayList<>();
        if(Func.isBlank(parentId)){
            return menuVOList;
        }
        if(parentId.equals("mangeModel") || parentId.equals("businessModel")){
            if(parentId.equalsIgnoreCase("FunctionObject")){
        boolean isFunctionObject = Func.isNotBlank(modeType) && modeType.equalsIgnoreCase("FunctionObject");
        if(parentId.equals("systemManagmentNode") || parentId.equals("modelManagmentNode") || isFunctionObject){
            int childType = this.checkChildObject(parentId);
            if(isFunctionObject){
                try {
                    /**判断该模块下子对象是模块还是操作,0表示无子节点,1表示是模块,2表示是操作**/
                    int childType = this.checkChildObject(parentId);
                    if(childType == 2){
                        try{
                            FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false);
                            for(int i = 0;i < infos.length ;i++){
                                FuncOperationInfo info = infos[i];
                                MenuVO menuVO = new MenuVO();
                                menuVO.setChildType(childType);
                                menuVO.setId(info.id);
                                menuVO.setCode(info.funcId);
                                menuVO.setId(info.operId);
@@ -325,7 +331,8 @@
                                menuVO.setAlias(info.operAlias);
                                menuVO.setRemark(info.operDesc);
                                menuVO.setSort((int) info.number);
                                //menuVO.setIsValid(info.isValid);
                                menuVO.setModeType("FunctionObject");
                                menuVO.setIsValid(info.isValid);
                                menuVO.setHasChildren(false);
                                menuVOList.add(menuVO);
                            }
@@ -339,6 +346,8 @@
                            for(int i = 0;i < funcInfos.length; i++){
                                FunctionInfo funcInfo = funcInfos[i];
                                MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
                                menuVO.setChildType(childType);
                                menuVO.setModeType("FunctionObject");
                                menuVOList.add(menuVO);
                            }
                        }catch (PLException e) {
@@ -352,21 +361,36 @@
                }
            }else{
                try{
                    MenuVO parentNode;
                    //将返回的节点外层套上当前父节点
                    if(parentId.equals("systemManagmentNode")){
                        parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode();
                    }else{
                        parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode();
                    }
                    List<MenuVO> menuVOS = new ArrayList<>();
                    //查询的三级节点
                    FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
                    for(int i = 0;i < funcInfos.length; i++){
                        FunctionInfo funcInfo = funcInfos[i];
                        MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
                        menuVO.setModeType("FunctionObject");
                        menuVOList.add(menuVO);
                        menuVO.setChildType(childType);
                        menuVOS.add(menuVO);
                    }
                    parentNode.setChildren(menuVOS);
                    menuVOList.add(parentNode);
                }catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException(String.valueOf(e.code),e.messages);
                }
            }
        }else if(parentId.equals("operateType")){
        }else if(parentId.equals("sysOptionNode")){
            //加载所有操作
            try{
                //将返回的节点外层套上当前父节点
                MenuVO parentNode = JsonConfigReader.getSysModuleConf().getOperateNode();
                List<MenuVO> menuVOS = new ArrayList<>();
                OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId);
                for(int i = 0; i < operateInfos.length;i++ ){
                    OperateInfo operateInfo = operateInfos[i];
@@ -376,19 +400,22 @@
                    menuVO.setCode(operateInfo.identify);
                    menuVO.setAlias(operateInfo.alias);
                    menuVO.setCategory(2);
                    menuVO.setChildType(0);
                    menuVO.setRemark(operateInfo.desc);
                    menuVO.getMeta().put("keepAlive",false);
                    menuVO.setSort((int) operateInfo.seq);
                    menuVO.setModeType("operateObject");
                    menuVO.setHasChildren(false);
                    menuVOList.add(menuVO);
                    menuVOS.add(menuVO);
                }
                parentNode.setChildren(menuVOS);
                menuVOList.add(parentNode);
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)});
            }
        }
        return menuVOList;
        return menuVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
    /**
@@ -399,10 +426,11 @@
    private MenuVO functionInfoToMenuVO(FunctionInfo funcInfo){
        MenuVO menuVO = new MenuVO();
        menuVO.setId(funcInfo.id);
        menuVO.setValid(funcInfo.isValid);
        menuVO.setSource(funcInfo.image);
        //if(StringUtils.isBlank(menu.resourceB)){
        //    continue;
        //}
        menuVO.setPathC(funcInfo.resourceC);
        menuVO.setResourceDotNet(funcInfo.resourceDotNet);
        menuVO.setResourceMobile(funcInfo.resourceMobile);
        menuVO.setPath(funcInfo.resourceB);
        menuVO.setParentId(funcInfo.parentId);
        menuVO.setCode(funcInfo.aliasName);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1028 @@
package com.vci.frameworkcore.compatibility.impl;
import com.vci.client.common.excel.ExcelDocumentUtils;
import com.vci.common.exception.VciException;
import com.vci.common.locale.LocaleDisplay;
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.frameworkcore.compatibility.SmHMSysModConfigServiceI;
import com.vci.pagemodel.MenuVO;
import com.vci.client.common.excel.SheetDataSet;
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.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.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
/**
 * é¦–页系统模块配置添加按钮、添加操作类型等接口服务
 * @author ludc
 * @date 2024/8/19 12:42
 */
@Service
public class SmHMSysModConfigServiceImpl implements SmHMSysModConfigServiceI {
    @Autowired
    private PlatformClientUtil platformClientUtil;
    private List<FunctionInfo> fileFunctionDatas = new ArrayList<FunctionInfo>();
    private int count = 0;
    private static FunctionOperateDelegate foDelegate;
    {
        if(Func.isEmpty(foDelegate)){
            foDelegate = new FunctionOperateDelegate();
        }
    }
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * æ·»åŠ æ¨¡å—
     * @param menuVO
     * @return
     */
    @Override
    public MenuVO addModule(MenuVO menuVO) throws VciBaseException {
        VciBaseUtil.alertNotNull(menuVO,"新增的模块对象");
        try {
            //往数据库里插入新建模块数据
            String puid = foDelegate.saveModule(menuVO);
            /**
             * è¿”回值:1,表示模块名称重复
             *            2,表示模块标识重复
             *         3, æ¨¡æ¿åˆ«åå­˜åœ¨é‡å¤
             */
            if(puid.equals("1")){
                throw new VciBaseException("模块名称重复,请修改!");
            }else if(puid.equals("2")){
                throw new VciBaseException("模块标识重复,请修改!");
            }else if(puid.equals("3")) {
                throw new VciBaseException("模块别名重复,请修改!");
            }
            menuVO.setId(puid);
            return menuVO;
        } catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    /**
     * ä¿®æ”¹æ¨¡å—
     * @param menuVO
     * @return
     */
    @Override
    public MenuVO updateModule(MenuVO menuVO) throws VciBaseException {
        VciBaseUtil.alertNotNull(menuVO,"修改的模块对象");
        try {
            String res = "";
            //更新数据库
            res = foDelegate.updateMod(menuVO);
            /**
             * è¿”回: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("模块别名重复,请修改!");
            }/* else if (res.equals("4")) {
                throw new VciBaseException("模块编号重复,请修改!");
            }*/
            return menuVO;
        } catch (VciBaseException e) {
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    /**
     * åˆ é™¤æ¨¡å—
     * @param menuVO
     * @return
     */
    @Override
    public boolean delModule(MenuVO menuVO) {
        VciBaseUtil.alertNotNull(menuVO,"添加操作类型的列表");
        String res = "";
        try {
            String puid = "";
            if("FunctionObject".equals(menuVO.getModeType())) {
                puid = menuVO.getId();
            }else if("modelManagmentNode".equals(menuVO.getId())) {
                puid = "modelManagmentNode";
            }else if("systemManagmentNode".equals(menuVO.getId())) {
                puid = "systemManagmentNode";
            }
            if(Func.isBlank(puid)){
                throw new VciBaseException("未找到要删除的模块!");
            }
            res = foDelegate.deleteModule(puid);
            /**
             * è¿”回值:1表示模块在权限模块已经有授权信息,无法删除
             */
            if(res.equals("1")){
               throw new VciBaseException("当前模块(或下级模块)已经存在授权信息,无法删除。");
            }
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
    }
    /**
     * å¢žåŠ æ“ä½œç±»åž‹
     * @return
     */
    @Override
    public boolean addOperationType(List<MenuVO> menuVOList) {
        VciBaseUtil.alertNotNull(menuVOList,"添加操作类型的列表");
        List<FuncOperationInfo> objs = new ArrayList<>();
        //将操作类型组装成需要存储的对象
        menuVOList.stream().forEach(menuVO -> {
            FuncOperationInfo info = new FuncOperationInfo();
            //info.id = menuVO.getId() == null ? "" : menuVO.getId();
            info.funcId = menuVO.getParentId() == null ? "" : menuVO.getParentId();
            info.operId = menuVO.getId() == null ? "" : menuVO.getId();
            info.operName = menuVO.getName() == null ? "" : menuVO.getName();
            //info.operIndentify = menuVO.getOperIndentify() == null ? "" : menuVO.getOperIndentify();
            info.operAlias = menuVO.getAlias() == null ? "" : menuVO.getAlias();
            info.operDesc = menuVO.getRemark() == null ? "" : menuVO.getRemark();
            info.number = -1;
            info.isValid = true;
            /*VCIBaseTreeNode node = (VCIBaseTreeNode)treePaths[i].getLastPathComponent();
            OperateObject operateObject = (OperateObject) node.getObj();
            obj.setFuncId(funcObj.getId());
            obj.setOperId(operateObject.getId());
            obj.setOperName(operateObject.getName());
            obj.setOperIndentify(operateObject.getIdentify());
            obj.setOperAlias(operateObject.getAlias());
            obj.setNumber(-1);
            obj.setIsValid(true);*/
            objs.add(info);
        });
        //执行保存
        boolean res = true;
        try {
            res = this.saveFuncOperation(objs.toArray(new FuncOperationInfo[objs.size()]));
        } catch (Exception e) {
            res = false;
            e.printStackTrace();
            String exceptionMessage = "增加操作类型失败,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
        return res;
    }
    /**
     * åˆ é™¤éžç³»ç»Ÿæ¨¡å—
     * @return
     */
    @Override
    public boolean delNonsysModule() {
        try {
            if(platformClientUtil.getFrameworkService().deleteModules("nonsys")){
                return true;
            }
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "删除非系统模块失败,原因:"+VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
        return false;
    }
    /**
     * åˆ é™¤ä¸šåŠ¡æ¨¡å—
     * @return
     */
    @Override
    public boolean delBusinessModule() {
        try {
            if(platformClientUtil.getFrameworkService().deleteModules("business")){
                return true;
            }
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "删除业务模块失败,原因:"+VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new VciBaseException(exceptionMessage);
        }
        return false;
    }
    /**
     * å¯¼å‡ºsql
     * @return
     */
    @Override
    public File exportFunctionSql(HttpServletResponse response,String exportPath,boolean isFunction) throws PLException {
        String dir = Func.isBlank(exportPath) ?  LocalFileUtil.getDefaultTempFolder():exportPath;
        String[][] allDatas;
        int size;
        if(isFunction){
            size = (int)platformClientUtil.getFrameworkService().getAllModelManagementNum();
            allDatas = this.getAllDatas(size);
        }else{
            size = (int)platformClientUtil.getFrameworkService().getAllOperitionsNum();
            allDatas = this.getAllOperitions(size);
        }
        File file = expData(dir,isFunction, allDatas);
        return file;
    }
    /**
     * å¯¼å‡º
     * @return
     */
    @Override
    public String exportModule(HttpServletResponse response) throws IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        //写excel
        String excelPath = defaultTempFolder + File.separator + "module.xls";
        final List<String> columns = new ArrayList<String>(Arrays.asList("PLNAME","PLRESOURCEC","PLSUFFIXC","PLRESOURCEB",
                "PLSUFFIXB","PLMODULENO","PLDESC","PLISVALID","PLIMAGE","PLMODULESEQUENCE","PLALIASNAME",
                "PLMODULENAME","PLRESOURCEDOTNET","PLRESOURCEMOBIL","级别","别名","PLNO","PLISVALID",
                "PLNAME","PLUNIQUEFLAG","PLDESC","PLALIAS","PLSEQUENCE"));// è®¾ç½®è¡¨å•列名
        //int count = transmitTreeObject.getCurrentTreeNode().getChildCount();
        new File(excelPath).createNewFile();
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>(10000);
        //设置列头
        for (int index = 0; index < columns.size(); index++) {
            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
        }
        //查询要导出的数据
        String[][] firstLevel = new String[3000][23];
        try {
            firstLevel = this.checkLevel();
        } catch (VciBaseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        String[][] datas = new String[10000][columns.size()];
        for(int i=0;i<firstLevel.length;i++){
            datas[i] =firstLevel[i];
        }
        if(Func.isEmpty(datas)){
            excelDataList.add(new WriteExcelData(1,1, "导出的列表为空,请刷新后尝试重新导出!"));
        }else{
            for (int i = 0; i < firstLevel.length; i++) {
                int row = i + 1;
                excelDataList.add(new WriteExcelData(row,0, ""+datas[i][0]));
                excelDataList.add(new WriteExcelData(row,1, ""+datas[i][1]));
                excelDataList.add(new WriteExcelData(row,2, ""+datas[i][2]));
                excelDataList.add(new WriteExcelData(row,3, ""+datas[i][3]));
                excelDataList.add(new WriteExcelData(row,4, ""+datas[i][4]));
                excelDataList.add(new WriteExcelData(row,5, ""+datas[i][5]));
                excelDataList.add(new WriteExcelData(row,6, ""+datas[i][6]));
                excelDataList.add(new WriteExcelData(row,7, ""+datas[i][7]));
                excelDataList.add(new WriteExcelData(row,8, ""+datas[i][8]));
                excelDataList.add(new WriteExcelData(row,9, ""+datas[i][9]));
                excelDataList.add(new WriteExcelData(row,10,""+datas[i][10]));
                excelDataList.add(new WriteExcelData(row,11,""+datas[i][11]));
                excelDataList.add(new WriteExcelData(row,12,""+datas[i][12]));
                excelDataList.add(new WriteExcelData(row,13,""+datas[i][13]));
                excelDataList.add(new WriteExcelData(row,14,""+datas[i][14]));
                excelDataList.add(new WriteExcelData(row,15,""+datas[i][15]));
                excelDataList.add(new WriteExcelData(row,16,""+datas[i][16]));
                excelDataList.add(new WriteExcelData(row,17,""+datas[i][17]));
                excelDataList.add(new WriteExcelData(row,18,""+datas[i][18]));
                excelDataList.add(new WriteExcelData(row,19,""+datas[i][19]));
                excelDataList.add(new WriteExcelData(row,20,""+datas[i][20]));
                excelDataList.add(new WriteExcelData(row,21,""+datas[i][21]));
                excelDataList.add(new WriteExcelData(row,22,""+datas[i][22]));
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * å¯¼å…¥
     * @param files
     * @return
     * @throws PLException
     */
    @Override
    public BaseResult importModule(LinkedList<File> files) throws PLException, IOException {
        logger.info("正在收集表单数据......");
        boolean isSuccess = collectionDatas(files);
        logger.info("正在导入表单人员信息......");
        logger.info("count==="+count);
        boolean resBoolean = false;
        if(isSuccess == false){
            resBoolean = importExcelData(count);
        }
        return resBoolean ? BaseResult.success("导入成功!"):BaseResult.fail("导入失败!");
    }
    /**
     * ç®¡ç†åŠŸèƒ½æ¨¡å—ã€ä¸šåŠ¡åŠŸèƒ½æ¨¡å—ä¸‹çš„å¶å­èŠ‚ç‚¹â€”ä¿®æ”¹æ“ä½œåˆ«åæŽ¥å£
     * @return
     */
    @Override
    public boolean updateAlias(MenuVO menuVO) throws VciException {
        String alias = menuVO.getAlias();
        if ("".equals(alias)){
            throw new VciBaseException("请填写操作别名!");
        }
        boolean isValid = menuVO.getIsValid();
        String id = menuVO.getId();
        return foDelegate.updateFuncOperation(id , alias, isValid);
    }
    @Override
    public List<Object> getSysConfTree() {
        return null;
    }
    @Override
    public boolean addSysConf() {
        return false;
    }
    @Override
    public boolean updateSysConf() {
        return false;
    }
    @Override
    public boolean delSysConf() {
        return false;
    }
    @Override
    public String exportSysConf(HttpServletResponse response) {
        return null;
    }
    /**
     * æ”¶é›†è¡¨å•信息。
     * @param files
     * @return
     * @throws PLException
     * @throws IOException
     */
    private boolean collectionDatas(LinkedList<File> files) throws PLException, IOException{
        boolean b=false;
        for (File f : files) {
            List<SheetDataSet> sheetDataSets = this.getFileList(f);
            if (sheetDataSets != null && !sheetDataSets.isEmpty()) {
                for (SheetDataSet sheet : sheetDataSets) {
                    // sheet不能为空并且必须有出表头外的一条数据
                    if (sheet != null && sheet.getDataSet() != null && sheet.getDataSet().size() > 1) {
                        List<String[]> dataSet = sheet.getDataSet();
                        String fParentId=""; //第一级的id(第二级的parentid)
                        boolean boo=true;
                        boolean first=false;
                        String[] pd=new String[100];
                        int jibie=2;
                        for (int i = 1; i < dataSet.size(); i++) {
                            //fileDatas = new ArrayList<FunctionObject>();
                            String[] oneData = dataSet.get(i);
                            String id = ObjectUtility.getNewObjectID36();
                            FunctionInfo funObj=new FunctionInfo();
                            boolean onebl=false;
                            boolean twobl=false;
                            boolean same=false;
                            String plName=oneData[0];
                            //TODO: è¿™é‡Œç»å¯¹ä¼šå‡ºé—®é¢˜ï¼Œå¯¼å‡ºçš„第一层的级别都是0,都不会存在等于1的,所以平台这儿等于1应该是不对的
                            if(oneData[14].equals("0")) {
                                try {
                                    onebl = foDelegate.firstLevel(plName);
                                } catch (VciException e) {
                                    // TODO Auto-generated catch block
                                    e.printStackTrace();
                                }
                                //如果第一级重名
                                if(onebl == true) {//第一级重名后覆盖第一级
                                    fuzhi(funObj,oneData);
                                    try {
                                        fParentId = foDelegate.changeFirstLevel(funObj,plName);
                                        pd[2]=fParentId;
                                    } catch (VciException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                    funObj.id = fParentId;
                                    fileFunctionDatas.add(funObj);
                                    first=true;
                                } else {
                                    funObj.id = id;
                                    funObj.parentId = "modelManagmentNode";
                                    fuzhi(funObj,oneData);
                                    fileFunctionDatas.add(funObj);
                                    first=false;
                                }
                                b=false;
                            }
                            //#########################     åˆå¹¶     #########################
                            for(jibie=2;jibie<100;jibie++){
                                if(oneData[14].equals(String.valueOf(jibie))){
                                    if(first == true && boo == true){
                                        try {
                                            if(pd[jibie]==null){
                                                pd[jibie]="";
                                            }
                                            twobl=foDelegate.secondLevel(plName,pd[jibie]);
                                        } catch (VciException e) {
                                            // TODO Auto-generated catch block
                                            e.printStackTrace();
                                        }
                                        if(twobl==true) {//重名后覆盖
                                            fuzhi(funObj,oneData);
                                            try {
                                                fParentId=foDelegate.changeSecondLevel(funObj,plName,pd[jibie]);
                                                pd[jibie+1]=fParentId;
                                            } catch (VciException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                            //funObj.setId(fParentId);
                                            funObj.id = pd[jibie+1];
                                            fileFunctionDatas.add(funObj);
                                            boo = true;
                                        }
                                    } else {
                                        funObj.id = id;
                                        b = false;
                                    }
                                }
                            }
                            if(oneData[14].equals("-1")) {
                                importExcelData(count);
                                FuncOperationInfo foObj = new FuncOperationInfo();
                                int len=fileFunctionDatas.size();
                                //**************同一节点下不能有相同的操作类型********************
                                String dataOperName=oneData[18];
                                String plFuncOid=fileFunctionDatas.get(len-1).id;
                                try {
                                    same = foDelegate.selSameOper(dataOperName,plFuncOid);
                                } catch (VciBaseException e1) {
                                    // TODO Auto-generated catch block
                                    e1.printStackTrace();
                                }
                                //******************************************************
                                if(same == false) {
                                    foObj.id = id;
                                    foObj.funcId = fileFunctionDatas.get(len-1).id;
                                    try {
                                        OperateInfo operObj = foDelegate.fetchOperateTypeByName(oneData[18]);
                                        foObj.operId = operObj.id;
                                    } catch (VciException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                    foObj.number = Integer.parseInt(oneData[16]);
                                    foObj.operAlias = oneData[15];
                                    foObj.isValid = Integer.parseInt(oneData[17]) != 0;
                                    try {
                                        foDelegate.saveFuncOperation2(foObj);
                                    } catch (VciException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                } else {
                                    foObj.number = Integer.parseInt(oneData[16]);
                                    foObj.operAlias = oneData[15];
                                    foObj.isValid = Integer.parseInt(oneData[17]) != 0;
                                    try {
                                        foDelegate.updateOperation(foObj,dataOperName,plFuncOid);
                                    } catch (VciException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                }
                                count=fileFunctionDatas.size();
                                b=true;
                            }
                        }
                    }
                }
            }
        }
        return b;
    }
    /**
     * å¯¼å…¥è¡¨å•数据
     * @throws VciException
     */
    private boolean importExcelData(int count) throws PLException {
        boolean b=false;
        try {
            b=    foDelegate.importModules(fileFunctionDatas.toArray(new FunctionInfo[]{}),count);
        } catch (VciBaseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return b;
    }
    /**
     * èŽ·å–è¡¨å•æ•°æ®
     * @param f
     * @return
     * @throws IOException
     * @throws PLException
     * @autor caicong
     * @data 2014-3-11
     */
    private List<SheetDataSet> getFileList(File f) throws PLException, IOException {
        // èŽ·å–æµ
        BufferedInputStream fileInputStream = new BufferedInputStream(
                new FileInputStream(f));
        String name = f.getName();
        // èŽ·å–è¡¨list
        List<SheetDataSet> sheetDataSets = ExcelDocumentUtils
                .readExcelDocument(name, fileInputStream);
        return sheetDataSets;
    }
    /**
     * æŸ¥è¯¢"功能模块管理"整个树结构并导出
     * add by caill start
     * */
    private String[][] checkLevel() throws VciBaseException{
        String[][] res = new String[3000][23];
        try{
            res = platformClientUtil.getFrameworkService().checkLevel();
        }catch (PLException e) {
            e.printStackTrace();
            throw new VciBaseException(String.valueOf(e.code), e.messages);
        }
        return res;
    }
    /**
     * å°†æŸ¥è¯¢å‡ºçš„æ•°æ®è½¬æ¢æˆsql并写入指定路径下
     * @param dir
     * @param plDatas
     * @return
     */
    private File expData(String dir,boolean isFunction/*是否是导出管理功能模块sql*/, String[][] plDatas){
        new File(dir).mkdir();
        File file = new File(dir + (isFunction ? "/plfuncoperation.sql":"/ploperation.sql"));
        try {
            FileWriter w = new FileWriter(file);
            BufferedWriter bw = new BufferedWriter(w);
            System.out.println("长度为:"+plDatas.length);
            for(int i=0;i<plDatas.length;i++){
                if(isFunction){
                    if(!plDatas[i][16].trim().equals("") && plDatas[i][16]!=null && !plDatas[i][16].equals("-1")){
                        bw.write("insert into plfunction values('"+plDatas[i][0]+"','"+plDatas[i][1]+"',"+"'"+plDatas[i][2]+"',"+"'"+plDatas[i][3]+"',"+"'"+plDatas[i][4]+"',"
                                +"'"+plDatas[i][5]+"',"+"'"+plDatas[i][6]+"',"+"'"+plDatas[i][7]+"',"+"'"+plDatas[i][8]+"',"+"'"+plDatas[i][9]+"',"+"'"+plDatas[i][10]+"',"+"'"+plDatas[i][11]+"',"
                                +"'"+plDatas[i][12]+"',"+"'"+plDatas[i][13]+"',"+"'"+plDatas[i][14]+"',"+"'"+plDatas[i][15]+"');");
                        bw.write("\r\n");
                    }
                    if(!plDatas[i][16].trim().equals("") && plDatas[i][16]!=null && plDatas[i][16].equals("-1")){
                        bw.write("insert into plfuncoperation values('"+plDatas[i][17]+"','"+plDatas[i][18]+"',"+"'"+plDatas[i][19]+"',"+"'"+plDatas[i][20]+"',"+"'"+plDatas[i][21]+"',"
                                +"'"+plDatas[i][22]+"');");
                        bw.write("\r\n");
                    }
                }else{
                    bw.write("insert into ploperation values('"+plDatas[i][0]+"','"+plDatas[i][1]+"',"+"'"+plDatas[i][2]+"',"+"'"+plDatas[i][3]+"',"+"'"+plDatas[i][4]+"',"
                            +"'"+plDatas[i][5]+"');");
                    bw.write("\r\n");
                }
            }
            bw.flush();
            bw.close();
            return file;
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
    /**
     * ä¿å­˜æ¨¡å—下的操作
     * @param funcOperationObjs
     * @return
     * @throws VciException
     */
    public boolean saveFuncOperation(FuncOperationInfo[] funcOperationObjs) throws VciException {
        if(funcOperationObjs == null || funcOperationObjs.length < 0){
            return false;
        }
        boolean res = true;
        try{
            res = platformClientUtil.getFrameworkService().saveFuncOperation(funcOperationObjs, foDelegate.getUserEntityInfo());
        }catch (PLException e) {
            e.printStackTrace();
            throw new VciException(String.valueOf(e.code),e.messages);
        }
        return res;
    }
    /**
     * æŸ¥è¯¢"功能模块管理"整个树结构并导出sql
     * @return
     * @throws PLException
     */
    public String[][] getAllDatas(int size) throws PLException {
        String[][] res = new String[size][23];
        try{
            res = platformClientUtil.getFrameworkService().getAllDatas(size);
        }catch (PLException e) {
            e.printStackTrace();
            throw new PLException(String.valueOf(e.code), e.messages);
        }
        return res;
    }
    /**
     * èŽ·å¾—æ‰€æœ‰çš„æ“ä½œç±»åž‹å¹¶å¯¼å‡ºåˆ°.sql文件中
     * add by caill start 2015.12.11
     * */
    private String[][] getAllOperitions(int size) throws VciBaseException{
        String[][] res = new String[size][6];
        try{
            res = platformClientUtil.getFrameworkService().getAllOperitions(size);
        }catch (PLException e) {
            e.printStackTrace();
            throw new VciBaseException(String.valueOf(e.code), e.messages);
        }
        return res;
    }
    public void fuzhi(FunctionInfo functionInfo,String[] oneData){
        functionInfo.name = oneData[0];
        functionInfo.resourceC = oneData[1];
        functionInfo.suffixC = oneData[2];
        functionInfo.desc = oneData[6];
        functionInfo.resourceB = oneData[3];
        functionInfo.suffixB = oneData[4];
        functionInfo.seq = Integer.parseInt(oneData[9]);
        //funObj.setModuleNo(Integer.parseInt(oneData[5]));
        functionInfo.image = oneData[8];
        functionInfo.isValid = Integer.parseInt(oneData[7]) != 0;
        functionInfo.aliasName = oneData[10];
        functionInfo.resourceDotNet = oneData[12];
        functionInfo.resourceMobile = oneData[13];
    }
    /**
     * åŒ…含保存模块方法等操作类
     */
    private class FunctionOperateDelegate {
        /**
         * åˆ¤æ–­ç¬¬ä¸€çº§æ•°æ®æœ‰æ²¡æœ‰é‡åçš„
         * @param plName
         * @return
         * @throws VciException
         */
        public boolean firstLevel(String plName) throws VciException{
            try{
                return platformClientUtil.getFrameworkService().firstLevel(plName);
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciException(String.valueOf(e.code), e.messages);
            }
        }
        /**
         * è¦†ç›–重名的第一级数据
         * add by caill
         * */
        public String changeFirstLevel(FunctionInfo functionInfo,String plName) throws VciException{
            String fParentId="";
            try {
                fParentId= platformClientUtil.getFrameworkService().changeFirstLevel(functionInfo, plName);
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return fParentId;
        }
        /**
         * åˆ¤æ–­ç¬¬äºŒçº§æ•°æ®æœ‰æ²¡æœ‰é‡åçš„
         * add by caill
         * */
        public boolean secondLevel(String plName,String fParentId) throws VciException{
            try{
                return platformClientUtil.getFrameworkService().secondLevel(plName,fParentId);
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciException(String.valueOf(e.code), e.messages);
            }
        }
        /**
         * è¦†ç›–重名的第二级数据
         * add by caill
         * */
        public String changeSecondLevel(FunctionInfo functionInfo,String plName,String fParentId) throws VciException{
            String sParentId="";
            try {
                sParentId= platformClientUtil.getFrameworkService().changeSecondLevel(functionInfo, plName,fParentId);
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return sParentId;
        }
        /**
         * ä¿å­˜æ¨¡å—
         * @param object
         * @return
         * @throws VciException
         */
        public String saveModule(MenuVO object) throws VciBaseException {
            String res = "";
            try{
                res = platformClientUtil.getFrameworkService().saveModule(this.check(object,"add"),this.getUserEntityInfo());
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code), e.messages);
            }
            return res;
        }
        /**
         * ä¿®æ”¹æ¨¡å—
         * @param object
         * @return
         * @throws VciException
         */
        public String updateMod(MenuVO object) throws VciBaseException {
            String res = "";
            try{
                res = platformClientUtil.getFrameworkService().updateModule(this.check(object,"update"),this.getUserEntityInfo());
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code), e.messages);
            }
            return res;
        }
        /**
         * åˆ é™¤æ¨¡å—
         * @param puid
         * @return
         * @throws VciException
         */
        public String deleteModule(String puid) throws VciBaseException{
            String res = "";
            try{
                res = platformClientUtil.getFrameworkService().deleteModule(puid,this.getUserEntityInfo());
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code), e.messages);
            }
            return res;
        }
        /**
         * VO转DO对象
         * @return
         */
        public FunctionInfo menuVO2FunctionInfo(MenuVO object){
            FunctionInfo info = new FunctionInfo();
            info.id = object.getId() == null ? "" : object.getId();
            //info.layer = object.getLayer();
            info.name = object.getName() == null ? "" : object.getName();
            info.parentId = object.getParentId() == null ? "" : object.getParentId();
            info.resourceC = object.getPathC() == null ? "" : object.getPathC();
            //info.suffixC = object.getSuffixC() == null ? "" : object.getSuffixC();
            info.resourceB = object.getPath() == null ? "" : object.getPath();
            //info.suffixB = object.getSuffixB() == null ? "" : object.getSuffixB();
            info.desc = object.getRemark() == null ? "" : object.getRemark();
            info.seq = object.getSort();
            //info.moduleNo = object.getModuleNo();
            info.image = object.getSource() == null ? "" : object.getSource();
            info.isValid = object.getIsValid();
            info.aliasName = object.getAlias() == null ? "" : object.getAlias();
            info.resourceDotNet = object.getResourceDotNet() == null ? "" : object.getResourceDotNet();
            info.resourceMobile = object.getResourceMobile() == null ? "" : object.getResourceMobile();
            info.desc = object.getRemark();
            return info;
        }
        /**
         * <p>Description: é¡µé¢è¾“入的校验</p>
         *
         *@author xf
         *@time 2012-5-15
         *@return FunctionObject
         * @return
         */
        private FunctionInfo check(MenuVO menuVO,String type) {
            FunctionInfo obj = new FunctionInfo();
            //获取表单输入的值
            String modelName = menuVO.getName();
            String csIdentity = menuVO.getPathC();
            String bsIdentity = menuVO.getPath();
            String aliasName = menuVO.getAlias();
            String resDotNet = menuVO.getResourceDotNet();
            String resMobile = menuVO.getResourceMobile();
            //int moduleNo = transferStringToNum(moduleNoTxt.getText());
            int sequence = menuVO.getSort();
            String description = menuVO.getRemark();
            if("".equals(modelName) || "null".equals(modelName) || modelName == null) {
                throw new VciBaseException("模块名不能为空!");
            }else if(modelName.length() > 128) {
                throw new VciBaseException("模块名长度不能超过128!");
            }else if(description.length() > 255) {
                throw new VciBaseException("描述长度不能超过255!");
            }else if(csIdentity != null && !"".equals(csIdentity) && csIdentity.length() > 255) {
                throw new VciBaseException("C/S标识长度不能超过255!");
            } else if(resDotNet != null && !"".equals(resDotNet) && resDotNet.length() > 255) {
                throw new VciBaseException(".NET标识长度不能超过255!");
            }else if(resMobile != null && !"".equals(resMobile) && resMobile.length() > 255) {
                throw new VciBaseException("Mobile标识长度不能超过255!");
            } else if (sequence < 0) {
                throw new VciBaseException("序号不能小于0!");
            }
            if(type.equals("add")){
                //给object对象赋值
                String parentId = "";
                if(menuVO.getModeType().equals("FunctionObject")) {
                    parentId = menuVO.getParentId();
                }else if("modelManagmentNode".equals(menuVO.getParentId())) {
                    parentId = "modelManagmentNode";
                }else if("systemManagmentNode".equals(menuVO.getParentId())) {
                    parentId = "systemManagmentNode";
                }
                obj.parentId = parentId;
            }else{
                obj.id = menuVO.getId();
                obj.parentId = menuVO.getParentId();
            }
            obj.name = modelName;
            obj.resourceC = csIdentity;
            obj.desc = description;
            obj.resourceB = bsIdentity;
            obj.suffixC = "";
            obj.suffixB = "";
            obj.seq = sequence;
            obj.image = menuVO.getSource();
            obj.isValid = menuVO.getValid();//1有效0无效
            obj.aliasName = aliasName;
            obj.resourceDotNet = resDotNet;
            obj.resourceMobile = resMobile;
            return obj;
        }
        /**
         * èŽ·å–UserEntityInfo对象
         * @return
         */
        public UserEntityInfo getUserEntityInfo(){
            SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
            UserEntityInfo userEntityInfo = new UserEntityInfo(sessionInfo.getUserId(), "");
            return userEntityInfo;
        }
        /**
         * å¯¼å…¥æ¨¡å—对象
         * add by caill
         * */
        public boolean importModules(FunctionInfo[] funObject,int count) throws VciBaseException{
            boolean b=false;
            int len = funObject.length;
            List<FunctionInfo> funInfoList = new ArrayList<FunctionInfo>();
            for(int i = count ; i<len ; i++){
                if(funObject[i].parentId!=null){
                    FunctionInfo funInfo = funObject[i];
                    funInfoList.add(funInfo);
                }
            }
            FunctionInfo[] funInfos = new FunctionInfo[funInfoList.size()];
            for(int j=0;j<funInfoList.size();j++){
                funInfos[j] = funInfoList.get(j);
            }
            try {
                b = platformClientUtil.getFrameworkService().importModules(funInfos,this.getUserEntityInfo());
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return b;
        }
        /**
         * æŸ¥è¯¢åŒä¸€æ¨¡å—中是否已经存在相同的操作类型
         * add by caill
         * */
        public boolean selSameOper(String dataOperName,String plFuncOid) throws VciBaseException{
            boolean same=false;
            try {
                same = platformClientUtil.getFrameworkService().selSameOper(dataOperName,plFuncOid);
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return same;
        }
        public OperateInfo fetchOperateTypeByName(String name) throws VciException {
            try{
                OperateInfo info =  platformClientUtil.getFrameworkService().fetchOperateTypeByName(name);
                return info;
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code),e.messages);
            }
        }
        /**
         * ä¿å­˜æ“ä½œç±»åž‹
         * add by caill
         * */
        public boolean saveFuncOperation2(FuncOperationInfo funcOperationInfo) throws VciException{
            try {
                platformClientUtil.getFrameworkService().saveFuncOperation2(funcOperationInfo,this.getUserEntityInfo());
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return true;
        }
        /**
         * è¦†ç›–操作类型
         * add by caill
         * */
        public String updateOperation(FuncOperationInfo funcOperationInfo,String dataOperName,String plFuncOid) throws VciException{
            try {
                platformClientUtil.getFrameworkService().updateOperation(funcOperationInfo,this.getUserEntityInfo(),dataOperName,plFuncOid);
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }
        public boolean updateFuncOperation(String id , String alias, boolean isSelected) throws VciException {
            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);
            }
            return res;
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,259 @@
package com.vci.web.controller;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.frameworkcore.compatibility.ISmFunctionQueryService;
import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI;
import com.vci.pagemodel.MenuVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.util.Func;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
 * é¦–页系统模块配置控制器
 * @author ludc
 * @date 2024/8/19 10:55
 */
@RestController
@RequestMapping("/hmSysModConfigController")
@VciUnCheckRight
public class HMSysModConfigController {
    /**
     * åŠŸèƒ½æŸ¥è¯¢æœåŠ¡
     */
    @Resource
    private ISmFunctionQueryService functionQueryService;
    /**
     * é¦–页系统配置服务
     */
    @Resource
    private SmHMSysModConfigServiceI hmSysModConfigService;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * èŽ·å–å½“å‰æ¨¡å—ä¸‹çš„å­æ¨¡å—
     * @param parentId
     * @param modeType
     * @return
     */
    @GetMapping("/getSysModelTreeMenuByPID")
    public BaseResult<List<MenuVO>> getSysModelTreeMenuByPID(String parentId, String modeType) {
        try {
            return BaseResult.dataList(functionQueryService.getSysModelTreeMenuByPID(parentId,modeType,true));
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询子模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * æ·»åŠ æ¨¡å—
     * @param menuVO
     * @return
     */
    @PostMapping("/addModel")
    public BaseResult addModel(@RequestBody MenuVO menuVO) {
        try {
            return BaseResult.success(hmSysModConfigService.addModule(menuVO),"模块增加成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "增加模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * ä¿®æ”¹æ¨¡å—
     * @param menuVO
     * @return
     */
    @PutMapping("/updateModel")
    public BaseResult updateModel(@RequestBody MenuVO menuVO) {
        try {
            return BaseResult.success(hmSysModConfigService.updateModule(menuVO),"模块修改成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "修改模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * åˆ é™¤æ¨¡å—
     * @param menuVO
     * @return
     */
    @DeleteMapping("/delModule")
    public BaseResult delModule(@RequestBody MenuVO menuVO) {
        try {
            return BaseResult.success(hmSysModConfigService.delModule(menuVO),"模块删除成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "删除模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * ç®¡ç†åŠŸèƒ½æ¨¡å—ã€ä¸šåŠ¡åŠŸèƒ½æ¨¡å—ä¸‹çš„å¶å­èŠ‚ç‚¹â€”ä¿®æ”¹æ“ä½œåˆ«åæŽ¥å£
     * @param menuVO
     * @return
     */
    @PutMapping("/updateAlias")
    public BaseResult updateAlias(@RequestBody MenuVO menuVO) {
        try {
            return BaseResult.success(hmSysModConfigService.updateAlias(menuVO),"操作别名修改成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "操作别名修改时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * æ·»åŠ æ“ä½œç±»åž‹
     * @param menuVOList
     * @return
     */
    @PostMapping("/addOperationType")
    public BaseResult addOperationType(@RequestBody List<MenuVO> menuVOList) {
        try {
            return BaseResult.success(hmSysModConfigService.addOperationType(menuVOList),"操作类型添加成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "删除模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * åˆ é™¤éžç³»ç»Ÿæ¨¡å—
     * @return
     */
    @DeleteMapping("/delNonsysModule")
    public BaseResult delNonsysModule() {
        try {
            return BaseResult.success(hmSysModConfigService.delNonsysModule(),"删除非系统模块成功");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "删除非系统模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * åˆ é™¤ä¸šåŠ¡æ¨¡å—
     * @return
     */
    @PostMapping("/delBusinessModule")
    public BaseResult delBusinessModule() {
        try {
            return BaseResult.success(hmSysModConfigService.delBusinessModule(),"删除业务模块");
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "删除业务模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * å¯¼å‡ºç®¡ç†åŠŸèƒ½æ¨¡å—æˆ–æ“ä½œç±»åž‹ç®¡ç†æ¨¡å—sql
     * @return
     */
    @GetMapping("/exportFunctionSql")
    public void exportFunctionSql(HttpServletResponse response,String exportPath,boolean isFunction) {
        try {
            File file = hmSysModConfigService.exportFunctionSql(response,exportPath,isFunction);
            ControllerUtil.writeFileToResponse(response,file,true);
        } catch (Exception e) {
            String msg = "导出sql时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                //出错时
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
    /**
     * å¯¼å‡ºæ¨¡å—
     * @return
     */
    @GetMapping("/exportModule")
    public void exportModule(HttpServletResponse response) {
        try {
            String excelPath = hmSysModConfigService.exportModule(response);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出模块时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                //出错时
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
    /**
     * å¯¼å…¥æ¨¡å—
     * @return
     */
    @GetMapping("/importModule")
    public BaseResult importModule(@RequestParam("files") List<MultipartFile> files) {
        LinkedList<File> fileList = new LinkedList<>();
        try {
            for (MultipartFile file : files) {
                String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
                File file1 = new File(excelFileName);
                file.transferTo(file1);
                fileList.add(file1);
            }
            if(Func.isEmpty(fileList)){
                return hmSysModConfigService.importModule(fileList);
            } else {
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
            }
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }finally {
            fileList.stream().forEach(file -> file.delete());
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java
@@ -49,25 +49,6 @@
    }
    /**
     * èŽ·å–å½“å‰æ¨¡å—ä¸‹çš„å­æ¨¡å—
     * @param parentId
     * @return
     * @throws PLException
     */
    @GetMapping("/getSysModelTreeMenuByPID")
    @VciUnCheckRight
    public List<MenuVO> getSysModelTreeMenuByPID(String parentId) {
        try {
            return functionQueryService.getSysModelTreeMenuByPID(parentId,true);
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询子模块时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * èŽ·å–å½“å‰ç”¨æˆ·çš„èœå•
     * @param treeQueryObject æ ‘查询对象
     * @return  æ ‘节点,出现错误会在异常处理器中统一返回Json
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/properties/JsonConfigReader.java
@@ -17,20 +17,75 @@
    /**
     * èœå•json配置文件,如有其他需要读取的,可以仿照当前逻辑编写
     */
    private static MenuVO menuVO;
    private static sysModuleConf sysModuleConf;
    static{
        try {
            File file = ResourceUtils.getFile("classpath:menuConfig.json");
            String json = FileUtils.readFileToString(file, "UTF-8");
            menuVO = JSON.parseObject(json, MenuVO.class);
            sysModuleConf = JSON.parseObject(json, sysModuleConf.class);
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static MenuVO getMenuVO() {
        return menuVO;
    public static sysModuleConf getSysModuleConf() {
        return sysModuleConf;
    }
    public static class sysModuleConf {
        /**
         * ç³»ç»Ÿæ¨¡å—配置
         */
        private MenuVO sysModuleNode;
        /**
         * ç®¡ç†åŠŸèƒ½æ¨¡å—
         */
        private MenuVO systemManagmentNode;
        /**
         * ä¸šåŠ¡åŠŸèƒ½æ¨¡å—
         */
        private MenuVO modelManagmentNode;
        /**
         * æ“ä½œç±»åž‹æ¨¡å—
         */
        private MenuVO operateNode;
        public void setSysModuleNode(MenuVO sysModuleNode) {
            this.sysModuleNode = sysModuleNode;
        }
        public void setSystemManagmentNode(MenuVO systemManagmentNode) {
            this.systemManagmentNode = systemManagmentNode;
        }
        public void setModelManagmentNode(MenuVO modelManagmentNode) {
            this.modelManagmentNode = modelManagmentNode;
        }
        public MenuVO getSysModuleNode() {
            return sysModuleNode;
        }
        public MenuVO getSystemManagmentNode() {
            return systemManagmentNode;
        }
        public MenuVO getModelManagmentNode() {
            return modelManagmentNode;
        }
        public void setOperateNode(MenuVO operateNode) {
            this.operateNode = operateNode;
        }
        public MenuVO getOperateNode() {
            return operateNode;
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java
@@ -275,7 +275,7 @@
    /**
     * å¯¼å‡ºä¸šåŠ¡ç±»åž‹
     * name ä¸šåŠ¡ç±»åž‹åç§°
     * oid ä¸šåŠ¡ç±»åž‹åç§°
     * @return åˆ›å»ºç»“æžœ
     */
    void expData(String oid, HttpServletResponse response) throws PLException, IOException;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -1264,7 +1264,7 @@
    /**
     * å¯¼å‡ºä¸šåŠ¡ç±»åž‹
     * name ä¸šåŠ¡ç±»åž‹åç§°
     * oid ä¸šåŠ¡ç±»åž‹åç§°
     * @return åˆ›å»ºç»“æžœ
     */
    @Override