Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
aec33295
Commit
aec33295
authored
May 30, 2024
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办小程序埋点概览接口
parent
40c32225
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
222 additions
and
0 deletions
+222
-0
EventTrackingController.java
...haoban/manage/web/controller/EventTrackingController.java
+107
-0
WechatOverviewQO.java
.../haoban/manage/web/qo/eventtracking/WechatOverviewQO.java
+33
-0
TrendVO.java
...a/com/gic/haoban/manage/web/vo/eventtracking/TrendVO.java
+47
-0
ViewModuleVO.java
.../gic/haoban/manage/web/vo/eventtracking/ViewModuleVO.java
+35
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/EventTrackingController.java
0 → 100644
View file @
aec33295
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.DataApiUtils
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.manage.web.qo.eventtracking.WechatOverviewQO
;
import
com.gic.haoban.manage.web.qo.wechatwork.StoreGroupCommonQO
;
import
com.gic.haoban.manage.web.utils.data.ConcurrencyUtils
;
import
com.gic.haoban.manage.web.utils.data.MapThreadHandlerRequest
;
import
com.gic.haoban.manage.web.utils.data.StoreAuthUtils
;
import
com.gic.haoban.manage.web.vo.eventtracking.ViewModuleVO
;
import
com.gic.web.common.controller.NewBaseController
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 好办小程序埋点分析
* @Author guojx
* @Date 2024/5/30 9:06
*/
@RestController
@Slf4j
@RequestMapping
(
"wechat-event-tracking"
)
public
class
EventTrackingController
extends
NewBaseController
{
@Autowired
private
StoreAuthUtils
storeAuthUtils
;
/**
* 概览
* @param qo
* @return
*/
@RequestMapping
(
value
=
"overview"
)
public
RestResponse
overview
(
@RequestBody
WechatOverviewQO
qo
)
{
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
getOverviewParam
(
qo
).
toJSONString
(),
"data_point_anal_hb_app_overview"
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getDataList
(
res
);
return
RestResponse
.
successResult
(
CollectionUtils
.
isEmpty
(
list
)
?
null
:
list
.
get
(
0
));
}
/**
* 趋势图
* @param qo
* @return
*/
@RequestMapping
(
value
=
"trend"
)
public
RestResponse
trend
(
@RequestBody
WechatOverviewQO
qo
)
{
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
getOverviewParam
(
qo
).
toJSONString
(),
"data_point_anal_hb_app_trend"
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getDataList
(
res
);
return
RestResponse
.
successResult
(
list
);
}
/**
* 模块访问统计
* @param qo
* @return
*/
@RequestMapping
(
value
=
"view-module"
)
public
RestResponse
<
List
<
ViewModuleVO
>>
viewModule
(
@RequestBody
WechatOverviewQO
qo
)
{
JSONObject
jsonParam
=
getOverviewParam
(
qo
);
List
<
MapThreadHandlerRequest
>
list
=
new
ArrayList
<>();
// 1 访问次数 2 访问人数 3 访问时长
jsonParam
.
put
(
"orderByField"
,
1
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"1_visitCnt"
));
jsonParam
.
put
(
"orderByField"
,
2
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"2_visitNum"
));
jsonParam
.
put
(
"orderByField"
,
3
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"3_visitTime"
));
Map
<
String
,
List
<
JSONObject
>>
map
=
ConcurrencyUtils
.
concurrencyDataForMap
(
list
);
List
<
ViewModuleVO
>
voList
=
new
ArrayList
<>();
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
map
.
forEach
((
k
,
v
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
v
))
{
String
dataType
=
k
.
substring
(
0
,
1
);
String
key
=
k
.
substring
(
2
);
List
<
ViewModuleVO
>
tempList
=
new
ArrayList
<>();
for
(
JSONObject
temp
:
v
)
{
ViewModuleVO
vo
=
JSON
.
parseObject
(
temp
.
toJSONString
(),
ViewModuleVO
.
class
);
vo
.
setDataType
(
Integer
.
parseInt
(
dataType
));
vo
.
setData
(
temp
.
getLong
(
key
));
tempList
.
add
(
vo
);
}
voList
.
addAll
(
tempList
);
}
});
}
return
RestResponse
.
successResult
(
voList
);
}
private
JSONObject
getOverviewParam
(
WechatOverviewQO
qo
)
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
qo
);
jsonObject
.
remove
(
"storeGroupId"
);
jsonObject
.
remove
(
"storeId"
);
storeAuthUtils
.
setCommonParam
(
jsonObject
,
new
StoreGroupCommonQO
().
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
()));
return
jsonObject
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/eventtracking/WechatOverviewQO.java
0 → 100644
View file @
aec33295
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
.
eventtracking
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author guojx
* @Date 2024/5/30 9:14
*/
@Data
public
class
WechatOverviewQO
implements
Serializable
{
/**
* yyyy-MM-dd
*/
private
String
startDate
;
/**
* 数据类型 1天 2近7天 3近30天 4周 5月
*/
private
Integer
dateType
;
/**
* 分组ID,可为空
*/
private
String
storeGroupId
;
/**
* 门店ID。可为空
*/
private
String
storeId
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/eventtracking/TrendVO.java
0 → 100644
View file @
aec33295
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
eventtracking
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author guojx
* @Date 2024/5/30 9:24
*/
@Data
public
class
TrendVO
implements
Serializable
{
/**
* 员工总人数
*/
private
Integer
clerkNum
;
/**
* 绑定人数
*/
private
Integer
bindingNum
;
/**
* 绑定率
*/
private
Double
bindingRate
;
/**
* 活跃人数
*/
private
Integer
visitNum
;
/**
* 活跃率
*/
private
Double
visitRate
;
/**
* 访问次数
*/
private
Integer
visitCnt
;
/**
* 业务日期
*/
private
String
bizDate
;
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/eventtracking/ViewModuleVO.java
0 → 100644
View file @
aec33295
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
eventtracking
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author guojx
* @Date 2024/5/30 9:44
*/
@Data
public
class
ViewModuleVO
implements
Serializable
{
/**
* 模块code
*/
private
String
moduleCode
;
/**
* 模块名称
*/
private
String
moduleName
;
/**
* 数值
*/
private
Long
data
;
/**
* 1:访问次数 2:访问人数 3:访问时长 (单位秒)
*/
private
Integer
dataType
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment