|
|
|
|
@ -9,6 +9,7 @@ import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX;
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseJJD; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseZDRY; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.*; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc.WdpcPerson; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc2.WdpcGrjdJsbry; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc.WdpcGrjdXfsj; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc.WdpcGrjdXfsjCs; |
|
|
|
|
@ -125,7 +126,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
cache.put(item.getBjrzjhm(), new Byte[0]); |
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
RiskPersonal personal = createPerson(syrkxx, item.getBjsj(), now, end, Default.BIG_TAG_JJD); |
|
|
|
|
if(personal != null) { |
|
|
|
|
if (personal != null) { |
|
|
|
|
personals.add(personal); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -135,16 +136,16 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
|
String[] arr = idCards.split(","); |
|
|
|
|
for (String s : arr) { |
|
|
|
|
if(cache.get(s) != null) { |
|
|
|
|
if (cache.get(s) != null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
GBaseSYRKXX xx = idCodeMap.get(s); |
|
|
|
|
if(xx == null) { |
|
|
|
|
if (xx == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
cache.put(xx.getGmsfhm(), new Byte[0]); |
|
|
|
|
RiskPersonal personal = createPerson(xx, item.getBjsj(), now, end, Default.BIG_TAG_JJD); |
|
|
|
|
if(personal == null) { |
|
|
|
|
if (personal == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
personals.add(personal); |
|
|
|
|
@ -156,7 +157,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
cache.put(syrkxx.getGmsfhm(), new Byte[0]); |
|
|
|
|
RiskPersonal personal = createPerson(syrkxx, item.getBjsj(), now, end, Default.BIG_TAG_JJD); |
|
|
|
|
if(personal == null) { |
|
|
|
|
if (personal == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
personals.add(personal); |
|
|
|
|
@ -240,7 +241,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
Contradiction contradiction = map.get(syrkxx.getGmsfhm()); |
|
|
|
|
RiskPersonal personal = createPerson(syrkxx, Optional.of(contradiction).map(Contradiction::getMaxTime) |
|
|
|
|
.orElse(null), now.toLocalDate(), now, Default.BIG_TAG_SHWFR); |
|
|
|
|
if(personal != null) { |
|
|
|
|
if (personal != null) { |
|
|
|
|
personals.add(personal); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -294,8 +295,8 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
Date nowDate = new Date(); |
|
|
|
|
for (GBaseSYRKXX xx : xxList) { |
|
|
|
|
if (map.get(xx.getGmsfhm()) == null) { |
|
|
|
|
RiskPersonal personal =createPerson(xx, nowDate, today, now, Default.BIG_TAG_PETITION); |
|
|
|
|
if(personal != null) { |
|
|
|
|
RiskPersonal personal = createPerson(xx, nowDate, today, now, Default.BIG_TAG_PETITION); |
|
|
|
|
if (personal != null) { |
|
|
|
|
personals.add(personal); |
|
|
|
|
} |
|
|
|
|
map.put(xx.getGmsfhm(), new Byte[0]); |
|
|
|
|
@ -335,7 +336,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
orgCodeMap.put(org.getDm(), org); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, SupExternalDepart> supExternalDepartMap = supDeparts.stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val,old) -> val)); |
|
|
|
|
Map<String, SupExternalDepart> supExternalDepartMap = supDeparts.stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val, old) -> val)); |
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = new ArrayList<>(getByIdCode(idCards2)); |
|
|
|
|
// 去重
|
|
|
|
|
@ -348,17 +349,17 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
for (GBaseSYRKXX xx : xxList) { |
|
|
|
|
if (map.get(xx.getGmsfhm()) == null) { |
|
|
|
|
RiskPersonal personal = createPerson(xx, nowDate, today, now, Default.BIG_TAG_PETITION); |
|
|
|
|
if(personal == null) { |
|
|
|
|
if (personal == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
SupExternalDepart depart = hope.get(xx.getSspcsdm()); |
|
|
|
|
if(depart == null) { |
|
|
|
|
if (depart == null) { |
|
|
|
|
personal.setMobileNumber(xx.getLxdh()); |
|
|
|
|
PointOrg org = orgCodeMap.get(xx.getSspcsdm()); |
|
|
|
|
org = OrgUtil.findOrg(org, orgIdMap); |
|
|
|
|
depart = Optional.ofNullable(org).map(PointOrg::getDm).map(supExternalDepartMap::get).orElse(null); |
|
|
|
|
} |
|
|
|
|
if(depart != null) { |
|
|
|
|
if (depart != null) { |
|
|
|
|
hope.put(xx.getSspcsdm(), depart); |
|
|
|
|
personal.setControlDepartId(depart.getInternalId()); |
|
|
|
|
personal.setControlDepartName(depart.getInternalName()); |
|
|
|
|
@ -378,7 +379,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void pullInvestigate() { |
|
|
|
|
List<WdpcRyLgXX> xxList = lgXXRepository.list(new LambdaQueryWrapper<WdpcRyLgXX>().select(WdpcRyLgXX::getXm,WdpcRyLgXX::getSfzh,WdpcRyLgXX::getGxdwmc,WdpcRyLgXX::getGxdwbh,WdpcRyLgXX::getLxdh)); |
|
|
|
|
List<WdpcRyLgXX> xxList = lgXXRepository.list(new LambdaQueryWrapper<WdpcRyLgXX>().select(WdpcRyLgXX::getXm, WdpcRyLgXX::getSfzh, WdpcRyLgXX::getGxdwmc, WdpcRyLgXX::getGxdwbh, WdpcRyLgXX::getLxdh)); |
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
List<RiskPersonal> personals = new ArrayList<>(); |
|
|
|
|
for (WdpcRyLgXX wdpcRyLgXX : xxList) { |
|
|
|
|
@ -396,7 +397,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
person.setTags(Default.INVESTIGATE_FOUR); |
|
|
|
|
personals.add(person); |
|
|
|
|
} |
|
|
|
|
if(!personals.isEmpty()) { |
|
|
|
|
if (!personals.isEmpty()) { |
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -431,13 +432,13 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
orgCodeMap.put(org.getDm(), org); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, SupExternalDepart> supExternalDepartMap = supDeparts.stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val,old) -> val)); |
|
|
|
|
Map<String, SupExternalDepart> supExternalDepartMap = supDeparts.stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val, old) -> val)); |
|
|
|
|
Map<String, Byte[]> map = new WeakHashMap<>(); |
|
|
|
|
List<RiskPersonal> personals = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
Map<String, SupExternalDepart> hope = new WeakHashMap<>(); |
|
|
|
|
for (WdpcGrjdJsbry ry : jsbryList) { |
|
|
|
|
if(map.get(ry.getIdCode()) != null) { |
|
|
|
|
if (map.get(ry.getIdCode()) != null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
map.put(ry.getIdCode(), new Byte[0]); |
|
|
|
|
@ -452,15 +453,15 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
person.setCreateTime(LocalDateTime.now()); |
|
|
|
|
person.setControlTime(LocalDateTime.now()); |
|
|
|
|
person.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
|
if(xx != null) { |
|
|
|
|
if (xx != null) { |
|
|
|
|
SupExternalDepart depart = hope.get(xx.getSspcsdm()); |
|
|
|
|
if(depart == null) { |
|
|
|
|
if (depart == null) { |
|
|
|
|
person.setMobileNumber(xx.getLxdh()); |
|
|
|
|
PointOrg org = orgCodeMap.get(xx.getSspcsdm()); |
|
|
|
|
org = OrgUtil.findOrg(org, orgIdMap); |
|
|
|
|
depart = Optional.ofNullable(org).map(PointOrg::getDm).map(supExternalDepartMap::get).orElse(null); |
|
|
|
|
} |
|
|
|
|
if(depart != null) { |
|
|
|
|
if (depart != null) { |
|
|
|
|
hope.put(xx.getSspcsdm(), depart); |
|
|
|
|
person.setControlDepartId(depart.getInternalId()); |
|
|
|
|
person.setControlDepartName(depart.getInternalName()); |
|
|
|
|
@ -470,7 +471,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
person.setTags(Default.PSYCHOSIS_TAG); |
|
|
|
|
personals.add(person); |
|
|
|
|
} |
|
|
|
|
if(!personals.isEmpty()) { |
|
|
|
|
if (!personals.isEmpty()) { |
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -487,6 +488,27 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
riskTestRepository.getBaseMapper().truncateTable(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final WdpcPersonRepository wdpcPersonRepository; |
|
|
|
|
|
|
|
|
|
private final RiskPersonalRepository personalRepository; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void syncPerson() { |
|
|
|
|
wdpcPersonRepository.getBaseMapper().truncateTable(); |
|
|
|
|
List<RiskPersonal> personals = personalRepository.list(new LambdaQueryWrapper<RiskPersonal>() |
|
|
|
|
.select(RiskPersonal::getIdCode, RiskPersonal::getIdCode) |
|
|
|
|
.eq(RiskPersonal::getDel, 0)); |
|
|
|
|
|
|
|
|
|
List<WdpcPerson> personList = new ArrayList<>(); |
|
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
|
WdpcPerson person = new WdpcPerson(); |
|
|
|
|
person.setId(personal.getId()); |
|
|
|
|
person.setIdCode(personal.getIdCode()); |
|
|
|
|
personList.add(person); |
|
|
|
|
} |
|
|
|
|
wdpcPersonRepository.saveBatch(personList, 10000); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过身份证号查询实有人口 |
|
|
|
|
* |
|
|
|
|
|