From 28d515b41a911b170eff79666a9f237d8786173f Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 12 Jan 2023 17:23:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=A9=BA=E5=80=BC=E6=97=B6=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SIAccountServiceImpl.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index cb0da89a9..86dbc3a69 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1746,6 +1746,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { private Map checkJsonMap(Map newMap, String oldJson) { Map oldMap = JSON.parseObject(oldJson, HashMap.class); + Map toDelMap = new HashMap<>(); //校验newMap中的value值是否为整数或者小数 for(Map.Entry newEntry : newMap.entrySet()) { String newValue = newEntry.getValue(); @@ -1754,7 +1755,17 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (newValue.length() > 0 && !isNumeric(newValue)) { throw new SalaryRunTimeException("请检查导入Excel中个人或单位对应的福利项数值是否为整数或小数!"); } + + if ("".equals(newEntry.getValue())) { + toDelMap.put(newEntry.getKey(), newEntry.getValue()); + } } + if (toDelMap.size() > 0) { + for (Map.Entry delEntry : toDelMap.entrySet()) { + newMap.remove(delEntry.getKey()); + } + } + if (oldMap == null) { return newMap; @@ -1768,7 +1779,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } } - return newMap; }