|
@ -1,4 +1,9 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.time.Period; |
|
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
@ -667,9 +672,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
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) { |
|
|
|
|
|
try { |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); |
|
|
if (200 != thirdResult.getCode()) { |
|
|
if (200 != thirdResult.getCode()) { |
|
|
log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); |
|
|
log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); |
|
@ -705,13 +710,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
entity.setIcResiUserId(dbResi.getUserId()); |
|
|
//死亡未获取到数据
|
|
|
//死亡未获取到数据
|
|
|
if (thirdResultObject != null) { |
|
|
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("issueDate")); |
|
|
entity.setDeathDate(thirdResultObject.getString("issueDate")); |
|
|
// entity.setCremationTime(thirdResultObject.getString("CREMATION_TIME"));
|
|
|
// entity.setCremationTime(thirdResultObject.getString("CREMATION_TIME"));
|
|
|
// entity.setMz(thirdResultObject.getString("FAMILY_ADD"));
|
|
|
// entity.setMz(thirdResultObject.getString("FAMILY_ADD"));
|
|
|
// 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("certificateID")); |
|
|
entity.setThirdRecordId(thirdResultObject.getString("certificateID")); |
|
|
JSONArray jsonArray = thirdResultObject.getJSONArray("surface"); |
|
|
JSONArray jsonArray = thirdResultObject.getJSONArray("surface"); |
|
|
if (jsonArray!=null && jsonArray.size()>0){ |
|
|
if (jsonArray!=null && jsonArray.size()>0){ |
|
@ -720,6 +725,16 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
if (jsonObject.get("name").equals("户籍地址")){ |
|
|
if (jsonObject.get("name").equals("户籍地址")){ |
|
|
entity.setAddress(jsonObject.get("value").toString()); |
|
|
entity.setAddress(jsonObject.get("value").toString()); |
|
|
} |
|
|
} |
|
|
|
|
|
if (jsonObject.get("name").equals("年龄")){ |
|
|
|
|
|
if (jsonObject.get("value")!=null && !jsonObject.get("value").equals("")){ |
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); |
|
|
|
|
|
LocalDateTime localBirthDate = LocalDateTime.parse(jsonObject.get("value").toString(), formatter); |
|
|
|
|
|
LocalDateTime dateTime = LocalDateTime.parse(thirdResultObject.getString("issueDate"), formatter); |
|
|
|
|
|
LocalDate localDate = dateTime.toLocalDate(); |
|
|
|
|
|
Period period = Period.between(localBirthDate.toLocalDate(), localDate); |
|
|
|
|
|
entity.setAge(String.valueOf(period.getYears())); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -732,22 +747,24 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setDealStatus(judgeDealStatus.dealStatus); |
|
|
entity.setDealStatus(judgeDealStatus.dealStatus); |
|
|
} |
|
|
} |
|
|
entity.setUpdatedTime(new Date()); |
|
|
entity.setUpdatedTime(new Date()); |
|
|
// list.add(entity);
|
|
|
// list.add(entity);
|
|
|
dataSyncRecordDeathService.saveOrUpdate(entity); |
|
|
dataSyncRecordDeathService.saveOrUpdate(entity); |
|
|
} |
|
|
|
|
|
if (list.size() == NumConstant.ZERO) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
// dataSyncRecordDeathService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED);
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error("siwang exception", e); |
|
|
log.error("siwang exception", e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/* if (list.size() == NumConstant.ZERO) { |
|
|
|
|
|
return; |
|
|
|
|
|
}*/ |
|
|
|
|
|
// dataSyncRecordDeathService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED);
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void hunYin(List<NatUserInfoResultDTO> dbResiList) { |
|
|
private void hunYin(List<NatUserInfoResultDTO> dbResiList) { |
|
|
try { |
|
|
|
|
|
List<DataSyncRecordMaritalEntity> list = new ArrayList<>(); |
|
|
// List<DataSyncRecordMaritalEntity> list = new ArrayList<>();
|
|
|
for (NatUserInfoResultDTO dbResi : dbResiList) { |
|
|
for (NatUserInfoResultDTO dbResi : dbResiList) { |
|
|
|
|
|
try { |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.hunYin(dbResi.getIdCard(), dbResi.getName()); |
|
|
YtDataSyncResDTO thirdResult = YtHsResUtils.hunYin(dbResi.getIdCard(), dbResi.getName()); |
|
|
if (200 != thirdResult.getCode()) { |
|
|
if (200 != thirdResult.getCode()) { |
|
|
log.warn("hunyin 调用蓝图接口失败了 继续处理下一个人"); |
|
|
log.warn("hunyin 调用蓝图接口失败了 继续处理下一个人"); |
|
@ -798,15 +815,15 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
entity.setUpdatedTime(new Date()); |
|
|
entity.setUpdatedTime(new Date()); |
|
|
// list.add(entity);
|
|
|
// list.add(entity);
|
|
|
dataSyncRecordMaritalService.saveOrUpdate(entity); |
|
|
dataSyncRecordMaritalService.saveOrUpdate(entity); |
|
|
} |
|
|
|
|
|
if (list.size() == NumConstant.ZERO) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
// dataSyncRecordMaritalService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED);
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error("hunyin exception", e); |
|
|
log.error("hunyin exception", e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/* if (list.size() == NumConstant.ZERO) { |
|
|
|
|
|
return; |
|
|
|
|
|
}*/ |
|
|
|
|
|
// dataSyncRecordMaritalService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED);
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* desc:从数据库获取居民信息 |
|
|
* desc:从数据库获取居民信息 |
|
|