Merge branch 'feature/v3-siFunctionImprove-0112' into release/2.5.3.2301.01

This commit is contained in:
sy 2023-01-12 17:24:55 +08:00
commit 3abffc2ee9
1 changed files with 11 additions and 1 deletions

View File

@ -1746,6 +1746,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
private Map<String, String> checkJsonMap(Map<String, String> newMap, String oldJson) {
Map<String, String> oldMap = JSON.parseObject(oldJson, HashMap.class);
Map<String, String> toDelMap = new HashMap<>();
//校验newMap中的value值是否为整数或者小数
for(Map.Entry<String, String> 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<String, String> 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;
}