Source/UBCS-WEB/src/views/monitor/log/operateLog.vue
@@ -63,18 +63,18 @@ label: "ç¨æ·å", prop: "userName", search: true, width:'100' width:'120' }, { label: "å§å", prop: "realName", search: true, width:'100' width:'120' }, { label: "ç¨æ·ip", prop: "ip", width:'100' width:'130' }, { label: "模å", @@ -89,7 +89,7 @@ { label: "æä½ç»æ", prop: "operateResult", width:'100' width:'110' }, { label: "æè¿°", Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java
@@ -82,7 +82,7 @@ * @param logParentPath * @return */ //@Override @Override public List<LocalLogVO> getSystemLogList(String logParentPath) { List<LocalLogVO> localLogsVO = new ArrayList<>(); // ä¸ä¸ºç©ºè¯´ææ¯å è½½å½åè¿ä¸ªæå¡è·¯å¾ä¸çæ¥å¿æä»¶ @@ -90,44 +90,48 @@ File file = new File(logParentPath); if (file.isDirectory()) { File[] files = file.listFiles(); Arrays.stream(files).forEach(item->{ // ç»å»ºæ¥å¿æä»¶å¯¹è±¡ LocalLogVO localLog = new LocalLogVO(); localLog.setLogName(item.getName()); localLog.setLogType(getLogType(item.getName())); localLog.setCreateTime(getLastModifiedOrCreatTime(false,logParentPath)); localLog.setLastModifier(getLastModifiedOrCreatTime(true,logParentPath)); localLog.setLogPath(logParentPath); String serviceId = getServiceId(logParentPath); localLog.setServiceId(serviceId); localLog.setServiceName(getServiceName(serviceId)); localLog.setHasChildren(false); localLogsVO.add(localLog); }); if(Func.isNotEmpty(files) && files.length>0){ Arrays.stream(files).forEach(item->{ // ç»å»ºæ¥å¿æä»¶å¯¹è±¡ LocalLogVO localLog = new LocalLogVO(); localLog.setLogName(item.getName()); localLog.setLogType(getLogType(item.getName())); localLog.setCreateTime(getLastModifiedOrCreatTime(false,logParentPath)); localLog.setLastModifier(getLastModifiedOrCreatTime(true,logParentPath)); localLog.setLogPath(logParentPath); String serviceId = getServiceId(logParentPath); localLog.setServiceId(serviceId); localLog.setServiceName(getServiceName(serviceId)); localLog.setHasChildren(false); localLogsVO.add(localLog); }); } } }else { File fileDir = new File(PARENTPATH); File[] childDir = fileDir.listFiles(); Arrays.stream(childDir).forEach(dir->{ if(dir.getName().contains("ubcs_")){ String fullPath = dir.getPath() + LOGPATH; File file = new File(fullPath); if(file.exists()){ LocalLogVO localLogVO = new LocalLogVO(); localLogVO.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); localLogVO.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); localLogVO.setLogPath(fullPath); String serviceId = getServiceId(file.getPath()); localLogVO.setServiceId(serviceId); String serviceName = getServiceName(serviceId); localLogVO.setServiceName(serviceName); localLogVO.setLogType(serviceName+"æ¥å¿ç¶ç®å½"); localLogVO.setLogName(serviceName+"æ¥å¿ç¶ç®å½"); localLogVO.setHasChildren(true); localLogsVO.add(localLogVO); if(Func.isNotEmpty(childDir) && childDir.length > 0){ Arrays.stream(childDir).forEach(dir->{ if(dir.getName().contains("ubcs_")){ String fullPath = dir.getPath() + LOGPATH; File file = new File(fullPath); if(file.exists()){ LocalLogVO localLogVO = new LocalLogVO(); localLogVO.setLastModifier(getLastModifiedOrCreatTime(true,fullPath)); localLogVO.setCreateTime(getLastModifiedOrCreatTime(false,fullPath)); localLogVO.setLogPath(fullPath); String serviceId = getServiceId(file.getPath()); localLogVO.setServiceId(serviceId); String serviceName = getServiceName(serviceId); localLogVO.setServiceName(serviceName); localLogVO.setLogType(serviceName+"æ¥å¿ç¶ç®å½"); localLogVO.setLogName(serviceName+"æ¥å¿ç¶ç®å½"); localLogVO.setHasChildren(true); localLogsVO.add(localLogVO); } } } }); }); } } return localLogsVO; } Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/SpecialCharacterConverter.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,35 @@ package com.vci.ubcs.starter.util; import net.logstash.logback.encoder.org.apache.commons.lang3.StringEscapeUtils; /** * * @author ludc * @date 2023/12/1 9:16 */ public class SpecialCharacterConverter { /** * ç¹æ®åç¬¦è½¬ä¹ * @param input * @return */ public static String escapeSpecialCharacters(String input) { input = input.replace("'", "''"); // 转ä¹åå¼å· input = input.replace("\"", "\\\""); // 转ä¹åå¼å· input = input.replace("%", "\\%"); // 转ä¹ç¾åå· input = input.replace("_", "\\_"); // 转ä¹ä¸å线 input = input.replace("\\", "\\\\"); // 转ä¹åææ return input; } public static String unescapeSpecialCharacters(String input) { input = input.replace("''", "'"); // å转ä¹åå¼å· input = input.replace("\\\"", "\""); // å转ä¹åå¼å· input = input.replace("\\%", "%"); // å转ä¹ç¾åå· input = input.replace("\\_", "_"); // å转ä¹ä¸å线 input = input.replace("\\\\", "\\"); // å转ä¹åææ return input; } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -44,6 +44,7 @@ import com.vci.ubcs.starter.revision.service.RevisionModelUtil; import com.vci.ubcs.starter.util.MdmBtmTypeConstant; import com.vci.ubcs.starter.util.SaveLogUtil; import com.vci.ubcs.starter.util.SpecialCharacterConverter; import com.vci.ubcs.starter.util.UBCSSqlKeyword; import com.vci.ubcs.starter.web.constant.QueryOptionConstant; import com.vci.ubcs.starter.web.constant.RegExpConstant; @@ -791,6 +792,7 @@ sql[0] += " and oid != '" + orderDTO.getCopyFromVersion() + "'"; } sql[0] += " and lastR = '1' and lastV = '1' "; // è·åä¸å䏿 ¡éªçåç±»oid String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid()); if(Func.isNotEmpty(isParticipateCheckOids)){ sql[0] += " and codeclsfid not in(" + isParticipateCheckOids + ")"; @@ -1193,12 +1195,12 @@ temp = "%s"; } queryKey = String.format(temp, "nvl("+ "t." + attrId +",'/')"); queryValue = String.format(temp, "'" + (trim ? value.trim() : value) + "'"); queryValue = String.format(temp, "'" + (trim ? SpecialCharacterConverter.escapeSpecialCharacters(value.trim()):SpecialCharacterConverter.escapeSpecialCharacters(value)) + "'"); conditionMap.put(queryKey, queryValue); } else { if(StringUtils.isNotBlank(value)) { //ä¸ºç©ºçæ¶åä¸ä»£è¡¨ä¸æ ¡éªï¼åªæ¯ä¸å»é¤ç¸å ³çä¿¡æ¯ conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + value + "'"); conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + SpecialCharacterConverter.escapeSpecialCharacters(value) + "'"); }else{ conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL); } @@ -2472,7 +2474,6 @@ return getSqlByValue(key, value, attrVOMap,btmType); } }*/ } /** Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -3824,7 +3824,7 @@ private void batchSwitchClassifyAttrOnOrder(Collection<CodeClassifyTemplateAttrVO> attrVOS,List<ClientBusinessObject> dataList, CodeClassifyFullInfoBO classifyFullInfo,boolean isImPort) { Map<String, CodeClassifyTemplateAttrVO> dateAttrVOMap = attrVOS.stream().filter( s -> StringUtils.isNotBlank(s.getClassifyInvokeAttr()) && StringUtils.isNotBlank(s.getClassifyInvokeAttr()) s -> StringUtils.isNotBlank(s.getClassifyInvokeAttr()) ).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); Map<String,CodeClassifyFullInfoBO> classifyFullInfoMap=new HashMap<>(); classifyFullInfoMap.put(classifyFullInfo.getCurrentClassifyVO().getOid(),classifyFullInfo);