| | |
| | | |
| | | 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; |
| | |
| | | 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("根据身份证查询残疾人群业务-加密证件信息出错"); |
| | |
| | | .eq("card_no", aesCardNo) |
| | | ); |
| | | } catch (Exception e) { |
| | | |
| | | log.error("根据身份证查询残疾人群业务-加密证件信息出错"); |
| | | } |
| | | return null; |