From 29c3367d8c8f9777bde6a86fa26c86d19a35bc07 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 19 八月 2021 15:18:25 +0800
Subject: [PATCH] Merge branch 'zzj' of http://182.151.2.19:9380/root/zhihuishequ into zzj
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java
index 49bc10d..b497207 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java
@@ -18,12 +18,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
-import javax.crypto.BadPaddingException;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.NoSuchPaddingException;
-import java.io.UnsupportedEncodingException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
+import java.util.Date;
import java.util.List;
/**
@@ -41,6 +36,7 @@
@Value("${domain.aesKey:}")
private String aesKey;
+
/**
* description 批量保存重点人群人员信息
* 处理逻辑:同一个人的信息可以被多个社区重复录入
@@ -56,6 +52,10 @@
public R saveBatchKeyPerson(List<KeyPersonInfoDTO> list) {
list.forEach(keyPersonInfoDTO -> {
KeyPersonInfoDO dbKeyPerson = checkExistFromDb(keyPersonInfoDTO);
+ ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(keyPersonInfoDTO.getCardNo());
+ if (population != null) {
+ keyPersonInfoDTO.setUserId(population.getId());
+ }
if (dbKeyPerson != null) {
//已经存在数据,进行数据更新操作
KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO();
@@ -65,22 +65,26 @@
comMngPopulationTagCardNoDTO.setCardNo(dbKeyPerson.getCardNo());
comMngPopulationTagCardNoDTO.setLabel(calculateLabel(dbKeyPerson));
comMngPopulationService.editTagPopulationByCardNo(comMngPopulationTagCardNoDTO);
- ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo());
- if(population !=null){
- keyPersonInfoDO.setUserId(population.getId());
+ try {
+ String aesCardNo = AESUtil.encrypt128(keyPersonInfoDTO.getCardNo(), aesKey);
+ String phone = AESUtil.encrypt128(keyPersonInfoDTO.getPhone(), aesKey);
+ String guardianPhone = AESUtil.encrypt128(keyPersonInfoDTO.getGuardianPhone(), aesKey);
+ keyPersonInfoDO.setCardNo(aesCardNo);
+ keyPersonInfoDO.setPhone(phone);
+ keyPersonInfoDO.setGuardianPhone(guardianPhone);
+ keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType()));
+ keyPersonInfoDO.setInvalid(false);
+ keyPersonInfoDO.setSubmitDate(new Date());
+ updateById(keyPersonInfoDO);
+ } catch (Exception e) {
+ log.error("根据身份证查询残疾人群业务-加密证件信息出错");
}
- keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType()));
- keyPersonInfoDO.setInvalid(false);
- updateById(keyPersonInfoDO);
} else {
KeyPersonInfoDO keyPersonInfoDO = new KeyPersonInfoDO();
BeanUtils.copyProperties(keyPersonInfoDTO, keyPersonInfoDO);
- ComMngPopulationDO population=comMngPopulationService.getPopulationByCardNo(keyPersonInfoDO.getCardNo());
- if(population !=null){
- keyPersonInfoDO.setUserId(population.getId());
- }
keyPersonInfoDO.setVisiterType(Integer.parseInt(keyPersonInfoDTO.getVisiterType()));
keyPersonInfoDO.setInvalid(false);
+ keyPersonInfoDO.setSubmitDate(new Date());
save(keyPersonInfoDO);
}
});
@@ -110,7 +114,7 @@
return baseMapper.selectOne(
new QueryWrapper<KeyPersonInfoDO>()
.eq("act_id", keyPersonInfoDTO.getActId())
- .eq("card_no",aesCardNo)
+ .eq("card_no", aesCardNo)
.eq("visiter_type", keyPersonInfoDTO.getVisiterType())
);
} catch (Exception e) {
--
Gitblit v1.7.1