ludc
2024-08-16 56de7a42d2567ce72885be8ebb1d1250d68ddd1b
业务类型接口联调调整,首页系统模块配置查询接口上传
已修改13个文件
已添加2个文件
548 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsBtmTypeDTO.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsBtmTypeAttributeVO.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsBtmTypeVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/properties/JsonConfigReader.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsCodeGenSchemaServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/OsScanAnnotationTool.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsBtmTypeDTO.java
@@ -86,11 +86,6 @@
    private String lifeCycleId;
    /**
     * ç”Ÿå‘½å‘¨æœŸçš„中文名称
     */
    private String lifeCycleName;
    /**
     * ç‰ˆæ¬¡è§„则
     */
    private String versionRule;
@@ -104,11 +99,6 @@
     * å¤‡ç”¨ç”Ÿå‘½å‘¨æœŸè‹±æ–‡åç§°
     */
    private String subLifeCycleId;
    /**
     * å¤‡ç”¨ç”Ÿå‘½å‘¨æœŸä¸­æ–‡åç§°
     */
    private String subLifeCycleName;
    /**
     * æ˜¯å¦ä¸ºè§†å›¾
@@ -136,14 +126,9 @@
    private String delimiter;
    /**
     * æ·»åŠ æˆ–è€…ç§»é™¤çš„å±žæ€§ä¿¡æ¯
     */
    private List<OsBtmTypeLinkAttributesDTO> attributes;
    /**
     * æ·»åŠ æˆ–ç§»é™¤çš„å±žæ€§
     */
    private String[] apNameArray;
    private String apNameArray;
    /**
     * æ—¶é—´æˆ³ï¼Œç”¨äºŽæ ¡éªŒæ˜¯å¦æœ€æ–°æ•°æ®
@@ -170,11 +155,11 @@
     */
    private Date lastModifyTime;
    public void setApNameArray(String[] apNameArray) {
    public void setApNameArray(String apNameArray) {
        this.apNameArray = apNameArray;
    }
    public String[] getApNameArray() {
    public String getApNameArray() {
        return apNameArray;
    }
@@ -338,14 +323,6 @@
        this.versionRule = versionRule;
    }
    public List<OsBtmTypeLinkAttributesDTO> getAttributes() {
        return attributes;
    }
    public void setAttributes(List<OsBtmTypeLinkAttributesDTO> attributes) {
        this.attributes = attributes;
    }
    public Date getTs() {
        return ts;
    }
@@ -386,28 +363,12 @@
        this.lifeCycleId = lifeCycleId;
    }
    public String getLifeCycleName() {
        return lifeCycleName;
    }
    public void setLifeCycleName(String lifeCycleName) {
        this.lifeCycleName = lifeCycleName;
    }
    public String getSubLifeCycleId() {
        return subLifeCycleId;
    }
    public void setSubLifeCycleId(String subLifeCycleId) {
        this.subLifeCycleId = subLifeCycleId;
    }
    public String getSubLifeCycleName() {
        return subLifeCycleName;
    }
    public void setSubLifeCycleName(String subLifeCycleName) {
        this.subLifeCycleName = subLifeCycleName;
    }
    public String getClassFullName() {
@@ -436,14 +397,11 @@
                ", implClass='" + implClass + '\'' +
                ", shape='" + shape + '\'' +
                ", lifeCycleId='" + lifeCycleId + '\'' +
                ", lifeCycleName='" + lifeCycleName + '\'' +
                ", versionRule='" + versionRule + '\'' +
                ", subLifeCycleId='" + subLifeCycleId + '\'' +
                ", subLifeCycleName='" + subLifeCycleName + '\'' +
                ", viewFlag=" + viewFlag +
                ", viewCreateSql='" + viewCreateSql + '\'' +
                ", classFullName='" + classFullName + '\'' +
                ", attributes=" + attributes +
                ", ts=" + ts +
                '}';
    }
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java
@@ -33,7 +33,6 @@
     */
    private Boolean hasChildren;
    /**
     * èœå•编号
     */
