| 
					
				 | 
			
			
				@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.toolkit.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.fasterxml.jackson.core.JsonProcessingException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fasterxml.jackson.databind.ObjectMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.base.BaseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.base.WorkerCertificateInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.constant.DictTypeEnum; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -15,10 +14,10 @@ import com.zfire.jiasm.syncdata.plus.service.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.request.SignSplb; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.request.WorkUploadInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.request.ZJInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.response.ResultData; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.response.WebsitQXLB; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.response.WorkerUploadResponse; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.extern.slf4j.Slf4j; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.jetbrains.annotations.NotNull; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jetbrains.annotations.Nullable; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.scheduling.annotation.Scheduled; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Component; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -67,9 +66,9 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Scheduled(fixedDelay = 1 * 60 * 1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void uploadWorkProcess() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /*if (1==1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (1==1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<OutWorkerUpload> recs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Worker worker = new Worker(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -77,6 +76,9 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WorkerStreet workerStreet = new WorkerStreet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<SignSplb> jySignSplbList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<SignSplb> sySignSplbList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SignSplb> jyList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SignSplb> syList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WebsitQXLB  websitqypl = new WebsitQXLB(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String wxgaddapi = "/outapp/wxg/add"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String wdqyapi = "/outapp/wxg/base"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -119,7 +121,7 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 提取师傅证件信息,未同时不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 提取师傅证件信息,未同步时不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (getCertificateInfo(workerCertificateInfo, worker.getWorkerId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -135,20 +137,35 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 获取网点签约品类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 生成数据对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            getreq(workerCertificateInfo, jySignSplbList, sySignSplbList, req, worker, workerStreet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getreq(workerCertificateInfo, req, worker, workerStreet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 按网点同步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 该网点未签约家用品类,工程师不能签约家用品类 todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (WorkerBrandAccount dot: workerBrandAccount){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //网点未签约品类时该网点师傅信息不同步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                GreeResponseHelper response = getwdqylbxx(wdqyapi,dot.getBrandWebsitNumber()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (response.getStatus() == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 获取网点签约的品类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    websitqypl = JSONObject.parseObject(response.getData().toString(), WebsitQXLB.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 写入表备注信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    updateWorkerUploadLag(item,"获取网点签约的品类信息失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 从网点签约的品类信息中过滤师傅的品类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                extracted(jySignSplbList, sySignSplbList, jyList, syList, websitqypl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                getwdqylbxx(wdqyapi,dot.getBrandWebsitNumber()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (1==1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 过滤后无品类,不能上传 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (jyList.size()<1 && syList.size()<1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 写入表备注信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    updateWorkerUploadLag(item,"师傅签约品类过滤后不能同时为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 按网点过滤师傅的类别信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                req.setJySignSplbList(jyList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                req.setSySignSplbList(syList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 服务人员编号(不填值为新增,填值为修改) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -163,6 +180,9 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 同步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 syncData(dot.getId(), wxgaddapi, item, req); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                jyList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                syList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -170,6 +190,55 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void extracted(List<SignSplb> jySignSplbList, List<SignSplb> sySignSplbList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                           List<SignSplb> jyList, List<SignSplb> syList, WebsitQXLB websitqypl) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> syfwlbList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> jyfwlbList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 过滤商用品类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (websitqypl.getSySignSplbList().size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 大类名称 取交集 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            websitqypl.getSySignSplbList().get(0).getFwlbList().retainAll(sySignSplbList.get(0).getFwlbList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            syfwlbList.addAll(websitqypl.getSySignSplbList().get(0).getFwlbList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 品类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (SignSplb sy : sySignSplbList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for (SignSplb wdsy: websitqypl.getSySignSplbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (wdsy.getSpdl().equals(sy.getSpdl()) && wdsy.getSpxl().equals(sy.getSpxl())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        SignSplb one = new SignSplb(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setFwlbList(syfwlbList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpdl(wdsy.getSpdl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpdlName(wdsy.getSpdlName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpxl(wdsy.getSpxl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpxlName(wdsy.getSpxlName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        syList.add(one); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 过滤家用品类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (websitqypl.getJySignSplbList().size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 大类名称 取交集 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            websitqypl.getJySignSplbList().get(0).getFwlbList().retainAll(jySignSplbList.get(0).getFwlbList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            jyfwlbList.addAll(websitqypl.getJySignSplbList().get(0).getFwlbList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 品类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (SignSplb sy : jySignSplbList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for (SignSplb wdjy: websitqypl.getJySignSplbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (wdjy.getSpdl().equals(sy.getSpdl()) && wdjy.getSpxl().equals(sy.getSpxl())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        SignSplb one = new SignSplb(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setFwlbList(syfwlbList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpdl(wdjy.getSpdl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpdlName(wdjy.getSpdlName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpxl(wdjy.getSpxl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        one.setSpxlName(wdjy.getSpxlName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        jyList.add(one); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private Boolean checkNecessary(Worker worker, OutWorkerUpload item, WorkerCertificateInfo workerCertificateInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Boolean flag = Boolean.FALSE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (StringUtils.isEmpty(workerCertificateInfo.getSfzbh())){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -435,22 +504,12 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 获取网点签约的品类信息 并过滤师傅的品类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void getwdqylbxx(String apiPath, String wdno) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private GreeResponseHelper getwdqylbxx(String apiPath, String wdno) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String,String> req = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         req.put("wdno",wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         GreeResponseHelper response = greeLogic.greePost(apiPath, JSONObject.toJSONString(req), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (response.getStatus() == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 获取网点签约的品类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            WebsitQXLB res = JSONObject.parseObject(response.getData().toString(), WebsitQXLB.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 失败 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return response; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -503,7 +562,6 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void getreq(WorkerCertificateInfo workerCertificateInfo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        List<SignSplb> jySignSplbList, List<SignSplb> sySignSplbList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         WorkUploadInfo req, Worker worker, WorkerStreet workerStreet) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<ZJInfo> zjInfoList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -511,7 +569,7 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         getcert(workerCertificateInfo, zjInfoList, worker); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 生成数据对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        setReq(zjInfoList, jySignSplbList, sySignSplbList, req, worker); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setReq(zjInfoList, req, worker); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 省份-城市-区县-乡镇 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         extractedPCAS(req, workerStreet); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -536,11 +594,9 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void setReq(List<ZJInfo> zjInfoList, List<SignSplb> jySignSplbList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        List<SignSplb> sySignSplbList,WorkUploadInfo req, Worker worker) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void setReq(List<ZJInfo> zjInfoList, WorkUploadInfo req, Worker worker) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.setJySignSplbList(jySignSplbList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.setSySignSplbList(sySignSplbList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         req.setZjInfoList(zjInfoList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         req.setCsgzns(worker.getJobAge()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -627,8 +683,8 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (StringUtils.isNotEmpty(worker.getMobile())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             req.setYddh(worker.getMobile()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.setYxcjgcjgdl(worker.getCollectEnginLimitNum()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.setYxcjgdl(worker.getCollectLimitNum()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.setMaxwxnum(worker.getRepairDayLimit()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.setMaxaznum(worker.getDayOrderNum()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void getcert(WorkerCertificateInfo workerCertificateInfo, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -797,26 +853,23 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private Boolean getCategory(Brand brand, List<SignSplb> jySignSplbList, List<SignSplb> sySignSplbList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                              Worker worker, OutWorkerUpload itemi) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<String> SYDictCode = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> SYDictDaleiCode = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 提取所有的商用大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取品牌商所有的商用大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<SysDict> sysDicts = sysDictService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(SysDict::getDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(SysDict::getFlag, DictTypeEnum.DICT_TYPE_FLAG_SY.getCode()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sysDicts !=null && sysDicts.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            SYDictCode = sysDicts.stream().map(SysDict::getDictCode).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SYDictDaleiCode = sysDicts.stream().map(SysDict::getDictCode).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 差网点对应的类别信息,师傅的类别信息需要网点的类别信息内 todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 差服务类目的同步数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 提取师傅的服务大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<WorkerServiceCategoryDetail> categoryRecs = workerServiceCategoryDetailService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerServiceCategoryDetail> wxgCategoryRecs = workerServiceCategoryDetailService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(WorkerServiceCategoryDetail::getWorkerId, worker.getWorkerId()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 组装类别参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (categoryRecs !=null && categoryRecs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            getCategory(brand, jySignSplbList, sySignSplbList, SYDictCode, categoryRecs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (wxgCategoryRecs !=null && wxgCategoryRecs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getCategory(brand, jySignSplbList, sySignSplbList, SYDictDaleiCode, wxgCategoryRecs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (jySignSplbList.size()<1 && sySignSplbList.size()<1){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -832,13 +885,14 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 师傅的服务类型分,安装、维修、配送等 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 格力网点答约的服务类目也要限制师傅的品数参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void getCategory(Brand brand, List<SignSplb> jySignSplbList, List<SignSplb> sySignSplbList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                             List<String> SYDictCode, List<WorkerServiceCategoryDetail> categoryRecs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                             List<String> SYDictDaleiCode, List<WorkerServiceCategoryDetail> wxgCategoryRecs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<SysDictRef> sysDictRefs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 这里需要按师傅的服务类型分,安装、维修、配送等分别组装参数 这里做 for todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 组装参数类别名称信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> fwlbList = getCategoryName(wxgCategoryRecs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 获取师傅在品牌商品对应的类别信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        getDictRefs(brand, categoryRecs, sysDictRefs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getDictRefs(brand, wxgCategoryRecs, sysDictRefs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 组关品类参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (SysDictRef item:sysDictRefs){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -848,7 +902,7 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .eq(SysDict::getDictType, DictTypeEnum.DICT_TYPE_SMALL_TYPE.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .eq(SysDict::getParentDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .eq(SysDict::getStatus, DictTypeEnum.DICT_TYPE_ON.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    .eq(SysDict::getDictCode, "120300") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // .eq(SysDict::getDictCode, "120300") 测试用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .eq(SysDict::getParentDictCode, item.getRefDictCode()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (categorys !=null && categorys.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (SysDict category :categorys){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -857,10 +911,9 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     v.setSpdlName(item.getRefDictName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     v.setSpxl(Integer.valueOf(category.getDictCode())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     v.setSpxlName(category.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    // 对应格力品牌商的服务类目需对应  todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    v.getFwlbList().add("安装"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    v.setFwlbList(fwlbList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 查看是否为商用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (SYDictCode.contains(item.getDictCode())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (SYDictDaleiCode.contains(item.getDictCode())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         sySignSplbList.add(v); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         jySignSplbList.add(v); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -870,14 +923,36 @@ public class UploadWorkerTOGreeTask { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private void getDictRefs(Brand brand, List<WorkerServiceCategoryDetail> categoryRecs, List<SysDictRef> sysDictRefs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<String> caregoryIds = categoryRecs.stream().map(WorkerServiceCategoryDetail::getMainId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @NotNull 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private List<String> getCategoryName(List<WorkerServiceCategoryDetail> wxgCategoryRecs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 服务类型 INSTALL=安装 REPAIR=维修  DELIVERY=配送 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,String> serviceFwlbList = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (WorkerServiceCategoryDetail w: wxgCategoryRecs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (w.getType().equals("INSTALL")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                serviceFwlbList.put("INSTALL","安装"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (w.getType().equals("REPAIR")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                serviceFwlbList.put("REPAIR\"","维修"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (w.getType().equals("DELIVERY")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                serviceFwlbList.put("DELIVERY","配送"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> fwlbList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Set<String> keySet = serviceFwlbList.keySet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (String key : keySet){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String val = serviceFwlbList.get(key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            fwlbList.add(val); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return fwlbList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getDictRefs(Brand brand, List<WorkerServiceCategoryDetail> wxgCategoryRecs, List<SysDictRef> sysDictRefs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> wxgCaregoryIds = wxgCategoryRecs.stream().map(WorkerServiceCategoryDetail::getMainId).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 提取师傅所在品牌商对应的大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<SysDictRef> sysDictRefRecs =  sysDictRefService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(SysDictRef::getBrandId, brand.getBrandId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .eq(SysDictRef::getDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                .in(SysDictRef::getDictCode,caregoryIds).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .in(SysDictRef::getDictCode,wxgCaregoryIds).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // sysDictRefs 内的大类信息需去除无效的大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 提取品牌商所有无效的大类信息 
			 |