yumeng 4 лет назад
Родитель
Сommit
9dbb9389c3

+ 1 - 15
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java

@@ -39,29 +39,21 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
     public void getCheckinData() {
         try {
             Map<String, Object> qywxAccessToken = tokenService.getOAAccessToken();
-            System.err.println(qywxAccessToken);
             if ((Integer) qywxAccessToken.get("code") != 0) {
                 log.error("企业微信获取token失败,返回信息:{}", qywxAccessToken.get("message"));
                 throw new Exception("企业微信获取token失败");
             }
-
             List<WechatUserList> list = userListService.list();
             if (Check.isNull(list)) {
                 return;
             }
 
-
-            //  params.put("access_token", (String) qywxAccessToken.get("accessToken"));
             for (WechatUserList userList : list) {
-                // params.remove("useridlist");
                 JSONObject params = new JSONObject();
-
                 String userId = userList.getUserId();
                 String departId = userList.getDepartId();
                 params.put("opencheckindatatype", 3);
-
                 JSONArray userArr = new JSONArray();
-
                 userArr.add(userId);
                 params.put("useridlist", userArr);
                 params.put("starttime", 1598889600);
@@ -79,8 +71,6 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                                 checkinData.setDepartId(departId);
                                 checkinData.setUserId(userId);
                                 checkinData.setCheckinType(jsonObject.getString("checkin_type"));
-
-
                                 Long checkinTimeStamp = jsonObject.getLong("checkin_time"); //下班打卡时间
                                 java.util.Date checkDate = DateUtils.stampToTime(checkinTimeStamp);
                                 checkinData.setCheckinTime(checkDate);
@@ -105,16 +95,12 @@ public class WechatCheckinDataServiceImpl extends ServiceImpl<WechatCheckinDataM
                                 checkinData.setMediaids(jsonObject.getJSONArray("mediaids").toJSONString());
                                 checkinData.setLat(jsonObject.getString("lat"));
                                 this.save(checkinData);
-
                             }
                         }
-
                     }
 
-
                 } else {
-                    //     throw new Exception("企业微信获取部门列表");
-
+                    log.error("获取打卡数据异常");
                 }
             }
         } catch (Exception e) {