Commit 593f6a11 authored by hongguangwu's avatar hongguangwu

人员档案相关-校验

parent 53fdcda1
......@@ -108,17 +108,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(employeeInfo.getEmpName());
checkIdCard.setIdCard(employeeInfo.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>();
checkList.add(checkIdCard);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
R<TCheckIdCard> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) {
TCheckIdCard check = checkListR.getData();
if (check.getIsTrue() == CommonConstants.ZERO_INT) {
return R.failed(check.getReason());
}
}
}
return R.ok();
}
}
......@@ -616,6 +613,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)) {
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(), errorMessage));
} else {
errorMessageList = new ArrayList<>();
}
// 获取身份证、手机号列表,批量查询档案
......@@ -734,19 +733,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(excel.getEmpName());
checkIdCard.setIdCard(excel.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>();
checkList.add(checkIdCard);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
R<TCheckIdCard> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) {
TCheckIdCard check = checkListR.getData();
if (check.getIsTrue() == CommonConstants.ZERO_INT) {
errorMsg.add(check.getReason());
break;
}
}
}
saveEmp.setEmpName(excel.getEmpName());
saveEmp.setEmpIdcard(excel.getEmpIdcard());
......
......@@ -159,7 +159,7 @@ public class TCheckIdCardController {
@SysLog("校验姓名身份证 --- 单个")
@Inner
@PostMapping("/inner/checkIdCardSingle")
public R<TCheckIdCard> checkIdCardSingle(String idCard, String name) {
return tCheckIdCardService.checkIdCardSingle(idCard, name);
public R<TCheckIdCard> checkIdCardSingle(@RequestBody TCheckIdCard tCheckIdCard) {
return tCheckIdCardService.checkIdCardSingle(tCheckIdCard);
}
}
......@@ -45,5 +45,5 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> {
**/
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
}
@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)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
......@@ -237,6 +239,16 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(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();
c.setIdCard(idCard);
......@@ -246,5 +258,6 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
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