|
|
|
|
@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.biutag.supervisiondata.common.interfaces.CompletableFutureUtil; |
|
|
|
|
import com.biutag.supervisiondata.pojo.constants.Default; |
|
|
|
|
import com.biutag.supervisiondata.pojo.database.Contradiction; |
|
|
|
|
import com.biutag.supervisiondata.pojo.database.PointOrg; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseJJD; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseTbDZdrylb; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseZDRY; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.*; |
|
|
|
|
import com.biutag.supervisiondata.pojo.enums.DepartType; |
|
|
|
|
@ -18,7 +16,6 @@ import com.biutag.supervisiondata.util.IdCodeUtil;
|
|
|
|
|
import com.biutag.supervisiondata.util.PatternUtil; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.cglib.core.Local; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
@ -79,10 +76,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
} |
|
|
|
|
jjdList.add(item); |
|
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
|
String[] strs = idCards.split(","); |
|
|
|
|
for (String s : strs) { |
|
|
|
|
idCodes1.add(s); |
|
|
|
|
} |
|
|
|
|
idCodes1.addAll(Arrays.asList(idCards.split(","))); |
|
|
|
|
} else { |
|
|
|
|
jjdMMap.computeIfAbsent(item.getBjrlxdh(), k -> new ArrayList<>()).add(item); |
|
|
|
|
mobiles1.add(item.getBjrlxdh()); |
|
|
|
|
@ -118,7 +112,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
Map<String, Byte[]> cache = new WeakHashMap<>(); |
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
for (GBaseJJD item : jjdList) { |
|
|
|
|
GBaseSYRKXX syrkxx = null; |
|
|
|
|
GBaseSYRKXX syrkxx; |
|
|
|
|
// 接警单证件号不为空并没入过库
|
|
|
|
|
if (item.getBjrzjhm() != null && cache.get(item.getBjrzjhm()) == null) { |
|
|
|
|
syrkxx = idCodeMap.get(item.getBjrzjhm()); |
|
|
|
|
@ -130,16 +124,12 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
} |
|
|
|
|
String idCards = PatternUtil.takeIdCard(item.getCjqk()); |
|
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
|
String[] strs = idCards.split(","); |
|
|
|
|
for (String s : strs) { |
|
|
|
|
if (cache.get(s) == null) { |
|
|
|
|
syrkxx = idCodeMap.get(s); |
|
|
|
|
cache.put(s, new Byte[0]); |
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end, Default.BIG_TAG_JJD)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String[] arr = idCards.split(","); |
|
|
|
|
Arrays.stream(arr).filter(s -> cache.get(s) == null).map(idCodeMap::get) |
|
|
|
|
.filter(Objects::nonNull).forEach(obj -> { |
|
|
|
|
personals.add(createPerson(obj, item.getBjsj(), now, end, Default.BIG_TAG_JJD)); |
|
|
|
|
cache.put(obj.getGmsfhm(), new Byte[0]); |
|
|
|
|
}); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
List<GBaseSYRKXX> xxList = Optional.ofNullable(mobileMap.get(item.getBjdh())).orElse(new ArrayList<>()); |
|
|
|
|
@ -196,7 +186,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
} |
|
|
|
|
mobiles.append(s).append(","); |
|
|
|
|
} |
|
|
|
|
personal.setMobileNumber(mobiles.length() == 0 ? "" : mobiles.substring(0, mobiles.length() - 1)); |
|
|
|
|
personal.setMobileNumber(mobiles.isEmpty() ? "" : mobiles.substring(0, mobiles.length() - 1)); |
|
|
|
|
} |
|
|
|
|
personals.add(personal); |
|
|
|
|
} |
|
|
|
|
@ -255,14 +245,11 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
).join(); |
|
|
|
|
|
|
|
|
|
List<String> idCards = new ArrayList<>(); |
|
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
|
idCards.addAll(pList1.stream().map(DataPetition12337::getIdCode).toList()); |
|
|
|
|
idCards.addAll(pList2.stream().map(DataPetitionComplaint::getResponderIdCode).toList()); |
|
|
|
|
mobiles.addAll(pList3.stream().map(DataCaseVerif::getResponderPhone).toList()); |
|
|
|
|
List<String> mobiles2 = new ArrayList<>(pList3.stream().map(DataCaseVerif::getResponderPhone).distinct().toList()); |
|
|
|
|
|
|
|
|
|
List<String> idCards2 = idCards.stream().distinct().toList(); |
|
|
|
|
List<String> mobiles2 = mobiles.stream().distinct().toList(); |
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = new ArrayList<>(); |
|
|
|
|
// 实有人口数据整合
|
|
|
|
|
CompletableFuture.allOf(CompletableFutureUtil.runSyncObject(() -> xxList.addAll(getByIdCode(IntStream.range(0, (idCards2.size() + 9999) / 10000) |
|
|
|
|
@ -285,34 +272,6 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final SupExternalDepartRepository supExternalDepartRepository; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void syncOrg() { |
|
|
|
|
List<GBaseSYRKXX> xxInfo = gBaseSYRKXXRepository.getBaseMapper().selectOrg(); |
|
|
|
|
List<PointOrg> orgs = zdryRepository.getBaseMapper().selectOrg(); |
|
|
|
|
|
|
|
|
|
Map<String, PointOrg> orgIdMap = new WeakHashMap<>(); |
|
|
|
|
Map<String, PointOrg> orgCodeMap = new WeakHashMap<>(); |
|
|
|
|
for (PointOrg org : orgs) { |
|
|
|
|
orgIdMap.put(org.getId(), org); |
|
|
|
|
orgCodeMap.put(org.getDm(), org); |
|
|
|
|
} |
|
|
|
|
int a = 0; |
|
|
|
|
int b = 0; |
|
|
|
|
for (GBaseSYRKXX syrkxx : xxInfo) { |
|
|
|
|
PointOrg org = orgCodeMap.get(syrkxx.getSspcsdm()); |
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
if(org== null) { |
|
|
|
|
a++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
b++; |
|
|
|
|
} |
|
|
|
|
log.info("ok{} | notOk{}", b, a); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final RiskTestRepository riskTestRepository; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -325,16 +284,6 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
riskTestRepository.getBaseMapper().truncateTable(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PointOrg findOrg(PointOrg org, Map<String, PointOrg> orgIdMap) { |
|
|
|
|
if(org == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
if(org.getPcs() == null || !org.getPcs().equals("1")) { |
|
|
|
|
return findOrg(orgIdMap.get(org.getPid()), orgIdMap); |
|
|
|
|
} |
|
|
|
|
return org; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过身份证号查询实有人口 |
|
|
|
|
* |
|
|
|
|
@ -342,14 +291,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
* @return 实有人口信息 |
|
|
|
|
*/ |
|
|
|
|
List<GBaseSYRKXX> getByIdCode(List<List<String>> idCodes) { |
|
|
|
|
List<GBaseSYRKXX> tmp = new ArrayList<>(); |
|
|
|
|
for (int i = 0, len = idCodes.size(); i < len; i++) { |
|
|
|
|
tmp.addAll(gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getLxdh, GBaseSYRKXX::getSspcsdm, GBaseSYRKXX::getSspcsmc) |
|
|
|
|
.in(GBaseSYRKXX::getGmsfhm, idCodes.get(i)))); |
|
|
|
|
log.info("证件查询进度:{}", i); |
|
|
|
|
} |
|
|
|
|
return tmp; |
|
|
|
|
return getXXInfo(idCodes,1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -359,12 +301,23 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
* @return 查到的实有人口数据 |
|
|
|
|
*/ |
|
|
|
|
List<GBaseSYRKXX> getByMobiles(List<List<String>> mobiles) { |
|
|
|
|
return getXXInfo(mobiles,2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> getXXInfo(List<List<String>> strList, int type) { |
|
|
|
|
List<GBaseSYRKXX> tmp = new ArrayList<>(); |
|
|
|
|
for (int i = 0, len = mobiles.size(); i < len; i++) { |
|
|
|
|
tmp.addAll(gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getXlmc, GBaseSYRKXX::getLxdh, GBaseSYRKXX::getSspcsdm, GBaseSYRKXX::getSspcsmc) |
|
|
|
|
.in(GBaseSYRKXX::getLxdh, mobiles.get(i)))); |
|
|
|
|
LambdaQueryWrapper<GBaseSYRKXX> wrapper; |
|
|
|
|
for (int i = 0, len = strList.size(); i < len; i++) { |
|
|
|
|
wrapper = new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getXlmc, GBaseSYRKXX::getLxdh, GBaseSYRKXX::getSspcsdm, GBaseSYRKXX::getSspcsmc); |
|
|
|
|
if (type == 1) { |
|
|
|
|
log.info("身份证查询进度:{}", i); |
|
|
|
|
wrapper.in(GBaseSYRKXX::getGmsfhm, strList.get(i)); |
|
|
|
|
} else { |
|
|
|
|
log.info("手机号查询进度:{}", i); |
|
|
|
|
wrapper.in(GBaseSYRKXX::getLxdh, strList.get(i)); |
|
|
|
|
} |
|
|
|
|
tmp.addAll(gBaseSYRKXXRepository.list(wrapper)); |
|
|
|
|
} |
|
|
|
|
return tmp; |
|
|
|
|
} |
|
|
|
|
|