Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fe99f435
authored
Mar 02, 2021
by
sunxiwang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
统计修改
1 parent
13b5b58b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
21 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePageDateContraller.java
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/GroupChatStatisticTask.java
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/UserBehaviorDataTak.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WePageDateContraller.java
View file @
fe99f43
...
...
@@ -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
);
}
}
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
View file @
fe99f43
...
...
@@ -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"
;
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/GroupChatStatisticTask.java
View file @
fe99f43
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
);
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/UserBehaviorDataTak.java
View file @
fe99f43
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment