| 
					
				 | 
			
			
				@@ -1,34 +1,42 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.zfire.jiasm.syncdata.download; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.IdWorker; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.toolkit.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.base.BaseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.constant.DictTypeEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.constant.ServiceCategoryEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.gree.GreeLogic; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.helper.GreeResponseHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.helper.GreeWxgHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.plus.entity.ItfTblWangdianWxgDownload; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.plus.service.ItfTblWangdianWxgDownloadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.response.ResultData; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.plus.entity.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.plus.service.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.request.SignSplb; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.zfire.jiasm.syncdata.request.ZJInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.response.WangdianWxgVos; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.zfire.jiasm.syncdata.response.WorkerUploadResponse; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.response.WxgQueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.zfire.jiasm.syncdata.utils.oss.OSSUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import lombok.extern.slf4j.Slf4j; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.scheduling.annotation.Scheduled; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Component; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import javax.annotation.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.HashMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.io.File; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.text.ParseException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 格力品牌网点维修工基础资料下载 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 格力品牌维修工图片信息同步到本地 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 扫描下载表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Slf4j 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Component 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 public class GLPPWXGQuery { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     String wdqyapi = "/outapp/wxg/list"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     BaseService baseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Resource 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -37,80 +45,633 @@ public class GLPPWXGQuery { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     OSSUtil ossUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ItfTblWangdianWxgDownloadService itfTblWangdianWxgDownloadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WorkerBrandAccountService workerBrandAccountService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WorkerCertService workerCertService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WorkerStreetService workerStreetService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ProvinceService provinceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    CityService cityService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    AreaService areaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    StreetService streetService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    BrandLbsRelateService brandLbsRelateService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WorkerServiceCategoryService workerServiceCategoryService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WorkerServiceCategoryDetailService workerServiceCategoryDetailService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    SysDictRefService sysDictRefService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resource 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    SysDictService sysDictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 按网点查询工程师信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 按网点查询工程师信息并同步-只处理新增(证件,师傅地理位置,师傅服务的类目) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Scheduled(fixedDelay = 1 * 60 * 1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void wxgQuery() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Scheduled(fixedDelay = 3 * 60 * 1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void wxgQueryAdd() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /*if (1==1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (1==1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WangdianWxgVos wvos = new WangdianWxgVos(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCert> updateList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCert> addList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,Object> req = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerServiceCategory> wscList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerServiceCategoryDetail> wscdList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerStreet> ws = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取品牌信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Brand brand = baseService.getBrand(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (brand == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String wdno = "S21A0020"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String wxgno = "S21A00200023"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // WxgQueryInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 字典表中查出ID 格力只有-家电售后 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysDict sysDict =  sysDictService.lambdaQuery(). 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                eq(SysDict::getDictType,ServiceCategoryEnum.DICT_TYPE_SERVICE_CATEGORY.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(SysDict::getDictValue,ServiceCategoryEnum.DICT_TYPE_SERVICE_CATEGORY.getText()).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (sysDict == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取现有的师傅数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<ItfTblWangdianWxgDownload> wxgRecs =  itfTblWangdianWxgDownloadService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .select(ItfTblWangdianWxgDownload::getWxgno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ItfTblWangdianWxgDownload::getWdno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ItfTblWangdianWxgDownload::getSfzen) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(ItfTblWangdianWxgDownload::getWxgno,"S21A00200023")// 测试用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .like(ItfTblWangdianWxgDownload::getWdno,"S%").list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        log.info("开始同步网点师傅信息: {}",sdf.format(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (ItfTblWangdianWxgDownload wxg :wxgRecs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getParameter(wxg.getWdno(), wxg.getWxgno(), req); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 格力总部查询工程师信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            GreeResponseHelper response = greeLogic.greePost(wdqyapi, JSONObject.toJSONString(req), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (response.getStatus() == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WxgQueryInfo resultDatax = JSONObject.parseObject(response.getData().toString(), WxgQueryInfo.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wvos = resultDatax.getWangdianWxgVos().get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 提取师傅的服务大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<WorkerServiceCategoryDetail> wxgCategoryRecs = workerServiceCategoryDetailService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerServiceCategoryDetail::getWorkerId, wxg.getSfzen()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 服务类型 INSTALL=安装 REPAIR=维修  DELIVERY=配送 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, List<WorkerServiceCategoryDetail>> wxgCategoryTypeRecs = wxgCategoryRecs.stream(). 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        collect(Collectors.groupingBy(WorkerServiceCategoryDetail::getType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 本地提取商户师傅信息 按品牌,网点,师傅编号    师傅离职的情况不再处理 todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WorkerBrandAccount workerBrandAccount = workerBrandAccountService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandId, brand.getBrandId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandWebsitNumber, wxg.getWdno()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandWorkerNumber, wxg.getWxgno()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (workerBrandAccount == null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 新增 WorkerBrandAccount todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-新增证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        List<WorkerCert> wc = workerCertService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                .eq(WorkerCert::getWorkerId, workerBrandAccount.getWorkerId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                .list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 不存在新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (wc ==null || wc.size()<1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            // 同步-新增证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            for (ZJInfo zj:wvos.getZjInfoList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                workercertAdd(wvos, addList, workerBrandAccount, zj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-新增师傅地理位置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 师傅省市区街道信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        List<WorkerStreet> wsOld = workerStreetService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                .eq(WorkerStreet::getWorkerId, workerBrandAccount.getWorkerId()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 不存在新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (wsOld ==null || wsOld.size()<1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            addWorkerStreet(wvos,brand.getBrandId(),ws); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-新增师傅服务的类目信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-师傅服务的类目信息 无则插入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        getServiceCategory(wvos, wscList, wscdList, brand, sysDict, wxg, wxgCategoryTypeRecs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 新增或修改(证件,师傅地理位置,师傅服务的类目) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        addOrUpdate(updateList, addList, wscList, wscdList, ws); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } catch (Exception ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    log.info("工程师信息同步失败:{}", ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        log.info("同步网点师傅信息结束: {}",sdf.format(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 按网点查询工程师信息并同步-只处理存在进行修改 (证件,师傅地理位置,师傅服务的类目) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     *     格力总部获取师傅信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     *     本地提取商户师傅信息 只修改不新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Scheduled(fixedDelay = 3 * 60 * 1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void wxgQueryUpdate() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (1==1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WangdianWxgVos wvos = new WangdianWxgVos(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCert> updateList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerCert> addList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String,Object> req = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("wdno",wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("wxgno",wxgno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("page",1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("size",1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("xsgsshstat",2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerServiceCategory> wscList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerServiceCategoryDetail> wscdList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WorkerStreet> ws = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 查询工程师 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GreeResponseHelper responsex = greeLogic.greePost(wdqyapi, JSONObject.toJSONString(req), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        log.info("response: {}",responsex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        WxgQueryInfo resultDatax = JSONObject.parseObject(responsex.getData().toString(), WxgQueryInfo.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        log.info("resultDatax: {}",JSONObject.toJSONString(resultDatax.getWangdianWxgVos())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取品牌信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Brand brand = baseService.getBrand(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (brand == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 字典表中查出ID 格力只有-家电售后 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysDict sysDict =  sysDictService.lambdaQuery(). 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                eq(SysDict::getDictType,ServiceCategoryEnum.DICT_TYPE_SERVICE_CATEGORY.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(SysDict::getDictValue,ServiceCategoryEnum.DICT_TYPE_SERVICE_CATEGORY.getText()).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (sysDict == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 提取现有的数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取现有的师傅数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<ItfTblWangdianWxgDownload> wxgRecs =  itfTblWangdianWxgDownloadService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .select(ItfTblWangdianWxgDownload::getWxgno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        ItfTblWangdianWxgDownload::getWdno) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                .eq(ItfTblWangdianWxgDownload::getWxgno,"S21A00200023") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ItfTblWangdianWxgDownload::getWdno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ItfTblWangdianWxgDownload::getSfzen) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(ItfTblWangdianWxgDownload::getWxgno,"S21A00200023")// 测试用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .like(ItfTblWangdianWxgDownload::getWdno,"S%").list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 查询工程师 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        log.info("开始同步网点师傅信息: {}",sdf.format(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (ItfTblWangdianWxgDownload wxg :wxgRecs){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            GreeResponseHelper response = getWxgInfo(wdqyapi,wxg.getWdno(),wxg.getWxgno()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            log.info("response: {}",JSONObject.toJSONString(response)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getParameter(wxg.getWdno(), wxg.getWxgno(), req); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 格力总部查询工程师信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            GreeResponseHelper response = greeLogic.greePost(wdqyapi, JSONObject.toJSONString(req), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (response.getStatus() == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                ResultData resultData = JSONObject.parseObject(response.getData().toString(), ResultData.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WxgQueryInfo resultDatax = JSONObject.parseObject(response.getData().toString(), WxgQueryInfo.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wvos = resultDatax.getWangdianWxgVos().get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 提取师傅的服务大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<WorkerServiceCategoryDetail> wxgCategoryRecs = workerServiceCategoryDetailService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerServiceCategoryDetail::getWorkerId, wxg.getSfzen()).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 服务类型 INSTALL=安装 REPAIR=维修  DELIVERY=配送 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, List<WorkerServiceCategoryDetail>> wxgCategoryTypeRecs = wxgCategoryRecs.stream(). 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        collect(Collectors.groupingBy(WorkerServiceCategoryDetail::getType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 本地提取商户师傅信息 按品牌,网点,师傅编号    师傅离职的情况不再处理 todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WorkerBrandAccount workerBrandAccount = workerBrandAccountService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandId, brand.getBrandId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandWebsitNumber, wxg.getWdno()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(WorkerBrandAccount::getBrandWorkerNumber, wxg.getWxgno()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 存在修改 不存在不处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (workerBrandAccount != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 证件同步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        for (ZJInfo zj:wvos.getZjInfoList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            // 同步-新增或修改证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            workercertUpdataOrAdd(wvos, updateList, addList, workerBrandAccount, zj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-师傅地理位置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        updateWorkerStreet(wvos,workerBrandAccount.getWorkerId(),brand.getBrandId(),ws); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 同步-师傅服务的类目信息 无则插入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        getServiceCategory(wvos, wscList, wscdList, brand, sysDict, wxg, wxgCategoryTypeRecs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 新增或修改(证件,师傅地理位置,师傅服务的类目) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        addOrUpdate(updateList, addList, wscList, wscdList, ws); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } catch (Exception ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    log.info("工程师信息同步失败:{}", ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        log.info("同步网点师傅信息结束: {}",sdf.format(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void addOrUpdate(List<WorkerCert> updateList, List<WorkerCert> addList, List<WorkerServiceCategory> wscList, List<WorkerServiceCategoryDetail> wscdList, List<WorkerStreet> ws) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 证件同步 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (updateList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workerCertService.saveOrUpdate(updateList.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (addList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workerCertService.saveOrUpdate(addList.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 同步-师傅地理位置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (ws.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workerStreetService.updateBatchById(ws); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 师傅服务类目新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (wscList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workerServiceCategoryService.saveBatch(wscList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (wscdList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            workerServiceCategoryDetailService.saveBatch(wscdList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        updateList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        addList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ws.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        wscList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        wscdList.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getServiceCategory(WangdianWxgVos wvos, List<WorkerServiceCategory> wscList, List<WorkerServiceCategoryDetail> wscdList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Brand brand, SysDict sysDict, ItfTblWangdianWxgDownload wxg, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Map<String, List<WorkerServiceCategoryDetail>> wxgCategoryTypeRecs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<String> complete = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 先处理商用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (SignSplb syitem: wvos.getSySignSplbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 扫描每个大类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (String s :syitem.getFwlbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 师傅服务的大类中查看是否存在 不存在新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                extracted(wscList, wscdList, complete, brand, sysDict, wxg, wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        syitem, s,ServiceCategoryEnum.COMMERCIAL_TYPE.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        complete.clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 处理家用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (SignSplb syitem: wvos.getJySignSplbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 扫描每个大类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (String s :syitem.getFwlbList()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 师傅服务的大类中查看是否存在 不存在新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                extracted(wscList, wscdList, complete, brand, sysDict, wxg, wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        syitem, s,ServiceCategoryEnum.HOME_TYPE.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void extracted(List<WorkerServiceCategory> wscList, List<WorkerServiceCategoryDetail> wscdList, List<String> complete, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                           Brand brand, SysDict sysDict, ItfTblWangdianWxgDownload wxg, Map<String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<WorkerServiceCategoryDetail>> wxgCategoryTypeRecs, SignSplb syitem, String s, String type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ( !complete.contains(s + syitem.getSpdl())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 提取品牌商对应的大类信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SysDictRef sysDictRef =  sysDictRefService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .select(SysDictRef::getDictCode,SysDictRef::getDictValue) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .eq(SysDictRef::getBrandId, brand.getBrandId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .eq(SysDictRef::getDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .in(SysDictRef::getRefDictCode, syitem.getSpdl()).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 提取证件信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (s.equals(ServiceCategoryEnum.INSTALL_TYPE.getText())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                getAddInfo(wscList, wscdList, sysDict, wxg, wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sysDictRef,ServiceCategoryEnum.INSTALL_TYPE.getCode(),type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (s.equals(ServiceCategoryEnum.REPAIR_TYPE.getText())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                getAddInfo(wscList, wscdList, sysDict, wxg, wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sysDictRef,ServiceCategoryEnum.REPAIR_TYPE.getCode(),type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (s.equals(ServiceCategoryEnum.DELIVERY_TYPE.getText())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                getAddInfo(wscList, wscdList, sysDict, wxg, wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sysDictRef,ServiceCategoryEnum.DELIVERY_TYPE.getCode(),type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 新增过的无需再次新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            complete.add(s + syitem.getSpdl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getAddInfo(List<WorkerServiceCategory> wscList, List<WorkerServiceCategoryDetail> wscdList, SysDict sysDict, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            ItfTblWangdianWxgDownload wxg, Map<String, List<WorkerServiceCategoryDetail>> wxgCategoryTypeRecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            SysDictRef sysDictRef, String code, String type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Boolean include = Boolean.FALSE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 看师傅是否已有(服务类型 INSTALL=安装 REPAIR=维修  DELIVERY=配送)对应的大类信息 如有不做任何处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (WorkerServiceCategoryDetail category : wxgCategoryTypeRecs.get(code)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (category.getMainId().equals(sysDictRef.getDictCode())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                include = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!include){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 看 worker_service_category 有无数据,无数据新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (wxgCategoryTypeRecs.get(code).size() ==0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WorkerServiceCategory wsc = new WorkerServiceCategory(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setId(IdWorker.getIdStr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setWorkerId(String.valueOf(wxg.getWxgid())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setServiceCategoryId(sysDict.getDictCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setServiceCategoryName(sysDict.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setType(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wsc.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscList.add(wsc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // WorkerServiceCategoryDetail 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WorkerServiceCategoryDetail wscd = new WorkerServiceCategoryDetail(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setId(IdWorker.getIdStr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setWorkerServiceCategoryId(wsc.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setWorkerId(String.valueOf(wxg.getWxgid())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setServiceCategoryId(sysDict.getDictCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setServiceCategoryName(sysDict.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setFlag(type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setType(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setMainId(sysDictRef.getDictCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setMainName(sysDictRef.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscdList.add(wscd); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // WorkerServiceCategoryDetail 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WorkerServiceCategoryDetail wscd = new WorkerServiceCategoryDetail(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setId(IdWorker.getIdStr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setWorkerServiceCategoryId(wxgCategoryTypeRecs.get(code).get(0).getServiceCategoryId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setWorkerId(String.valueOf(wxg.getWxgid())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setServiceCategoryId(sysDict.getDictCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setServiceCategoryName(sysDict.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setFlag(type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setType(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setMainId(sysDictRef.getDictCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setMainName(sysDictRef.getDictValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscd.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                wscdList.add(wscd); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 工程师查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         // GreeResponseHelper response = getwdqylbxx(wdqyapi,wdno,wxgno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         // log.info("response: {}",JSONObject.toJSONString(response)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void workercertAdd(WangdianWxgVos wvos, List<WorkerCert> addList, WorkerBrandAccount workerBrandAccount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                               ZJInfo zj) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getAdd(addList, workerBrandAccount.getWorkerId(), zj.getZjmc(), wvos.getXingb(), zj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 上传图片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        addUload(addList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 工程师图片上传 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /*String id = IdWorker.getIdStr(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        baseService.saveToFile(greeLogic.greeFileUrl("1_p_230209_S2105410_1623559060645298177.jpeg"),id);*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void addWorkerStreet(WangdianWxgVos wvos, String brandId, List<WorkerStreet> ws) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerStreet n = new WorkerStreet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setId(UUID.randomUUID().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setProvinceId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setCityId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setAreaId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setStreetId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取省信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(wvos.getSfen())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Province province = provinceService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .eq(Province::getProvince, wvos.getSfen()).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (province !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<BrandLbsRelate> bra = brandLbsRelateService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(BrandLbsRelate::getProvinceId,province.getProvinceId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(BrandLbsRelate::getBrandId,brandId).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (bra != null && bra.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (BrandLbsRelate br :bra){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsProvinceId()) && StringUtils.isEmpty(n.getProvinceId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setProvinceId(br.getLbsProvinceId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setProvince(br.getLbsProvinceName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsCityId()) && StringUtils.isEmpty(n.getCityId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setCityId(br.getLbsCityId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setCity(br.getLbsCityName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsDistrictId()) && StringUtils.isEmpty(n.getAreaId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setAreaId(br.getLbsDistrictId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setArea(br.getLbsDistrictName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsStreetId()) && StringUtils.isEmpty(n.getStreetId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setStreet(br.getLbsStreetId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setStreetId(br.getLbsStreetName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ws.add(n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void updateWorkerStreet(WangdianWxgVos wvos, String workerId, String brandId, List<WorkerStreet> ws) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 师傅省市区街道信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerStreet old = workerStreetService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(WorkerStreet::getWorkerId, workerId).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Boolean flag = Boolean.FALSE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerStreet n = new WorkerStreet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setId(old.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setProvinceId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setCityId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setAreaId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        n.setStreetId(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private GreeResponseHelper getWxgInfo(String apiPath, String wdno, String wxgno) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 提取省信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(wvos.getSfen())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Province province = provinceService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .eq(Province::getProvince, wvos.getSfen()).one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (province !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<BrandLbsRelate> bra = brandLbsRelateService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(BrandLbsRelate::getProvinceId,province.getProvinceId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .eq(BrandLbsRelate::getBrandId,brandId).list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (bra != null && bra.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (BrandLbsRelate br :bra){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsProvinceId()) && StringUtils.isEmpty(n.getProvinceId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setProvinceId(br.getLbsProvinceId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setProvince(br.getLbsProvinceName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsCityId()) && StringUtils.isEmpty(n.getCityId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setCityId(br.getLbsCityId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setCity(br.getLbsCityName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsDistrictId()) && StringUtils.isEmpty(n.getAreaId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setAreaId(br.getLbsDistrictId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setArea(br.getLbsDistrictName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (StringUtils.isNotEmpty(br.getLbsStreetId()) && StringUtils.isEmpty(n.getStreetId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setStreet(br.getLbsStreetId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            n.setStreetId(br.getLbsStreetName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!old.getProvinceId().equals(n.getProvinceId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!old.getCityId().equals(n.getCityId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!old.getAreaId().equals(n.getAreaId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!old.getStreetId().equals(n.getStreetId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ws.add(n); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void workercertUpdataOrAdd(WangdianWxgVos wvos, List<WorkerCert> updateList, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                       List<WorkerCert> addList, WorkerBrandAccount workerBrandAccount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                       ZJInfo zj) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 师傅证件信息 按证件名提取 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerCert old = workerCertService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(WorkerCert::getWorkerId, workerBrandAccount.getWorkerId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(WorkerCert::getCertName, zj.getZjmc()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (old !=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 修改 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getUpdate(updateList, zj, old); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 新增 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            getAdd(addList, workerBrandAccount.getWorkerId(), zj.getZjmc(), wvos.getXingb(), zj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 上传图片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (updateList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            updateUpload(updateList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (addList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addUload(addList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void addUload(List<WorkerCert> addList) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(addList.get(0).getOutFileUrl())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String id = IdWorker.getIdStr() + ".jpeg"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            baseService.saveToFile(greeLogic.greeFileUrl(addList.get(0).getOutFileUrl()), id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String file = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ossUtil.uploadFile(id, new File(file)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addList.get(0).setFileUrl(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // new File(file).delete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(addList.get(0).getOutFileUrl2())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String id = IdWorker.getIdStr() + ".jpeg"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            baseService.saveToFile(greeLogic.greeFileUrl(addList.get(0).getOutFileUrl2()), id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String file = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ossUtil.uploadFile(id, new File(file)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addList.get(0).setFileUrl2(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // new File(file).delete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void updateUpload(List<WorkerCert> updateList) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(updateList.get(0).getOutFileUrl())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String id = IdWorker.getIdStr() + ".jpeg"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            baseService.saveToFile(greeLogic.greeFileUrl(updateList.get(0).getOutFileUrl()), id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String file = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ossUtil.uploadFile(file, new File(file)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            updateList.get(0).setFileUrl(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            new File(file).delete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (StringUtils.isNotEmpty(updateList.get(0).getOutFileUrl2())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String id = IdWorker.getIdStr() + ".jpeg"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            baseService.saveToFile(greeLogic.greeFileUrl(updateList.get(0).getOutFileUrl2()), id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String file = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ossUtil.uploadFile(file, new File(file)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            updateList.get(0).setFileUrl2(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            new File(file).delete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getAdd(List<WorkerCert> addList, String workerId, String zjmc,String xingb,  ZJInfo zj) throws ParseException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerCert add = new WorkerCert(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setId(UUID.randomUUID().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setWorkerId(workerId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setCertName(zjmc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (zj.getZjlj().contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<String> result = Arrays.asList(zj.getZjlj().split(",")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setOutFileUrl(result.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setOutFileUrl2(result.get(1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setOutFileUrl(zj.getZjlj()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (zj.getZjbh().contains("/")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<String> result = Arrays.asList(zj.getZjbh().split("/")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setCertNo(result.get(1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            add.setCertNo(zj.getZjbh()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setExpireTime(baseService.utcToDateStr(zj.getZjyxq())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setReviewTime(baseService.utcToDateStr(zj.getZjfssj())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setExamineStatus("OK"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setSex(xingb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setOutSyncStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        add.setOutSyncTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        addList.add(add); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getUpdate(List<WorkerCert> updateList,ZJInfo zj,WorkerCert old){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Boolean flag = Boolean.FALSE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WorkerCert up = new WorkerCert(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (zj.getZjlj().contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<String> result = Arrays.asList(zj.getZjlj().split(",")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ((!old.getOutFileUrl().equals(result.get(0)) && !old.getOutFileUrl2().equals(result.get(0))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    || (!old.getOutFileUrl().equals(result.get(1)) && !old.getOutFileUrl2().equals(result.get(1)))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                up.setId(old.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                up.setOutFileUrl(result.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                up.setOutFileUrl2(result.get(1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!old.getOutFileUrl().equals(zj.getZjlj()) && !old.getOutFileUrl2().equals(zj.getZjlj())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                up.setId(old.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                up.setOutFileUrl(zj.getZjlj()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                flag = Boolean.TRUE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            up.setOutSyncTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            updateList.add(up); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void getParameter(String wdno, String wxgno, Map<String, Object> req) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.put("wdno", wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.put("wxgno", wxgno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.put("page", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.put("size", 20); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        req.put("xsgsshstat", 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  /*  private GreeResponseHelper getWxgInfo(String apiPath, String wdno, String wxgno) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String,Object> req = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("wdno",wdno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("wxgno",wxgno); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("page",1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("size",1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        req.put("xsgsshstat",2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getParameter(wdno, wxgno, req, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return greeLogic.greePost(apiPath, JSONObject.toJSONString(req), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |