manailin
2021-06-20 1390400a03b5088a0a23fc02ee9969ca8b8fef07
[修改]修改导入模板加密问题
5个文件已修改
87 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/DisabledPersonsDO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/KeyPersonInfoDO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/DisabledPersonsServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/KeyPersonInfoServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/DisabledPersonsDO.java
@@ -82,10 +82,12 @@
    /**
     * 联系电话
     */
    @EncryptDecryptField
    private String phone;
    /**
     * 监护人联系电话
     */
    @EncryptDecryptField
    private String guardianPhone;
    /**
     * 地址
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/KeyPersonInfoDO.java
@@ -57,7 +57,6 @@
    /**
     * 户口所在地
     */
    @EncryptDecryptField
    private String censusRegister;
    /**
     * 居住地址
@@ -75,7 +74,6 @@
    /**
     * (法轮功类填写)基本情况
     */
    @EncryptDecryptField
    private String basicInfo;
    /**
     * 是否有效
@@ -84,7 +82,6 @@
    /**
     * 备注
     */
    @EncryptDecryptField
    private String note;
    /**
     * 文化程度(取字典表国家编码))
@@ -110,12 +107,10 @@
    /**
     * (精神类人群填写)目前诊断
     */
    @EncryptDecryptField
    private String diagnose;
    /**
     * 上报提交时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date submitDate;
    /**
     * (精神类人群填写)监护人名称
@@ -124,6 +119,7 @@
    /**
     * (精神类人群填写)监护人电话
     */
    @EncryptDecryptField
    private String guardianPhone;
    /**
     * (精神类人群填写)监护人关系
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -20,8 +20,14 @@
import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO;
import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO;
import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO;
import com.panzhihua.common.model.vos.user.*;
import com.panzhihua.common.utlis.*;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
import com.panzhihua.common.model.vos.user.ComMngHouseVo;
import com.panzhihua.common.model.vos.user.InputUserInfoVO;
import com.panzhihua.common.model.vos.user.UserElectronicFileVO;
import com.panzhihua.common.utlis.AgeUtils;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComMngPopulationHouseUserService;
@@ -33,14 +39,11 @@
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -466,6 +469,7 @@
    /**
     * 确认导入实有人口(有则更新,无则新建)
     *
     * @param list  用户信息
     * @param communityId   社区id
     * @return  导入结果
@@ -535,6 +539,7 @@
    /**
     * 根据id修改实有人口标签
     *
     * @param populationTagDTO 请求参数
     * @return 修改结果
     */
@@ -555,6 +560,7 @@
    /**
     * 批量删除实有人口
     *
     * @param Ids
     * @return
     */
@@ -576,6 +582,7 @@
    /**
     * 根据社区id查询所有实有人口
     *
     * @param communityId   社区id
     * @return  查询结果
     */
@@ -595,6 +602,7 @@
    /**
     * 根据id集合查询实有人口
     *
     * @param Ids   实有人口id集合
     * @return  查询结果
     */
@@ -705,6 +713,7 @@
    /**
     * 删除特殊群体人员
     *
     * @param id    特殊群体id
     * @return  删除结果
     */
@@ -725,6 +734,7 @@
    /**
     * 查询实有人口电子档信息
     *
     * @param populationId  实有人口id
     * @return  实有人口电子档信息
     */
@@ -756,6 +766,7 @@
    /**
     * 实有人口统计
     *
     * @param communityId   社区id
     * @return  统计结果
     */
@@ -796,7 +807,7 @@
                            .eq("card_no",aesCardNo)
            );
        } catch (Exception e) {
           log.error("根据身份证查询业务-加密证件信息出错");
            log.error("根据身份证查询业务-加密证件信息出错:{}", e.getCause());
        }
        return null;
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/DisabledPersonsServiceImpl.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO;
import com.panzhihua.common.model.dtos.community.DisabledPersonsDTO;
import com.panzhihua.common.model.helper.AESUtil;
import com.panzhihua.common.model.vos.R;
@@ -47,20 +46,22 @@
    public R saveBatchDisabledPerson(List<DisabledPersonsDTO> list) {
        list.forEach(disabledPersonsDTO -> {
            DisabledPersonsDO dbKeyPerson = checkExistFromDb(disabledPersonsDTO);
            ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(disabledPersonsDTO.getCardNo());
            if (population != null) {
                disabledPersonsDTO.setUserId(population.getId());
            }
            if (dbKeyPerson != null) {
                //已经存在数据,进行数据更新操作
                DisabledPersonsDO disabledPersonsDO = new DisabledPersonsDO();
                BeanUtils.copyProperties(disabledPersonsDTO, disabledPersonsDO);
                disabledPersonsDO.setId(dbKeyPerson.getId());
                ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO = new ComMngPopulationTagCardNoDTO();
                comMngPopulationTagCardNoDTO.setCardNo(dbKeyPerson.getCardNo());
                ComMngPopulationDO population = comMngPopulationService.getPopulationByCardNo(disabledPersonsDTO.getCardNo());
                if (population != null) {
                    disabledPersonsDO.setUserId(population.getId());
                }
                try {
                    String aesCardNo = AESUtil.encrypt128(disabledPersonsDTO.getCardNo(), aesKey);
                    String phone = AESUtil.encrypt128(disabledPersonsDTO.getPhone(), aesKey);
                    String guardianPhone = AESUtil.encrypt128(disabledPersonsDTO.getGuardianPhone(), aesKey);
                    disabledPersonsDO.setCardNo(aesCardNo);
                    disabledPersonsDO.setPhone(phone);
                    disabledPersonsDO.setGuardianPhone(guardianPhone);
                    updateById(disabledPersonsDO);
                } catch (Exception e) {
                    log.error("根据身份证查询残疾人群业务-加密证件信息出错");
@@ -84,7 +85,6 @@
                            .eq("card_no", aesCardNo)
            );
        } catch (Exception e) {
            log.error("根据身份证查询残疾人群业务-加密证件信息出错");
        }
        return null;
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("根据身份证查询残疾人群业务-加密证件信息出错");
                }
            } 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);
            }
        });