From 25035f51bc8ea0f315b31f9786d340f368c09753 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sat, 2 Apr 2022 14:34:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/excel/handler/IcNatExcelImportListener.java | 2 +- .../java/com/epmet/service/impl/IcNatServiceImpl.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java index 466743bdd8..1f09a5142f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -26,7 +26,7 @@ public class IcNatExcelImportListener implements ReadListener imp needUpdate = true; } - // 检测地点和手机号先不提示,说需要提示再提示 + // 检测地点和手机号先不提示,说需要提示再提示。需要考虑两个都不为空&&不相等 || 两个中一个为空一个不为空 + if ((natAddress == null && resiNat.getNatAddress() != null) + || (natAddress != null && resiNat.getNatAddress() == null) + || (natAddress != null && resiNat.getNatAddress() != null && !natAddress.equals(resiNat.getNatAddress()))) { + resiNat.setNatAddress(natAddress); + needUpdate = true; + } + if (!natAddress.equals(resiNat.getNatAddress())) { - //changedFieldNames.add("检测地点"); resiNat.setNatAddress(natAddress); needUpdate = true; } if (!mobile.equals(resiNat.getMobile())) { - //changedFieldNames.add("手机号"); resiNat.setMobile(mobile); needUpdate = true; }