|
|
|
@ -8,6 +8,8 @@ import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseJJD; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseJJD; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseZDRY; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseZDRY; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.*; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.*; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc.WdpcGrjdXfsj; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.wdpc.WdpcGrjdXfsjCs; |
|
|
|
import com.biutag.supervisiondata.pojo.enums.DepartType; |
|
|
|
import com.biutag.supervisiondata.pojo.enums.DepartType; |
|
|
|
import com.biutag.supervisiondata.repository.*; |
|
|
|
import com.biutag.supervisiondata.repository.*; |
|
|
|
import com.biutag.supervisiondata.service.PersonalService; |
|
|
|
import com.biutag.supervisiondata.service.PersonalService; |
|
|
|
@ -278,6 +280,45 @@ public class PersonalServiceImpl implements PersonalService { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final WdpcGrjdXfsjCsRepository xfsjCsRepository; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final WdpcGrjdXfsjRepository xfsjRepository; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void pullPetitionAgain() { |
|
|
|
|
|
|
|
List<String> idCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
CompletableFuture.allOf(CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
|
|
|
|
idCodes.addAll(xfsjRepository.list(new LambdaQueryWrapper<WdpcGrjdXfsj>().select(WdpcGrjdXfsj::getIdCode, WdpcGrjdXfsj::getName)).stream().map(WdpcGrjdXfsj::getIdCode).toList()); |
|
|
|
|
|
|
|
}), CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
|
|
|
|
idCodes.addAll(xfsjCsRepository.list(new LambdaQueryWrapper<WdpcGrjdXfsjCs>().select(WdpcGrjdXfsjCs::getIdCode, WdpcGrjdXfsjCs::getName)).stream().map(WdpcGrjdXfsjCs::getIdCode).toList()); |
|
|
|
|
|
|
|
})).join(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> idCards = idCodes.stream().distinct().toList(); |
|
|
|
|
|
|
|
List<List<String>> idCards2 = IntStream.range(0, (idCards.size() + 9999) / 10000) |
|
|
|
|
|
|
|
.mapToObj(i -> idCards.subList(i * 10000, Math.min((i + 1) * 10000, idCards.size()))) |
|
|
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = new ArrayList<>(); |
|
|
|
|
|
|
|
xxList.addAll(getByIdCode(idCards2)); |
|
|
|
|
|
|
|
// 去重
|
|
|
|
|
|
|
|
List<RiskPersonal> personals = new ArrayList<>(); |
|
|
|
|
|
|
|
Map<String, Byte[]> map = new WeakHashMap<>(); |
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
|
|
|
LocalDate today = now.toLocalDate(); |
|
|
|
|
|
|
|
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) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
personals.add(personal); |
|
|
|
|
|
|
|
map.put(xx.getGmsfhm(), new Byte[0]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private final RiskTestRepository riskTestRepository; |
|
|
|
private final RiskTestRepository riskTestRepository; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -346,7 +387,7 @@ public class PersonalServiceImpl implements PersonalService { |
|
|
|
person.setMobileNumber(item.getLxdh()); |
|
|
|
person.setMobileNumber(item.getLxdh()); |
|
|
|
person.setControlDepartId(item.getSspcsdm()); |
|
|
|
person.setControlDepartId(item.getSspcsdm()); |
|
|
|
person.setControlDepartName(item.getSspcsmc()); |
|
|
|
person.setControlDepartName(item.getSspcsmc()); |
|
|
|
person.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
person.setControlDepartType(DepartType.HUMAN.getType()); |
|
|
|
person.setIdCode(item.getGmsfhm().toUpperCase()); |
|
|
|
person.setIdCode(item.getGmsfhm().toUpperCase()); |
|
|
|
person.setCreateTime(time); |
|
|
|
person.setCreateTime(time); |
|
|
|
person.setAge(IdCodeUtil.idCard2Age(person.getIdCode(), now)); |
|
|
|
person.setAge(IdCodeUtil.idCard2Age(person.getIdCode(), now)); |
|
|
|
|