|
@@ -346,9 +346,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
long endTime = endDateTime.toEpochSecond(ZoneOffset.of("+8"));
|
|
|
System.out.println("startTime="+startTime+",endTime="+endTime);
|
|
|
|
|
|
- int batchCount = 1;
|
|
|
+ int totalLength = corpwxUserIds.size();
|
|
|
int batchSize = 100;
|
|
|
- int totalLength = 1;
|
|
|
+ int batchCount = totalLength/batchSize+(totalLength%batchSize==0?0:1);
|
|
|
+
|
|
|
//按批调用
|
|
|
for (int i=0;i<batchCount; i++) {
|
|
|
int fromIndex = i*batchSize;
|
|
@@ -377,6 +378,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
List<String> collect = userList.stream().map(User::getId).collect(Collectors.toList());
|
|
|
|
|
|
userMapper.delete(new QueryWrapper<User>().in("id", collect));
|
|
|
+ //抽取没有匹配上的人员
|
|
|
+ List<String> notUsefullCpIds = corpwxUserIds.stream().filter(c -> !updateUserList.stream().anyMatch(up -> up.getCorpwxUserid().equals(c))).collect(Collectors.toList());
|
|
|
+ if (notUsefullCpIds.size() > 0) {
|
|
|
+ userCorpwxTimeMapper.delete(new QueryWrapper<UserCorpwxTime>().eq("company_id", wxCorpInfo.getCompanyId()).in("corpwx_userid", notUsefullCpIds));
|
|
|
+ }
|
|
|
if (updateUserList.size() == 0) {
|
|
|
msg.data = "处理完毕。当前无新人员需要关联企业微信身份";
|
|
|
} else {
|
|
@@ -395,7 +401,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
String url = GET_CHECKIN_DAYDATA.replace("ACCESS_TOKEN", getCorpAccessToken(corpInfo));
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
-
|
|
|
+ System.out.println(""+objects.toString());
|
|
|
JSONObject reqParam = new JSONObject();
|
|
|
reqParam.put("starttime", startTime);
|
|
|
reqParam.put("endtime", endTime);
|