| 
						
						
						
					 | 
				
				 | 
				
					@ -1,5 +1,4 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.service.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.FieldConstant; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -25,8 +24,10 @@ import com.epmet.dto.result.NatUserInfoResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.DataSyncConfigEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.DataSyncScopeEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.IcNatEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.IcNatRelationEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.DataSyncConfigService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.DataSyncScopeService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.IcNatRelationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.IcNatService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -57,6 +58,8 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcNatDao icNatDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcNatService icNatService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcNatRelationService icNatRelationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private QueryWrapper<DataSyncConfigEntity> getWrapper(Map<String, Object> params){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -226,6 +229,8 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(),DateUtils.DATE_TIME_PATTERN)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setNatResult(natInfo.getSample_result_pcr()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setNatAddress(natInfo.getSampling_org_pcr()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setAgencyId(idCard.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setPids(idCard.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        entities.add(e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -237,6 +242,23 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isNotEmpty(groupByStatus.get(false))){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    icNatService.insertBatch(groupByStatus.get(false)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //组织关系表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<IcNatRelationEntity> relationEntities = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                entities.forEach(ne -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    // 不是居民的先不加关系表吧
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (ne.getIsResiUser().equals(NumConstant.ONE_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        IcNatRelationEntity e = new IcNatRelationEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setAgencyId(ne.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setPids(ne.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setIcNatId(ne.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        e.setUserType("sync"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        relationEntities.add(e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isNotEmpty(relationEntities)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    icNatRelationService.insertBatch(relationEntities); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |