This commit is contained in:
wans 2022-01-26 16:59:06 +08:00
parent 7943581dee
commit 17e2e6692a

View File

@ -593,65 +593,69 @@ public class BasePopulationInfoServiceImpl extends DefaultBaseService implements
List<BasePopulationInfoDTO> fullList = basePopulationInfoDao.listBasePopulationInfo(null); List<BasePopulationInfoDTO> fullList = basePopulationInfoDao.listBasePopulationInfo(null);
int forIndex = 0; int forIndex = 0;
for(BasePopulationInfoDTO item : fullList){ for(BasePopulationInfoDTO item : fullList){
jObj.put("uid", item.getBasePopulationInfoId()); try {
PopulationInfo info = new PopulationInfo(); jObj.put("uid", item.getBasePopulationInfoId());
info.setfull_name(item.getFullName()); PopulationInfo info = new PopulationInfo();
info.setname_used_before(item.getNameUsedBefore()); info.setfull_name(item.getFullName());
String gender = IdCardVerifyUtil.getIdCardGender(item.getIdCardNumber()); info.setname_used_before(item.getNameUsedBefore());
info.setgender("1".equals(gender) ? "" : ""); String gender = IdCardVerifyUtil.getIdCardGender(item.getIdCardNumber());
//info.setage(IdCardVerifyUtil.getAgeFromIdCardNumber(item.getIdCardNumber())); info.setgender("1".equals(gender) ? "" : "");
info.setage(15); info.setage(IdCardVerifyUtil.getAgeFromIdCardNumber(item.getIdCardNumber()));
if(item.getNation() != null && !"".equals(item.getNation())){ //info.setage(15);
DataDTO dataDTO = mongoDataService.get(item.getNation()); if(item.getNation() != null && !"".equals(item.getNation())){
info.setnation(dataDTO == null ? "" : dataDTO.getDataName()); DataDTO dataDTO = mongoDataService.get(item.getNation());
info.setnation(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getReligion() != null && !"".equals(item.getReligion())){
DataDTO dataDTO = mongoDataService.get(item.getReligion());
info.setreligion(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getEducation() != null && !"".equals(item.getEducation())){
DataDTO dataDTO = mongoDataService.get(item.getEducation());
info.seteducation(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getPoliticalStatus() != null && !"".equals(item.getPoliticalStatus())){
DataDTO dataDTO = mongoDataService.get(item.getPoliticalStatus());
info.setpolitical_status(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getMaritalStatus() != null && !"".equals(item.getMaritalStatus())){
DataDTO dataDTO = mongoDataService.get(item.getMaritalStatus());
info.setmarital_status(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getOccupationCategory() != null && !"".equals(item.getOccupationCategory())){
DataDTO dataDTO = mongoDataService.get(item.getOccupationCategory());
info.setoccupation_category(dataDTO == null ? "" : dataDTO.getDataName());
}
info.setoccupation(item.getOccupation() == null ? "" : item.getOccupation());
info.setlocation_all(item.getAreaNames() == null ? "" : item.getAreaNames());
info.setlocation_code(item.getAreaCode() == null ? "" : item.getAreaCode());
if(item.getAreaCode() != null && !"".equals(item.getAreaCode())){
AreaDTO areaDTO = mongoAreaService.getByCode(item.getAreaCode());
info.setlocation_area(areaDTO == null ? "" : areaDTO.getAreaName());
}
info.setis_key_teenager("");
info.setkey_teenager_time("");
info.setis_addicts("");
info.setaddicts_time("");
info.setis_aids("");
info.setaids_time("");
info.setis_community_correction("");
info.setcommunity_correction_time("");
info.setis_mental_disorders("");
info.setmental_disorders_time("");
info.setis_release_after_sentence("");
info.setrelease_after_sentence_time("");
info.setgrid_code(item.getGridId() == null ? "" : item.getGridId());
info.setgrid_name(item.getGridName() == null ? "" : item.getGridName());
jObj.put("data", info.saveCheckToJson());
kafkaTemplate.send("tableSync", jObj.toJSONString());
if(forIndex != 0 && forIndex % 5000 == 0){
System.out.println("================= PULL_COUNT_" + forIndex + " =================");
}
forIndex++;
} catch (Exception e){
System.out.println(item);
} }
if(item.getReligion() != null && !"".equals(item.getReligion())){
DataDTO dataDTO = mongoDataService.get(item.getReligion());
info.setreligion(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getEducation() != null && !"".equals(item.getEducation())){
DataDTO dataDTO = mongoDataService.get(item.getEducation());
info.seteducation(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getPoliticalStatus() != null && !"".equals(item.getPoliticalStatus())){
DataDTO dataDTO = mongoDataService.get(item.getPoliticalStatus());
info.setpolitical_status(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getMaritalStatus() != null && !"".equals(item.getMaritalStatus())){
DataDTO dataDTO = mongoDataService.get(item.getMaritalStatus());
info.setmarital_status(dataDTO == null ? "" : dataDTO.getDataName());
}
if(item.getOccupationCategory() != null && !"".equals(item.getOccupationCategory())){
DataDTO dataDTO = mongoDataService.get(item.getOccupationCategory());
info.setoccupation_category(dataDTO == null ? "" : dataDTO.getDataName());
}
info.setoccupation(item.getOccupation() == null ? "" : item.getOccupation());
info.setlocation_all(item.getAreaNames() == null ? "" : item.getAreaNames());
info.setlocation_code(item.getAreaCode() == null ? "" : item.getAreaCode());
if(item.getAreaCode() != null && !"".equals(item.getAreaCode())){
AreaDTO areaDTO = mongoAreaService.getByCode(item.getAreaCode());
info.setlocation_area(areaDTO == null ? "" : areaDTO.getAreaName());
}
info.setis_key_teenager("");
info.setkey_teenager_time("");
info.setis_addicts("");
info.setaddicts_time("");
info.setis_aids("");
info.setaids_time("");
info.setis_community_correction("");
info.setcommunity_correction_time("");
info.setis_mental_disorders("");
info.setmental_disorders_time("");
info.setis_release_after_sentence("");
info.setrelease_after_sentence_time("");
info.setgrid_code(item.getGridId() == null ? "" : item.getGridId());
info.setgrid_name(item.getGridName() == null ? "" : item.getGridName());
jObj.put("data", info.saveCheckToJson());
kafkaTemplate.send("tableSync", jObj.toJSONString());
if(forIndex != 0 && forIndex % 5000 == 0){
System.out.println("================= PULL_COUNT_" + forIndex + " =================");
}
forIndex++;
} }
} }