|
|
@ -34,6 +34,8 @@ import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.epmet.constant.ImportErrorMsgConstants.*; |
|
|
@ -152,6 +154,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
disposeErrorMsg(info, "房主身份证的长度超出限制"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (null != data.getSort() && !isNumber(data.getSort().toString())){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info, "排序格式不正确"); |
|
|
|
return; |
|
|
|
} |
|
|
|
/** |
|
|
|
* 2022-03-29 需求改动,单元号修改 eg 1 改为 1单元 |
|
|
|
* 做限制,此字段中必须带有 "单元"2字,不存在就不给导入 |
|
|
@ -205,6 +212,18 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isNumber(String str) { |
|
|
|
if(str.length()>0) { |
|
|
|
Pattern pattern = Pattern.compile("[0-9]*"); |
|
|
|
Matcher isNum = pattern.matcher(str); |
|
|
|
if (!isNum.matches()) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public void disposeErrorMsg(HouseInfoModel data,String msg){ |
|
|
|
HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class); |
|
|
|
err.setErrorMsg(msg); |
|
|
|