yaozhixue 1 year ago
parent
commit
3a61a65346

+ 15 - 4
src/main/java/com/zfire/jiasm/syncdata/service/impl/GLPPWXGQueryAddServiceImpl.java

@@ -359,6 +359,7 @@ public class GLPPWXGQueryAddServiceImpl implements GLPPWXGQueryAddService {
         // 提取格力现有的网点师傅数据信息
         wxgDownladRecs =  itfTblWangdianWxgDownloadService.lambdaQuery()
                 .eq(ItfTblWangdianWxgDownload::getCertStatus,0)
+                .eq(ItfTblWangdianWxgDownload::getCertTimes,20)
                 // .eq(ItfTblWangdianWxgDownload::getSfzen,"440785199006194614")// 测试用
                 // .eq(ItfTblWangdianWxgDownload::getWdno,"S2106139")// 测试用
                 .like(ItfTblWangdianWxgDownload::getWdno,"S%").list();
@@ -401,17 +402,27 @@ public class GLPPWXGQueryAddServiceImpl implements GLPPWXGQueryAddService {
                     addDataCert(addList);
                     // 修改保险信息
                     upWebsitWorker(upWebsitWorkers);
-                    wxg.updateById();
+                    wxg.setCertTimes(0);
                     // log.info("工程师证件照信息同步成功-师傅证件信息:{}", wxg.getSfzen());
                 } else {
-                    log.info("获取工程师证件照信息失败-师傅证件信息:{}", wxg.getSfzen());
-                    log.info("msg:{}", response.getMsg());
+                    wxg.setCertTimes(wxg.getCertTimes() + 1);
+                    log.info("获取工程师证件照信息失败-师傅证件信息:{} {}", wxg.getSfzen(),response.getMsg());
+                    wxg.setCertSynErrMsg("获取工程师证件照信息失败");
+                    JSONObject msg = JSONObject.parseObject(response.getMsg());
+                    if (null != msg.get("message")){
+                        wxg.setCertSynErrMsg(msg.getString("message"));
+                        if (wxg.getCertSynErrMsg().length()>128){
+                            wxg.setCertSynErrMsg(wxg.getCertSynErrMsg().substring(0,126));
+                        }
+                    }
                 }
+                wxg.updateById();
             } catch (Exception ex) {
                 ex.printStackTrace();
                 log.info("工程师证件照信息同步失败-师傅证件信息:{}", wxg.getSfzen());
+                wxg.setCertTimes(wxg.getCertTimes() + 1);
+                wxg.updateById();
                 throw new Exception("工程师证件照信息同步失败");
-
             }
         }