gengyang 5 years ago
parent
commit
aa33ac57df

+ 3 - 3
src/main/java/com/mokamrp/privates/mapper/vo/WorkContactEmployeeVo.java

@@ -19,7 +19,7 @@ public class WorkContactEmployeeVo {
     private Integer channelCodeId;
     private Date clientDeletedAt;
     private Date clientCreatedAt;
-    private Integer clientUnionid;
+    private String clientUnionid;
     private Integer clientGender;
     private String employeeName;
     private String companyName;
@@ -165,11 +165,11 @@ public class WorkContactEmployeeVo {
         this.clientCreatedAt = clientCreatedAt;
     }
 
-    public Integer getClientUnionid() {
+    public String getClientUnionid() {
         return clientUnionid;
     }
 
-    public void setClientUnionid(Integer clientUnionid) {
+    public void setClientUnionid(String clientUnionid) {
         this.clientUnionid = clientUnionid;
     }
 

+ 6 - 6
src/main/java/com/mokamrp/privates/service/impl/WorkContactEmployeeServiceImpl.java

@@ -94,6 +94,9 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
 
         for (int i = 0; i < j; i++) {
             Map<String, Object> map = new HashMap<String,Object>();       //数据采用的哈希表结构
+            if(list.get(i).getOpenId() == null || list.get(i).getOpenId().isEmpty()){
+                continue;
+            }
             map.put("openid", list.get(i).getOpenId());
             map.put("appid", list.get(i).getAppId());
             map.put("private_domain", 1);
@@ -101,8 +104,6 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
             resList.add(map);
         }
 
-        System.out.println(resList);
-
         /*请求typer*/
         HttpPost post = new HttpPost("http://yitian.mokagm.com/v1/external/fans/info");
         // (2) 使用HttpClient发送get请求,获得返回结果HttpResponse
@@ -122,11 +123,9 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
             if (response.getStatusLine().getStatusCode() == 200) {
                 HttpEntity resEntity = response.getEntity();
                 String message = EntityUtils.toString(resEntity, "utf-8");
-                //System.out.println(message);
                 JSONObject jsonObject = JSON.parseObject(message);
                 Object resMap;
                 if (jsonObject.get("data") != null) {
-                    System.out.println(jsonObject.get("data"));
                     responseList = jsonObject.getJSONArray("data");
 
                 }
@@ -136,12 +135,13 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
             return list;
         }
 
+
         int resLen = responseList.size();
         for (int i = 0; i < j; i++) {
             for(t=0;t<resLen;t++) {
                 //匹配成功的
-                if(list.get(i).getOpenId() != null && responseList.getJSONObject(i).get("openid").equals(list.get(i).getOpenId())){
-                    list.get(i).setTyperTag(responseList.getJSONObject(i).get("label").toString());
+                if(list.get(i).getOpenId() != null && responseList.getJSONObject(t).get("openid").equals(list.get(i).getOpenId())){
+                    list.get(i).setTyperTag(responseList.getJSONObject(t).get("label").toString());
                 }
             }
         }

+ 1 - 1
src/main/java/com/mokamrp/privates/tast/produce/ProduceDataHub.java

@@ -31,7 +31,7 @@ public class ProduceDataHub{
     /**
      * 导出任务,单进程
      */
-    @Scheduled(cron="0 0 4,12 * * *")
+    @Scheduled(cron="0 0 3,12 * * *")
     public void execute() {
         System.out.println("当前时间"+(new Date())+",定时任务推送公司粉丝datahub任务");
         QueryWrapper<Corp> obj= new QueryWrapper<Corp>();