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; @@ -55,6 +53,9 @@ */ @Autowired private VciSessionForLoginI vciSessionForLoginI; @Autowired private RedisService redisService; /** * æ§è¡æ¦æª @@ -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
@@ -412,6 +412,7 @@ /** * ä¿®æ¹ä¸å¡ç±»åä¸å¯¹åºå±æ§åç屿§ * * @param apName * @return * @throws PLException @@ -456,6 +457,7 @@ /** * å¤æè¯¥å±æ§æ¯å¦å·²ç»å¨ä¸å¡ç±»åä¸äº§çäºæ°æ® * * @param abName * @return * @throws PLException @@ -480,6 +482,7 @@ /** * è·ååå以filterå¼å§çä¸å¡ç±»å(for æ¥è¯¢)ï¼ä¸»è¦ç¨äºå±æ§æ± çä¸å¡ç±»åéæ©å¯¹è¯æ¡ * è·åå ¨é¨ä¸å¡ç±»åï¼ä¼ åfilter为"" * * @param btmName * @return * @throws PLException @@ -494,6 +497,7 @@ /** * ä¸å¡ç±»åå表æ¥è¯¢ï¼éæ ç»æï¼ç¨äºUIå®ä¹å·¦ä¾§ä¸å¡ç±»åæ¥è¯¢ï¼åªè¿ånameålable * * @param btmName * @return * @throws PLException @@ -634,6 +638,7 @@ /** * è·åææä¸å¡ç±»åï¼æ å½¢ç»æï¼ * * @return æ¥è¯¢ç»æ */ @Override @@ -651,6 +656,7 @@ 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)); @@ -663,6 +669,7 @@ /** * è·åææä¸å¡ç±»ååç§°éå * * @return */ @Override @@ -676,6 +683,7 @@ /** * è·åä¸å¡å ¨é¨å±æ§ç±»å * * @param btmName ä¸å¡ç±»ååç§° * @return 屿§çä¿¡æ¯ */ @@ -733,6 +741,7 @@ /** * dto转do对象 * * @return */ private BizType dto2BizType(OsBtmTypeDTO dto){ @@ -776,6 +785,7 @@ /** * å建æ°çä¸å¡ç±»å * * @return * @throws PLException */ @@ -815,6 +825,7 @@ /** * æ£æ¥ä¸å¡ç±»ååç§°æ¯å¦åè§ * * @param btmName * @throws PLException */ @@ -851,6 +862,7 @@ /** * éæ©ä¸çº§çæ¬ï¼å¿ 须鿩ææå·¥è¾å ¥çæ¬å·è§å; éæ©äºçº§çæ¬ï¼å¿ 须鿩ææå·¥è¾å ¥çæ¬å·è§å, (çæ¬¡å·å·²ç»é»è®¤éæ©). * * @return */ private void checkVersionInfo(OsBtmTypeDTO dto) throws PLException { @@ -865,6 +877,7 @@ /** * çæ¬æºå¶ä¿®æ¹: ä» å 许类åä»"ä¸å¯ä¿®è®¢"åæ´è³"ä¸çº§çæ¬ç®¡çæºå¶","äºçº§çæ¬ç®¡çæºå¶è¿è¡è°æ´"; "ä¸çº§çæ¬ç®¡çæºå¶"åæ´è³"äºçº§çæ¬ç®¡çæºå¶"; * ä¸¤ç§æ¹å¼. * * @param dbBizType å½åä¿®æ¹åçä¸å¡ç±»åï¼åºä¸åå¨çï¼ * @param dto å½åä¿®æ¹ä¸å¡ç±»å * @throws PLException @@ -880,6 +893,7 @@ /** * ä¿®æ¹ä¸å¡ç±»å * * @param btmTypeDTO * @return * @throws PLException @@ -939,6 +953,7 @@ /** * å é¤ä¸å¡ç±»å * * @param btmTypeDTO * @return * @throws PLException @@ -970,6 +985,7 @@ /** * ä¸è´æ§æ£æ¥ * * @return * @throws PLException */ @@ -1001,12 +1017,14 @@ /** * ä¸è´æ§æ£æ¥ä¿®å¤åè½ * * @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){ return BaseResult.success(); @@ -1021,6 +1039,7 @@ /** * å建è§å¾ * * @return * @throws PLException */ @@ -1031,6 +1050,7 @@ /** * å 餿°æ®çé¢çæ¥è¯¢ * * @return ä¸å¡ç±»åï¼é¾æ¥ç±»å */ @Override @@ -1051,6 +1071,7 @@ /** * å 餿°æ® * * @param btmNames ä¸å¡ç±»åå * @param linkNames 龿¥ç±»åå * @return @@ -1101,6 +1122,7 @@ /** * å é¤å ¨é¨ç±»å * * @return * @throws PLException */ @@ -1183,6 +1205,7 @@ /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°è·åå·²æçç´¢å¼ * * @param conditionMap æ ¹æ®æ¥è¯¢æ¡ä»¶ä¼ å: typename:ä¸å¡ç±»åå; * @return */ @@ -1221,6 +1244,7 @@ /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°å é¤ç´¢å¼ * * @param btmName * @param indexName * @return @@ -1251,6 +1275,7 @@ /** * ç»ä¸å¡ç±»åä¸çæå®å±æ§æ°å¢ç´¢å¼ * * @param indexObjectList * @return */ @@ -1309,6 +1334,7 @@ /** * 导åºä¸å¡ç±»å * oid ä¸å¡ç±»ååç§° * * @return åå»ºç»æ */ @Override @@ -1367,6 +1393,7 @@ /** * å¯¼å ¥ä¸å¡ç±»å * * @param file ä¸ä¼ çæä»¶ * @return */ @@ -1411,7 +1438,8 @@ 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[]{}); @@ -1486,6 +1514,7 @@ /** * è·åéè¦ä¿®å¤ç伪sql * * @param dbCheckMap * @return */ @@ -1710,6 +1739,7 @@ /** * 龿¥ç±»åå ³é®çä¸å¡ç±»å * * @param nodeVOList 对象å表 * @param relationVOList å ³èå ³ç³»å表 * @param link 龿¥ç±»å @@ -1786,6 +1816,7 @@ /** * è·åéè¦å é¤çä¸å¡ç±»å * * @return */ public List<BizType> getDelBtList() throws PLException { @@ -1808,6 +1839,7 @@ /** * è·åéè¦å é¤ç龿¥ç±»å * * @return */ public List<LinkType> getDelLtList() throws PLException { @@ -1817,6 +1849,7 @@ /** * è·åå¾ å é¤ç屿§ * * @return */ public List<String> getDelAbList() { @@ -1858,6 +1891,7 @@ /** * è·åå¾ å é¤çæä¸¾ç±»å * * @return */ public List<EnumType> getDelEnumList() { @@ -1887,6 +1921,7 @@ /** * è·åå¾ å é¤ççå½å¨æ * * @return */ public List<LifeCycle> getDelLCList(){ @@ -1931,6 +1966,7 @@ /** * è·åå¾ å é¤çç¶æ * * @return */ public List<StatePool> getDelSPList(){ @@ -1954,6 +1990,7 @@ /** * è·åå¾ å é¤ççæ¬è§å * * @return */ public List<VersionRule> getDelVRList(){ 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>