田源
2024-09-27 8bb85606a294d2c6d2d4840d42a62744d7ef909b
Merge remote-tracking branch 'origin/master'
已修改26个文件
已重命名3个文件
已添加6个文件
1917 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogInfoDTO.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogPeriodInfoDTO.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/pom.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/pom.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java 390 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java 615 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/PlatformClientUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/resources/properties/ice.properties 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/wel/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogInfoDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
package com.vci.dto;
import lombok.Data;
import java.io.Serializable;
/**
 * æ—¥å¿—传输对象
 * @author yuxc
 * @date 2024-09-18
 */
@Data
public class LogInfoDTO implements Serializable {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2492852474710986720L;
    private String puid;
    private String username;
    private String truename;
    private String userIp;
    private String result;
    private String content;
    private String date;
    private String type;
    private String moduleName;
    private String entityDesc;
    private String property;
    private String previousVal;
    private String newVal;
    private String logType;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogPeriodInfoDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package com.vci.dto;
import lombok.Data;
import java.io.Serializable;
/**
 * ä¿å­˜æœŸé™ä¼ è¾“对象
 * @author yuxc
 * @date 2024-09-11
 */
@Data
public class LogPeriodInfoDTO implements Serializable {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2492852474710986720L;
    //编码
    public String code;
    //值
    public String value;
    //是否选中
    public boolean choose;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/LogQueryCriteriaDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.vci.dto;
import lombok.Data;
import java.io.Serializable;
/**
 * æ—¥å¿—查询传输对象
 * @author yuxc
 * @date 2024-09-18
 */
@Data
public class LogQueryCriteriaDTO implements Serializable {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2492852474710986720L;
    //开始时间
    private String startDate;
    //结束日期
    private String endDate;
    //日志类型,1:登录;2:登出;3:授权;4:一般操作;5:集成应用
    int logType;
    //用户IP
    String ipText;
    //操作用户
    String userName;
    //操作类型
    String typeText;
    //页码
    int pageNo;
    //页面条数
    int pageSize;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
@@ -76,7 +76,7 @@
    private List<PLTabButtonVO> children;
    /**
     * æ˜¯å¦æ˜¾ç¤º
     * æ˜¾ç¤ºæ–¹å¼
     */
    private String displayMode;
@@ -91,7 +91,7 @@
    private String authorization;
    /**
     * æ˜¾ç¤ºæ–¹å¼
     * æ˜¯å¦æ˜¾ç¤º
     */
    private String show;
Source/plt-web/plt-web-parent/plt-web-base/pom.xml
@@ -73,6 +73,23 @@
            <artifactId>icegridgui</artifactId>
            <version>1.0.RELEASE</version>
        </dependency>
        <!--redis start-->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>2.1.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.9.0</version>
        </dependency>
        <!--redis end-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.13.3</version>
        </dependency>
    </dependencies>
</project>
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java
@@ -82,6 +82,11 @@
    public static final String SYS_ENUM_KEY = "sys_enum:";
    /**
     * å½“前登录的用户总数cache key
     */
    public static final String CURRENT_LOGGED_USERS_KEY = "current_logged_users";
    /**
     * èµ„源映射路径 å‰ç¼€
     */
    public static final String RESOURCE_PREFIX = "/profile";
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java
@@ -1,8 +1,6 @@
package com.vci.starter.web.interceptor;
import com.vci.starter.web.constant.TokenKeyConstant;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java
@@ -4,9 +4,11 @@
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.autoconfigure.SpringMVCConfig;
import com.vci.starter.web.constant.TokenKeyConstant;
import com.vci.starter.web.constant.VConstant;
import com.vci.starter.web.enumpck.ResultCodeEnum;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.SessionInfo;
import com.vci.starter.web.redis.RedisService;
import com.vci.starter.web.util.ApplicationContextProvider;
import com.vci.starter.web.util.LangBaseUtil;
import com.vci.starter.web.util.VciBaseUtil;
@@ -15,15 +17,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -56,6 +54,9 @@
    @Autowired
    private VciSessionForLoginI vciSessionForLoginI;
    @Autowired
    private RedisService redisService;
    /**
     * æ‰§è¡Œæ‹¦æˆª
     * @param request è¯·æ±‚对象
@@ -76,7 +77,7 @@
        if(StringUtils.isBlank(userToken)){
            userToken = request.getParameter(TokenKeyConstant.USER_TOKEN_KEY);
        }
        if(!(handler instanceof  HandlerMethod)){
        if(!(handler instanceof HandlerMethod)){
            return true;
        }
@@ -127,6 +128,11 @@
                if(logger.isErrorEnabled()) {
                    logger.error("token值非法,或过期,或者用户已经被踢下线," + userToken);
                }
                //删除缓存中统计的用户信息
                if(redisService == null){
                    redisService = ApplicationContextProvider.getBean(RedisService.class);
                }
                redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
                sendErrorMsg(response,"token值非法,或过期,或者用户已经被踢下线," + userToken,1);
                return false;
            }else{
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/pagemodel/Tree.java
@@ -58,6 +58,10 @@
     */
    private String text;
    /**
     * ç¼–号
     */
    private String id;
    /**
     * æ˜¯å¦å¶å­
     */
    private boolean leaf = false;
@@ -158,6 +162,21 @@
    }
    /**
     * è®¾ç½®ç¼–号
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }
    /**
     * èŽ·å–ç¼–å·
     */
    public String getId() {
        return id;
    }
    /**
     * æ˜¯å¦å¶å­èŠ‚ç‚¹
     * @return true è¡¨ç¤ºå¶å­èŠ‚ç‚¹
     */
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java
ÎļþÃû´Ó Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/FastJson2JsonRedisSerializer.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.vci.web.redis;
package com.vci.starter.web.redis;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java
ÎļþÃû´Ó Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisConfig.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.vci.web.redis;
package com.vci.starter.web.redis;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.annotation.CachingConfigurerSupport;
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java
ÎļþÃû´Ó Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisService.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.vci.web.redis;
package com.vci.starter.web.redis;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +11,7 @@
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.*;
@@ -21,10 +22,9 @@
 * @author dangsn
 **/
@SuppressWarnings(value = { "unchecked", "rawtypes" })
@Component
@Service
@Slf4j
public class RedisService
{
public class RedisService {
    @Autowired(required = false)
    public RedisTemplate redisTemplate;
@@ -390,6 +390,55 @@
        return new ArrayList<>();
    }
    /**
     * ç”¨æˆ·ç™»å½•
     * @param currentLoggedUserKey
     */
    public void increOnlineUser(String currentLoggedUserKey) {
        // æ£€æŸ¥é”®æ˜¯å¦å­˜åœ¨
        if (!redisTemplate.hasKey(currentLoggedUserKey)) {
            // å¦‚果键不存在,初始化为0
            redisTemplate.opsForValue().set(currentLoggedUserKey, 0);
        }
        // è‡ªå¢žåœ¨çº¿ç”¨æˆ·æ•°
        redisTemplate.opsForValue().increment(currentLoggedUserKey);
    }
    /**
     * ç”¨æˆ·ç™»å‡º
     * @param currentLoggedUserKey
     */
    public void decreOnlineUser(String currentLoggedUserKey) {
        // æ£€æŸ¥å½“前在线用户数
        String currentLoggedUser = (String)redisTemplate.opsForValue().get(currentLoggedUserKey);
        if (currentLoggedUser != null) {
            Long currentCount = Long.parseLong((String)redisTemplate.opsForValue().get(currentLoggedUserKey));
            if(currentCount > 0){
            }
            // è‡ªå‡åœ¨çº¿ç”¨æˆ·æ•°
            redisTemplate.opsForValue().decrement(currentLoggedUserKey);
        }
    }
    /**
     * èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·æ€»äººæ•°
     * @param currentLoggedUserKey
     * @return
     */
    public long getCurrentOnlineUserCount(String currentLoggedUserKey) {
        return Long.parseLong(redisTemplate.opsForValue().get(currentLoggedUserKey).toString());
    }
    /**
     * èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·çš„ç”¨æˆ·ååˆ—è¡¨
     * @param currentLoggedUserKey
     * @return
     */
    public Set<String> getCurrentLoggedUsers(String currentLoggedUserKey) {
        return redisTemplate.opsForSet().members(currentLoggedUserKey);
    }
    /**
     * åŸºäºŽLua脚本实现原子查询并删除
Source/plt-web/plt-web-parent/plt-web/pom.xml
@@ -106,23 +106,6 @@
            <version>0.9.11</version>
        </dependency>
        <!--redis start-->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>2.1.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.9.0</version>
        </dependency>
        <!--redis end-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.13.3</version>
        </dependency>
    </dependencies>
    <build>
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmHMSysModConfigServiceI.java
@@ -158,4 +158,10 @@
     */
    String exportSysConf(ExpExcelConditionVO expExcelConditionVO, HttpServletResponse response) throws IOException;
    /**
     * èŽ·å–å½“å‰åœ¨çº¿äººæ•°
     * @return
     */
    long getOnlineUsersNum();
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
@@ -12,12 +12,14 @@
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
import com.vci.starter.web.constant.VConstant;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.SessionInfo;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.starter.web.util.WebThreadLocalUtil;
import com.vci.starter.web.redis.RedisService;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import org.slf4j.Logger;
@@ -45,13 +47,22 @@
    private int count = 0;
    /**
     * åŒ…含保存模块方法等操作类
     */
    private static FunctionOperateDelegate foDelegate;
    /**
     * åˆå§‹åŒ–foDelegate
     */
    {
        if(Func.isEmpty(foDelegate)){
            foDelegate = new FunctionOperateDelegate();
        }
    }
    @Autowired
    private RedisService redisService;
    /**
     * æ—¥å¿—
@@ -770,6 +781,16 @@
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * èŽ·å–å½“å‰åœ¨çº¿äººæ•°
     * @return
     */
    @Override
    public long getOnlineUsersNum() {
        long currentLoggedUserCount = redisService.getCurrentOnlineUserCount(VConstant.CURRENT_LOGGED_USERS_KEY);
        return currentLoggedUserCount;
    }
    /**
@@ -1585,6 +1606,5 @@
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java
@@ -13,7 +13,7 @@
import com.vci.starter.web.util.*;
import com.vci.constant.CacheNameConstant;
import com.vci.web.properties.WebProperties;
import com.vci.web.redis.RedisService;
import com.vci.starter.web.redis.RedisService;
import com.vci.web.service.WebBoServiceI;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/HMSysModConfigController.java
@@ -506,4 +506,20 @@
        }
    }
    /**
     * èŽ·å–å½“å‰ç”¨æˆ·åœ¨çº¿äººæ•°
     * @return
     */
    @GetMapping("/getOnlineUsersNum")
    public BaseResult getOnlineUsersNum() {
        try {
            long onlineUsersNum = hmSysModConfigService.getOnlineUsersNum();
            return BaseResult.success(onlineUsersNum);
        } catch (Exception e) {
            String errorMsg = "获取当前用户在线人数时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/LogBasicController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,127 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
import com.vci.dto.LogQueryCriteriaDTO;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.LogBasicServiceI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
 * å¹³å°æ—¥å¿—控制器
 * @author yuxc
 * @date 2024-9-11
 */
@Controller
@RequestMapping("/loginBasicController")
@VciBusinessLog(modelName="日志服务")
public class LogBasicController {
    /**
     * ç™»å½•服务
     */
    @Autowired
    private LogBasicServiceI logBasicServiceI;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * èŽ·å–æ—¥æœŸä¿å­˜æœŸé™ä¸‹æ‹‰åˆ—è¡¨æ¡†
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @VciBusinessLog(operateName="日期保存期限")
    @GetMapping(value = "/getPeroid")
    @ResponseBody
    public BaseResult getPeroid(){
        try {
            return logBasicServiceI.getPeroid();
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * ä¿å­˜æœŸé™è®¾ç½®
     * period æœŸé™ç¼–码
     * @return ä¿å­˜ç»“æžœ
     */
    @VciBusinessLog(operateName="保存期限设置")
    @PostMapping(value = "/savePeriod")
    @ResponseBody
    public BaseResult savePeriod(String period){
        try {
            return logBasicServiceI.savePeriod(period);
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "保存出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * åˆ é™¤æ—¥å¿—
     * period æœŸé™ç¼–码
     * @return ä¿å­˜ç»“æžœ
     */
    @VciBusinessLog(operateName="删除日志")
    @DeleteMapping(value = "/deleteLog")
    @ResponseBody
    public BaseResult deleteLog(String deleteDate){
        try {
            return logBasicServiceI.deleteLog(deleteDate);
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "删除出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * æŸ¥è¯¢æ—¥å¿—
     * @param dto æŸ¥è¯¢æ¡ä»¶ä¼ è¾“对象
     * @return æŸ¥è¯¢æ•°æ®
     * @throws PLException
     */
    @VciBusinessLog(operateName="日志查询")
    @GetMapping(value = "/getLogListByContion")
    @ResponseBody
    public BaseResult getLogListByContion(@RequestBody LogQueryCriteriaDTO dto){
        try {
            return logBasicServiceI.getLogListByContion(dto);
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询日志出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
    /**
     * æ“ä½œç”¨æˆ·èŽ·å–
     */
    @VciBusinessLog(operateName="获取操作用户")
    @GetMapping(value = "/getOperatingUsers")
    @ResponseBody
    public BaseResult getOperatingUsers(){
        try {
            return logBasicServiceI.getOperatingUsers();
        }catch (Exception e){
            e.printStackTrace();
            String errorMsg = "查询日志出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e);
            logger.error(errorMsg);
            throw new VciBaseException(errorMsg);
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -397,6 +397,84 @@
        }
    }
    /**
     * ä¸šåŠ¡ç±»åž‹ä¸‹æ‹‰æŸ¥è¯¢
     * @param baseQueryObject selectBtmType é€‰æ‹©çš„æºå¯¹è±¡,带分页信息
     * @return
     * @throws PLException
     */
    @GetMapping( "/getBtmDatasByPage")
    @VciBusinessLog(operateName = "业务类型下拉查询")
    public BaseResult getBtmDatasByPage(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataGrid(uiManagerService.getBtmDatasByPage(baseQueryObject));
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "业务类型下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * UI定义下拉查询(templateType为UI定义时的选择对象下拉查询)
     * @param baseQueryObject selectBtmType é€‰æ‹©çš„æºå¯¹è±¡,带分页信息
     * @return
     * @throws PLException
     */
    @GetMapping( "/getUILayoutDatasByPage")
    @VciBusinessLog(operateName = "UI定义下拉查询")
    public BaseResult getUILayoutDatasByPage(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataGrid(uiManagerService.getUILayoutDatasByPage(baseQueryObject));
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "UI定义下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * é€‰æ‹©æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    @GetMapping( "/getPortalVIDatasByPage")
    @VciBusinessLog(operateName = "选择模板下拉查询")
    public BaseResult getPortalVIDatasByPage(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataGrid(uiManagerService.getPortalVIDatasByPage(baseQueryObject));
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "选择模板下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * æŸ¥è¯¢æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    @GetMapping( "/getQTInfoDatasByPage")
    @VciBusinessLog(operateName = "查询模板下拉查询")
    public BaseResult getQTInfoDatasByPage(BaseQueryObject baseQueryObject){
        try {
            return BaseResult.dataGrid(uiManagerService.getQTInfoDatasByPage(baseQueryObject));
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "查询模板下拉查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    //页面设计下配置按钮相关接口
    /**
     * èŽ·å–é¡µç­¾åŒºåŸŸæŒ‰é’®é…ç½®ä¿¡æ¯
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/LogBasicServiceI.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.dto.LogQueryCriteriaDTO;
import com.vci.starter.web.pagemodel.BaseResult;
/**
 * å¹³å°æ—¥å¿—服务
 * @author yuxc
 * @date 2024-9-11
 */
public interface LogBasicServiceI {
    /**
     * èŽ·å–æ—¥æœŸä¿å­˜æœŸé™ä¸‹æ‹‰åˆ—è¡¨æ¡†
     * @return æŸ¥è¯¢ç»“æžœ
     */
    BaseResult getPeroid() throws PLException;
    /**
     * ä¿å­˜æœŸé™è®¾ç½®
     * period æœŸé™ç¼–码
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult savePeriod(String period) throws PLException;
    /**
     * åˆ é™¤æ—¥å¿—
     * period æœŸé™ç¼–码
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult deleteLog(String deleteDate) throws PLException;
    /**
     * æŸ¥è¯¢æ—¥å¿—
     * @param dto æŸ¥è¯¢æ¡ä»¶ä¼ è¾“对象
     * @return æŸ¥è¯¢æ•°æ®
     * @throws PLException
     */
    BaseResult getLogListByContion(LogQueryCriteriaDTO dto) throws PLException;
    /**
     * æ“ä½œç”¨æˆ·èŽ·å–
     */
    BaseResult getOperatingUsers() throws PLException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
@@ -1,8 +1,11 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.btm.BizType;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.data.PLUILayout;
import com.vci.corba.portal.data.PLTabPage;
import com.vci.corba.portal.data.PortalVI;
import com.vci.pagemodel.PLTabButtonVO;
import com.vci.pagemodel.PLUILayoutCloneVO;
import com.vci.starter.web.exception.VciBaseException;
@@ -212,4 +215,36 @@
     */
    boolean authorizedUI(UIAuthorDTO uiAuthorDTO)throws Exception;
    /**
     * ä¸šåŠ¡ç±»åž‹ã€æºå¯¹è±¡ç±»åž‹ã€é¡¶å±‚èŠ‚ç‚¹æ˜¾ç¤ºç±»åž‹ç­‰éƒ½è°ƒç”¨è¿™ä¸ªæŽ¥å£æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    DataGrid<BizType> getBtmDatasByPage(BaseQueryObject baseQueryObject) throws Throwable;
    /**
     * UI定义下拉查询(templateType为UI定义时的选择对象下拉查询)
     * @param baseQueryObject selectBtmType é€‰æ‹©çš„æºå¯¹è±¡,带分页信息
     * @return
     * @throws PLException
     */
    DataGrid<PLUILayout> getUILayoutDatasByPage(BaseQueryObject baseQueryObject)throws Throwable;
    /**
     * é€‰æ‹©æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢ï¼ˆtemplateType为表格、表单、树表时的选择对象下拉查询)
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    DataGrid<PortalVI> getPortalVIDatasByPage(BaseQueryObject baseQueryObject) throws Throwable;
    /**
     * æŸ¥è¯¢æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    DataGrid<QTInfo> getQTInfoDatasByPage(BaseQueryObject baseQueryObject)throws Throwable;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LogBasicServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,390 @@
package com.vci.web.service.impl;
import com.vci.client.common.objects.UserObject;
import com.vci.corba.common.PLException;
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.framework.data.UserInfo;
import com.vci.corba.pllog.data.LogInfo;
import com.vci.corba.pllog.data.LogPeriodInfo;
import com.vci.corba.pllog.data.LogType;
import com.vci.dto.LogInfoDTO;
import com.vci.dto.LogPeriodInfoDTO;
import com.vci.dto.LogQueryCriteriaDTO;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.web.service.*;
import com.vci.web.util.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
 * ä¸šåŠ¡ç±»åž‹æœåŠ¡
 * @author yuxc
 * @date 2024-9-11
 */
@Service
public class LogBasicServiceImpl implements LogBasicServiceI {
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * å¹³å°çš„调用工具类
     */
    @Autowired
    private PlatformClientUtil platformClientUtil;
    public static final String UTF8_BOM="\uFEFF";
    private final String LOG_SAVE_PERIOD = "logSavePeriod";//日志保存期限
    /**
     * èŽ·å–æ—¥æœŸä¿å­˜æœŸé™ä¸‹æ‹‰åˆ—è¡¨æ¡†
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @Override
    public BaseResult getPeroid() throws PLException {
        //获取当前期限设置
        int curPeriod = platformClientUtil.getLogService().getCurPeriod();
        LogPeriodInfo[] periods = platformClientUtil.getLogService().getPeriods();
        List<LogPeriodInfoDTO> logDTOs = new ArrayList<>();
        for (LogPeriodInfo period : periods) {
            LogPeriodInfoDTO dto = new LogPeriodInfoDTO();
            dto.setValue(period.value);
            if(period.code.startsWith(UTF8_BOM)) {
                period.code=period.code.substring(1);
            }
            if (Integer.valueOf(period.code) == curPeriod){
                dto.setChoose(true);
            }
            dto.setCode(period.code);
            logDTOs.add(dto);
        }
        return BaseResult.dataList(logDTOs);
    }
    /**
     * ä¿å­˜æœŸé™è®¾ç½®
     * period æœŸé™ç¼–码
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult savePeriod(String period) throws PLException {
        UserEntityInfo userEntityInfo = new UserEntityInfo();
        userEntityInfo.setModules("com.vci.client.log.ui.LogBasicConfPanel");
        userEntityInfo.setUserName(WebUtil.getCurrentUserId());
        boolean b = platformClientUtil.getLogService().savePeriod(period, userEntityInfo);
        if(!b){
            return BaseResult.fail("保存失败!");
        }
        return BaseResult.success("保存成功!");
    }
    /**
     * åˆ é™¤æ—¥å¿—
     * @param deleteDate åˆ é™¤çš„æ—¥æœŸ
     * @return åˆ é™¤ç»“æžœ
     * @throws PLException
     */
    @Override
    public BaseResult deleteLog(String deleteDate) throws PLException {
        if(StringUtils.isBlank(deleteDate)){
            throw new PLException("500", new String[]{"日期不能为空!"});
        }
        //获取当前期限设置
        int curSavePeriod = platformClientUtil.getLogService().getCurPeriod();
        int monthSpan = 1;
        String monthLabel = "";
        LogPeriodInfo[] periods = platformClientUtil.getLogService().getPeriods();
        Map<String, String> periodMap = Arrays.stream(periods).collect(Collectors.toMap(e -> e.code, e -> e.value));
        if(curSavePeriod <= 0){
            // æœªé…ç½®æ—¶ï¼Œåªèƒ½åˆ é™¤
            monthLabel = periods[0].value;
            monthSpan = Integer.valueOf(periods[0].code);
        } else {
            monthSpan = curSavePeriod;//期限code
            monthLabel = periodMap.get(String.valueOf(curSavePeriod));//期限显示值
        }
        //检查删除逻辑
        checkCanDelete(deleteDate, monthSpan, monthLabel);
        boolean res = false;
        res = platformClientUtil.getLogService().deleteLog(getDeleteDateString(deleteDate));//删除日志
        if(!res){
            return BaseResult.fail("删除失败!");
        }
        return BaseResult.success("删除成功!");
    }
    /**
     * æŸ¥è¯¢æ—¥å¿—
     * @param queryDto æŸ¥è¯¢æ¡ä»¶ä¼ è¾“对象
     * @return æŸ¥è¯¢æ•°æ®
     * @throws PLException
     */
    @Override
    public BaseResult getLogListByContion(LogQueryCriteriaDTO queryDto) throws PLException {
        String querySql = getSQL(queryDto);
        LogInfo[] logInfos = platformClientUtil.getLogService().getLogListByContion(queryDto.getPageNo(),queryDto.getPageSize(),querySql);
        List<LogInfoDTO> dtos = new ArrayList<>();
        for (LogInfo logInfo : logInfos) {
            LogInfoDTO dto = new LogInfoDTO();
            dto.setLogType(logInfo.logType);
            dto.setDate(logInfo.date);
            dto.setContent(logInfo.content);
            dto.setPuid(logInfo.puid);
            dto.setModuleName(logInfo.moduleName);
            dto.setEntityDesc(logInfo.entityDesc);
            dto.setResult(logInfo.result);
            dto.setType(logInfo.type);
            dto.setProperty(logInfo.property);
            dto.setTruename(logInfo.truename);
            dto.setNewVal(logInfo.newVal);
            dto.setUserIp(logInfo.userIp);
            dto.setUsername(logInfo.username);
            dto.setPreviousVal(logInfo.previousVal);
            dtos.add(dto);
        }
        long sumLogRows = platformClientUtil.getLogService().getSumLogRows(querySql);
        BaseResult result = new BaseResult();
        result.setSuccess(true);
        result.setCode(200);
        result.setData(dtos);
        result.setTotal(sumLogRows);
        return result;
    }
    /**
     * æ“ä½œç”¨æˆ·èŽ·å–
     */
    @Override
    public BaseResult getOperatingUsers() throws PLException {
        List<UserObject> users = new ArrayList<UserObject>();
        if("secAdmin".equals(WebUtil.getCurrentUserId())){
            users.addAll(getUsersByUserNames(Arrays.asList("auditAdmin")));
            users.addAll(getUsersByUserNames(getUserNameByUserType(2)));
        }
        else if("auditAdmin".equals(WebUtil.getCurrentUserId())){
            users.addAll(getUsersByUserNames(Arrays.asList("secAdmin", "sysAdmin")));
        } else if("sysAdmin".equals(WebUtil.getCurrentUserId())){
        }
        return BaseResult.dataList(users);
    }
    /**
     * èŽ·å–ç”¨æˆ·ä¿¡æ¯
     * @param userNames ç”¨æˆ·åç§°
     * @return ç”¨æˆ·ä¿¡æ¯
     * @throws PLException
     */
    private List<UserObject> getUsersByUserNames(List<String> userNames) throws PLException {
        List<UserObject> userList = new ArrayList<UserObject>();
        for(String userName : userNames){
            UserInfo userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByName(userName);
            UserObject user = new UserObject();
            user.setId(userInfo.id);
            user.setUserName(userInfo.userName);
            user.setPwd(userInfo.pwd);
            user.setEmail(userInfo.email);
            user.setTrueName(userInfo.trueName);
            user.setSpecialties(userInfo.specialties);
            user.setDesc(userInfo.desc);
            user.setUserType(userInfo.userType);
            user.setStatus(userInfo.status);
            user.setCreateTime(userInfo.createTime);
            user.setCreateUser(userInfo.createUser);
            user.setUpdateTime(userInfo.updateTime);
            user.setUpdateUser(userInfo.updateUser);
            user.setPwdUpdateTime(userInfo.pwdUpdateTime);
            user.setGrantor(userInfo.grantor);
            user.setSecretGrade(userInfo.secretGrade);
            user.setIsDeptLeader(userInfo.isDeptLeader);
            userList.add(user);
        }
        Collections.sort(userList, new Comparator<UserObject>(){
            @Override
            public int compare(UserObject o1, UserObject o2) {
                return o1.getUserName().compareTo(o2.getUserName());
            }
        });
        return userList;
    }
    /**
     * æ ¹æ®ç”¨æˆ·ç±»åž‹èŽ·å–ç”¨æˆ·æ•°æ®
     * @param userType ç”¨æˆ·ç±»åž‹
     * @return ç”¨æˆ·æ•°æ®
     * @throws PLException
     */
    private List<String> getUserNameByUserType(int userType) throws PLException{
        List<String> userNames = new ArrayList<String>();
        String sql = "select plusername,pltruename from pluser u where u.plusertype = " + String.valueOf(userType);
        String[][] valss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        for(String[] vals : valss){
            userNames.add(vals[0]);
        }
        return userNames;
    }
    /**
     * èŽ·å–æŸ¥è¯¢æ¡ä»¶å¹¶æ‹¼æˆSQL,只拼where子句后面的SQL
     * @return
     */
    public String getSQL(LogQueryCriteriaDTO dto) throws PLException {
        StringBuffer sql = new StringBuffer("");
//        int period = getPeriod(LOG_SAVE_PERIOD);//获取保存期限,以月为单位
        int period = platformClientUtil.getLogService().getCurPeriod();;//获取保存期限,以月为单位
        //下面是拼出SQL
        if(period != 0){
            sql.append(" to_date(PLDATE) >= add_months(to_date(sysdate),"+(-period)+")");
        }
        if(dto.getStartDate()!=null&&!dto.getStartDate().trim().equals("")&&!dto.getStartDate().equals("null")){//起始日期
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            sql.append(" to_date(PLDATE) >= to_date('"+dto.getStartDate().trim()+"','yyyy-MM-dd') ");
        }
        if(dto.getEndDate()!=null&&!dto.getEndDate().trim().equals("")&&!dto.getEndDate().equals("null")){//结束日期
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            sql.append(" trunc(PLDATE) <= to_date('"+dto.getEndDate().trim()+"','yyyy-MM-dd')");
        }
        if(dto.getLogType() == LogType.Login.value()) {//登入登出日志
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            sql.append("PLLOGTYPE in ('" + getLogTypeString(LogType.Login) +"','" + getLogTypeString(LogType.Logout)+ "')");
        } else if(dto.getLogType() == LogType.Grant.value()) {//授权日志
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            sql.append("PLLOGTYPE in('" + getLogTypeString(LogType.Grant) + "')");
        } else if(dto.getLogType() == LogType.General.value()) {//一般操作日志
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            sql.append("PLLOGTYPE in('" + getLogTypeString(LogType.General) + "')");
        }
        if(StringUtils.isNotBlank(dto.getUserName())){//操作用户
            if(!dto.getUserName().trim().equals("")){//如果用户名为空格则不加用户条件
                if(!sql.toString().equals("")){
                    sql.append(" and ");
                }
                if(dto.getUserName().contains("*")){
                    dto.setUserName(dto.getUserName().trim().replaceAll("\\*", "%"));
                    sql.append(" PLUSER like '").append(dto.getUserName().trim()).append("'");
                }else{
                    sql.append(" PLUSER = '").append(dto.getUserName().trim()).append("'");
                }
            }
        }
        //按IP查询
        if(StringUtils.isNotBlank(dto.getIpText())){
            String ip = dto.getIpText().trim();
            if(!sql.toString().equals("")){
                sql.append(" and ");
            }
            if(ip.trim().contains("*")){//模糊查询
                ip = ip.trim().replaceAll("\\*", "%");
                sql.append(" PLIP like '").append(ip.trim()).append("'");
            }else{
                sql.append(" PLIP = '").append(ip.trim()).append("'");
            }
        }
        if(StringUtils.isNotBlank(dto.getTypeText())){
            String typeValue = dto.getTypeText();
            sql.append(" and pltype like '%").append(typeValue).append("%'");
        }
        //过滤掉admin和developer用户的日志记录
        sql.append(" and PLUSER !='admin' and  PLUSER !='developer' ");
        sql.append(" and pluser != '" + WebUtil.getCurrentUserId() + "' ");
        // å®‰å…¨ä¿å¯†å‘˜ä¸çœ‹ç³»ç»Ÿç®¡ç†å‘˜çš„æ—¥å¿—
        if("secAdmin".equals(WebUtil.getCurrentUserId())){
            sql.append(" and pluser != 'sysAdmin' ");
        }
        // å®¡è®¡ç®¡ç†å‘˜åªçœ‹ç³»ç»Ÿç®¡ç†å‘˜å’Œå®‰å…¨ä¿å¯†å‘˜çš„æ—¥å¿—
        else if("auditAdmin".equals(WebUtil.getCurrentUserId())){
            sql.append(" and pluser in ('secAdmin', 'sysAdmin')");
        }
        return sql.toString();
    }
    protected String getLogTypeString(LogType logType){
        String res = "";
        if(logType == LogType.Login) {
            res = "登录";
        } else if(logType == LogType.Logout) {
            res = "登出";
        } else if(logType == LogType.Grant) {
            res = "授权";
        } else if(logType == LogType.General) {
            res = "一般操作";
        } else if(logType == LogType.Integration) {
            res = "集成应用";
        }
        return res;
    }
    /**
     * æ—¥æœŸå­—符串处理
     * @param deleteDate æ—¥æœŸå­—符串
     * @return å¤„理完成的日期字符串
     */
    protected String getDeleteDateString(String deleteDate){
        int s = Integer.parseInt(deleteDate.substring(8))+1;
        StringBuffer buff = new StringBuffer();
        buff.append(deleteDate.substring(0, 8));
        if(("0"+s).length()>2){
            buff.append(s+"");
        }else{
            buff.append("0"+s);
        }
        return buff.toString();
    }
    /**
     * åˆ é™¤é€»è¾‘检查
     * @param deleteDate æ—¥æœŸå­—符串
     * @param monthSpan æœŸé™code
     * @param monthLabel æœŸé™æ˜¾ç¤ºå€¼
     * @return
     * @throws PLException
     */
    private boolean checkCanDelete(String deleteDate, int monthSpan, String monthLabel) throws PLException {
        boolean res = false;
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            sdf.parse(deleteDate);
        } catch (ParseException  e1) {
            throw new PLException("500", new String[]{"将" + deleteDate + "转换日期时发生错误!"});
        }
        String sql = "SELECT FLOOR(MONTHS_BETWEEN(SYSDATE, to_date('" + deleteDate + "','yyyy-mm-dd'))) from dual";
        String[][] vals;
        try {
            vals = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
            if(vals != null && vals.length > 0 && vals[0].length > 0){
                int spval = Integer.valueOf(vals[0][0]);
                if(spval <= monthSpan){
                    throw new PLException("500", new String[]{"只能删除 " + monthLabel + " ä¹‹å‰çš„æ•°æ®ï¼"});
                }
            }
        } catch (PLException e) {
            e.printStackTrace();
            e.messages[0] += "计算是否可以删除指定日期之前的数据时发生错误!";
            throw new PLException("500", e.messages);
        }
        res = true;
        return res;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
@@ -19,6 +19,7 @@
import com.vci.starter.web.annotation.bus.VciLoginAfter;
import com.vci.starter.web.annotation.bus.VciLogoutBefore;
import com.vci.starter.web.annotation.bus.VciLogoutPlugin;
import com.vci.starter.web.constant.VConstant;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.interceptor.VciSessionForLoginI;
import com.vci.starter.web.pagemodel.RequestClientInfo;
@@ -30,7 +31,7 @@
import com.vci.constant.CacheNameConstant;
import com.vci.dto.LoginUserDTO;
import com.vci.web.properties.WebProperties;
import com.vci.web.redis.RedisService;
import com.vci.starter.web.redis.RedisService;
import com.vci.web.service.LoginServiceI;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
@@ -146,7 +147,7 @@
     * @return æ‰§è¡Œç»“æžœ
     * @throws VciBaseException å‚数错误,用户不能登录等会抛出异常
     */
    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*单点登录不需要校验密码*/) throws VciBaseException, PLException {
    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*单点登录不需要校验密码*/) throws VciBaseException {
        LoginResultBO loginResult = new LoginResultBO();
        loginResult.setSuccess(false);
@@ -167,6 +168,7 @@
            String tokenKey = redisService.getCacheObject(userIdTokenKey);
            redisService.deleteObject(tokenKey);
            redisService.deleteObject(userIdTokenKey);
            redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
        }
        //3.获取用户的对象(对象中包含角色部门还有密码策略信息(当前用户没设置密码策略就是取的默认密码策略))
@@ -242,6 +244,8 @@
        sessionInfo.setToken(token);
        //初始化平台的token
        sessionForLogin.initInvocationInfo(sessionInfo);
        //记录当前登录人数的总数
        redisService.increOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
        //拷贝用户到新的session会话中
        copyUser2SessionInfo(user, sessionInfo, userDTO.getLangCode());
        //拷贝请求信息到session会话中
@@ -558,6 +562,8 @@
                }
            });
        }
        //清除存当前登录的用户(总数-1)
        redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
        sessionForLogin.logout(userToken);
        if(!CollectionUtils.isEmpty(logoutpluginBeanMap)){
            logoutpluginBeanMap.forEach((k,v) -> {
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
@@ -98,6 +98,7 @@
        PLActionCls pac = new PLActionCls();
        pac.name = pLActionCls.getName();
        pac.pid = pLActionCls.getPid();
        pac.id = pLActionCls.getId();
        pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription();
        pac.creator = WebUtil.getCurrentUserId();
        pac.createTime = System.currentTimeMillis();
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -153,7 +153,7 @@
    public List<OsBtmTypeVO> selectAllBtm() {
        try {
            return btmDO2VOs(Arrays.stream(platformClientUtil.getBtmService().getBizTypes("")).collect(Collectors.toList()));
        }  catch (PLException e) {
        } catch (PLException e) {
            throw new RuntimeException(e);
        }
    }
@@ -166,7 +166,7 @@
    @Override
    @VciUnLog
    public Map<String, OsBtmTypeVO> selectAllBtmMap() {
        return Optional.ofNullable(self.selectAllBtm()).orElseGet(()->new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s->s.getId().toLowerCase(), t->t,(o1,o2)->o1));
        return Optional.ofNullable(self.selectAllBtm()).orElseGet(() -> new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(), t -> t, (o1, o2) -> o1));
    }
    /**
@@ -178,7 +178,7 @@
    @Override
    public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems) {
        List<OsBtmTypeVO> VOS = new ArrayList<>();
        Optional.ofNullable(btmItems).orElseGet(()->new ArrayList<>()).stream().forEach(btmItem -> {
        Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).stream().forEach(btmItem -> {
            OsBtmTypeVO vo = btmDO2VO(btmItem);
            VOS.add(vo);
        });
@@ -194,7 +194,7 @@
    @Override
    public OsBtmTypeVO btmDO2VO(BizType btmItem) {
        OsBtmTypeVO vo = new OsBtmTypeVO();
        if(btmItem !=null){
        if (btmItem != null) {
            vo.setOid(btmItem.oid);
            vo.setCreator(btmItem.creator);
            vo.setLastModifier(btmItem.modifier);
@@ -202,7 +202,7 @@
                // btmItem.createTime拿到的是时间戳,但是这儿要的是例如2017-12-27 09:32:20.034这样的格式,所以不调用这个方法,改调用其他方法
                //vo.setCreateTime(VciDateUtil.str2Date(String.valueOf(btmItem.createTime),VciDateUtil.DateTimeFormat));
                vo.setCreateTime(Func.parse(btmItem.createTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
                vo.setLastModifyTime( Func.parse(btmItem.modifyTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
                vo.setLastModifyTime(Func.parse(btmItem.modifyTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
                vo.setTs(Func.parse(btmItem.ts, ConcurrentDateFormat.of(VciDateUtil.DateTimeMillFormat)));
            } catch (Exception e) {
                e.printStackTrace();
@@ -221,29 +221,29 @@
            vo.setDelimiter(btmItem.delimiter);
            vo.setfName(btmItem.fName);
            vo.setVersionRule(String.valueOf(btmItem.verRuleName));
            if(StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()){
            if (StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()) {
                vo.setRevisionFlag(true);
            }
            vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(",")));
            vo.setApNameArray(btmItem.apNameArray);
            List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList()));
            List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>();
            Optional.ofNullable(attributeVOS).orElseGet(()->new ArrayList<>()).stream().forEach(attributeVO->{
            Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> {
                OsBtmTypeAttributeVO btmTypeAttributeVO = new OsBtmTypeAttributeVO();
                BeanUtil.convert(attributeVO,btmTypeAttributeVO);
                BeanUtil.convert(attributeVO, btmTypeAttributeVO);
                btmTypeAttributeVO.setPkBtmType(vo.getOid());
                btmTypeAttributeVO.setBtmTypeId(vo.getId());
                btmTypeAttributeVO.setAttributeDataType(attributeVO.getAttributeDataType());
                btmTypeAttributeVO.setAttributeLength(attributeVO.getAttrLength());
                btmTypeAttributeVO.setDefaultValue(attributeVO.getDefaultValue());
                if("secretgrade".equalsIgnoreCase(attributeVO.getId())){
                if ("secretgrade".equalsIgnoreCase(attributeVO.getId())) {
                    vo.setSecretFlag(true);
                }
                if(StringUtils.isNotBlank(attributeVO.getBtmTypeId())){
                if (StringUtils.isNotBlank(attributeVO.getBtmTypeId())) {
                    btmTypeAttributeVO.setReferFlag(true);
                    btmTypeAttributeVO.setReferBtmTypeId(attributeVO.getBtmTypeId());
                }
                if(StringUtils.isNotBlank(attributeVO.getEnumId())){
                if (StringUtils.isNotBlank(attributeVO.getEnumId())) {
                    btmTypeAttributeVO.setEnumFlag(true);
                    btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId()));
                }
@@ -262,13 +262,13 @@
     */
    @Override
    public List<OsBtmTypeVO> listBtmByIds(Collection<String> btmIds) {
        if(CollectionUtils.isEmpty(btmIds)){
        if (CollectionUtils.isEmpty(btmIds)) {
            return null;
        }
        Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap();
        List<OsBtmTypeVO> btmTypeVOS = new ArrayList<>();
        btmIds.stream().forEach(id->{
            if(btmTypeVOMap.containsKey(id.toLowerCase())){
        btmIds.stream().forEach(id -> {
            if (btmTypeVOMap.containsKey(id.toLowerCase())) {
                btmTypeVOS.add(btmTypeVOMap.get(id.toLowerCase()));
            }
        });
@@ -283,10 +283,10 @@
     */
    @Override
    public OsBtmTypeVO getBtmById(String id) {
        if(StringUtils.isBlank(id)){
        if (StringUtils.isBlank(id)) {
            return null;
        }
        return self.selectAllBtmMap().getOrDefault(id.toLowerCase(),null);
        return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null);
    }
    /**
@@ -297,33 +297,33 @@
     */
    @Override
    public List<OsUsedAttributeVO> listBtmUsedInfo(String btmName) {
        return listBtmUsedInfo(btmName,false);
        return listBtmUsedInfo(btmName, false);
    }
    /**
     * èŽ·å–ä¸šåŠ¡ç±»åž‹çš„åœ¨å“ªä¸ªå±žæ€§ä¸­ä½¿ç”¨
     *
     * @param btmId ä¸šåŠ¡ç±»åž‹
     * @param btmId   ä¸šåŠ¡ç±»åž‹
     * @param hasLink æ˜¯å¦åŒ…含链接类型中
     * @return å¼•用的信息
     */
    @Override
    public List<OsUsedAttributeVO> listBtmUsedInfo(String btmId, boolean hasLink){
        VciBaseUtil.alertNotNull(btmId,"业务类型的名称");
        List<OsAttributeVO> allReferThisBtmAttributes = Optional.ofNullable(attributeService.selectAllAttribute()).orElseGet(()->new ArrayList<>()).stream().filter(s->btmId.equalsIgnoreCase(s.getBtmTypeId())).collect(Collectors.toList());
        if(CollectionUtils.isEmpty(allReferThisBtmAttributes)){
    public List<OsUsedAttributeVO> listBtmUsedInfo(String btmId, boolean hasLink) {
        VciBaseUtil.alertNotNull(btmId, "业务类型的名称");
        List<OsAttributeVO> allReferThisBtmAttributes = Optional.ofNullable(attributeService.selectAllAttribute()).orElseGet(() -> new ArrayList<>()).stream().filter(s -> btmId.equalsIgnoreCase(s.getBtmTypeId())).collect(Collectors.toList());
        if (CollectionUtils.isEmpty(allReferThisBtmAttributes)) {
            return null;
        }
        //根据这些属性,找它使用的业务类型
        List<OsUsedAttributeVO> usedInfos= new ArrayList<>();
        List<OsUsedAttributeVO> usedInfos = new ArrayList<>();
        List<OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap().values().stream().collect(Collectors.toList());
        List<OsLinkTypeVO> linkTypeVOS = linkTypeService.selectAllLinkMap().values().stream().collect(Collectors.toList());
        allReferThisBtmAttributes.stream().forEach(attribute->{
        allReferThisBtmAttributes.stream().forEach(attribute -> {
            //其他的业务类型包含了这个属性的
            List<OsBtmTypeVO> usedBtms = btmTypeVOMap.stream().filter(btmTypeVO -> !CollectionUtils.isEmpty(btmTypeVO.getAttributes()) && btmTypeVO.getAttributes().stream().anyMatch(s -> attribute.getId().equalsIgnoreCase(s.getId()))).collect(Collectors.toList());
            if(!CollectionUtils.isEmpty(usedBtms)){
                usedBtms.stream().forEach(btm->{
                    btm.getAttributes().stream().filter(s->attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm->{
            if (!CollectionUtils.isEmpty(usedBtms)) {
                usedBtms.stream().forEach(btm -> {
                    btm.getAttributes().stream().filter(s -> attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm -> {
                        OsUsedAttributeVO usedAttributeVO = new OsUsedAttributeVO();
                        usedAttributeVO.setId(attrInBtm.getId());
                        usedAttributeVO.setName(attrInBtm.getName());
@@ -333,11 +333,11 @@
                    });
                });
            }
            if(hasLink){
                List<OsLinkTypeVO> usedLinks = linkTypeVOS.stream().filter(linkTypeVO -> !CollectionUtils.isEmpty(linkTypeVO.getAttributes()) &&linkTypeVO.getAttributes().stream().anyMatch(s->attribute.getId().equalsIgnoreCase(s.getId())) ).collect(Collectors.toList());
                if(!CollectionUtils.isEmpty(usedLinks)){
                    usedLinks.stream().forEach(link->{
                        link.getAttributes().stream().filter(s->attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm->{
            if (hasLink) {
                List<OsLinkTypeVO> usedLinks = linkTypeVOS.stream().filter(linkTypeVO -> !CollectionUtils.isEmpty(linkTypeVO.getAttributes()) && linkTypeVO.getAttributes().stream().anyMatch(s -> attribute.getId().equalsIgnoreCase(s.getId()))).collect(Collectors.toList());
                if (!CollectionUtils.isEmpty(usedLinks)) {
                    usedLinks.stream().forEach(link -> {
                        link.getAttributes().stream().filter(s -> attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm -> {
                            OsUsedAttributeVO usedAttributeVO = new OsUsedAttributeVO();
                            usedAttributeVO.setId(attrInBtm.getId());
                            usedAttributeVO.setName(attrInBtm.getName());
@@ -360,15 +360,15 @@
     */
    @Override
    public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) throws PLException {
        VciBaseUtil.alertNotNull(btmId,"业务类型的编号");
        VciBaseUtil.alertNotNull(btmId, "业务类型的编号");
        BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmId);
        if(Func.isEmpty(bizTypes)){
        if (Func.isEmpty(bizTypes)) {
            return new ArrayList<>();
        }
        BizType bizType = bizTypes[0];
        OsBtmTypeVO btmTypeVO = btmDO2VO(bizType);
        List<OsBtmTypeAttributeVO> attributes = btmTypeVO.getAttributes();
        if(attributes == null){
        if (attributes == null) {
            attributes = new ArrayList<>();
        }
        return attributes.stream().sorted(((o1, o2) -> o1.getId().toLowerCase(Locale.ROOT).compareTo(o2.getId().toLowerCase(Locale.ROOT)))).collect(Collectors.toList());
@@ -383,12 +383,12 @@
    @Override
    public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) throws PLException {
        List<OsBtmTypeAttributeVO> attrVOs = listAttributeByBtmId(btmId);
        if(attrVOs == null){
        if (attrVOs == null) {
            attrVOs = new ArrayList<>();
        }
        if(!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) {
        if (!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) {
            List<OsBtmTypeAttributeVO> finalAttrVOs = attrVOs;
            attributeService.getDefaultAttributeVOs().stream().forEach(attr->{
            attributeService.getDefaultAttributeVOs().stream().forEach(attr -> {
                OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
                BeanUtil.convert(attr, attributeVO);
                attributeVO.setAttributeDataType(attr.getAttributeDataType());
@@ -412,6 +412,7 @@
    /**
     * ä¿®æ”¹ä¸šåŠ¡ç±»åž‹ä¸­å¯¹åº”å±žæ€§åçš„å±žæ€§
     *
     * @param apName
     * @return
     * @throws PLException
@@ -426,7 +427,7 @@
        } catch (PLException e1) {
            e1.printStackTrace();
        }
        if(abItem == null || abItem.equals("")){
        if (abItem == null || abItem.equals("")) {
            return true;
        }
        try {
@@ -434,21 +435,21 @@
        } catch (PLException e) {
            e.printStackTrace();
        }
        if(btmNames == null || btmNames.length <= 0){
        if (btmNames == null || btmNames.length <= 0) {
            return true;
        }
        btmNameList = Arrays.asList(btmNames);
        for(Iterator<String> i = btmNameList.iterator(); i.hasNext();){
        for (Iterator<String> i = btmNameList.iterator(); i.hasNext(); ) {
            String btmName = i.next();
            try {
                platformClientUtil.getBtmService().modifyBTAttribute(btmName, apName);
            } catch (PLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                String erreMsg = "调整业务类型中【"+apName+"】属性时出现错误,原因:"+e.getMessage();
                String erreMsg = "调整业务类型中【" + apName + "】属性时出现错误,原因:" + e.getMessage();
                logger.error(erreMsg);
                throw new PLException("500",new String[]{erreMsg});
                throw new PLException("500", new String[]{erreMsg});
            }
        }
        return false;
@@ -456,6 +457,7 @@
    /**
     * åˆ¤æ–­è¯¥å±žæ€§æ˜¯å¦å·²ç»åœ¨ä¸šåŠ¡ç±»åž‹ä¸­äº§ç”Ÿäº†æ•°æ®
     *
     * @param abName
     * @return
     * @throws PLException
@@ -463,14 +465,14 @@
    @Override
    public boolean hasInstance(String abName) throws PLException {
        String[] btmNames = platformClientUtil.getBtmService().getBTNamesByAPName(abName);
        if(btmNames == null || btmNames.length == 0){
        if (btmNames == null || btmNames.length == 0) {
            return false;
        }
        for(int i = 0; i < btmNames.length; i++){
        for (int i = 0; i < btmNames.length; i++) {
            String btmName = btmNames[i];
            boolean flag;
            flag = platformClientUtil.getBtmService().hasData(btmName);
            if(flag){
            if (flag) {
                return flag;
            }
        }
@@ -480,13 +482,14 @@
    /**
     * èŽ·å–åå­—ä»¥filter开始的业务类型(for æŸ¥è¯¢),主要用于属性池的业务类型选择对话框
     * èŽ·å–å…¨éƒ¨ä¸šåŠ¡ç±»åž‹ï¼Œä¼ å‚filter为""
     *
     * @param btmName
     * @return
     * @throws PLException
     */
    @Override
    public BizType[] getBizTypes(String btmName) throws PLException {
        if(null == btmName){
        if (null == btmName) {
            btmName = "";
        }
        return platformClientUtil.getBtmService().getBizTypes(btmName);
@@ -494,18 +497,19 @@
    /**
     * ä¸šåŠ¡ç±»åž‹åˆ—è¡¨æŸ¥è¯¢ï¼Œéžæ ‘ç»“æž„ï¼šç”¨äºŽUI定义左侧业务类型查询,只返回name和lable
     *
     * @param btmName
     * @return
     * @throws PLException
     */
    @Override
    public Tree getBizTree(String btmName) throws PLException {
        if(null == btmName){
        if (null == btmName) {
            btmName = "";
        }
        Tree returnTree = new Tree();
        BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmName);
        if(Func.isEmpty(bizTypes)){
        if (Func.isEmpty(bizTypes)) {
            return returnTree;
        }
        returnTree.setOid("");
@@ -514,13 +518,13 @@
        List<Tree> trees = new ArrayList<>();
        Arrays.stream(bizTypes).forEach(bizType -> {
            Tree tree = new Tree();
            tree.setText(bizType.name + " " +bizType.label);
            tree.setText(bizType.name + " " + bizType.label);
            tree.setOid(bizType.oid);
            tree.setLeaf(true);
            tree.setParentName(bizType.fName);
            Map<String, String> atrrMap = new HashMap<>();
            atrrMap.put("name",bizType.name);
            atrrMap.put("lable",bizType.label);
            atrrMap.put("name", bizType.name);
            atrrMap.put("lable", bizType.label);
            tree.setAttributes(atrrMap);
            trees.add(tree);
        });
@@ -537,7 +541,7 @@
     */
    @Override
    public DataGrid<OsBtmTypeVO> referDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) {
        DataGrid<OsBtmTypeVO> dataGrid = queryObjectServiceInfoBySql(conditionMap, pageHelper, "plbtmtype",OsBtmTypeVO.class,((data, obj) -> {
        DataGrid<OsBtmTypeVO> dataGrid = queryObjectServiceInfoBySql(conditionMap, pageHelper, "plbtmtype", OsBtmTypeVO.class, ((data, obj) -> {
            obj.setTableName(VciBaseUtil.getTableName(obj.getId()));
        }));
        return dataGrid;
@@ -552,7 +556,7 @@
    @Override
    public OsBtmTypeVO selectByOid(String oid) {
        List<OsBtmTypeVO> btmTypeVOS = self.selectAllBtmMap().values().stream().collect(Collectors.toList());
        return Optional.ofNullable(btmTypeVOS).orElseGet(()->new ArrayList<>()).stream().filter(s->s.getOid().equalsIgnoreCase(oid)).findFirst().orElseGet(()->null);
        return Optional.ofNullable(btmTypeVOS).orElseGet(() -> new ArrayList<>()).stream().filter(s -> s.getOid().equalsIgnoreCase(oid)).findFirst().orElseGet(() -> null);
    }
    /**
@@ -564,8 +568,8 @@
    @Override
    public String getNameById(String id) {
        OsBtmTypeVO btmTypeVO = getBtmById(id);
        if(btmTypeVO == null){
            throw new VciBaseException("业务类型[{0}]在系统里不存在",new String[]{id});
        if (btmTypeVO == null) {
            throw new VciBaseException("业务类型[{0}]在系统里不存在", new String[]{id});
        }
        return btmTypeVO.getName();
    }
@@ -582,7 +586,7 @@
        List<OsERNodeVO> nodeVOList = new ArrayList<>();
        List<OsERRelationVO> relationVOList = new ArrayList<>();
        //看当前这个业务类型,参照了其他的哪些业务类型 .我们不显示引用当前业务类型的业务类型
        splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO,true);
        splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO, true);
        loadAllLinkTypeByBtmType(nodeVOList, relationVOList, btmTypeVO);
        OsERVO osERVO = new OsERVO();
        osERVO.setTabViewList(nodeVOList);
@@ -604,25 +608,25 @@
        List<OsUsedAttributeVO> usedAttributeVOS = listBtmUsedInfo(btmTypeVO.getId());
        List<OsERNodeVO> nodeVOList = new ArrayList<>();
        List<OsERRelationVO> relationVOList = new ArrayList<>();
        splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO,false);
        if(!CollectionUtils.isEmpty(usedAttributeVOS)){
            usedAttributeVOS.stream().forEach(usedAttr->{
        splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO, false);
        if (!CollectionUtils.isEmpty(usedAttributeVOS)) {
            usedAttributeVOS.stream().forEach(usedAttr -> {
                //业务类型和链接类型都有可能
                if(BooleanEnum.TRUE.getValue().equalsIgnoreCase(usedAttr.getBusinessType())){
                if (BooleanEnum.TRUE.getValue().equalsIgnoreCase(usedAttr.getBusinessType())) {
                    //业务类型
                    OsBtmTypeVO linkBtmVO = self.selectAllBtmMap().get(usedAttr.getPkBtmType().toLowerCase(Locale.ROOT));
                    splicingBtmType2Json(nodeVOList, relationVOList, linkBtmVO,false);
                    splicingBtmType2Json(nodeVOList, relationVOList, linkBtmVO, false);
                    OsERRelationVO relationVO = new OsERRelationVO();
                    relationVO.setTo(btmTypeVO.getId() + " " + btmTypeVO.getName());
                    relationVO.setFrom(linkBtmVO.getId() + " " + linkBtmVO.getName());
                    relationVO.setToText("引用");
                    relationVOList.add(relationVO);
                }else{
                } else {
                    //是链接类型
                    OsLinkTypeVO linkTypeVO = linkTypeService.selectAllLinkMap().get(usedAttr.getPkBtmType().toLowerCase(Locale.ROOT));
                    List<OsLinkTypeVO> linkTypeVOList = new ArrayList<>();
                    linkTypeVOList.add(linkTypeVO);
                    splicingLinkType2Json(nodeVOList, relationVOList,linkTypeVOList,btmTypeVO,true);
                    splicingLinkType2Json(nodeVOList, relationVOList, linkTypeVOList, btmTypeVO, true);
                }
            });
        }
@@ -634,6 +638,7 @@
    /**
     * èŽ·å–æ‰€æœ‰ä¸šåŠ¡ç±»åž‹ï¼ˆæ ‘å½¢ç»“æž„ï¼‰
     *
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @Override
@@ -642,18 +647,19 @@
        BizType[] bizTypes = getBizTypes("");
        OsBtmTypeVO osBtmTypeVO = null;
        List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes));
        for(int i = 0; i < osBtmTypeVOS.size(); i++){
        for (int i = 0; i < osBtmTypeVOS.size(); i++) {
            osBtmTypeVO = osBtmTypeVOS.get(i);
            if(osBtmTypeVO.getfName().equals("")){
            if (osBtmTypeVO.getfName().equals("")) {
                Tree tree = new Tree();
                tree.setOid(osBtmTypeVO.getOid());
                tree.setParentName(null);
                tree.setParentId(null);
                tree.setLeaf(true);
                tree.setId(osBtmTypeVO.getId());
                tree.setText(osBtmTypeVO.getDescription());
                tree.setAttributes(WebUtil.objectToMapString(osBtmTypeVO));
                tree.setChildren(getChildren(osBtmTypeVOS,osBtmTypeVO));
                tree.setChildren(getChildren(osBtmTypeVOS, osBtmTypeVO));
                rootTreeList.add(tree);
            }
        }
@@ -663,12 +669,13 @@
    /**
     * èŽ·å–æ‰€æœ‰ä¸šåŠ¡ç±»åž‹åç§°é›†åˆ
     *
     * @return
     */
    @Override
    public List<String> getAllBtmName() throws PLException {
        BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes("");
        if(null != bizTypes && bizTypes.length > 0){
        if (null != bizTypes && bizTypes.length > 0) {
            return Arrays.stream(bizTypes).map(bizType -> bizType.name).collect(Collectors.toList());
        }
        return null;
@@ -676,6 +683,7 @@
    /**
     * èŽ·å–ä¸šåŠ¡å…¨éƒ¨å±žæ€§ç±»åž‹
     *
     * @param btmName ä¸šåŠ¡ç±»åž‹åç§°
     * @return å±žæ€§çš„信息
     */
@@ -723,7 +731,7 @@
            vo.setOwner(attribute.creator);
            vo.setLastModifyTime(new Date(attribute.modifyTime));
            String maxLength = AttributeConstants.getOtherValueByType(attribute.other, AttributeConstants.LENGTH);
            if(StringUtils.isNotBlank(maxLength)){
            if (StringUtils.isNotBlank(maxLength)) {
                vo.setAttributeLength(Integer.valueOf(maxLength));
            }
            osBtms.add(vo);
@@ -733,12 +741,13 @@
    /**
     * dto转do对象
     *
     * @return
     */
    private BizType dto2BizType(OsBtmTypeDTO dto){
    private BizType dto2BizType(OsBtmTypeDTO dto) {
        BizType bizType = new BizType();
        bizType.oid = dto.getOid();
        bizType.name =dto.getId();
        bizType.name = dto.getId();
        bizType.isAbstract = dto.isAbstractFlag();
        bizType.label = dto.getName();
        bizType.fName = dto.getfName();
@@ -758,7 +767,7 @@
        bizType.delimiter = (dto.getDelimiter() == null ? "" : dto.getDelimiter());
        bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0: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());
@@ -766,22 +775,23 @@
        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.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();
        bizType.ts = Func.isEmpty(dto.getTs()) ? timeMillis : dto.getTs().getTime();
        return bizType;
    }
    /**
     * åˆ›å»ºæ–°çš„业务类型
     *
     * @return
     * @throws PLException
     */
    @Override
    public boolean addBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException {
        VciBaseUtil.alertNotNull(btmTypeDTO,"创建的业务类型对象");
        VciBaseUtil.alertNotNull(btmTypeDTO, "创建的业务类型对象");
        //业务类型名称检查
        checkName(btmTypeDTO.getId());
        //生命周期检查
@@ -815,26 +825,27 @@
    /**
     * æ£€æŸ¥ä¸šåŠ¡ç±»åž‹åç§°æ˜¯å¦åˆè§„
     *
     * @param btmName
     * @throws PLException
     */
    private void checkName(String btmName) throws PLException {
        if (Func.isBlank(btmName)) {
            throw new PLException("500",new String[]{"业务类型名不能为空!"});
            throw new PLException("500", new String[]{"业务类型名不能为空!"});
        }
        if (!btmName.matches("[a-z A-Z]*")) {
            throw new PLException("500",new String[]{"业务类型名只能为英文字母!"});
            throw new PLException("500", new String[]{"业务类型名只能为英文字母!"});
        }
        int maxLength = platformClientUtil.getBtmService().getBTNameMaxLength();
        if (btmName.length() > maxLength) {
            throw new PLException("500",new String[]{"业务类型名长度不能超过" + maxLength});
            throw new PLException("500", new String[]{"业务类型名长度不能超过" + maxLength});
        }
        if (platformClientUtil.getBtmService().checkRowIsExists(btmName)) {
            throw new PLException("500",new String[]{"业务类型名已经存在"});
            throw new PLException("500", new String[]{"业务类型名已经存在"});
        }
    }
@@ -845,19 +856,20 @@
     */
    private void checkLifeCycle(OsBtmTypeDTO btmTypeDTO) throws PLException {
        if (Func.isBlank(btmTypeDTO.getLifeCycleId())) {
            throw new PLException("500",new String[]{"生命周期不能为空"});
            throw new PLException("500", new String[]{"生命周期不能为空"});
        }
    }
    /**
     * é€‰æ‹©ä¸€çº§ç‰ˆæœ¬ï¼šå¿…须选择或手工输入版本号规则; é€‰æ‹©äºŒçº§ç‰ˆæœ¬ï¼šå¿…须选择或手工输入版本号规则, (版次号已经默认选择).
     *
     * @return
     */
    private void checkVersionInfo(OsBtmTypeDTO dto) throws PLException {
        //需要手动输入版本时revisionRuleId不能为空
        if (dto.getRevLevel() == 1 || dto.getRevLevel() == 2) {
            if (Func.isBlank(dto.getRevisionRuleId()) && !dto.isInputRevisionFlag()) {
                throw new PLException("500",new String[]{"版本号规则不能为空"});
                throw new PLException("500", new String[]{"版本号规则不能为空"});
            }
        }
    }
@@ -865,38 +877,40 @@
    /**
     * ç‰ˆæœ¬æœºåˆ¶ä¿®æ”¹: ä»…允许类型从"不可修订"变更至"一级版本管理机制","二级版本管理机制进行调整"; "一级版本管理机制"变更至"二级版本管理机制";
     * ä¸¤ç§æ–¹å¼.
     *
     * @param dbBizType å½“前修改前的业务类型(库中存储的)
     * @param dto å½“前修改业务类型
     * @param dto       å½“前修改业务类型
     * @throws PLException
     */
    private void checkRevLevel(BizType dbBizType,OsBtmTypeDTO dto) throws PLException {
        if (dbBizType.revLevel == 1 && dto.getRevLevel()==0) {
            throw new PLException("500",new String[]{"版本变更错误:不能从一级变为不可修订"});
    private void checkRevLevel(BizType dbBizType, OsBtmTypeDTO dto) throws PLException {
        if (dbBizType.revLevel == 1 && dto.getRevLevel() == 0) {
            throw new PLException("500", new String[]{"版本变更错误:不能从一级变为不可修订"});
        }
        if (dbBizType.revLevel == 2 && (dto.getRevLevel() == 1 || dto.getRevLevel() == 0)) {
            throw new PLException("500",new String[]{"版本变更错误:不能从二级变为一级或不可修订"});
            throw new PLException("500", new String[]{"版本变更错误:不能从二级变为一级或不可修订"});
        }
    }
    /**
     * ä¿®æ”¹ä¸šåŠ¡ç±»åž‹
     *
     * @param btmTypeDTO
     * @return
     * @throws PLException
     */
    @Override
    public boolean updateBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException {
        VciBaseUtil.alertNotNull(btmTypeDTO,"修改的业务类型对象");
        VciBaseUtil.alertNotNull(btmTypeDTO, "修改的业务类型对象");
        //检查生命周期是否合规
        checkLifeCycle(btmTypeDTO);
        //查询数据库中的业务类型
        String id = btmTypeDTO.getId();
        BizType dbBizType = platformClientUtil.getBtmService().getBizTypeByName(id);
        if(Func.isEmpty(dbBizType) || Func.isBlank(dbBizType.oid)){
            throw new PLException("500",new String[]{"当前修改的业务类型不存在!"});
        if (Func.isEmpty(dbBizType) || Func.isBlank(dbBizType.oid)) {
            throw new PLException("500", new String[]{"当前修改的业务类型不存在!"});
        }
        //检查版本规则修改是否合规
        checkRevLevel(dbBizType,btmTypeDTO);
        checkRevLevel(dbBizType, btmTypeDTO);
        checkVersionInfo(btmTypeDTO);
        //处理业务类型下的属性
        List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray().split(",")));
@@ -939,28 +953,29 @@
    /**
     * åˆ é™¤ä¸šåŠ¡ç±»åž‹
     *
     * @param btmTypeDTO
     * @return
     * @throws PLException
     */
    @Override
    public boolean deleteBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException {
        VciBaseUtil.alertNotNull(btmTypeDTO,"删除的业务类型");
        VciBaseUtil.alertNotNull(btmTypeDTO, "删除的业务类型");
        String btmName = btmTypeDTO.getId();
        //只能删除叶子节点
        if(Func.isNotBlank(btmTypeDTO.getfName())){
            throw new PLException("500",new String[]{"只能删除叶子节点"});
        if (Func.isNotBlank(btmTypeDTO.getfName())) {
            throw new PLException("500", new String[]{"只能删除叶子节点"});
        }
        // ä¸šåŠ¡ç±»åž‹è¢«é“¾æŽ¥ç±»åž‹ä½¿ç”¨, ä¸èƒ½åˆ é™¤
        List<String> usedNameList = linkTypeService.getUsedBtmLinkList(btmName);
        if (usedNameList != null && usedNameList.size() > 0) {
            throw new PLException("500",new String[]{"该类型已被链接类型使用,禁止删除"});
            throw new PLException("500", new String[]{"该类型已被链接类型使用,禁止删除"});
        }
        // ä¸šåŠ¡ç±»åž‹å·²ç»ç”Ÿæˆäº†ä¸šåŠ¡å¯¹è±¡, ä¸èƒ½åˆ é™¤
        if (hasInstanceByBtmName(btmName)) {
            throw new PLException("500",new String[]{"该类型已有实例,禁止删除"});
            throw new PLException("500", new String[]{"该类型已有实例,禁止删除"});
        }
        BizType bizType = new BizType();
        bizType.ts = btmTypeDTO.getTs().getTime();
        bizType.oid = btmTypeDTO.getOid();
@@ -970,6 +985,7 @@
    /**
     * ä¸€è‡´æ€§æ£€æŸ¥
     *
     * @return
     * @throws PLException
     */
@@ -977,9 +993,9 @@
    public BaseResult checkBtmConsistency() throws PLException {
        String[] result = platformClientUtil.getBtmService().btmConsistencyCheck();
        Map<String, String> dbCheckMap = new HashMap<String, String>();
        for(int i = 0; i < result.length; i++){
        for (int i = 0; i < result.length; i++) {
            String info = result[i];
            if(info.equals("")){
            if (info.equals("")) {
                continue;
            }
            String[] infos = info.split("/DML");
@@ -987,9 +1003,9 @@
            String dml = infos[1];
            dbCheckMap.put(typeName, dml);
        }
        if(dbCheckMap.size() < 1){
        if (dbCheckMap.size() < 1) {
            return BaseResult.successMsg("数据库中的表结构与类型一致,无需修复!!");
        }else{
        } else {
            //需要修复时就需要界面唤起对话框进行处理
            List<Map> list = new ArrayList<>();
            list.add(dbCheckMap);
@@ -1001,26 +1017,29 @@
    /**
     * ä¸€è‡´æ€§æ£€æŸ¥ä¿®å¤åŠŸèƒ½
     *
     * @param repairData
     * @return
     */
    @Override
    public BaseResult executeRepair(String repairData) throws Exception {
        Map<String, String> dbCheckMap = new ObjectMapper().readValue(repairData, new TypeReference<Map<String,String>>(){});
        Map<String, String> dbCheckMap = new ObjectMapper().readValue(repairData, new TypeReference<Map<String, String>>() {
        });
        List<String> list = this.getRepairDML(dbCheckMap);
        if(list.size() < 1){
        if (list.size() < 1) {
            return BaseResult.success();
        }
        try {
            String[] result = platformClientUtil.getBtmService().executeRepair(list.toArray(new String[0]));
            return BaseResult.success(result);
        }catch (PLException e){
            return BaseResult.fail("业务类型修复失败,原因:"+VciBaseUtil.getExceptionMessage(e));
        } catch (PLException e) {
            return BaseResult.fail("业务类型修复失败,原因:" + VciBaseUtil.getExceptionMessage(e));
        }
    }
    /**
     * åˆ›å»ºè§†å›¾
     *
     * @return
     * @throws PLException
     */
@@ -1031,6 +1050,7 @@
    /**
     * åˆ é™¤æ•°æ®ç•Œé¢çš„æŸ¥è¯¢
     *
     * @return ä¸šåŠ¡ç±»åž‹ï¼Œé“¾æŽ¥ç±»åž‹
     */
    @Override
@@ -1039,11 +1059,11 @@
        List<String> allBtmName = this.getAllBtmName();
        //获取链接类型名称集合
        List<String> allLinkType = linkTypeService.getAllLtName();
        Map<String,List> map = new HashMap<>();
        map.put("btmType",allBtmName);
        map.put("linkType",allLinkType);
        map.put("table",tableList);
        map.put("workFlow",workFlowTableList);
        Map<String, List> map = new HashMap<>();
        map.put("btmType", allBtmName);
        map.put("linkType", allLinkType);
        map.put("table", tableList);
        map.put("workFlow", workFlowTableList);
        List<Map> list = new ArrayList<>();
        list.add(map);
        return BaseResult.dataList(list);
@@ -1051,24 +1071,25 @@
    /**
     * åˆ é™¤æ•°æ®
     * @param btmNames ä¸šåŠ¡ç±»åž‹å
     *
     * @param btmNames  ä¸šåŠ¡ç±»åž‹å
     * @param linkNames é“¾æŽ¥ç±»åž‹å
     * @return
     * @throws PLException
     */
    @Override
    public List<Map> truncateTable(String[] btmNames,String[] linkNames) throws PLException {
    public List<Map> truncateTable(String[] btmNames, String[] linkNames) throws PLException {
        List<Map> returnMapList = new ArrayList<>();
        Map<String, List<String>> map = new HashMap<>();
        map.put("btmSuccess",new ArrayList<>());
        map.put("btmFail",new ArrayList<>());
        map.put("linkSuccess",new ArrayList<>());
        map.put("linkFail",new ArrayList<>());
        if(Func.isNotEmpty(btmNames)){
            for(int i = 0; i < btmNames.length; i++){
        map.put("btmSuccess", new ArrayList<>());
        map.put("btmFail", new ArrayList<>());
        map.put("linkSuccess", new ArrayList<>());
        map.put("linkFail", new ArrayList<>());
        if (Func.isNotEmpty(btmNames)) {
            for (int i = 0; i < btmNames.length; i++) {
                String btName = btmNames[i];
                try {
                    if(platformClientUtil.getBtmService().truncateTable(btName)){
                    if (platformClientUtil.getBtmService().truncateTable(btName)) {
                        //修改成功记录下成功的业务类型名
                        map.get("btmSuccess").add(btName);
                    }
@@ -1080,12 +1101,12 @@
                }
            }
        }
        if(Func.isNotEmpty(linkNames)){
        if (Func.isNotEmpty(linkNames)) {
            //truncate链接类型数据
            for(int i = 0; i < linkNames.length; i++){
            for (int i = 0; i < linkNames.length; i++) {
                String ltName = linkNames[i];
                try {
                    if(platformClientUtil.getLinkTypeService().truncateTable(ltName)){
                    if (platformClientUtil.getLinkTypeService().truncateTable(ltName)) {
                        map.get("linkSuccess").add(ltName);
                    }
                } catch (PLException e1) {
@@ -1101,6 +1122,7 @@
    /**
     * åˆ é™¤å…¨éƒ¨ç±»åž‹
     *
     * @return
     * @throws PLException
     */
@@ -1108,7 +1130,7 @@
    public BaseResult deleteAllType() throws PLException {
        DeleteType deleteType = new DeleteType();
        //获取待删除的业务类型
        List<BizType> delBtList =  deleteType.getDelBtList();
        List<BizType> delBtList = deleteType.getDelBtList();
        //获取待删除的链接类型
        List<LinkType> ltNames = deleteType.getDelLtList();
        //获取待删除的属性
@@ -1125,7 +1147,7 @@
            platformClientUtil.getBtmService().deleteBtsAndTables(delBtList.toArray(new BizType[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除业务类型和对应表格时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除业务类型和对应表格时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1133,7 +1155,7 @@
            ClientServiceProvider.getOMDService().getLinkTypeService().deleteLtsAndTables(ltNames.toArray(new LinkType[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除链接类型时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除链接类型时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1142,7 +1164,7 @@
            platformClientUtil.getAttributeService().deleteAttributeDefs(abs);
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除属性池属性时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除属性池属性时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1150,7 +1172,7 @@
            platformClientUtil.getEnumService().deleteEnumTypes(delEnumList.toArray(new EnumType[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除枚举类型时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除枚举类型时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1158,7 +1180,7 @@
            platformClientUtil.getLifeCycleService().deleteLifeCycles(delLCList.toArray(new LifeCycle[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除生命周期时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除生命周期时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1166,7 +1188,7 @@
            platformClientUtil.getStatePoolService().deleteStatePools(delStateList.toArray(new StatePool[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除状态池状态时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除状态池状态时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1174,7 +1196,7 @@
            platformClientUtil.getVersionService().deleteVersionRules(delVRList.toArray(new VersionRule[0]));
        } catch (PLException e) {
            e.printStackTrace();
            String exceptionMessage = "清除版本规则时出现异常,原因:"+VciBaseUtil.getExceptionMessage(e);
            String exceptionMessage = "清除版本规则时出现异常,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
@@ -1183,12 +1205,13 @@
    /**
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹åç§°å’Œå…¶ä¸‹çš„å±žæ€§åç§°èŽ·å–å·²æœ‰çš„ç´¢å¼•
     *
     * @param conditionMap æ ¹æ®æŸ¥è¯¢æ¡ä»¶ä¼ å‚: typename:业务类型名;
     * @return
     */
    @Override
    public List<IndexObject> getIndexByCondition(Map<String,String> conditionMap) throws PLException {
        if(Func.isEmpty(conditionMap)){
    public List<IndexObject> getIndexByCondition(Map<String, String> conditionMap) throws PLException {
        if (Func.isEmpty(conditionMap)) {
            return new ArrayList<>();
        }
        List<String> indexNameList = new ArrayList<String>();
@@ -1205,15 +1228,15 @@
        //HashMap<String, String> indexmap = new HashMap<String, String>();
        BusinessObject findBTMObjects[] = platformClientUtil.getQueryService().findBTMObjects(qtl.getId(), OQTool.qtTOXMl(qtl).asXML());
        List<IndexObject> indexObjects = new ArrayList<>();
        for(int i = 0; i < findBTMObjects.length; i++) {
        for (int i = 0; i < findBTMObjects.length; i++) {
            BusinessObject findBTMObject = findBTMObjects[i];
            IndexObject indexObject = new IndexObject();
            indexObject.setOid(findBTMObject.oid);
            indexObject.setDescription(findBTMObject.description);
            indexObject.setCreateTime(Func.format(new Date(findBTMObject.createTime),DateUtil.PATTERN_DATE));
            indexObject.setIndexName(ObjectTool.getBOAttributeValue(findBTMObject,"indexname"));
            indexObject.setTypeName(ObjectTool.getBOAttributeValue(findBTMObject,"typename"));
            indexObject.setAttrNames(ObjectTool.getBOAttributeValue(findBTMObject,"attrname"));
            indexObject.setCreateTime(Func.format(new Date(findBTMObject.createTime), DateUtil.PATTERN_DATE));
            indexObject.setIndexName(ObjectTool.getBOAttributeValue(findBTMObject, "indexname"));
            indexObject.setTypeName(ObjectTool.getBOAttributeValue(findBTMObject, "typename"));
            indexObject.setAttrNames(ObjectTool.getBOAttributeValue(findBTMObject, "attrname"));
            indexObjects.add(indexObject);
        }
        return indexObjects;
@@ -1221,18 +1244,19 @@
    /**
     * æ ¹æ®ä¸šåŠ¡ç±»åž‹åç§°å’Œå…¶ä¸‹çš„å±žæ€§åç§°åˆ é™¤ç´¢å¼•
     *
     * @param btmName
     * @param indexName
     * @return
     */
    @Override
    public boolean delIndex(String btmName, String indexName) throws PLException {
        VciBaseUtil.alertNotNull(btmName,"业务类型名",indexName,"索引名");
        VciBaseUtil.alertNotNull(btmName, "业务类型名", indexName, "索引名");
        Map<String, String> conditionMap = new HashMap<>();
        conditionMap.put("typename",btmName);
        conditionMap.put("indexname",indexName);
        conditionMap.put("typename", btmName);
        conditionMap.put("indexname", indexName);
        List<IndexObject> bo2 = getIndexByCondition(conditionMap);
        if(bo2!=null && bo2.size()>0) {
        if (bo2 != null && bo2.size() > 0) {
            String[] indexAttr = {indexName};
            boolean alterFlag = platformClientUtil.getBtmService().dropIndex(btmName, indexAttr);
@@ -1243,7 +1267,7 @@
            for (int i = 0; i < bo2.size(); i++) {
                String oid = bo2.get(i).getOid();
                BusinessObject bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid, "indexobject");
                platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1);
                platformClientUtil.getBOFactoryService().deleteBusinessObject(bo, 1);
            }
        }
        return true;
@@ -1251,12 +1275,13 @@
    /**
     * ç»™ä¸šåŠ¡ç±»åž‹ä¸‹çš„æŒ‡å®šå±žæ€§æ–°å¢žç´¢å¼•
     *
     * @param indexObjectList
     * @return
     */
    @Override
    public boolean addIndex(List<IndexObject> indexObjectList) throws PLException {
        VciBaseUtil.alertNotNull(indexObjectList,"新增的索引信息");
        VciBaseUtil.alertNotNull(indexObjectList, "新增的索引信息");
        String btmName = indexObjectList.get(0).getTypeName();
        String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining(","));
        String[] oldindexAttr = {indexNames};
@@ -1264,23 +1289,23 @@
        List<BusinessObject> boList = new ArrayList<>();
        //先查询当前添加索引是否已经存在,如果存在就先删除再新增实现替换操作
        Map<String, String> conditionMap = new HashMap<>();
        conditionMap.put("typename",btmName);
        conditionMap.put("typename", btmName);
        //先这样处理,前端现在只做了单次保存,所以不用in
        conditionMap.put("indexname", indexNames);
        List<IndexObject> indexObjects = getIndexByCondition(conditionMap);
        if(indexObjects!=null && indexObjects.size()>0){
        if (indexObjects != null && indexObjects.size() > 0) {
            //索引不存在时删除就会报错索引不存在,所以这里有索引才去删除
            boolean b = platformClientUtil.getBtmService().dropIndex(btmName, oldindexAttr);
            if(b){
                for(int i = 0; i < indexObjects.size(); i ++){
            if (b) {
                for (int i = 0; i < indexObjects.size(); i++) {
                    String oid = (String) indexObjects.get(i).getOid();
                    bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid,"indexobject");
                    platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1);
                    bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid, "indexobject");
                    platformClientUtil.getBOFactoryService().deleteBusinessObject(bo, 1);
                }
            }
        }
        for(int i = 0; i < indexObjectList.size(); i ++){
        for (int i = 0; i < indexObjectList.size(); i++) {
            IndexObject indexObject = indexObjectList.get(i);
            //bo = platformClientUtil.getBOFService().initBusinessObject("indexobject");
            bo = boService.createCBOByBtmName("indexobject");
@@ -1290,11 +1315,11 @@
            attributeValues.add(new AttributeValue("attrname", indexObject.getAttrNames()));
            bo.newAttrValList = attributeValues.toArray(new AttributeValue[attributeValues.size()]);
            bo.description = indexObject.getDescription();
            String[] indexAttr = {indexObject.getIndexName(),indexObject.getAttrNames()};
            String[] indexAttr = {indexObject.getIndexName(), indexObject.getAttrNames()};
            //给指定业务类型的指定属性创建索引
            boolean alterFlag = platformClientUtil.getBtmService().addIndex(btmName, indexAttr);
            //索引创建成功之后,需要存储成功索引到索引表中
            if(!alterFlag){
            if (!alterFlag) {
                return false;
            }
            boList.add(bo);
@@ -1302,13 +1327,14 @@
            //platformClientUtil.getBOFactoryService().createBusinessObject(bo,false,false);
        }
        //添加索引信息到索引的业务表中
        platformClientUtil.getBOFactoryService().batchCreateBusinessObject(boList.toArray(new BusinessObject[boList.size()]),false,false);
        platformClientUtil.getBOFactoryService().batchCreateBusinessObject(boList.toArray(new BusinessObject[boList.size()]), false, false);
        return true;
    }
    /**
     * å¯¼å‡ºä¸šåŠ¡ç±»åž‹
     * oid ä¸šåŠ¡ç±»åž‹åç§°
     *
     * @return åˆ›å»ºç»“æžœ
     */
    @Override
@@ -1319,7 +1345,7 @@
        //设置列名
        List<String> columns = new ArrayList<>(
                Arrays.asList("类型名称", "标签", "继承自", "实现类", "描述", "版本规则", "版本号规则",
                        "是否手工输入","分隔符", "版次号规则","生命周期", "备选生命周期列表","属性列表")
                        "是否手工输入", "分隔符", "版次号规则", "生命周期", "备选生命周期列表", "属性列表")
        );
        try {
            new File(excelPath).createNewFile();
@@ -1327,25 +1353,25 @@
            List<WriteExcelData> excelDataList = new ArrayList<>();
            //设置列头
            for (int index = 0; index < columns.size(); index++) {
                excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
                excelDataList.add(new WriteExcelData(0, index, columns.get(index)));
            }
            HashSet<String> attributes = new HashSet<>();
            int i = 0;
            for (String name : names.split(",")) {
                BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(name);
                excelDataList.add(new WriteExcelData(i+1,0, bizType.name));
                excelDataList.add(new WriteExcelData(i+1,1, bizType.label));
                excelDataList.add(new WriteExcelData(i+1,2, bizType.fName));
                excelDataList.add(new WriteExcelData(i+1,3, bizType.implClass));
                excelDataList.add(new WriteExcelData(i+1,4, bizType.description));
                excelDataList.add(new WriteExcelData(i+1,5, bizType.revLevel));
                excelDataList.add(new WriteExcelData(i+1,6, bizType.revRuleName));
                excelDataList.add(new WriteExcelData(i+1,7, bizType.revInput));
                excelDataList.add(new WriteExcelData(i+1,8, bizType.delimiter));
                excelDataList.add(new WriteExcelData(i+1,9, bizType.verRuleName));
                excelDataList.add(new WriteExcelData(i+1,10, bizType.lifeCycle));
                excelDataList.add(new WriteExcelData(i+1,11, String.join(",",bizType.lifeCycles)));
                excelDataList.add(new WriteExcelData(i+1,12, String.join(",",bizType.apNameArray)));
                excelDataList.add(new WriteExcelData(i + 1, 0, bizType.name));
                excelDataList.add(new WriteExcelData(i + 1, 1, bizType.label));
                excelDataList.add(new WriteExcelData(i + 1, 2, bizType.fName));
                excelDataList.add(new WriteExcelData(i + 1, 3, bizType.implClass));
                excelDataList.add(new WriteExcelData(i + 1, 4, bizType.description));
                excelDataList.add(new WriteExcelData(i + 1, 5, bizType.revLevel));
                excelDataList.add(new WriteExcelData(i + 1, 6, bizType.revRuleName));
                excelDataList.add(new WriteExcelData(i + 1, 7, bizType.revInput));
                excelDataList.add(new WriteExcelData(i + 1, 8, bizType.delimiter));
                excelDataList.add(new WriteExcelData(i + 1, 9, bizType.verRuleName));
                excelDataList.add(new WriteExcelData(i + 1, 10, bizType.lifeCycle));
                excelDataList.add(new WriteExcelData(i + 1, 11, String.join(",", bizType.lifeCycles)));
                excelDataList.add(new WriteExcelData(i + 1, 12, String.join(",", bizType.apNameArray)));
                attributes.addAll(Arrays.asList(bizType.apNameArray));
                i++;
            }
@@ -1353,20 +1379,21 @@
            ExcelUtil.writeDataToFile(excelPath, excelOption);
            //导出属性
            String attrPath = attributeService.exportAttributes("btmattr",
                    attributes.stream().collect(Collectors.joining(",")),true);
                    attributes.stream().collect(Collectors.joining(",")), true);
            //移动属性到链接类型文件夹里面去
            FileUtil.move(new File(attrPath), new File(defaultTempFolder),true);
            FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\")));
        }catch (IOException e) {
            FileUtil.move(new File(attrPath), new File(defaultTempFolder), true);
            FileUtil.del(attrPath.substring(0, attrPath.lastIndexOf("\\")));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        File zip = ZipUtil.zip(defaultTempFolder);
        FileUtil.del(defaultTempFolder + File.separator);
        ControllerUtil.writeFileToResponse(response,zip.getAbsoluteFile());
        ControllerUtil.writeFileToResponse(response, zip.getAbsoluteFile());
    }
    /**
     * å¯¼å…¥ä¸šåŠ¡ç±»åž‹
     *
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
@@ -1392,8 +1419,8 @@
            }
        }
        //TODO:导入属性,但是这个逻辑实际上存在一些问题,导入的属性只是业务类型的属性不应该去给属性池导入,可能是想的属性不存在的就新增一次
        BaseResult baseResult = attributeService.importAttributes(attrExcel,true);
        if(!baseResult.isSuccess()){
        BaseResult baseResult = attributeService.importAttributes(attrExcel, true);
        if (!baseResult.isSuccess()) {
            //删除上传的文件夹
            FileUtil.del(defaultTempFolder + File.separator);
            return baseResult;
@@ -1408,13 +1435,14 @@
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没有导入的链接文件。导入终止!"});
            }
        }
        try{
        try {
            //1、读取excel中的数据,组成对象
            ReadExcelOption excelOption = new ReadExcelOption();
            List<OsBtmTypePO> poList = ExcelUtil.readDataObjectFromExcel(btmExcel, OsBtmTypePO.class,excelOption,(value, po, fieldName)->{});
            List<OsBtmTypePO> poList = ExcelUtil.readDataObjectFromExcel(btmExcel, OsBtmTypePO.class, excelOption, (value, po, fieldName) -> {
            });
            //去除都是空的情况
            if(CollectionUtils.isEmpty(poList)){
                return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{});
            if (CollectionUtils.isEmpty(poList)) {
                return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL, new String[]{});
            }
            //当前excel中是否重复用的判重Map:(key:判重属性,value:行号)
            Map<String, String> excelReapeat = new HashMap<>();
@@ -1422,25 +1450,25 @@
            //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑
            poList.stream().forEach(osBtmTypePO -> {
                if(Func.isBlank(osBtmTypePO.getName())){//属性名判空
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,name");
                }else if(osBtmTypePO.getName().length() > maxLength){
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,业务类型名长度不能超过" + maxLength);
                }else if(!osBtmTypePO.getName().matches("^[A-Za-z]+$")){
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,业务类型名称只能为英文字母");
                }else if (osBtmTypePO.getName().length() > maxLength) {
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,业务类型名长度不能超过" + maxLength);
                }else if(excelReapeat.containsKey(osBtmTypePO.getName())){//业务类型名在表格中判重
                    throw new VciBaseException("第【"+excelReapeat.get(osBtmTypePO.getName())+"】行和第【"+osBtmTypePO.getRowIndex()+"】行数据,业务类型名重复");
                }else if (Func.isBlank(osBtmTypePO.getLifeCycle())) {
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,生命周期不能为空");
                }else if ("true".equalsIgnoreCase(osBtmTypePO.getRevInput()) && Func.isBlank(osBtmTypePO.getRevRuleName())) {
                    throw new VciBaseException("第【"+osBtmTypePO.getRowIndex()+"】行,版本号规则不能为空");
                if (Func.isBlank(osBtmTypePO.getName())) {//属性名判空
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,name");
                } else if (osBtmTypePO.getName().length() > maxLength) {
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,业务类型名长度不能超过" + maxLength);
                } else if (!osBtmTypePO.getName().matches("^[A-Za-z]+$")) {
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,业务类型名称只能为英文字母");
                } else if (osBtmTypePO.getName().length() > maxLength) {
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,业务类型名长度不能超过" + maxLength);
                } else if (excelReapeat.containsKey(osBtmTypePO.getName())) {//业务类型名在表格中判重
                    throw new VciBaseException("第【" + excelReapeat.get(osBtmTypePO.getName()) + "】行和第【" + osBtmTypePO.getRowIndex() + "】行数据,业务类型名重复");
                } else if (Func.isBlank(osBtmTypePO.getLifeCycle())) {
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,生命周期不能为空");
                } else if ("true".equalsIgnoreCase(osBtmTypePO.getRevInput()) && Func.isBlank(osBtmTypePO.getRevRuleName())) {
                    throw new VciBaseException("第【" + osBtmTypePO.getRowIndex() + "】行,版本号规则不能为空");
                }
                try {
                    BizType historyBtm = platformClientUtil.getBtmService().getBizTypeByName(osBtmTypePO.getName());
                    //已有此数据进行删除覆盖
                    if(historyBtm != null && !historyBtm.name.equals("")){
                    if (historyBtm != null && !historyBtm.name.equals("")) {
                        platformClientUtil.getBtmService().deleteBizType(historyBtm);
                    }
                } catch (PLException e) {
@@ -1448,7 +1476,7 @@
                }
                //属性名excel中判重处理
                excelReapeat.put(osBtmTypePO.getName(),osBtmTypePO.getRowIndex());
                excelReapeat.put(osBtmTypePO.getName(), osBtmTypePO.getRowIndex());
                BizType bizType = new BizType();
                bizType.name = osBtmTypePO.getName();
                bizType.label = osBtmTypePO.getLable();
@@ -1472,12 +1500,12 @@
                    throw new RuntimeException(e);
                }
            });
        }catch (Exception e){
            if(logger.isErrorEnabled()){
                logger.error("读取excel内容时或保存业务类型信息时出现了错误,具体原因:",VciBaseUtil.getExceptionMessage(e));
        } catch (Exception e) {
            if (logger.isErrorEnabled()) {
                logger.error("读取excel内容时或保存业务类型信息时出现了错误,具体原因:", VciBaseUtil.getExceptionMessage(e));
            }
            e.printStackTrace();
            return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e);
            return BaseResult.fail(VciBaseUtil.getExceptionMessage(e), new String[]{}, e);
        }
        //删除上传的文件夹
        FileUtil.del(defaultTempFolder + File.separator);
@@ -1486,12 +1514,13 @@
    /**
     * èŽ·å–éœ€è¦ä¿®å¤çš„ä¼ªsql
     *
     * @param dbCheckMap
     * @return
     */
    private List<String> getRepairDML(Map<String, String> dbCheckMap) {
        List<String> list = new ArrayList<String>();
        for(Iterator<String> ite = dbCheckMap.keySet().iterator(); ite.hasNext();){
        for (Iterator<String> ite = dbCheckMap.keySet().iterator(); ite.hasNext(); ) {
            String type = ite.next();
            String dml = dbCheckMap.get(type);
            list.add(type + "/DML" + dml);
@@ -1515,18 +1544,18 @@
            e.printStackTrace();
            String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            throw new PLException("500",new String[]{exceptionMessage});
            throw new PLException("500", new String[]{exceptionMessage});
        }
        return flag;
    }
    private List<Tree> getChildren(List<OsBtmTypeVO> osBtmTypeVOS,OsBtmTypeVO parentBIzType){
        List<Tree> trees= new ArrayList<>();
    private List<Tree> getChildren(List<OsBtmTypeVO> osBtmTypeVOS, OsBtmTypeVO parentBIzType) {
        List<Tree> trees = new ArrayList<>();
        for (OsBtmTypeVO bizType : osBtmTypeVOS) {
            if(StringUtils.isBlank(bizType.getfName())){
            if (StringUtils.isBlank(bizType.getfName())) {
                continue;
            }
            if(bizType.getfName().equals(parentBIzType.getId())){
            if (bizType.getfName().equals(parentBIzType.getId())) {
                Tree tree = new Tree();
                tree.setOid(bizType.getOid());
                tree.setParentName(parentBIzType.getfName());
@@ -1534,7 +1563,7 @@
                tree.setLeaf(true);
                tree.setText(bizType.getDescription());
                tree.setAttributes(WebUtil.objectToMapString(bizType));
                tree.setChildren(getChildren(osBtmTypeVOS,bizType));
                tree.setChildren(getChildren(osBtmTypeVOS, bizType));
                trees.add(tree);
            }
        }
@@ -1544,12 +1573,12 @@
    /**
     * å°†ä¸šåŠ¡ç±»åž‹æ‹¼æŽ¥json
     *
     * @param nodeVOList  å¯¹è±¡èŠ‚ç‚¹çš„ä¿¡æ¯
     * @param relationVOList  å…³ç³»çš„信息
     * @param btmTypeVO ä¸šåŠ¡ç±»åž‹æ˜¾ç¤ºå¯¹è±¡
     * @param hasRefer åŒ…含参照
     * @param nodeVOList     å¯¹è±¡èŠ‚ç‚¹çš„ä¿¡æ¯
     * @param relationVOList å…³ç³»çš„信息
     * @param btmTypeVO      ä¸šåŠ¡ç±»åž‹æ˜¾ç¤ºå¯¹è±¡
     * @param hasRefer       åŒ…含参照
     */
    private void splicingBtmType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO,boolean hasRefer) {
    private void splicingBtmType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO, boolean hasRefer) {
        OsERNodeVO nodeVO = new OsERNodeVO();
        nodeVO.setKey(btmTypeVO.getId() + " " + btmTypeVO.getName());
        List<OsERNodePropertyVO> itemList = new ArrayList<>();
@@ -1557,15 +1586,15 @@
            OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO();
            nodePropertyVO.setName(attribute.getId() + " " + attribute.getName());
            nodePropertyVO.setKey("oid".equals(attribute.getId().toLowerCase()));
            if(StringUtils.isNotBlank(attribute.getReferBtmTypeId())){
            if (StringUtils.isNotBlank(attribute.getReferBtmTypeId())) {
                //参照的属性,设置为黄色
                nodePropertyVO.setColor("#FEDD32FF");
            }else{
            } else {
                nodePropertyVO.setColor("#000");
            }
            itemList.add(nodePropertyVO);
            //判断参照
            if(hasRefer) {
            if (hasRefer) {
                selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList);
            }
        });
@@ -1576,9 +1605,9 @@
    /**
     * åˆ¤æ–­ä¸šåŠ¡ç±»åž‹çš„å±žæ€§æ˜¯ä¸æ˜¯å‚ç…§ç±»åž‹ï¼Œå¹¶å°†å‚ç…§æ·»åŠ åˆ°ER图中
     *
     * @param attribute     ä¸šåŠ¡ç±»åž‹å±žæ€§
     * @param nodeVOList  èŠ‚ç‚¹ä¿¡æ¯
     * @param btmTypeVO ä¸šåŠ¡ç±»åž‹
     * @param attribute      ä¸šåŠ¡ç±»åž‹å±žæ€§
     * @param nodeVOList     èŠ‚ç‚¹ä¿¡æ¯
     * @param btmTypeVO      ä¸šåŠ¡ç±»åž‹
     * @param relationVOList å…³ç³»ä¿¡æ¯
     */
    private void selectReferenceBtmType(OsBtmTypeAttributeVO attribute, OsBtmTypeVO btmTypeVO,
@@ -1592,14 +1621,14 @@
            nodeVO.setKey(referenceBtmType.getId() + " " + referenceBtmType.getName());
            List<OsERNodePropertyVO> items = new ArrayList<>();
            if(referenceBtmType.getId().equalsIgnoreCase(btmTypeVO.getId())){
            if (referenceBtmType.getId().equalsIgnoreCase(btmTypeVO.getId())) {
                //参照自己的内容
                OsERRelationVO relationVO = new OsERRelationVO();
                relationVO.setTo(referenceBtmType.getId() + " " + referenceBtmType.getName());
                relationVO.setFrom(btmTypeVO.getId() + " " + btmTypeVO.getName());
                relationVO.setToText("自参照");
                relationVOList.add(relationVO);
            }else {
            } else {
                referenceBtmAttributes.forEach(attr -> {
                    OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO();
                    nodePropertyVO.setName(attr.getId() + " " + attr.getName());
@@ -1622,23 +1651,23 @@
    /**
     * åŠ è½½ä¸šåŠ¡ç±»åž‹æ‰€å…³è”çš„é“¾æŽ¥ç±»åž‹
     *
     * @param nodeVOList  èŠ‚ç‚¹ä¿¡æ¯
     * @param nodeVOList     èŠ‚ç‚¹ä¿¡æ¯
     * @param relationVOList å…³ç³»çš„信息
     * @param btmTypeVO    ä¸šåŠ¡ç±»åž‹
     * @param btmTypeVO      ä¸šåŠ¡ç±»åž‹
     */
    private void loadAllLinkTypeByBtmType(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO) {
        Map<String, OsLinkTypeVO> linkTypeVOMap = linkTypeService.selectAllLinkMap();
        Collection<OsLinkTypeVO> linkTypeVOS = linkTypeVOMap.values();
        Set<OsLinkTypeVO> fromLinkTypeVOList = linkTypeVOS.stream().filter(link ->
            Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId()))
                Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId()))
        ).collect(Collectors.toSet());
        Set<OsLinkTypeVO> toLinkTypeList = linkTypeVOS.stream().filter(link ->
                Arrays.stream(link.getToBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId()))).collect(Collectors.toSet());
                Arrays.stream(link.getToBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId()))).collect(Collectors.toSet());
        List<OsLinkTypeVO> linkTypeVOList = new ArrayList<>();
        linkTypeVOList.addAll(fromLinkTypeVOList);
        linkTypeVOList.addAll(toLinkTypeList);
        if (!CollectionUtils.isEmpty(linkTypeVOList)) {
            splicingLinkType2Json(nodeVOList, relationVOList,linkTypeVOList,btmTypeVO,false);
            splicingLinkType2Json(nodeVOList, relationVOList, linkTypeVOList, btmTypeVO, false);
        }
    }
@@ -1646,31 +1675,31 @@
    /**
     * å°†é“¾æŽ¥ç±»åž‹æ‹¼æŽ¥æˆjson
     *
     * @param nodeVOList  èŠ‚ç‚¹ä¿¡æ¯
     * @param relationVOList  å…³ç³»ä¿¡æ¯
     * @param linkTypeVOs é“¾æŽ¥ç±»åž‹
     * @param btmTypeVO ä¸šåŠ¡ç±»åž‹çš„æ˜¾ç¤ºå¯¹è±¡
     * @param used æ˜¯å¦ä¸ºè¢«ä½¿ç”¨
     * @param nodeVOList     èŠ‚ç‚¹ä¿¡æ¯
     * @param relationVOList å…³ç³»ä¿¡æ¯
     * @param linkTypeVOs    é“¾æŽ¥ç±»åž‹
     * @param btmTypeVO      ä¸šåŠ¡ç±»åž‹çš„æ˜¾ç¤ºå¯¹è±¡
     * @param used           æ˜¯å¦ä¸ºè¢«ä½¿ç”¨
     */
    private void splicingLinkType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList,
                                       List<OsLinkTypeVO> linkTypeVOs,OsBtmTypeVO btmTypeVO,boolean used) {
                                       List<OsLinkTypeVO> linkTypeVOs, OsBtmTypeVO btmTypeVO, boolean used) {
        linkTypeVOs.forEach(link -> {
            List<OsLinkTypeAttributeVO> attributeList = link.getAttributes();
            OsERNodeVO nodeVO= new OsERNodeVO();
            OsERNodeVO nodeVO = new OsERNodeVO();
            nodeVO.setKey(link.getId() + " " + link.getName());
            List<OsERNodePropertyVO> items = new ArrayList<>();
            attributeList.forEach(attr -> {
                OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO();
                nodePropertyVO.setName(attr.getId() + " " + attr.getName());
                nodePropertyVO.setKey("oid".equals(attr.getId().toLowerCase()));
                if(StringUtils.isNotBlank(attr.getReferBtmTypeId())) {
                if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) {
                    nodePropertyVO.setColor("#FEDD32FF");
                }else {
                } else {
                    nodePropertyVO.setColor("#1c446f");
                }
                items.add(nodePropertyVO);
                //判断参照
                if(!used) {
                if (!used) {
                    selectReferenceLinkType(attr, link, nodeVOList, relationVOList);
                }
            });
@@ -1682,26 +1711,26 @@
            nodeVOList.add(nodeVO);
            if(used){
            if (used) {
                relationVO.setText("被引用");
            }
            //如果当前的from端,那么就显示to端的
            //如果当前的是to端的,那么就显示from端的内容
            if(Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId()))){
            if (Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId()))) {
                //这个是from端
               if(!used) {
                   relationVO.setToText("from端");
               }
                if (!used) {
                    relationVO.setToText("from端");
                }
                //找这个链接类型的to端的业务类型
               link.getToBtmTypeVOS().stream().forEach(toBtm->{
                    splicingBtmType2JsonForLink(nodeVOList,relationVOList,link,toBtm,true);
               });
            }else{
                if(!used) {
                link.getToBtmTypeVOS().stream().forEach(toBtm -> {
                    splicingBtmType2JsonForLink(nodeVOList, relationVOList, link, toBtm, true);
                });
            } else {
                if (!used) {
                    relationVO.setToText("to端");
                }
                link.getFromBtmTypeVOS().stream().forEach(fromBtm->{
                    splicingBtmType2JsonForLink(nodeVOList,relationVOList,link,fromBtm,false);
                link.getFromBtmTypeVOS().stream().forEach(fromBtm -> {
                    splicingBtmType2JsonForLink(nodeVOList, relationVOList, link, fromBtm, false);
                });
            }
            relationVOList.add(relationVO);
@@ -1710,11 +1739,12 @@
    /**
     * é“¾æŽ¥ç±»åž‹å…³é”®çš„业务类型
     * @param nodeVOList å¯¹è±¡åˆ—表
     *
     * @param nodeVOList     å¯¹è±¡åˆ—表
     * @param relationVOList å…³è”关系列表
     * @param link é“¾æŽ¥ç±»åž‹
     * @param btmTypeVO ä¸šåŠ¡ç±»åž‹
     * @param to æ˜¯å¦ä¸ºto端
     * @param link           é“¾æŽ¥ç±»åž‹
     * @param btmTypeVO      ä¸šåŠ¡ç±»åž‹
     * @param to             æ˜¯å¦ä¸ºto端
     */
    private void splicingBtmType2JsonForLink(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsLinkTypeVO link, OsBtmTypeVO btmTypeVO, boolean to) {
        OsERNodeVO nodeVO = new OsERNodeVO();
@@ -1732,7 +1762,7 @@
        OsERRelationVO relationVO = new OsERRelationVO();
        relationVO.setFrom(link.getId() + " " + link.getName());
        relationVO.setTo(btmTypeVO.getId() + " " + btmTypeVO.getName());
        relationVO.setToText(to?"to端":"from端");
        relationVO.setToText(to ? "to端" : "from端");
        relationVOList.add(relationVO);
        nodeVOList.add(nodeVO);
    }
@@ -1740,12 +1770,12 @@
    /**
     * åˆ¤æ–­é“¾æŽ¥ç±»åž‹çš„属性是不是参照类型,并将参照添加到ER图中
     *
     * @param attr          é“¾æŽ¥ç±»åž‹çš„属性
     * @param linkTypeVO é“¾æŽ¥ç±»åž‹çš„内容
     * @param nodeVOList èŠ‚ç‚¹å¯¹è±¡
     * @param attr           é“¾æŽ¥ç±»åž‹çš„属性
     * @param linkTypeVO     é“¾æŽ¥ç±»åž‹çš„内容
     * @param nodeVOList     èŠ‚ç‚¹å¯¹è±¡
     * @param relationVOList å…³ç³»å¯¹è±¡
     */
    private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO,List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) {
    private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) {
        if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) {
            //是参照类型的
            OsBtmTypeVO referenceBtmType = getBtmById(attr.getReferBtmTypeId());
@@ -1775,7 +1805,7 @@
    /**
     * å°è£…删除全部类型相关的查询方法的内部类
     */
    private class DeleteType{
    private class DeleteType {
        private List<String> exceptBts, exceptAbs, exceptEnums, exceptRev, exceptLCs, exceptStates;
@@ -1786,20 +1816,21 @@
        /**
         * èŽ·å–éœ€è¦åˆ é™¤çš„ä¸šåŠ¡ç±»åž‹
         *
         * @return
         */
        public List<BizType> getDelBtList() throws PLException {
            List<BizType> list = new ArrayList<>();
            BizType[] bts = platformClientUtil.getBtmService().getBizTypes("");
            for(BizType bt : bts){
            for (BizType bt : bts) {
                boolean exceptFlag = false;
                for(String except : exceptBts){
                    if(except.equalsIgnoreCase(bt.name)){
                for (String except : exceptBts) {
                    if (except.equalsIgnoreCase(bt.name)) {
                        exceptFlag = true;
                        break;
                    }
                }
                if(!exceptFlag){
                if (!exceptFlag) {
                    list.add(bt);
                }
            }
@@ -1808,6 +1839,7 @@
        /**
         * èŽ·å–éœ€è¦åˆ é™¤çš„é“¾æŽ¥ç±»åž‹
         *
         * @return
         */
        public List<LinkType> getDelLtList() throws PLException {
@@ -1817,6 +1849,7 @@
        /**
         * èŽ·å–å¾…åˆ é™¤çš„å±žæ€§
         *
         * @return
         */
        public List<String> getDelAbList() {
@@ -1829,26 +1862,26 @@
            }
            //依据保留的类型构造保留的属性
            exceptAbs = new ArrayList<String>();
            for(String except : exceptBts){
            for (String except : exceptBts) {
                String[] btmApNameArray = null;
                try {
                    btmApNameArray = platformClientUtil.getBtmService().getAttributeNames(except);
                } catch (PLException e) {
                    e.printStackTrace();
                }
                if(btmApNameArray != null){
                    for(String abName : btmApNameArray){
                        if(!exceptAbs.contains(abName)){
                if (btmApNameArray != null) {
                    for (String abName : btmApNameArray) {
                        if (!exceptAbs.contains(abName)) {
                            exceptAbs.add(abName);
                        }
                    }
                }
            }
            //构造可删除的属性
            if(attribItems != null){
                for(AttributeDef ab : attribItems){
            if (attribItems != null) {
                for (AttributeDef ab : attribItems) {
                    String abName = ab.name;
                    if(!exceptAbs.contains(abName)){
                    if (!exceptAbs.contains(abName)) {
                        list.add(abName);
                    }
                }
@@ -1858,6 +1891,7 @@
        /**
         * èŽ·å–å¾…åˆ é™¤çš„æžšä¸¾ç±»åž‹
         *
         * @return
         */
        public List<EnumType> getDelEnumList() {
@@ -1867,15 +1901,15 @@
                exceptEnums = new ArrayList<String>();
                EnumType[] emItems = ClientServiceProvider.getOMDService().getEnumService().getEnumTypes("", 0, 0);
                AttributeDef[] abs = platformClientUtil.getAttributeService().getAttributeDefsByNames(exceptAbs.toArray(new String[0]));
                for(AttributeDef ab : abs){
                for (AttributeDef ab : abs) {
                    OtherInfo otherInfo = OtherInfo.getOtherInfoByText(ab.other);
                    String enumName = otherInfo.getEnumName();
                    if(enumName != null && !enumName.equals("") && !exceptEnums.contains(enumName)){
                    if (enumName != null && !enumName.equals("") && !exceptEnums.contains(enumName)) {
                        exceptEnums.add(enumName);
                    }
                }
                for(EnumType em : emItems){
                    if(!exceptEnums.contains(em.name)){
                for (EnumType em : emItems) {
                    if (!exceptEnums.contains(em.name)) {
                        list.add(em);
                    }
                }
@@ -1887,17 +1921,18 @@
        /**
         * èŽ·å–å¾…åˆ é™¤çš„ç”Ÿå‘½å‘¨æœŸ
         *
         * @return
         */
        public List<LifeCycle> getDelLCList(){
        public List<LifeCycle> getDelLCList() {
            List<LifeCycle> list = new ArrayList<LifeCycle>();
            exceptLCs = new ArrayList<String>();
            exceptStates = new ArrayList<String>();
            for(String btName : exceptBts){
            for (String btName : exceptBts) {
                try {
                    BizType bt = platformClientUtil.getBtmService().getBizTypeByName(btName);
                    String lcName = bt.lifeCycle;
                    if(lcName != null && !lcName.equals("") && !exceptLCs.contains(lcName)){
                    if (lcName != null && !lcName.equals("") && !exceptLCs.contains(lcName)) {
                        exceptLCs.add(lcName);
                    }
                } catch (PLException e) {
@@ -1911,15 +1946,15 @@
            } catch (PLException e) {
                e.printStackTrace();
            }
            if(lcs != null){
                for(LifeCycle lc : lcs){
            if (lcs != null) {
                for (LifeCycle lc : lcs) {
                    String name = lc.name;
                    if(name != null && !name.equals("") && !exceptLCs.contains(name)){
                    if (name != null && !name.equals("") && !exceptLCs.contains(name)) {
                        list.add(lc);
                    }else{
                    } else {
                        //保留的状态池
                        Bound[] bounds = lc.bounds;
                        for(Bound bound : bounds){
                        for (Bound bound : bounds) {
                            String sName = bound.name;
                            exceptStates.add(sName);
                        }
@@ -1931,9 +1966,10 @@
        /**
         * èŽ·å–å¾…åˆ é™¤çš„çŠ¶æ€
         *
         * @return
         */
        public List<StatePool> getDelSPList(){
        public List<StatePool> getDelSPList() {
            List<StatePool> list = new ArrayList<StatePool>();
            StatePool[] states = null;
            try {
@@ -1941,10 +1977,10 @@
            } catch (PLException e) {
                e.printStackTrace();
            }
            if(states != null){
                for(StatePool state : states){
            if (states != null) {
                for (StatePool state : states) {
                    String name = state.name;
                    if(name != null && !name.equals("") && !exceptStates.contains(name)){
                    if (name != null && !name.equals("") && !exceptStates.contains(name)) {
                        list.add(state);
                    }
                }
@@ -1954,16 +1990,17 @@
        /**
         * èŽ·å–å¾…åˆ é™¤çš„ç‰ˆæœ¬è§„åˆ™
         *
         * @return
         */
        public List<VersionRule> getDelVRList(){
        public List<VersionRule> getDelVRList() {
            List<VersionRule> list = new ArrayList<VersionRule>();
            exceptRev = new ArrayList<String>();
            for(String btName : exceptBts){
            for (String btName : exceptBts) {
                try {
                    BizType bt = platformClientUtil.getBtmService().getBizTypeByName(btName);
                    String revName = bt.revRuleName;
                    if(revName != null && !revName.equals("") && !exceptRev.contains(revName)){
                    if (revName != null && !revName.equals("") && !exceptRev.contains(revName)) {
                        exceptRev.add(revName);
                    }
                } catch (PLException e) {
@@ -1976,10 +2013,10 @@
            } catch (PLException e) {
                e.printStackTrace();
            }
            if(revs != null){
                for(VersionRule rev : revs){
            if (revs != null) {
                for (VersionRule rev : revs) {
                    String name = rev.name;
                    if(name != null && !name.equals("") && !exceptRev.contains(name)){
                    if (name != null && !name.equals("") && !exceptRev.contains(name)) {
                        list.add(rev);
                    }
                }
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -5,6 +5,7 @@
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.framework.data.RoleRightInfo;
import com.vci.corba.omd.btm.BizType;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.PortalService;
import com.vci.corba.portal.data.*;
import com.vci.dto.RoleRightDTO;
@@ -20,7 +21,7 @@
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.SessionInfo;
import com.vci.starter.web.util.*;
import com.vci.web.redis.RedisService;
import com.vci.starter.web.redis.RedisService;
import com.vci.web.service.OsBtmServiceI;
import com.vci.web.service.UIManagerServiceI;
import com.vci.web.util.*;
@@ -2118,7 +2119,6 @@
        return roleRightVOS;
    }
    /**
     * UI角色对象转换
     * @param infos
@@ -2267,7 +2267,7 @@
     * @param obj
     * @throws PLException
     */
    public void checkCodeName(PLUILayout obj) throws PLException {
    private void checkCodeName(PLUILayout obj) throws PLException {
        PLUILayout[] plUILayouts = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(obj.plRelatedType);
        int length = plUILayouts.length;
        String code = obj.plCode;
@@ -2333,6 +2333,220 @@
        return res;
    }
    /**
     * ä¸šåŠ¡ç±»åž‹ã€æºå¯¹è±¡ç±»åž‹ã€é¡¶å±‚èŠ‚ç‚¹æ˜¾ç¤ºç±»åž‹ç­‰éƒ½è°ƒç”¨è¿™ä¸ªæŽ¥å£æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    public DataGrid<BizType> getBtmDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
        BizType[] btmNames = null;
        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
        String where = " 1=1 ";
        String text = "";
        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
        if(Func.isNotEmpty(conditionMap)){
            //过滤条件
            String filterInputValue = conditionMap.get("filterInputValue");
            if(Func.isNotBlank(filterInputValue)){
                where += String.format(" and (bt.name like '%%%s%%' or bt.label like '%%%s%%')", text, text);
            }
        }
        String fromWhere = String.format(" from plbtmtype bt where %s ", where);
        String fromWhereOrderBy = String.format(" %s order by bt.name", fromWhere);
        String sql = String.format("select * from(" +
                "  select row_.*,rownum rownum_ from( " +
                "         select bt.name, bt.label %s" +
                "  ) row_ " +
                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
        List<BizType> list = new LinkedList<BizType>();
        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        for(String[] kvs : kvss){
            BizType bi = new BizType();
            bi.name = kvs[0];
            bi.label = kvs[1];
            list.add(bi);
        }
        btmNames = list.toArray(new BizType[]{});
        sql = String.format("select count(1) count_ %s", fromWhere);
        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        int total = Integer.valueOf(kvss[0][0]);
        DataGrid<BizType> res = new DataGrid<>();
        res.setData(Arrays.asList(btmNames));
        res.setTotal(total);
        return res;
    }
    /**
     * UI定义下拉查询(templateType为UI定义时的UI定义下拉查询)
     * @param baseQueryObject selectBtmType é€‰æ‹©çš„æºå¯¹è±¡,带分页信息
     * @return
     * @throws PLException
     */
    public DataGrid<PLUILayout> getUILayoutDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
        PLUILayout[] datas = null;
        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
        String where = " 1=1 ";
        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
        if(Func.isNotEmpty(conditionMap)){
            //选择的对象类型
            String selectBtmType = conditionMap.get("selectBtmType");
            if(selectBtmType != null){
                where += String.format(" and ui.PLRELATEDTYPE = '%s' ", selectBtmType);
            }
            //过滤条件
            String filterInputValue = conditionMap.get("filterInputValue");
            if(Func.isNotBlank(filterInputValue)){
                where += String.format(" and (ui.plname like '%%%s%%') ", filterInputValue, filterInputValue);
            }
        }
        String fromWhere = String.format(" from PLUILAYOUT ui where %s ", where);
        String fromWhereOrderBy = String.format(" %s order by ui.plname", fromWhere);
        String sql = String.format("select * from(" +
                "  select row_.*,rownum rownum_ from( " +
                "         select ui.plname, ui.plcode %s" +
                "  ) row_ " +
                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
        List<PLUILayout> list = new LinkedList<PLUILayout>();
        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        for(String[] kvs : kvss){
            PLUILayout bi = new PLUILayout();
            bi.plName = kvs[0];
            bi.plCode = kvs[1];
            list.add(bi);
        }
        datas = list.toArray(new PLUILayout[0]);
        sql = String.format("select count(1) count_ %s", fromWhere);
        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        int total = Integer.valueOf(kvss[0][0]);
        DataGrid<PLUILayout> res = new DataGrid<PLUILayout>();
        res.setData(Arrays.asList(datas));
        res.setTotal(total);
        return res;
    }
    /**
     * é€‰æ‹©æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢ï¼ˆtemplateType为表格、表单、树表时的选择对象下拉查询)
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    public DataGrid<PortalVI> getPortalVIDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
        PortalVI[] datas = null;
        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
        String where = " 1=1 ";
        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
        if(Func.isNotEmpty(conditionMap)){
            //选择的源对象或者是选择的父节点显示类型
            String selectBtmType = conditionMap.get("selectBtmType");
            if(selectBtmType != null){
                where += String.format(" and vi.typename = '%s' ", selectBtmType);
            }
            /*if(getPopupDialog().getPortalVIType() != null){
                where += String.format(" and vi.vitype = %d ", getPopupDialog().getPortalVIType().getIntVal());
            }*/
            //过滤条件
            String filterInputValue = conditionMap.get("filterInputValue");
            if(Func.isNotBlank(filterInputValue)){
                where += String.format(" and (vi.viname like '%%%s%%') ", filterInputValue, filterInputValue);
            }
        }
        String fromWhere = String.format(" from plportalvi vi where %s ", where);
        String fromWhereOrderBy = String.format(" %s order by vi.viname", fromWhere);
        String sql = String.format("select * from(" +
                "  select row_.*,rownum rownum_ from( " +
                "         select vi.viname,vi.vitype  %s" +
                "  ) row_ " +
                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
        List<PortalVI> list = new LinkedList<>();
        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        for(String[] kvs : kvss){
            PortalVI bi = new PortalVI();
            bi.viName = kvs[0];
            bi.viType = Short.valueOf(kvs[1]);
            list.add(bi);
        }
        datas = list.toArray(new PortalVI[]{});
        sql = String.format("select count(1) count_ %s", fromWhere);
        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        int total = Integer.valueOf(kvss[0][0]);
        DataGrid<PortalVI> res = new DataGrid<>();
        res.setData(Arrays.asList(datas));
        res.setTotal(total);
        return res;
    }
    /**
     * æŸ¥è¯¢æ¨¡æ¿ä¸‹æ‹‰æŸ¥è¯¢
     * @param baseQueryObject
     * @return
     * @throws PLException
     */
    public DataGrid<QTInfo> getQTInfoDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
        QTInfo[] datas = null;
        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
        String where = " 1=1 ";
        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
        if(Func.isNotEmpty(conditionMap)){
            //选择的源对象或者是选择的父节点显示类型
            String selectBtmType = conditionMap.get("selectBtmType");
            if(selectBtmType != null){
                where += String.format(" and qt.btmname = '%s' ", selectBtmType);
            }
            //过滤条件
            String filterInputValue = conditionMap.get("filterInputValue");
            if(Func.isNotBlank(filterInputValue)){
                where += String.format(" and (qt.qtname like '%%%s%%') ", filterInputValue, filterInputValue);
            }
        }
        String fromWhere = String.format(" from PL_QTEMPLATE qt where %s ", where);
        String fromWhereOrderBy = String.format(" %s order by qt.qtname ", fromWhere);
        String sql = String.format("select * from(" +
                "  select row_.*,rownum rownum_ from( " +
                "         select qt.qtname,qt.btmname  %s" +
                "  ) row_ " +
                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
        List<QTInfo> list = new LinkedList<QTInfo>();
        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        for(String[] kvs : kvss){
            QTInfo bi = new QTInfo();
            bi.qtName = kvs[0];
            bi.btmName = kvs[1];
            list.add(bi);
        }
        datas = list.toArray(new QTInfo[]{});
        sql = String.format("select count(1) count_ %s", fromWhere);
        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
        int total = Integer.valueOf(kvss[0][0]);
        DataGrid<QTInfo> res = new DataGrid<QTInfo>();
        res.setData(Arrays.asList(datas));
        res.setTotal(total);
        return res;
    }
    //基础公共检查接口
    private abstract class BaseComptInter {
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/PlatformClientUtil.java
@@ -4,7 +4,6 @@
import com.vci.corba.bofactory.BOFactoryServicePrx;
import com.vci.corba.common.PLException;
import com.vci.corba.framework.FrameworkServicePrx;
import com.vci.corba.log.LogServicePrx;
import com.vci.corba.omd.atm.AttPoolServicePrx;
import com.vci.corba.omd.btm.BTMServicePrx;
import com.vci.corba.omd.data.AttributeValue;
@@ -14,6 +13,7 @@
import com.vci.corba.omd.qtm.QTDServicePrx;
import com.vci.corba.omd.stm.StatePoolServicePrx;
import com.vci.corba.omd.vrm.VersionRuleServicePrx;
import com.vci.corba.pllog.LogServicePrx;
import com.vci.corba.portal.PortalServicePrx;
import com.vci.corba.query.ObjectQueryServicePrx;
import com.vci.corba.volume.VolumeServicePrx;
Source/plt-web/plt-web-parent/plt-web/src/main/resources/properties/ice.properties
@@ -1,4 +1,5 @@
#NameService=PLT
Adapter=PLT
Endpoints=default -h localhost -p 4601
Endpoints=default -h localhost -p 4061
Ice.MessageSizeMax=1048576
#Endpoints=VCI-PLT/Locator:default -h localhost -p 4601
Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js
@@ -9,6 +9,14 @@
  });
}
// èŽ·å–å½“å‰ç”¨æˆ·åœ¨çº¿äººæ•°
export function getOnlineUsersNum() {
  return request({
    url: "/api/hmSysModConfigController/getOnlineUsersNum",
    method: "get",
  });
}
// é…ç½®é¡¹æŸ¥è¯¢
export function getAppConfigDetailsByID(params) {
  return request({
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
@@ -151,6 +151,8 @@
        });
        this.treeData[0].children = data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    // å¤„理树形结构
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -185,6 +185,8 @@
        });
        this.treeData[0].children = data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -202,6 +202,8 @@
        });
        this.treeData = data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    // å¤„理业务类型树形结构
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
@@ -1,26 +1,10 @@
<template>
  <el-container>
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
          <div class="headerCon">
            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">创建
            </el-button>
            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">修改
            </el-button>
            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">删除
            </el-button>
            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
            </el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
            </el-button>
            <el-button class="smallBtn" plain size="small" type="primary"
                       @click="checkViewClickHandler">查看使用范围
            </el-button>
          </div>
        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 280px);">
          <div style="height:  calc(100vh - 190px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
@@ -36,6 +20,7 @@
    <el-main>
      <basic-container>
      </basic-container>
    </el-main>
@@ -43,8 +28,53 @@
</template>
<script>
import {getBizTypes} from "@/api/modeling/businessType/api";
export default {
  name: "index"
  name: "index",
  data() {
    return {
      treeOption: {
        height: 'auto',
        defaultExpandedKeys: ['topNode'],
        menu: false,
        addBtn: false,
        props: {
          label: 'label',
          value: 'oid',
          children: 'children'
        }
      },
      nodeRow: {},
      treeData: [{
        label: '业务类型树',
        oid: 'topNode',
        children: []
      }],
    }
  },
  created() {
    this.getTreeList();
  },
  methods: {
    //树表查询
    getTreeList() {
      const loading = this.$loading({});
      getBizTypes().then(res => {
        const data = res.data.data.map(item => {
          item.attributes.label = item.attributes.id;
          return item.attributes;
        });
        this.treeData[0].children = data;
        loading.close();
      }).catch(error => {
        loading.close();
      })
    },
    // æ ‘点击
    nodeClick(row) {
      this.nodeRow = row;
    },
  }
}
</script>
Source/plt-web/plt-web-ui/src/views/systemModel/systemMonitor/index.vue
@@ -4,8 +4,8 @@
      <el-form ref="form" :model="form" label-width="150px">
        <el-form-item label="当前在线用户人数">
          <div style="display: flex;">
            <el-input v-model="form.name" :readOnly="true"></el-input>
            <el-button plain style="margin-left: 10px"> åˆ·æ–°</el-button>
            <el-input v-model="form.currentOnlineUser" :readOnly="true"></el-input>
            <el-button plain type="primary" style="margin-left: 10px" @click="getOnlineUsersNum"> åˆ·æ–°</el-button>
          </div>
        </el-form-item>
      </el-form>
@@ -14,14 +14,31 @@
</template>
<script>
import {
  getOnlineUsersNum
} from "@/api/systemModel/systemConfig/api"
export default {
  name: "index",
  data() {
    return {
      form: {
        name: '0'
        currentOnlineUser: '0'
      }
    }
  },
  created() {
    this.getOnlineUsersNum();
  },
  methods: {
    // å·¦ä¾§æ ‘查询
    getOnlineUsersNum() {
      getOnlineUsersNum().then(res => {
        if (res.data.code === 200) {
          const data = res.data.obj;
          this.form.currentOnlineUser = data;
        }
      })
    }
  }
}
</script>
Source/plt-web/plt-web-ui/src/views/wel/index.vue
@@ -13,12 +13,6 @@
            <img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status"/>
            <img src="https://img.shields.io/badge/Spring%20Cloud-2021-blue.svg" alt="Coverage Status"/>
            <img src="https://img.shields.io/badge/Spring%20Boot-2.7-blue.svg" alt="Downloads"/>
            <a target="_blank" href="https://bladex.vip">
              <img src="https://img.shields.io/badge/Saber%20Author-Small%20Chill-ff69b4.svg" alt="Downloads"/>
            </a>
            <a target="_blank" href="https://bladex.vip">
              <img src="https://img.shields.io/badge/Copyright%20-@BladeX-%23ff3f59.svg" alt="Downloads"/>
            </a>
          </p>
        </basic-container>
      </el-col>