From 1d120cd17019741a199e5fe93fa4241a9b96dad3 Mon Sep 17 00:00:00 2001 From: tangwei Date: Thu, 9 Jul 2026 15:18:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=94=B5=E7=AB=99?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SdEngInfoBHServiceImpl.java | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java index 45447ad9..99adaddd 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_base/service/impl/SdEngInfoBHServiceImpl.java @@ -1009,6 +1009,18 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl stInfoMap = microservicDynamicSQLMapper.getOneBySql(buildStcdInfoViewSql(), Collections.singletonMap("stcd", stcd)); + if (stInfoMap != null && !stInfoMap.isEmpty()) { + EngStInfoResultVo result = new EngStInfoResultVo(); + result.setMsStbprpT(buildCamelCaseMsStbprpTMap(stInfoMap)); + result.setStBaseInfo(buildStBaseInfo(stInfoMap)); + return result; + } + EngBaseInfoVo baseInfo = getStInfoByStcd(stcd); if (baseInfo == null) { return null; @@ -1035,6 +1047,132 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl stInfoMap) { + EngStBaseInfoVo stBaseInfo = new EngStBaseInfoVo(); + stBaseInfo.setStcd(getMapString(stInfoMap, "stcd")); + stBaseInfo.setStnm(getMapString(stInfoMap, "stnm")); + stBaseInfo.setSttpCode(getMapString(stInfoMap, "sttpCode")); + stBaseInfo.setSttpName(getMapString(stInfoMap, "sttpName")); + stBaseInfo.setSttpFullPath(getMapString(stInfoMap, "sttpFullPath")); + stBaseInfo.setSttpTreeLevel(getMapInteger(stInfoMap, "sttpTreeLevel")); + stBaseInfo.setStCode(null); + stBaseInfo.setStName(null); + stBaseInfo.setBaseId(getMapString(stInfoMap, "baseId")); + stBaseInfo.setBaseName(getMapString(stInfoMap, "baseName")); + stBaseInfo.setHbrvcd(getMapString(stInfoMap, "hbrvcd")); + stBaseInfo.setHbrvcdName(getMapString(stInfoMap, "hbrvcdName")); + stBaseInfo.setRvcd(getMapString(stInfoMap, "rvcd")); + stBaseInfo.setRvcdName(getMapString(stInfoMap, "rvcdName")); + return stBaseInfo; + } + + private Map buildCamelCaseMsStbprpTMap(Map stInfoMap) { + LinkedHashMap result = new LinkedHashMap<>(); + List canonicalKeys = Arrays.asList( + "stcd", "stnm","ennm", "sttp", "sttpCode", "sttpName", "sttpFullPath", "sttpTreeLevel", + "rstcd", "baseId", "baseName", "hbrvcd", "hbrvcdName", "rvcd", "rvcdName", "addvcd", + "lgtd", "lttd", "stlc", "usfl", "dtin", "dtinTm", "bldsttCode", "introduce", "logo", + "inffile", "inv", "invinmn", "stdsdt", "pststdt", "pesstdt", "swdt", "jcdt", "wddt", + "orderIndex", "remark", "vlsr", "vlsrTm", "recordUser", "recordTime", "modifyUser", + "modifyTime", "isDeleted", "deleteUser", "deleteTime", "dataSource" + ); + for (String canonicalKey : canonicalKeys) { + result.put(canonicalKey, getMapValue(stInfoMap, canonicalKey)); + } + return result; + } + + private String getMapString(Map source, String key) { + Object value = getMapValue(source, key); + return value == null ? null : String.valueOf(value); + } + + private Integer getMapInteger(Map source, String key) { + Object value = getMapValue(source, key); + if (value == null) { + return null; + } + if (value instanceof Number number) { + return number.intValue(); + } + return Integer.parseInt(String.valueOf(value)); + } + + private Object getMapValue(Map source, String key) { + if (source == null || source.isEmpty() || StrUtil.isBlank(key)) { + return null; + } + if (source.containsKey(key)) { + return source.get(key); + } + String upperKey = key.toUpperCase(Locale.ROOT); + if (source.containsKey(upperKey)) { + return source.get(upperKey); + } + String lowerKey = key.toLowerCase(Locale.ROOT); + if (source.containsKey(lowerKey)) { + return source.get(lowerKey); + } + for (Map.Entry entry : source.entrySet()) { + if (entry.getKey() != null && entry.getKey().equalsIgnoreCase(key)) { + return entry.getValue(); + } + } + return null; + } + private String buildVmsstbprptViewSql() { return "SELECT " + "eng.STCD AS id, " +