@@ -103,11 +102,25 @@
     * æ˜¯å¦æ–°çª—口打开
     */
    private String isOpenName;
    /**
     * åªé’ˆå¯¹äºŽé¦–页系统模块配置使用,用于区分点击不同的节点,展开的不同查询逻辑
     */
    private String modeType;
    /**
     * å‰ç«¯æ˜¯å¦éšè—
     */
    private HashMap<String,Boolean> meta = new HashMap<>();
    public String getModeType() {
        return modeType;
    }
    public void setModeType(String modeType) {
        this.modeType = modeType;
    }
    public String getId() {
        return id;
    }
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsBtmTypeAttributeVO.java
@@ -53,7 +53,7 @@
    /**
     * æ•°æ®ç±»åž‹
     */
    private String attrDataType;
    private String attributeDataType;
    /**
     * æ˜¯å¦å¯ä»¥ä¸ºç©º
@@ -191,12 +191,12 @@
        this.description = description;
    }
    public String getAttrDataType() {
        return attrDataType;
    public String getAttributeDataType() {
        return attributeDataType;
    }
    public void setAttrDataType(String attrDataType) {
        this.attrDataType = attrDataType;
    public void setAttributeDataType(String attributeDataType) {
        this.attributeDataType = attributeDataType;
    }
    public boolean isReferFlag() {
@@ -379,7 +379,7 @@
                ", name='" + name + '\'' +
                ", attributeLength=" + attributeLength +
                ", description='" + description + '\'' +
                ", attrDataType='" + attrDataType + '\'' +
                ", attributeDataType='" + attributeDataType + '\'' +
                ", nullableFlag=" + nullableFlag +
                ", defaultValue='" + defaultValue + '\'' +
                ", precisionLength=" + precisionLength +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsBtmTypeVO.java
@@ -1,5 +1,7 @@
package com.vci.pagemodel;
import com.vci.starter.web.pagemodel.Tree;
import java.util.Date;
import java.util.List;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
@@ -1,9 +1,11 @@
package com.vci.frameworkcore.compatibility;
import com.vci.common.exception.VciException;
import com.vci.corba.common.PLException;
import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum;
import com.vci.pagemodel.MenuVO;
import com.vci.pagemodel.SmFunctionVO;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.PageHelper;
import com.vci.starter.web.pagemodel.Tree;
@@ -52,13 +54,23 @@
    List<MenuVO> treeCurrentUserMenu(TreeQueryObject treeQueryObject, ResourceControlTypeEnum resourceControlTypeEnum) throws PLException;
    /**
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    List<MenuVO> getSysModelTreeMenuByPID(String parentId,boolean isAll) throws VciBaseException;
    int checkChildObject(String moduleId) throws VciException;
    /**
     * èŽ·å–æ‰€æœ‰çš„åŠŸèƒ½èœå•
     * @param treeQueryObject æ ‘查询对象
     * @param resourceControlTypeEnum è§’色控制区域,也是功能控制的区域
     * @return  æ ‘节点,出现错误会在异常处理器中统一返回Json
     */
     List<Tree> treeAllMenu(TreeQueryObject treeQueryObject, ResourceControlTypeEnum resourceControlTypeEnum);
    /**
     * é€šè¿‡ä¸Šçº§èŠ‚ç‚¹èŽ·å–ä¸‹çº§çš„æ‰€æœ‰çš„èœå•èŠ‚ç‚¹
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -2,8 +2,13 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.vci.client.ClientSession;
import com.vci.common.exception.VciException;
import com.vci.common.locale.LocaleDisplay;
import com.vci.corba.common.PLException;
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.RoleRightInfo;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.portal.data.PLUILayout;
@@ -14,13 +19,13 @@
import com.vci.pagemodel.MenuVO;
import com.vci.pagemodel.SmFunctionVO;
import com.vci.omd.utils.ObjectTool;
import com.vci.pagemodel.SmFunctionVO;
import com.vci.starter.web.constant.QueryOptionConstant;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.*;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
import com.vci.pagemodel.UIContentVO;
import com.vci.web.properties.JsonConfigReader;
import com.vci.web.service.UIEngineServiceI;
import com.vci.web.service.WebBoServiceI;
import com.vci.web.util.Func;
@@ -279,107 +284,156 @@
            }
            functionVOList.add(functionVO);
        }
        //如果是开发或者测试用户,需哟获取系统模块配置菜单
        if(adminOrDeveloperOrRoot){
            functionVOList.addAll(this.getSystemMenu());
            //获取首页系统模块配置菜单
            MenuVO menuVO = JsonConfigReader.getMenuVO();
            functionVOList.add(menuVO);
        }
        return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
    }
    /**
     * èŽ·å–é¦–é¡µç³»ç»Ÿæ¨¡å—é…ç½®èœå•
     * é€šè¿‡æ¨¡å—ID获取子级列表
     * @param parentId
     * @param isAll æ˜¯å¦åŒ…括无效的模块,true则包括
     * @return
     * @throws VciBaseException
     */
    @Override
    public List<MenuVO> getSysModelTreeMenuByPID(String parentId,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")){
                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.setId(info.id);
                                menuVO.setCode(info.funcId);
                                menuVO.setId(info.operId);
                                menuVO.setName(info.operName);
                                //menuVO.setOperIndentify(info.operIndentify);
                                menuVO.setAlias(info.operAlias);
                                menuVO.setRemark(info.operDesc);
                                menuVO.setSort((int) info.number);
                                //menuVO.setIsValid(info.isValid);
                                menuVO.setHasChildren(false);
                                menuVOList.add(menuVO);
                            }
                        }catch (PLException e) {
                            e.printStackTrace();
                            throw new VciBaseException(String.valueOf(e.code), e.messages);
                        }
                    }else if(childType == 1){
                        try{
                            FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll);
                            for(int i = 0;i < funcInfos.length; i++){
                                FunctionInfo funcInfo = funcInfos[i];
                                MenuVO menuVO = this.functionInfoToMenuVO(funcInfo);
                                menuVOList.add(menuVO);
                            }
                        }catch (PLException e) {
                            e.printStackTrace();
                            throw new VciBaseException(String.valueOf(e.code),e.messages);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new VciBaseException("模块查询时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e));
                }
            }else{
                try{
                    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);
                    }
                }catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException(String.valueOf(e.code),e.messages);
                }
            }
        }else if(parentId.equals("operateType")){
            //加载所有操作
            try{
                OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId);
                for(int i = 0; i < operateInfos.length;i++ ){
                    OperateInfo operateInfo = operateInfos[i];
                    MenuVO menuVO = new MenuVO();
                    menuVO.setId(operateInfo.id);
                    menuVO.setName(operateInfo.name);
                    menuVO.setCode(operateInfo.identify);
                    menuVO.setAlias(operateInfo.alias);
                    menuVO.setCategory(2);
                    menuVO.setRemark(operateInfo.desc);
                    menuVO.getMeta().put("keepAlive",false);
                    menuVO.setSort((int) operateInfo.seq);
                    menuVO.setModeType("operateObject");
                    menuVO.setHasChildren(false);
                    menuVOList.add(menuVO);
                }
            }catch (PLException e) {
                e.printStackTrace();
                throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)});
            }
        }
        return menuVOList;
    }
    /**
     * functionInfo转VO对象
     * @param funcInfo
     * @return
     */
    private List<MenuVO> getSystemMenu(){
        /*如果是测试账号或者开发账号,处理返回systemManagmentNode和modelManagmentNode以外,
         è¿˜éœ€è¦è¿”回操作类型管理菜单节点(operateNode)和系统配置、系统运行监控节点*/
        List<MenuVO> functionVOList = new ArrayList<>();
        String menuJson = "{\n" +
                "    \"hasChildren\": true,\n" +
                "    \"children\": [\n" +
                "        {\n" +
                "            \"hasChildren\": true,\n" +
                "            \"children\": [],\n" +
                "            \"id\": \"systemManagmentNode\",\n" +
                "            \"name\": \"管理功能模块\",\n" +
                "            \"parentId\": \"VCIBaseTreeNode\",\n" +
                "            \"code\": \"systemManagmentNode\",\n" +
                "            \"alias\": \"system\",\n" +
                "            \"meta\": {\n" +
                "                \"keepAlive\": false\n" +
                "            },\n" +
                "            \"sort\": 2,\n" +
                "            \"soruce\": \"\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"hasChildren\": true,\n" +
                "            \"children\": [],\n" +
                "            \"id\": \"modelManagmentNode\",\n" +
                "            \"name\": \"业务功能模块\",\n" +
                "            \"parentId\": \"VCIBaseTreeNode\",\n" +
                "            \"code\": \"modelManagmentNode\",\n" +
                "            \"alias\": \"model\",\n" +
                "            \"meta\": {\n" +
                "                \"keepAlive\": false\n" +
                "            },\n" +
                "            \"sort\": 3,\n" +
                "            \"soruce\": \"\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"hasChildren\": true,\n" +
                "            \"children\": [],\n" +
                "            \"id\": \"operateNode\",\n" +
                "            \"name\": \"操作类型管理\",\n" +
                "            \"parentId\": \"VCIBaseTreeNode\",\n" +
                "            \"code\": \"operateNode\",\n" +
                "            \"alias\": \"operate\",\n" +
                "            \"meta\": {\n" +
                "                \"keepAlive\": false\n" +
                "            },\n" +
                "            \"sort\": 4,\n" +
                "            \"soruce\": \"\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"hasChildren\": false,\n" +
                "            \"children\": [],\n" +
                "            \"id\": \"sysOptionNode\",\n" +
                "            \"name\": \"系统配置\",\n" +
                "            \"parentId\": \"VCIBaseTreeNode\",\n" +
                "            \"code\": \"sysOptionNode\",\n" +
                "            \"alias\": \"sysOption\",\n" +
                "            \"meta\": {\n" +
                "                \"keepAlive\": false\n" +
                "            },\n" +
                "            \"sort\": 5,\n" +
                "            \"soruce\": \"\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"hasChildren\": false,\n" +
                "            \"children\": [],\n" +
                "            \"id\": \"sysMonitorNode\",\n" +
                "            \"name\": \"系统运行监控\",\n" +
                "            \"parentId\": \"VCIBaseTreeNode\",\n" +
                "            \"code\": \"sysMonitorNode\",\n" +
                "            \"alias\": \"sysMonitor\",\n" +
                "            \"meta\": {\n" +
                "                \"keepAlive\": false\n" +
                "            },\n" +
                "            \"sort\": 5,\n" +
                "            \"soruce\": \"\"\n" +
                "        }\n" +
                "    ],\n" +
                "    \"id\": \"VCIBaseTreeNode\",\n" +
                "    \"name\": \"系统模块配置\",\n" +
                "    \"parentId\": \"\",\n" +
                "    \"code\": \"rootNode\",\n" +
                "    \"alias\": \"root\",\n" +
                "    \"meta\": {\n" +
                "        \"keepAlive\": false\n" +
                "    },\n" +
                "    \"sort\": 1,\n" +
                "    \"soruce\": \"\"\n" +
                "}";
        functionVOList.add(JSON.parseObject(menuJson, MenuVO.class));
        return functionVOList;
    private MenuVO functionInfoToMenuVO(FunctionInfo funcInfo){
        MenuVO menuVO = new MenuVO();
        menuVO.setId(funcInfo.id);
        menuVO.setSource(funcInfo.image);
        //if(StringUtils.isBlank(menu.resourceB)){
        //    continue;
        //}
        menuVO.setPath(funcInfo.resourceB);
        menuVO.setParentId(funcInfo.parentId);
        menuVO.setCode(funcInfo.aliasName);
        menuVO.setAlias(funcInfo.aliasName);
        menuVO.setName(funcInfo.name);
        menuVO.getMeta().put("keepAlive",false);
        menuVO.setSort((int) funcInfo.seq);
        if(this.checkChildObject(menuVO.getId()) == 0){
            menuVO.setHasChildren(false);
        }else{
            menuVO.setHasChildren(true);
        }
        return menuVO;
    }
    /**
     * é€šè¿‡æ¨¡å—ID检查该模块子级对象是模块还是操作
     * @param moduleId
     * @return 0表示没有模块也没有操作,1表示有模块,2表示有操作
     * @throws VciException
     */
    @Override
    public int checkChildObject(String moduleId) throws VciBaseException {
        long res = 0;
        try{
            res = ClientSession.getFrameworkService().checkChildObject(moduleId);
        }catch (PLException e) {
            e.printStackTrace();
            throw new VciBaseException(String.valueOf(e.code),e.messages);
        }
        return (int)res;
    }
    public List<MenuVO> findChildFunctionVO(String parentOid,Map<String, List<FunctionInfo>> map) throws PLException {
@@ -723,6 +777,7 @@
        }
        return dataGrid(queryMap,pageHelper);
    }
    /**
     * æ‰¹é‡æ ¹æ®è§’色的主键获取关联的权限
     *
@@ -755,7 +810,6 @@
        }
        return gridFunctionByRoleOid(roleOidCollection.stream().collect(Collectors.joining(",")), queryMap,pageHelper,resourceControlTypeEnum,false);
    }
    /**
     * æ¸…除缓存
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/SmFunctionController.java
@@ -6,8 +6,12 @@
import com.vci.pagemodel.MenuVO;
import com.vci.pagemodel.SmFunctionVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.*;
import com.vci.pagemodel.UIContentVO;
import com.vci.starter.web.util.VciBaseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -29,6 +33,10 @@
    @Autowired
    private ISmFunctionQueryService functionQueryService;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
   /**
    * èŽ·å–å½“å‰ç”¨æˆ·çš„èœå•
@@ -41,6 +49,25 @@
    }
    /**
     * èŽ·å–å½“å‰æ¨¡å—ä¸‹çš„å­æ¨¡å—
     * @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/controller/WebBtmTypeController.java
@@ -54,7 +54,6 @@
@RequestMapping("/btmTypeController")
@VciBusinessLog(modelName="业务类型")
@RestController
@VciUnCheckRight
public class WebBtmTypeController {
    /**
@@ -191,7 +190,7 @@
     * btmTypeDTO é“¾æŽ¥ç±»åž‹ä¿®æ”¹çš„对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/updateBtmType")
    @PutMapping("/updateBtmType")
    public BaseResult updateBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){
        try {
            return btmService.updateBtmType(btmTypeDTO) ? BaseResult.success("业务类型修改成功!"):BaseResult.fail("业务类型修改失败!");
@@ -469,7 +468,7 @@
                OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
                BeanUtil.convert(attr,attributeVO);
                attributeVO.setAttributeLength(attr.getAttrLength());
                attributeVO.setAttrDataType(attr.getAttributeDataType());
                attributeVO.setAttributeDataType(attr.getAttributeDataType());
                attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
                attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
                finalBoAttrs.add(attributeVO);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/properties/JsonConfigReader.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.vci.web.properties;
import com.alibaba.fastjson.JSON;
import com.vci.pagemodel.MenuVO;
import org.apache.commons.io.FileUtils;
import org.springframework.util.ResourceUtils;
import java.io.*;
/**
 * è¯»å–json配置文件,菜单等
 * @author ludc
 * @date 2024/8/16 10:09
 */
