From 0c11fade58e0a1075c1d4e58867337629aa9a6df Mon Sep 17 00:00:00 2001 From: tangwei Date: Thu, 25 Jun 2026 17:29:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SdEngInfoBHServiceImpl.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) 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 37ca529c..6afe35c0 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 @@ -258,10 +258,11 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl engInfoPatch, String source) throws JsonMappingException { - if (engInfoPatch == null || engInfoPatch.isEmpty()) { + Map filteredPatch = filterEngInfoPatchFields(engInfoPatch); + if (filteredPatch.isEmpty()) { return false; } - String stcd = toTextValue(engInfoPatch.get("stcd")); + String stcd = toTextValue(filteredPatch.get("stcd")); if (!StringUtils.hasText(stcd)) { return false; } @@ -270,9 +271,9 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl filterEngInfoPatchFields(Map engInfoPatch) { + Map filteredPatch = new LinkedHashMap<>(); + if (engInfoPatch == null || engInfoPatch.isEmpty()) { + return filteredPatch; + } + Set validFieldNames = new HashSet<>(); + for (Field field : SdEngInfoBH.class.getDeclaredFields()) { + if ("serialVersionUID".equals(field.getName())) { + continue; + } + validFieldNames.add(field.getName()); + } + for (Map.Entry entry : engInfoPatch.entrySet()) { + if (validFieldNames.contains(entry.getKey())) { + filteredPatch.put(entry.getKey(), entry.getValue()); + } + } + return filteredPatch; + } + private boolean isLinkedNameFieldPatched(String fieldName, Map engInfoPatch) { for (Map.Entry entry : ENG_CODE_NAME_FIELD_MAP.entrySet()) { if (entry.getValue().equals(fieldName) && engInfoPatch.containsKey(entry.getKey())) {