|
@@ -70,7 +70,35 @@ public class PersonInfoController {
|
|
|
MessageResult<PersonInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
-// personInfo.setId(UUID.randomUUID().toString());
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("companyId", personInfo.getCompanyId());
|
|
|
+ searchParams.put("idCard", personInfo.getIdCard());
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("id_","asc"));
|
|
|
+ Page<PersonInfo> page = personInfoService.pageSearch(searchParams, 1, 1,false, sortList);
|
|
|
+
|
|
|
+ if (page.size() > 0) {
|
|
|
+ msgResult.setMessage("身份证已导入!");
|
|
|
+ msgResult.setResult(false);
|
|
|
+ return msgResult;
|
|
|
+ } else {
|
|
|
+ CheckIdCard cic = null;
|
|
|
+ if (StringUtils.isEmpty(personInfo.getIdCard())) {
|
|
|
+ msgResult.setMessage("身份证不能为空!");
|
|
|
+ msgResult.setResult(false);
|
|
|
+ return msgResult;
|
|
|
+ } else {
|
|
|
+ personInfo.setIdCard(personInfo.getIdCard().trim().toUpperCase());
|
|
|
+ }
|
|
|
+
|
|
|
+ cic = new CheckIdCard(personInfo.getIdCard());
|
|
|
+ if (!cic.validate()) {
|
|
|
+ msgResult.setMessage("身份证验证失败!");
|
|
|
+ msgResult.setResult(false);
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
personInfo.setDelFlag(false);
|
|
|
personInfo.setCreateBy(subject);
|
|
|
personInfo.setCreateTime(new Date());
|