Commit 593f6a11 authored by hongguangwu's avatar hongguangwu

人员档案相关-校验

parent 53fdcda1
...@@ -108,17 +108,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -108,17 +108,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
TCheckIdCard checkIdCard = new TCheckIdCard(); TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(employeeInfo.getEmpName()); checkIdCard.setName(employeeInfo.getEmpName());
checkIdCard.setIdCard(employeeInfo.getEmpIdcard()); checkIdCard.setIdCard(employeeInfo.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>(); R<TCheckIdCard> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
checkList.add(checkIdCard); , "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) { if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) { TCheckIdCard check = checkListR.getData();
if (check.getIsTrue() == CommonConstants.ZERO_INT) { if (check.getIsTrue() == CommonConstants.ZERO_INT) {
return R.failed(check.getReason()); return R.failed(check.getReason());
} }
} }
}
return R.ok(); return R.ok();
} }
} }
...@@ -616,6 +613,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -616,6 +613,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>(); Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)) { if (Common.isNotNull(errorMessageList)) {
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(), errorMessage)); errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(), errorMessage));
} else {
errorMessageList = new ArrayList<>();
} }
// 获取身份证、手机号列表,批量查询档案 // 获取身份证、手机号列表,批量查询档案
...@@ -734,19 +733,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -734,19 +733,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
TCheckIdCard checkIdCard = new TCheckIdCard(); TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(excel.getEmpName()); checkIdCard.setName(excel.getEmpName());
checkIdCard.setIdCard(excel.getEmpIdcard()); checkIdCard.setIdCard(excel.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>(); R<TCheckIdCard> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
checkList.add(checkIdCard); , "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) { if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) { TCheckIdCard check = checkListR.getData();
if (check.getIsTrue() == CommonConstants.ZERO_INT) { if (check.getIsTrue() == CommonConstants.ZERO_INT) {
errorMsg.add(check.getReason()); errorMsg.add(check.getReason());
break;
} }
} }
}
saveEmp.setEmpName(excel.getEmpName()); saveEmp.setEmpName(excel.getEmpName());
saveEmp.setEmpIdcard(excel.getEmpIdcard()); saveEmp.setEmpIdcard(excel.getEmpIdcard());
......
...@@ -159,7 +159,7 @@ public class TCheckIdCardController { ...@@ -159,7 +159,7 @@ public class TCheckIdCardController {
@SysLog("校验姓名身份证 --- 单个") @SysLog("校验姓名身份证 --- 单个")
@Inner @Inner
@PostMapping("/inner/checkIdCardSingle") @PostMapping("/inner/checkIdCardSingle")
public R<TCheckIdCard> checkIdCardSingle(String idCard, String name) { public R<TCheckIdCard> checkIdCardSingle(@RequestBody TCheckIdCard tCheckIdCard) {
return tCheckIdCardService.checkIdCardSingle(idCard, name); return tCheckIdCardService.checkIdCardSingle(tCheckIdCard);
} }
} }
...@@ -45,5 +45,5 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> { ...@@ -45,5 +45,5 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> {
**/ **/
R<List<TCheckIdCard>> checkIdCard(List<TCheckIdCard> checkList); R<List<TCheckIdCard>> checkIdCard(List<TCheckIdCard> checkList);
R<TCheckIdCard> checkIdCardSingle(String idCard, String name); R<TCheckIdCard> checkIdCardSingle(TCheckIdCard tCheckIdCard);
} }
...@@ -226,7 +226,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -226,7 +226,9 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
} }
@Override @Override
public R<TCheckIdCard> checkIdCardSingle(String idCard, String name) { public R<TCheckIdCard> checkIdCardSingle(TCheckIdCard tCheckIdCard) {
String idCard = tCheckIdCard.getIdCard();
String name = tCheckIdCard.getName();
if (Common.isEmpty(idCard) || Common.isEmpty(name)){ if (Common.isEmpty(idCard) || Common.isEmpty(name)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY); return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
} }
...@@ -237,6 +239,16 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -237,6 +239,16 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkIdCard)){ if (Common.isNotNull(checkIdCard)){
return R.ok(checkIdCard); return R.ok(checkIdCard);
} else {
// 没找到正确的,再去找有没有错误的,如果还没有,再查
List<TCheckIdCard> checkList = baseMapper.selectList(Wrappers.<TCheckIdCard>query().lambda()
.eq(TCheckIdCard::getIdCard,idCard));
if (checkList != null && !checkList.isEmpty()) {
for (TCheckIdCard c : checkList) {
if (idCard.equals(c.getIdCard()) && name.equals(c.getName())) {
return R.ok(c);
}
}
} }
TCheckIdCard c = new TCheckIdCard(); TCheckIdCard c = new TCheckIdCard();
c.setIdCard(idCard); c.setIdCard(idCard);
...@@ -246,5 +258,6 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -246,5 +258,6 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
return R.ok(c); return R.ok(c);
} }
} }
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment