|
@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|
|
import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; |
|
|
import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; |
|
|
import com.epmet.commons.tools.dto.result.YtHsjcResDTO; |
|
|
import com.epmet.commons.tools.dto.result.YtHsjcResDTO; |
|
|
|
|
|
import com.epmet.commons.tools.enums.GenderEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
@ -40,10 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -182,7 +180,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 根据dataCode 调用不同的方法 抽取数据
|
|
|
//TODO 根据dataCode 调用不同的方法 抽取数据
|
|
|
if (CollectionUtils.isNotEmpty(allConfigList)) { |
|
|
if (CollectionUtils.isEmpty(allConfigList)) { |
|
|
log.warn("dataSyncForYanTaiTask don't have any resi data to pull data form YanTai interface"); |
|
|
log.warn("dataSyncForYanTaiTask don't have any resi data to pull data form YanTai interface"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -196,7 +194,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
|
|
|
|
|
//没传具体参数 则 按照
|
|
|
//没传具体参数 则 按照
|
|
|
int pageNo = NumConstant.ONE; |
|
|
int pageNo = NumConstant.ONE; |
|
|
int pageSize = NumConstant.ONE_THOUSAND; |
|
|
int pageSize = 1;//todo fangkaita NumConstant.ONE_THOUSAND;
|
|
|
|
|
|
//ToDo 去掉
|
|
|
|
|
|
formDTO.setIdCards(Collections.singletonList("370283199912010302")); |
|
|
List<NatUserInfoResultDTO> dbResiList = null; |
|
|
List<NatUserInfoResultDTO> dbResiList = null; |
|
|
//设置查询数据范围
|
|
|
//设置查询数据范围
|
|
|
formDTO.setOrgList(config.getScopeList()); |
|
|
formDTO.setOrgList(config.getScopeList()); |
|
@ -206,7 +206,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
switch (anEnum) { |
|
|
switch (anEnum) { |
|
|
case HE_SUAN: |
|
|
case HE_SUAN: |
|
|
//查询正常状态的居民
|
|
|
//查询正常状态的居民
|
|
|
dbResiList = getNatUserInfoFromDb(formDTO, anEnum, pageNo, pageSize); |
|
|
dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); |
|
|
if (CollectionUtils.isEmpty(dbResiList)) { |
|
|
if (CollectionUtils.isEmpty(dbResiList)) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
@ -215,24 +215,25 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
case CAN_JI: |
|
|
case CAN_JI: |
|
|
//查询正常状态的居民 并回显 残疾状态
|
|
|
//查询正常状态的居民 并回显 残疾状态
|
|
|
formDTO.setCategoryColumn("IS_CJ"); |
|
|
formDTO.setCategoryColumn("IS_CJ"); |
|
|
dbResiList = getNatUserInfoFromDb(formDTO, anEnum, pageNo, pageSize); |
|
|
dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); |
|
|
canJi(dbResiList); |
|
|
canJi(dbResiList); |
|
|
break; |
|
|
break; |
|
|
case SI_WANG: |
|
|
case SI_WANG: |
|
|
//查询正常状态的居民
|
|
|
//查询正常状态的居民
|
|
|
dbResiList = getNatUserInfoFromDb(formDTO, anEnum, pageNo, pageSize); |
|
|
dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); |
|
|
siWang(dbResiList); |
|
|
siWang(dbResiList); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
log.warn("没有要处理的数据"); |
|
|
log.warn("没有要处理的数据"); |
|
|
} |
|
|
} |
|
|
pageNo++; |
|
|
pageNo++; |
|
|
} while (dbResiList != null && dbResiList.size() == pageSize); |
|
|
} while (false);//todo fangkaita(dbResiList != null && dbResiList.size() == pageSize);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void siWang(List<NatUserInfoResultDTO> dbResiList) { |
|
|
private void siWang(List<NatUserInfoResultDTO> dbResiList) { |
|
|
|
|
|
try { |
|
|
List<DataSyncRecordDeathEntity> list = new ArrayList<>(); |
|
|
List<DataSyncRecordDeathEntity> list = new ArrayList<>(); |
|
|
for (NatUserInfoResultDTO dbResi : dbResiList) { |
|
|
for (NatUserInfoResultDTO dbResi : dbResiList) { |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); |
|
@ -255,7 +256,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DataSyncRecordDeathEntity entity = new DataSyncRecordDeathEntity(); |
|
|
DataSyncRecordDeathEntity entity = new DataSyncRecordDeathEntity(); |
|
|
|
|
|
if (dbDeathEntity != null && StringUtils.isNotBlank(dbDeathEntity.getId())) { |
|
|
entity.setId(dbDeathEntity.getId()); |
|
|
entity.setId(dbDeathEntity.getId()); |
|
|
|
|
|
} |
|
|
entity.setCustomerId(dbResi.getCustomerId()); |
|
|
entity.setCustomerId(dbResi.getCustomerId()); |
|
|
entity.setAgencyId(dbResi.getAgencyId()); |
|
|
entity.setAgencyId(dbResi.getAgencyId()); |
|
|
entity.setPids(dbResi.getPids()); |
|
|
entity.setPids(dbResi.getPids()); |
|
@ -263,7 +266,8 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setName(dbResi.getName()); |
|
|
entity.setName(dbResi.getName()); |
|
|
entity.setIdCard(dbResi.getIdCard()); |
|
|
entity.setIdCard(dbResi.getIdCard()); |
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
|
|
|
//死亡未获取到数据
|
|
|
|
|
|
if (thirdResultObject != null) { |
|
|
entity.setAge(thirdResultObject.getString("AGE")); |
|
|
entity.setAge(thirdResultObject.getString("AGE")); |
|
|
entity.setAddress(thirdResultObject.getString("FAMILY_ADD")); |
|
|
entity.setAddress(thirdResultObject.getString("FAMILY_ADD")); |
|
|
entity.setDeathDate(thirdResultObject.getString("DEATH_DATE")); |
|
|
entity.setDeathDate(thirdResultObject.getString("DEATH_DATE")); |
|
@ -272,18 +276,24 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setOrganName(thirdResultObject.getString("CREATE_ORGAN_NAME")); |
|
|
entity.setOrganName(thirdResultObject.getString("CREATE_ORGAN_NAME")); |
|
|
entity.setNation(thirdResultObject.getString("NATION")); |
|
|
entity.setNation(thirdResultObject.getString("NATION")); |
|
|
entity.setThirdRecordId(thirdResultObject.getString("RECORD_ID")); |
|
|
entity.setThirdRecordId(thirdResultObject.getString("RECORD_ID")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
entity.setDealStatus(NumConstant.ZERO); |
|
|
entity.setDealStatus(NumConstant.ZERO); |
|
|
entity.setDealResult(StrConstant.EPMETY_STR); |
|
|
entity.setDealResult(StrConstant.EPMETY_STR); |
|
|
if (judgeDealStatus.isNeedSetStatus) { |
|
|
if (judgeDealStatus.isNeedSetStatus) { |
|
|
entity.setDealResult(judgeDealStatus.dealResult); |
|
|
entity.setDealResult(judgeDealStatus.dealResult); |
|
|
entity.setDealStatus(judgeDealStatus.dealStatus); |
|
|
entity.setDealStatus(judgeDealStatus.dealStatus); |
|
|
} |
|
|
} |
|
|
|
|
|
entity.setUpdatedTime(new Date()); |
|
|
list.add(entity); |
|
|
list.add(entity); |
|
|
} |
|
|
} |
|
|
if (list.size() == NumConstant.ZERO) { |
|
|
if (list.size() == NumConstant.ZERO) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
dataSyncRecordDeathService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); |
|
|
dataSyncRecordDeathService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("siwang exception", e); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -295,13 +305,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
* @param pageSize |
|
|
* @param pageSize |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
private List<NatUserInfoResultDTO> getNatUserInfoFromDb(DataSyncTaskParam formDTO, DataSyncEnum anEnum, int pageNo, int pageSize) { |
|
|
private List<NatUserInfoResultDTO> getNatUserInfoFromDb(DataSyncTaskParam formDTO, int pageNo, int pageSize) { |
|
|
//根据 组织 分页获取 居民数据
|
|
|
//根据 组织 分页获取 居民数据
|
|
|
PageInfo<NatUserInfoResultDTO> pageInfo = PageHelper.startPage(pageNo, pageSize, false) |
|
|
PageInfo<NatUserInfoResultDTO> pageInfo = PageHelper.startPage(pageNo, pageSize, false) |
|
|
.doSelectPageInfo(() -> baseDao.getIdCardsByScope(formDTO)); |
|
|
.doSelectPageInfo(() -> baseDao.getIdCardsByScope(formDTO)); |
|
|
List<NatUserInfoResultDTO> dbResiList; |
|
|
List<NatUserInfoResultDTO> dbResiList; |
|
|
dbResiList = pageInfo.getList(); |
|
|
dbResiList = pageInfo.getList(); |
|
|
//如果传了身份证号 则按照身份证号查询 并同步记录, userId如果为空则是 手动录入的 此人没有录入居民库 但是也可以同步
|
|
|
/* //如果传了身份证号 则按照身份证号查询 并同步记录, userId如果为空则是 手动录入的 此人没有录入居民库 但是也可以同步
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getIdCards()) && DataSyncEnum.HE_SUAN.getCode().equals(anEnum.getCode())) { |
|
|
if (CollectionUtils.isNotEmpty(formDTO.getIdCards()) && DataSyncEnum.HE_SUAN.getCode().equals(anEnum.getCode())) { |
|
|
List<NatUserInfoResultDTO> collect = formDTO.getIdCards().stream().map(id -> { |
|
|
List<NatUserInfoResultDTO> collect = formDTO.getIdCards().stream().map(id -> { |
|
|
NatUserInfoResultDTO e = new NatUserInfoResultDTO(); |
|
|
NatUserInfoResultDTO e = new NatUserInfoResultDTO(); |
|
@ -314,11 +324,12 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
dbResiList.stream().filter(u -> u.getIdCard().equals(c.getIdCard())).forEach(u -> c.setUserId(u.getUserId())); |
|
|
dbResiList.stream().filter(u -> u.getIdCard().equals(c.getIdCard())).forEach(u -> c.setUserId(u.getUserId())); |
|
|
} |
|
|
} |
|
|
dbResiList = collect; |
|
|
dbResiList = collect; |
|
|
} |
|
|
}*/ |
|
|
return dbResiList; |
|
|
return dbResiList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void canJi(List<NatUserInfoResultDTO> resiList) { |
|
|
private void canJi(List<NatUserInfoResultDTO> resiList) { |
|
|
|
|
|
try { |
|
|
List<DataSyncRecordDisabilityEntity> list = new ArrayList<>(); |
|
|
List<DataSyncRecordDisabilityEntity> list = new ArrayList<>(); |
|
|
for (NatUserInfoResultDTO dbResi : resiList) { |
|
|
for (NatUserInfoResultDTO dbResi : resiList) { |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.canji(dbResi.getIdCard(), dbResi.getName()); |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.canji(dbResi.getIdCard(), dbResi.getName()); |
|
@ -336,7 +347,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataSyncRecordDisabilityEntity entity = new DataSyncRecordDisabilityEntity(); |
|
|
DataSyncRecordDisabilityEntity entity = new DataSyncRecordDisabilityEntity(); |
|
|
|
|
|
if (dbDisablityEntity != null && StringUtils.isNotBlank(dbDisablityEntity.getId())) { |
|
|
entity.setId(dbDisablityEntity.getId()); |
|
|
entity.setId(dbDisablityEntity.getId()); |
|
|
|
|
|
} |
|
|
//居民库里 是否是残疾
|
|
|
//居民库里 是否是残疾
|
|
|
String categoryColumn = dbResi.getCategoryColumn(); |
|
|
String categoryColumn = dbResi.getCategoryColumn(); |
|
|
|
|
|
|
|
@ -381,18 +394,28 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setPids(dbResi.getPids()); |
|
|
entity.setPids(dbResi.getPids()); |
|
|
entity.setGridId(dbResi.getGridId()); |
|
|
entity.setGridId(dbResi.getGridId()); |
|
|
entity.setName(dbResi.getName()); |
|
|
entity.setName(dbResi.getName()); |
|
|
entity.setIdCard(thirdResultObject.getString("citizenId")); |
|
|
entity.setIdCard(dbResi.getIdCard()); |
|
|
entity.setMobile(thirdResultObject.getString("phoneNo")); |
|
|
|
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
|
|
|
if (thirdResultObject != null){ |
|
|
|
|
|
entity.setMobile(thirdResultObject.getString("phoneNo")); |
|
|
entity.setCardNum(thirdResultObject.getString("cardNum")); |
|
|
entity.setCardNum(thirdResultObject.getString("cardNum")); |
|
|
|
|
|
|
|
|
entity.setCjzk(thirdResultObject.getString("idtLevelName")); |
|
|
entity.setCjzk(thirdResultObject.getString("idtLevelName")); |
|
|
entity.setCjlb(thirdResultObject.getString("idtKindName")); |
|
|
entity.setCjlb(thirdResultObject.getString("idtKindName")); |
|
|
|
|
|
|
|
|
entity.setEduLevel(thirdResultObject.getString("eduLevelName")); |
|
|
entity.setEduLevel(thirdResultObject.getString("eduLevelName")); |
|
|
entity.setMaritalStatus(thirdResultObject.getString("marriagerName")); |
|
|
entity.setMaritalStatusName(thirdResultObject.getString("marriagerName")); |
|
|
entity.setGuardian(thirdResultObject.getString("guardian")); |
|
|
entity.setGuardian(thirdResultObject.getString("guardian")); |
|
|
entity.setGuardianPhone(thirdResultObject.getString("guardianPhone")); |
|
|
entity.setGuardianPhone(thirdResultObject.getString("guardianPhone")); |
|
|
|
|
|
entity.setMzCn(thirdResultObject.getString("raceName")); |
|
|
|
|
|
String genderName = thirdResultObject.getString("genderName"); |
|
|
|
|
|
if (GenderEnum.MAN.getName().equals(genderName)){ |
|
|
|
|
|
entity.setGender(NumConstant.ONE); |
|
|
|
|
|
}else { |
|
|
|
|
|
entity.setGender(NumConstant.TWO); |
|
|
|
|
|
} |
|
|
|
|
|
entity.setResidentAdd(thirdResultObject.getString("residentAdd")); |
|
|
|
|
|
entity.setNowAdd(thirdResultObject.getString("nowAdd")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
entity.setDealStatus(NumConstant.ZERO); |
|
|
entity.setDealStatus(NumConstant.ZERO); |
|
|
entity.setDisabilityStatus(disabilityStatus); |
|
|
entity.setDisabilityStatus(disabilityStatus); |
|
|
entity.setDealResult(StrConstant.EPMETY_STR); |
|
|
entity.setDealResult(StrConstant.EPMETY_STR); |
|
@ -400,9 +423,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setDealResult(judgeDealStatus.getDealResult()); |
|
|
entity.setDealResult(judgeDealStatus.getDealResult()); |
|
|
entity.setDealStatus(judgeDealStatus.getDealStatus()); |
|
|
entity.setDealStatus(judgeDealStatus.getDealStatus()); |
|
|
} |
|
|
} |
|
|
|
|
|
entity.setUpdatedTime(new Date()); |
|
|
list.add(entity); |
|
|
list.add(entity); |
|
|
} |
|
|
} |
|
|
dataSyncRecordDisabilityService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); |
|
|
dataSyncRecordDisabilityService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("canJi exception", e); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -414,7 +441,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2022/9/27 11:08 |
|
|
* @date 2022/9/27 11:08 |
|
|
*/ |
|
|
*/ |
|
|
private void hsjc(List<NatUserInfoResultDTO> idCards, String customerId) { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void hsjc(List<NatUserInfoResultDTO> idCards, String customerId) { |
|
|
|
|
|
try { |
|
|
List<IcNatEntity> entities = new ArrayList<>(); |
|
|
List<IcNatEntity> entities = new ArrayList<>(); |
|
|
idCards.forEach(idCard -> { |
|
|
idCards.forEach(idCard -> { |
|
|
YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); |
|
|
YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); |
|
@ -429,7 +458,12 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); |
|
|
e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); |
|
|
e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); |
|
|
e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); |
|
|
e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); |
|
|
e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); |
|
|
e.setNatResult(natInfo.getSample_result_pcr()); |
|
|
String resultPcr = natInfo.getSample_result_pcr(); |
|
|
|
|
|
//检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性
|
|
|
|
|
|
e.setNatResult(NumConstant.ZERO_STR); |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(resultPcr)){ |
|
|
|
|
|
e.setNatResult(NumConstant.ONE_STR); |
|
|
|
|
|
} |
|
|
e.setNatAddress(natInfo.getSampling_org_pcr()); |
|
|
e.setNatAddress(natInfo.getSampling_org_pcr()); |
|
|
e.setAgencyId(idCard.getAgencyId()); |
|
|
e.setAgencyId(idCard.getAgencyId()); |
|
|
e.setPids(idCard.getPids()); |
|
|
e.setPids(idCard.getPids()); |
|
@ -444,13 +478,11 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); |
|
|
entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); |
|
|
Map<Boolean, List<IcNatEntity>> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); |
|
|
Map<Boolean, List<IcNatEntity>> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); |
|
|
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { |
|
|
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { |
|
|
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(false), 500)) { |
|
|
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { |
|
|
icNatService.insertBatch(icNatEntities); |
|
|
icNatService.insertBatch(icNatEntities); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//组织关系表
|
|
|
//组织关系表
|
|
|
List<IcNatRelationEntity> relationEntities = new ArrayList<>(); |
|
|
List<IcNatRelationEntity> relationEntities = new ArrayList<>(); |
|
|
entities.forEach(ne -> { |
|
|
icNatEntities.forEach(ne -> { |
|
|
// 不是居民的先不加关系表吧
|
|
|
// 不是居民的先不加关系表吧
|
|
|
if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { |
|
|
if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { |
|
|
IcNatRelationEntity e = new IcNatRelationEntity(); |
|
|
IcNatRelationEntity e = new IcNatRelationEntity(); |
|
@ -463,13 +495,17 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
if (CollectionUtils.isNotEmpty(relationEntities)) { |
|
|
if (CollectionUtils.isNotEmpty(relationEntities)) { |
|
|
for (List<IcNatRelationEntity> icNatRelationEntities : ListUtils.partition(relationEntities, 500)) { |
|
|
icNatRelationService.insertBatch(relationEntities); |
|
|
icNatRelationService.insertBatch(icNatRelationEntities); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("hsjc exception", e); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private class JudgeDealStatus { |
|
|
private class JudgeDealStatus { |
|
|
private boolean isNext; |
|
|
private boolean isNext; |
|
|