Commit fe99f435 by sunxiwang

统计修改

1 parent 13b5b58b
......@@ -2,6 +2,7 @@ package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.redis.RedisCache;
import com.linkwechat.wecom.domain.dto.WePageStaticDataDto;
import com.linkwechat.wecom.service.IWeCorpAccountService;
import com.linkwechat.wecom.service.IWeUserService;
import io.swagger.annotations.Api;
......@@ -42,6 +43,7 @@ public class WePageDateContraller {
@PreAuthorize("@ss.hasPermi('wecom:page:getCorpRealTimeData')")
@GetMapping("/getCorpRealTimeData")
public AjaxResult getCorpRealTimeData(){
return AjaxResult.success(redisCache.getCacheList("getCorpRealTimeData"));
WePageStaticDataDto wePageStaticDataDto = redisCache.getCacheObject("getCorpRealTimeData");
return AjaxResult.success(wePageStaticDataDto);
}
}
......@@ -371,8 +371,8 @@ public class WeConstans {
}
public static final String WECOM_FINANCE_INDEX = "finance";
//public static final String WECOM_FINANCE_INDEX = "finance_new";
//public static final String WECOM_FINANCE_INDEX = "finance";
public static final String WECOM_FINANCE_INDEX = "finance_new";
public static final String WECOM_SENSITIVE_HIT_INDEX = "sensitive";
......
package com.linkwechat.quartz.task;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.utils.bean.BeanUtils;
import com.linkwechat.wecom.client.WeCustomerClient;
......@@ -55,17 +56,22 @@ public class GroupChatStatisticTask {
idList.add(weGroup.getOwner());
ownerFilter.setUserid_list(idList);
query.setOwnerFilter(ownerFilter);
GroupChatStatisticDto groupChatStatistic = weCustomerClient.getGroupChatStatisticGroupByDay(query);
List<GroupChatStatisticDto.GroupchatStatisticData> items = groupChatStatistic.getItems();
if(CollectionUtil.isNotEmpty(items)){
items.forEach(groupchatStatisticData -> {
WeGroupStatistic weGroupStatistic = new WeGroupStatistic();
GroupChatStatisticDto.StatisticData data = groupchatStatisticData.getData();
BeanUtils.copyPropertiesignoreOther(data, weGroupStatistic);
weGroupStatistic.setChatId(weGroup.getChatId());
weGroupStatistic.setStatTime(groupchatStatisticData.getStatTime());
weGroupStatisticList.add(weGroupStatistic);
});
try {
GroupChatStatisticDto groupChatStatistic = weCustomerClient.getGroupChatStatisticGroupByDay(query);
List<GroupChatStatisticDto.GroupchatStatisticData> items = groupChatStatistic.getItems();
if(CollectionUtil.isNotEmpty(items)){
items.forEach(groupchatStatisticData -> {
WeGroupStatistic weGroupStatistic = new WeGroupStatistic();
GroupChatStatisticDto.StatisticData data = groupchatStatisticData.getData();
BeanUtils.copyPropertiesignoreOther(data, weGroupStatistic);
weGroupStatistic.setChatId(weGroup.getChatId());
weGroupStatistic.setStatTime(groupchatStatisticData.getStatTime());
weGroupStatisticList.add(weGroupStatistic);
});
}
} catch (Exception e) {
e.printStackTrace();
log.error("群聊数据拉取失败: ownerFilter:【{}】,ex:【{}】", JSONObject.toJSONString(ownerFilter),e.getStackTrace());
}
});
weGroupStatisticService.saveBatch(weGroupStatisticList);
......
......@@ -2,6 +2,7 @@ package com.linkwechat.quartz.task;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dtflys.forest.exceptions.ForestRuntimeException;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.bean.BeanUtils;
import com.linkwechat.wecom.client.WeCustomerClient;
......@@ -65,13 +66,18 @@ public class UserBehaviorDataTak {
List<String> idList = new ArrayList<>();
idList.add(weUser.getUserId());
query.setUserid(idList);
UserBehaviorDataDto userBehaviorData = weCustomerClient.getUserBehaviorData(query);
List<UserBehaviorDataDto.BehaviorData> behaviorDataList = userBehaviorData.getBehaviorData();
for (UserBehaviorDataDto.BehaviorData data : behaviorDataList) {
WeUserBehaviorData weUserBehaviorData = new WeUserBehaviorData();
BeanUtils.copyPropertiesignoreOther(data, weUserBehaviorData);
weUserBehaviorData.setUserId(weUser.getUserId());
dataList.add(weUserBehaviorData);
try {
UserBehaviorDataDto userBehaviorData = weCustomerClient.getUserBehaviorData(query);
List<UserBehaviorDataDto.BehaviorData> behaviorDataList = userBehaviorData.getBehaviorData();
for (UserBehaviorDataDto.BehaviorData data : behaviorDataList) {
WeUserBehaviorData weUserBehaviorData = new WeUserBehaviorData();
BeanUtils.copyPropertiesignoreOther(data, weUserBehaviorData);
weUserBehaviorData.setUserId(weUser.getUserId());
dataList.add(weUserBehaviorData);
}
} catch (ForestRuntimeException e) {
e.printStackTrace();
log.error("员工数据拉取失败: userId:【{}】,ex:【{}】",weUser.getUserId(),e.getStackTrace());
}
});
weUserBehaviorDataService.saveBatch(dataList);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!