| 
					
				 | 
			
			
				@@ -70,6 +70,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String outFile=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String outFilet=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<WorkerCertGree> wcgs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,String> wcgids = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 提取品牌信息 用于多品牌数据同步目前仅格力,可以先不用做 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Brand brand = baseService.getBrand(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -77,6 +78,16 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCertGree> wcgsold = workerCertGreeService.lambdaQuery().list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (CollectionUtils.isNotEmpty(wcgsold)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wcgsold.stream().forEach(event->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wcgids.put(event.getWorkerId() + event.getBrandWebsitId() + event.getCertName(),event.getWorkerCertGreeId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wcgsold.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 获取待同步到格力总部师傅的证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // recs = getWorkerUploads(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -154,7 +165,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 网点上传成功 生成对像 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (upf){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        getWorkerCertGreeInfo(outFile, outFilet, wcgs, item, wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        getWorkerCertGreeInfo(outFile, outFilet, wcgs, item, wdno, wcgids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 上传完后师傅所在网点的证件保存,并写入更新表待师傅证件修改 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -192,7 +203,8 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void getWorkerCertGreeInfo(String outFile, String outFilet, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                                       List<WorkerCertGree> wcgs, WorkerCert item, WorkerBrandAccount wdno) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                       List<WorkerCertGree> wcgs, WorkerCert item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                       WorkerBrandAccount wdno, Map<String,String> wcgids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WorkerCertGree  awc = new WorkerCertGree(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         awc.setWorkerCertGreeId(IdWorker.getIdStr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         awc.setWorkerId(wdno.getWorkerId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -211,11 +223,11 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         setCertFlag(item.getCertName(), awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 存在进行修改 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        setWorkerCertGreeId(wdno, awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setWorkerCertGreeId(wdno, awc, wcgids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         wcgs.add(awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void setWorkerCertGreeId(WorkerBrandAccount wdno, WorkerCertGree awc) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void setWorkerCertGreeIdbak(WorkerBrandAccount wdno, WorkerCertGree awc) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WorkerCertGree wcg = workerCertGreeService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(WorkerCertGree::getWorkerId, wdno.getWorkerId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(WorkerCertGree::getBrandWebsitId, wdno.getBrandWebsitId()) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -226,6 +238,14 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void setWorkerCertGreeId(WorkerBrandAccount wdno, WorkerCertGree awc, Map<String,String> wcgids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (wcgids.containsKey(awc.getWorkerId() + awc.getBrandWebsitId() + awc.getCertName())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            awc.setWorkerCertGreeId(wcgids.get(awc.getWorkerId() + awc.getBrandWebsitId() + awc.getCertName())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wcgids.put(awc.getWorkerId() + awc.getBrandWebsitId() + awc.getCertName(),awc.getWorkerCertGreeId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void setCertFlag(String certName, WorkerCertGree awc) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ("身份证".equals(certName)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             awc.setCertFlag(1); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -251,6 +271,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String filet =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String fid3 = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Integer count = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,String> wcgids = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 提取品牌信息 用于多品牌数据同步目前仅格力,可以先不用做 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Brand brand = baseService.getBrand(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -258,6 +279,14 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCertGree> wcgsold = workerCertGreeService.lambdaQuery().list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (CollectionUtils.isNotEmpty(wcgsold)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wcgsold.stream().forEach(event->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wcgids.put(event.getWorkerId() + event.getBrandWebsitId() + event.getCertName(),event.getWorkerCertGreeId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wcgsold.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 获取待同步到格力总部师傅的保除证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // wws = getWorkerUploadsBx(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -317,7 +346,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 生成网点保险数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    getWorkerCertGree(wcgs, item, wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    getWorkerCertGree(wcgs, item, wdno, wcgids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 保存本地表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 extractedBxEnd(wcgs, item); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -335,7 +364,8 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void getWorkerCertGree(List<WorkerCertGree> wcgs, WebsitWorker item, WorkerBrandAccount wdno) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getWorkerCertGree(List<WorkerCertGree> wcgs, WebsitWorker item, WorkerBrandAccount wdno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                   Map<String,String> wcgids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WorkerCertGree  awc = new WorkerCertGree(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         awc.setWorkerCertGreeId(IdWorker.getIdStr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         awc.setWorkerId(wdno.getWorkerId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -350,7 +380,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         awc.setSafeCompany("人保"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         setCertFlag("保险证", awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 存在进行修改 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        setWorkerCertGreeId(wdno, awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setWorkerCertGreeId(wdno, awc, wcgids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         wcgs.add(awc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |