|
@ -32,6 +32,7 @@ import com.epmet.service.IcNatService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -223,14 +224,16 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); |
|
|
e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); |
|
|
e.setUserId(idCard.getUserId()); |
|
|
e.setUserId(idCard.getUserId()); |
|
|
e.setUserType("sync"); |
|
|
e.setUserType("sync"); |
|
|
e.setName(natInfo.getName()); |
|
|
e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); |
|
|
e.setMobile(natInfo.getTelephone()); |
|
|
e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); |
|
|
e.setIdCard(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()); |
|
|
e.setNatResult(natInfo.getSample_result_pcr()); |
|
|
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()); |
|
|
|
|
|
e.setAttachmentType(""); |
|
|
|
|
|
e.setAttachmentUrl(""); |
|
|
entities.add(e); |
|
|
entities.add(e); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -240,7 +243,9 @@ 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))){ |
|
|
icNatService.insertBatch(groupByStatus.get(false)); |
|
|
for (List<IcNatEntity> icNatEntities : ListUtils.partition(groupByStatus.get(false), 500)) { |
|
|
|
|
|
icNatService.insertBatch(icNatEntities); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//组织关系表
|
|
|
//组织关系表
|
|
|
List<IcNatRelationEntity> relationEntities = new ArrayList<>(); |
|
|
List<IcNatRelationEntity> relationEntities = new ArrayList<>(); |
|
@ -257,7 +262,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
if (CollectionUtils.isNotEmpty(relationEntities)){ |
|
|
if (CollectionUtils.isNotEmpty(relationEntities)){ |
|
|
icNatRelationService.insertBatch(relationEntities); |
|
|
for (List<IcNatRelationEntity> icNatRelationEntities : ListUtils.partition(relationEntities, 500)) { |
|
|
|
|
|
icNatRelationService.insertBatch(icNatRelationEntities); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|