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())) {