|
@@ -323,15 +323,25 @@ public class RshyJkManagerImpl implements RshyJkManager {
|
|
|
protected void saveIdentity2DB(String barCode, RshyVo rshyVo) {
|
|
|
log.info("保存身份信息到数据库, 身份证号码: {}", rshyVo.getSfzh());
|
|
|
Identity identity = new Identity();
|
|
|
+ LambdaQueryWrapper<Identity> wrapper = new LambdaQueryWrapper<>();
|
|
|
if (StrUtil.isNotBlank(barCode)) {
|
|
|
identity.setBarCode(barCode);
|
|
|
+ wrapper.eq(Identity::getBarCode, barCode);
|
|
|
}
|
|
|
identity.setIdNum(rshyVo.getSfzh());
|
|
|
+ wrapper.eq(Identity::getIdNum, rshyVo.getSfzh());
|
|
|
identity.setName(rshyVo.getXm());
|
|
|
+ wrapper.eq(Identity::getName, rshyVo.getXm());
|
|
|
identity.setAddress(rshyVo.getAddress());
|
|
|
+ wrapper.eq(Identity::getAddress, rshyVo.getAddress());
|
|
|
identity.setPhone(rshyVo.getPhone());
|
|
|
+ if (StrUtil.isNotBlank(rshyVo.getPhone())) {
|
|
|
+ wrapper.eq(Identity::getPhone, rshyVo.getPhone());
|
|
|
+ }
|
|
|
//identity.setPhoto(rshyVo.getPhoto());
|
|
|
- identityService.saveOK(identity);
|
|
|
+ if (identityService.getOne(wrapper) == null) {
|
|
|
+ identityService.saveOK(identity);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Async
|