|
|
|
|
@ -120,9 +120,6 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
List<List<String>> mobiles = IntStream.range(0, (mobiles2.size() + 9999) / 10000) |
|
|
|
|
.mapToObj(i -> mobiles2.subList(i * 10000, Math.min((i + 1) * 10000, mobiles2.size()))) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
// 查询数据
|
|
|
|
|
log.info("开始根据身份证实用人口信息补全 =》 {}", idCodes.size()); |
|
|
|
|
int count = 0; |
|
|
|
|
// 身份证查到的人
|
|
|
|
|
List<GBaseSYRKXX> sFms = new ArrayList<>(); |
|
|
|
|
// 手机号查到的人
|
|
|
|
|
@ -137,7 +134,9 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
|
GBaseSYRKXX info = null; |
|
|
|
|
List<GBaseSYRKXX> xxxInfo; |
|
|
|
|
log.info("开始处理信息对应"); |
|
|
|
|
|
|
|
|
|
List<RiskPersonal> toInsert = new ArrayList<>(); |
|
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
|
if (personal.getIdCode() != null) { |
|
|
|
|
String[] strs = personal.getIdCode().split(","); |
|
|
|
|
@ -191,14 +190,26 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
toInsert.add(personal); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
|
log.info("开始处理部门, {}", toInsert.size()); |
|
|
|
|
int count = 0; |
|
|
|
|
Map<String, SupExternalDepart> hope = new WeakHashMap<>(); |
|
|
|
|
for (RiskPersonal personal : toInsert) { |
|
|
|
|
count++; |
|
|
|
|
if(count % 100 == 0) { |
|
|
|
|
log.info("{}", count); |
|
|
|
|
} |
|
|
|
|
if (personal.getControlDepartType() != null && personal.getControlDepartType() >= DepartType.HUMAN.getType()) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
List<GBaseJJD> jjds = Optional.ofNullable(jjdMap.get(personal.getIdCode())).orElse(jjdMMap.get(Optional.ofNullable(personal.getMobileNumber()).orElse(""))); |
|
|
|
|
if (jjds == null || jjds.isEmpty()) { |
|
|
|
|
|
|
|
|
|
List<GBaseJJD> jjds = jjdMap.get(personal.getIdCode()); |
|
|
|
|
if (jjds == null) { |
|
|
|
|
jjds = jjdMMap.get(Optional.ofNullable(personal.getMobileNumber()).orElse("")); |
|
|
|
|
} |
|
|
|
|
if (jjds == null|| jjds.isEmpty()) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
GBaseJJD tmp = jjds.getFirst(); |
|
|
|
|
@ -218,14 +229,18 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
personal.setControlDepartName(null); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
PointOrg org = orgCodeMap.get(info.getSspcsdm()); |
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
SupExternalDepart depart = Optional.ofNullable(org).map(PointOrg::getDm).map(item -> jqExternalDepart.get(item)).orElse(null); |
|
|
|
|
SupExternalDepart depart = hope.get(tmp.getGxdwdm()); |
|
|
|
|
if(depart == null) { |
|
|
|
|
PointOrg org = orgCodeMap.get(tmp.getGxdwdm()); |
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
depart = Optional.ofNullable(org).map(PointOrg::getDm).map(item -> jqExternalDepart.get(item)).orElse(null); |
|
|
|
|
} |
|
|
|
|
if (depart == null) { |
|
|
|
|
personal.setControlDepartId(null); |
|
|
|
|
personal.setControlDepartName(null); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
hope.put(tmp.getGxdwdm(), depart); |
|
|
|
|
personal.setControlDepartId(depart.getInternalId()); |
|
|
|
|
personal.setControlDepartName(depart.getInternalName()); |
|
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
|
@ -239,8 +254,9 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
log.info("报警时间处理异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
riskPersonalService.formatAndSave(personals, Default.BIG_TAG_JJD); |
|
|
|
|
log.info("人数: {}", personals.size()); |
|
|
|
|
log.info("开始写数据"); |
|
|
|
|
riskPersonalService.formatAndSave(toInsert, Default.BIG_TAG_JJD); |
|
|
|
|
log.info("人数: {}", toInsert.size()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -299,7 +315,13 @@ public class GBaseJJDServiceImpl implements GBaseJJDService {
|
|
|
|
|
).join(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void syncPoliceInstance() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void toRedisCache(List<GBaseJJD> jjdList, String keyName) { |
|
|
|
|
RedisDao.getInstance().removeListAll(keyName); |
|
|
|
|
RedisDao.getInstance().pipeLineExec((connection, key, value) -> jjdList.forEach(item -> { |
|
|
|
|
connection.rPush(key.serialize(keyName), value.serialize(JSON.toJSONString(item))); |
|
|
|
|
})); |
|
|
|
|
|