public class JsonConfigReader {
    /**
     * èœå•json配置文件,如有其他需要读取的,可以仿照当前逻辑编写
     */
    private static MenuVO menuVO;
    static{
        try {
            File file = ResourceUtils.getFile("classpath:menuConfig.json");
            String json = FileUtils.readFileToString(file, "UTF-8");
            menuVO = JSON.parseObject(json, MenuVO.class);
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static MenuVO getMenuVO() {
        return menuVO;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -232,7 +232,7 @@
                BeanUtil.convert(attributeVO,btmTypeAttributeVO);
                btmTypeAttributeVO.setPkBtmType(vo.getOid());
                btmTypeAttributeVO.setBtmTypeId(vo.getId());
                btmTypeAttributeVO.setAttrDataType(attributeVO.getAttributeDataType());
                btmTypeAttributeVO.setAttributeDataType(attributeVO.getAttributeDataType());
                btmTypeAttributeVO.setAttributeLength(attributeVO.getAttrLength());
                btmTypeAttributeVO.setDefaultValue(attributeVO.getDefaultValue());
                if("secretgrade".equalsIgnoreCase(attributeVO.getId())){
@@ -385,7 +385,7 @@
            attributeService.getDefaultAttributeVOs().stream().forEach(attr->{
                OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
                BeanUtil.convert(attr, attributeVO);
                attributeVO.setAttrDataType(attr.getAttributeDataType());
                attributeVO.setAttributeDataType(attr.getAttributeDataType());
                attributeVO.setAttributeLength(attr.getAttrLength());
                attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
                attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
@@ -648,7 +648,7 @@
            AttributeDef sysAttributeDef = collect.get(attrName.toLowerCase());
            OsBtmTypeAttributeVO vo = new OsBtmTypeAttributeVO();
            vo.setOid(sysAttributeDef.oid);
            vo.setAttrDataType(sysAttributeDef.vtDataType);
            vo.setAttributeDataType(sysAttributeDef.vtDataType);
            vo.setPkBtmType(btmName);
            vo.setCreateTime(new Date(sysAttributeDef.createTime));
            vo.setCreator(sysAttributeDef.creator);
@@ -667,7 +667,7 @@
        for (AttributeDef attribute : attributeDefs) {
            OsBtmTypeAttributeVO vo = new OsBtmTypeAttributeVO();
            vo.setOid(attribute.oid);
            vo.setAttrDataType(attribute.vtDataType);
            vo.setAttributeDataType(attribute.vtDataType);
            vo.setPkBtmType(btmName);
            vo.setCreateTime(new Date(attribute.createTime));
            vo.setCreator(attribute.creator);
@@ -695,6 +695,7 @@
     */
    private BizType dto2BizType(OsBtmTypeDTO dto){
        BizType bizType = new BizType();
        bizType.oid = dto.getOid();
        bizType.name =dto.getId();
        bizType.isAbstract = dto.isAbstractFlag();
        bizType.label = dto.getName();
@@ -710,24 +711,24 @@
        }
        bizType.description = dto.getDescription();
        bizType.revLevel = dto.getRevLevel();
        bizType.revRuleName = dto.getRevisionRuleId();
        bizType.revInput = dto.isInputRevisionFlag();
        bizType.delimiter = (dto.getDelimiter() == null ? "" : dto.getDelimiter());
        bizType.verRuleName = Short.parseShort(dto.getVersionRule());
        bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0:Short.parseShort(dto.getVersionRule());
        //bizType.imageName = dto.get;
        //List<String> attrIdList = dto.getAttributesDTOList().stream().map(OsBtmTypeLinkAttributesDTO::getId).collect(Collectors.toList());
        bizType.apNameArray = dto.getApNameArray();//attrIdList.toArray(new String[attrIdList.size()]);
        bizType.apNameArray = dto.getApNameArray().split(",");//attrIdList.toArray(new String[attrIdList.size()]);
        String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
        long timeMillis = System.currentTimeMillis();
        bizType.creator = Func.isBlank(dto.getCreator()) ? userId:dto.getCreator();
        bizType.createTime = Func.isEmpty(dto.getCreateTime()) ? timeMillis:dto.getCreateTime().getTime();
        bizType.modifier = userId;
        bizType.modifyTime = timeMillis;
        bizType.ts = Func.isEmpty(dto.getTs())? timeMillis:dto.getTs().getTime();
        return bizType;
    }
@@ -856,14 +857,14 @@
        checkRevLevel(dbBizType,btmTypeDTO);
        checkVersionInfo(btmTypeDTO);
        //处理业务类型下的属性
        List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray()));
        List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray().split(",")));
        //不能移除的属性
        String[] unRemovableFields = null;
        List<String> unRemovableFields_ = null;
        //需要移除的属性
        List<String> removableFields = null;
        //修改前业务类型在数据库中已存在的所有属性
        String[] apNameArray = btmTypeDTO.getApNameArray();
        String[] apNameArray = btmTypeDTO.getApNameArray().split(",");
        Set<String> dbApNameArray = Arrays.stream(dbBizType.apNameArray)
                .collect(Collectors.toSet());
        //过滤出需要移除的属性
@@ -1481,7 +1482,7 @@
            if(StringUtils.isBlank(bizType.getfName())){
                continue;
            }
            if(bizType.getfName().equals(parentBIzType.getName())){
            if(bizType.getfName().equals(parentBIzType.getId())){
                Tree tree = new Tree();
                tree.setOid(bizType.getOid());
                tree.setParentName(parentBIzType.getfName());
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsCodeGenSchemaServiceImpl.java
@@ -412,7 +412,7 @@
            if(StringUtils.isBlank(idAttr.getName())){
                idAttr.setName("编号");
            }
            idAttr.setAttrDataType(VciFieldTypeEnum.VTString.name());
            idAttr.setAttributeDataType(VciFieldTypeEnum.VTString.name());
            if(idAttr.getAttributeLength() == null || idAttr.getAttributeLength() <= 0){
                idAttr.setAttributeLength(50);
            }
@@ -426,7 +426,7 @@
            if(StringUtils.isBlank(nameAttr.getName())){
                nameAttr.setName("名称");
            }
            nameAttr.setAttrDataType(VciFieldTypeEnum.VTString.name());
            nameAttr.setAttributeDataType(VciFieldTypeEnum.VTString.name());
            if(nameAttr.getAttributeLength() == null || nameAttr.getAttributeLength() <= 0){
                nameAttr.setAttributeLength(150);
            }
@@ -440,7 +440,7 @@
            if(StringUtils.isBlank(descAttr.getName())){
                descAttr.setName("描述");
            }
            descAttr.setAttrDataType(VciFieldTypeEnum.VTString.name());
            descAttr.setAttributeDataType(VciFieldTypeEnum.VTString.name());
            if(descAttr.getAttributeLength() == null || descAttr.getAttributeLength() <= 0){
                descAttr.setAttributeLength(250);
            }
@@ -455,7 +455,7 @@
                if(VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(attributeBO.getId())){
                    attributeBO.setName("状态");
                }
                attributeBO.setVciAttrDataType(attr.getAttrDataType());
                attributeBO.setVciAttrDataType(attr.getAttributeDataType());
                attributeBO.setNullable(String.valueOf(attr.isNullableFlag()));
                attributeBO.setAttrDataType(getAttrDateTypeFromVci(attributeBO.getVciAttrDataType()));
                attributeBO.setJdbcType(getJdbcTypeFromVci(attributeBO.getVciAttrDataType()));
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -319,7 +319,7 @@
                    }
                    OsBtmTypeAttributeVO attributeVO = attributeVOMap.getOrDefault(attrId.toLowerCase(Locale.ROOT), null);
                    if(attributeVO!=null){
                        String vtType = attributeVO.getAttrDataType();
                        String vtType = attributeVO.getAttributeDataType();
                        String attrType = "";
                        VciFieldTypeEnum fieldTypeEnum = VciFieldTypeEnum.forValue(vtType);
                        if(fieldTypeEnum == null) {
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
@@ -735,7 +735,7 @@
                OsBtmTypeAttributeVO idAttrVO = new OsBtmTypeAttributeVO();
                idAttrVO.setId("id");
                idAttrVO.setName("编号");
                idAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name());
                idAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name());
                idAttrVO.setAttributeLength(50);
                idAttrVO.setNullableFlag(true);
                attributes.add(idAttrVO);
@@ -743,7 +743,7 @@
                OsBtmTypeAttributeVO nameAttrVO = new OsBtmTypeAttributeVO();
                nameAttrVO.setId("name");
                nameAttrVO.setName("名称");
                nameAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name());
                nameAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name());
                nameAttrVO.setAttributeLength(50);
                nameAttrVO.setNullableFlag(true);
                attributes.add(nameAttrVO);
@@ -751,7 +751,7 @@
                OsBtmTypeAttributeVO descAttrVO = new OsBtmTypeAttributeVO();
                descAttrVO.setId("description");
                descAttrVO.setName("描述");
                descAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name());
                descAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name());
                descAttrVO.setAttributeLength(150);
                descAttrVO.setNullableFlag(true);
                attributes.add(descAttrVO);
@@ -894,7 +894,7 @@
                    //然后属性的中文名称
                    rowDataList.add(new WriteExcelData(rowIndex, 3, attributeVO.getName()));
                    //属性的类型
                    rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttrDataType())));
                    rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttributeDataType())));
                    //是否可以为空
                    rowDataList.add(new WriteExcelData(rowIndex, 5, attributeVO.isNullableFlag() ? "是" : "否"));
                    //属性长度
@@ -1064,7 +1064,7 @@
        }
        columnData.put(wordFieldProperties.getColumnId(),btmTypeAttributeVO.getId().toLowerCase());
        columnData.put(wordFieldProperties.getColumnName(),btmTypeAttributeVO.getName());
        String attrDataType = btmTypeAttributeVO.getAttrDataType();
        String attrDataType = btmTypeAttributeVO.getAttributeDataType();
        String columnType = VciFieldTypeEnum.getTextByValue(attrDataType);
        if(StringUtils.isBlank(columnType)){
            columnType = "字符串";
@@ -1194,15 +1194,8 @@
        } else {
            btmItem.verRuleName = 0;
        }
        //包含的属性的数组
        List<OsBtmTypeLinkAttributesDTO> attributesDTOList = btmTypeDTO.getAttributes();
        List<String> attrIdList = new ArrayList<String>();
        if (!CollectionUtils.isEmpty(attributesDTOList)) {
            for (OsBtmTypeLinkAttributesDTO attr : attributesDTOList) {
                attrIdList.add(attr.getId().toLowerCase());
            }
        }
        btmItem.apNameArray = attrIdList.toArray(new String[0]);
        //包含的属性名称
        btmItem.apNameArray = btmTypeDTO.getApNameArray().split(",");
    }
    /**
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/OsScanAnnotationTool.java
@@ -465,7 +465,7 @@
        Collections.addAll(fields,btmTypeClass.getDeclaredFields());
        List<OsBtmTypeLinkAttributesDTO> btmTypeLinkAttributesDTOList = new ArrayList<OsBtmTypeLinkAttributesDTO>();
        scanAttributes(fields,attributeDTOMap,btmTypeLinkAttributesDTOList,processAttributeInfo);
        btmTypeDTO.setAttributes(btmTypeLinkAttributesDTOList);
        btmTypeDTO.setApNameArray(btmTypeLinkAttributesDTOList.stream().map(OsBtmTypeLinkAttributesDTO::getId).collect(Collectors.joining(",")));
        btmTypeDTOMap.put(btmTypeDTO.getId().toLowerCase().trim(),btmTypeDTO);
    }
Source/plt-web/plt-web-parent/plt-web/src/main/resources/menuConfig.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
{
  "hasChildren": true,
  "children": [
    {
      "hasChildren": true,
      "children": [],
      "id": "systemManagmentNode",
      "name": "管理功能模块",
      "parentId": "VCIBaseTreeNode",
      "code": "systemManagmentNode",
      "alias": "system",
      "meta": {
        "keepAlive": false
      },
      "sort": 2,
      "soruce": "",
      "path": "views/systemModel/mangeModel/index"
    },
    {
      "hasChildren": true,
      "children": [],
      "id": "modelManagmentNode",
      "name": "业务功能模块",
      "parentId": "VCIBaseTreeNode",
      "code": "modelManagmentNode",
      "alias": "model",
      "meta": {
        "keepAlive": false
      },
      "sort": 3,
      "soruce": "",
      "path": "views/systemModel/businessModel/index"
    },
    {
      "hasChildren": true,
      "children": [],
      "id": "operateNode",
      "name": "操作类型管理",
      "parentId": "VCIBaseTreeNode",
      "code": "operateNode",
      "alias": "operate",
      "meta": {
        "keepAlive": false
      },
      "sort": 4,
      "soruce": "",
      "path": "views/systemModel/operateType/index"
    },
    {
      "hasChildren": false,
      "children": [],
      "id": "sysOptionNode",
      "name": "系统配置",
      "parentId": "VCIBaseTreeNode",
      "code": "sysOptionNode",
      "alias": "sysOption",
      "meta": {
        "keepAlive": false
      },
      "sort": 5,
      "soruce": "",
      "path": "views/systemModel/systemConfig/index"
    },
    {
      "hasChildren": false,
      "children": [],
      "id": "sysMonitorNode",
      "name": "系统运行监控",
      "parentId": "VCIBaseTreeNode",
      "code": "sysMonitorNode",
      "alias": "sysMonitor",
      "meta": {
        "keepAlive": false
      },
      "sort": 5,
      "soruce": "",
      "path": "views/systemModel/systemMonitor/index"
    }
  ],
  "id": "VCIBaseTreeNode",
  "name": "系统模块配置",
  "parentId": "systemManagmentNode",
  "code": "rootNode",
  "alias": "root",
  "meta": {
    "keepAlive": false
  },
  "sort": 0,
  "soruce": "",
  "path": ""
}