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
cab699bc
Commit
cab699bc
authored
Jun 20, 2024
by
guojx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2024-06-event-tracking' into 'master'
Feature 2024 06 event tracking See merge request
!1921
parents
494c9a38
c2ba66cf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
210 additions
and
96 deletions
+210
-96
EventTrackingController.java
...haoban/manage/web/controller/EventTrackingController.java
+27
-17
WechatEventTrackingStoreGroupHandle.java
...anage/web/handle/WechatEventTrackingStoreGroupHandle.java
+2
-3
WechatEventTrackingClerkDetailQO.java
...eb/qo/eventtracking/WechatEventTrackingClerkDetailQO.java
+1
-1
WechatEventTrackingStoreGroupQO.java
...web/qo/eventtracking/WechatEventTrackingStoreGroupQO.java
+1
-1
StoreGroupCommonQO.java
...c/haoban/manage/web/qo/wechatwork/StoreGroupCommonQO.java
+6
-0
StoreAuthUtils.java
.../com/gic/haoban/manage/web/utils/data/StoreAuthUtils.java
+43
-43
DateExpandUtils.java
...aoban/manage/web/utils/eventtracking/DateExpandUtils.java
+38
-1
TrendVO.java
...a/com/gic/haoban/manage/web/vo/eventtracking/TrendVO.java
+2
-0
WechatEventTrackingClerkVO.java
...nage/web/vo/eventtracking/WechatEventTrackingClerkVO.java
+2
-30
WechatEventTrackingOverviewVO.java
...e/web/vo/eventtracking/WechatEventTrackingOverviewVO.java
+88
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/EventTrackingController.java
View file @
cab699bc
...
@@ -20,10 +20,7 @@ import com.gic.haoban.manage.web.utils.data.ConcurrencyUtils;
...
@@ -20,10 +20,7 @@ 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.MapThreadHandlerRequest
;
import
com.gic.haoban.manage.web.utils.data.StoreAuthUtils
;
import
com.gic.haoban.manage.web.utils.data.StoreAuthUtils
;
import
com.gic.haoban.manage.web.utils.eventtracking.DateExpandUtils
;
import
com.gic.haoban.manage.web.utils.eventtracking.DateExpandUtils
;
import
com.gic.haoban.manage.web.vo.eventtracking.TrendVO
;
import
com.gic.haoban.manage.web.vo.eventtracking.*
;
import
com.gic.haoban.manage.web.vo.eventtracking.ViewModuleVO
;
import
com.gic.haoban.manage.web.vo.eventtracking.WechatEventTrackingClerkVO
;
import
com.gic.haoban.manage.web.vo.eventtracking.WechatEventTrackingStoreGroupVO
;
import
com.gic.haoban.manage.web.vo.wechatwork.DataPageVO
;
import
com.gic.haoban.manage.web.vo.wechatwork.DataPageVO
;
import
com.gic.qcloud.BucketNameEnum
;
import
com.gic.qcloud.BucketNameEnum
;
import
com.gic.web.common.controller.NewBaseController
;
import
com.gic.web.common.controller.NewBaseController
;
...
@@ -66,10 +63,10 @@ public class EventTrackingController extends NewBaseController {
...
@@ -66,10 +63,10 @@ public class EventTrackingController extends NewBaseController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"overview"
)
@RequestMapping
(
value
=
"overview"
)
public
RestResponse
overview
(
@RequestBody
WechatOverviewQO
qo
)
{
public
RestResponse
<
WechatEventTrackingOverviewVO
>
overview
(
@RequestBody
WechatOverviewQO
qo
)
{
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
getOverviewParam
(
qo
).
toJSONString
(),
"data_point_anal_hb_app_overview"
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
getOverviewParam
(
qo
).
toJSONString
(),
"data_point_anal_hb_app_overview"
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getDataList
(
res
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getDataList
(
res
);
return
RestResponse
.
successResult
(
CollectionUtils
.
isEmpty
(
list
)
?
n
ull
:
list
.
get
(
0
));
return
RestResponse
.
successResult
(
CollectionUtils
.
isEmpty
(
list
)
?
n
ew
WechatEventTrackingOverviewVO
()
:
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
list
.
get
(
0
)),
WechatEventTrackingOverviewVO
.
class
));
}
}
/**
/**
...
@@ -113,11 +110,11 @@ public class EventTrackingController extends NewBaseController {
...
@@ -113,11 +110,11 @@ public class EventTrackingController extends NewBaseController {
JSONObject
jsonParam
=
getOverviewParam
(
qo
);
JSONObject
jsonParam
=
getOverviewParam
(
qo
);
List
<
MapThreadHandlerRequest
>
list
=
new
ArrayList
<>();
List
<
MapThreadHandlerRequest
>
list
=
new
ArrayList
<>();
// 1 访问次数 2 访问人数 3 访问时长
// 1 访问次数 2 访问人数 3 访问时长
jsonParam
.
put
(
"orderByField"
,
1
);
jsonParam
.
put
(
"orderByField
s
"
,
1
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"1_visitCnt"
));
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"1_visitCnt"
));
jsonParam
.
put
(
"orderByField"
,
2
);
jsonParam
.
put
(
"orderByField
s
"
,
2
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"2_visitNum"
));
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"2_visitNum"
));
jsonParam
.
put
(
"orderByField"
,
3
);
jsonParam
.
put
(
"orderByField
s
"
,
3
);
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"3_visitTime"
));
list
.
add
(
new
MapThreadHandlerRequest
(
jsonParam
,
"data_point_anal_hb_app_module"
,
"3_visitTime"
));
Map
<
String
,
List
<
JSONObject
>>
map
=
ConcurrencyUtils
.
concurrencyDataForMap
(
list
);
Map
<
String
,
List
<
JSONObject
>>
map
=
ConcurrencyUtils
.
concurrencyDataForMap
(
list
);
...
@@ -151,10 +148,11 @@ public class EventTrackingController extends NewBaseController {
...
@@ -151,10 +148,11 @@ public class EventTrackingController extends NewBaseController {
public
RestResponse
<
DataPageVO
<
WechatEventTrackingStoreGroupVO
>>
storeGroup
(
@RequestBody
WechatEventTrackingStoreGroupQO
qo
)
{
public
RestResponse
<
DataPageVO
<
WechatEventTrackingStoreGroupVO
>>
storeGroup
(
@RequestBody
WechatEventTrackingStoreGroupQO
qo
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
qo
.
dealWithParam
(
jsonObject
);
qo
.
dealWithParam
(
jsonObject
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
qo
);
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
qo
.
setStatusList
(
statusList
));
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_store"
);
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_store"
);
DataPageVO
vo
=
storeAuthUtils
.
getDataCommon
(
jsonObject
.
toJSONString
(),
qo
.
getPageNum
(),
"data_point_anal_hb_app_store"
,
qo
.
getPageSize
(),
true
);
DataPageVO
vo
=
storeAuthUtils
.
getDataCommonParent
(
jsonObject
.
toJSONString
(),
qo
.
getPageNum
(),
"data_point_anal_hb_app_store"
,
qo
.
getPageSize
(),
true
,
true
);
storeAuthUtils
.
deleteTotalData
(
vo
);
if
(
CollectionUtils
.
isNotEmpty
(
vo
.
getRows
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
vo
.
getRows
()))
{
vo
.
setRows
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
vo
.
getRows
()),
WechatEventTrackingStoreGroupVO
.
class
));
vo
.
setRows
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
vo
.
getRows
()),
WechatEventTrackingStoreGroupVO
.
class
));
}
}
...
@@ -178,7 +176,9 @@ public class EventTrackingController extends NewBaseController {
...
@@ -178,7 +176,9 @@ public class EventTrackingController extends NewBaseController {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
qo
.
dealWithParam
(
jsonObject
);
qo
.
dealWithParam
(
jsonObject
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
qo
);
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
qo
.
setStatusList
(
statusList
));
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_store"
);
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_store"
);
//Excel的标题是字段进行计算
//Excel的标题是字段进行计算
List
<
String
>
indexList
=
new
ArrayList
<>();
List
<
String
>
indexList
=
new
ArrayList
<>();
...
@@ -231,8 +231,10 @@ public class EventTrackingController extends NewBaseController {
...
@@ -231,8 +231,10 @@ public class EventTrackingController extends NewBaseController {
public
RestResponse
<
DataPageVO
<
WechatEventTrackingClerkVO
>>
clerk
(
@RequestBody
WechatEventTrackingClerkDetailQO
qo
)
{
public
RestResponse
<
DataPageVO
<
WechatEventTrackingClerkVO
>>
clerk
(
@RequestBody
WechatEventTrackingClerkDetailQO
qo
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
qo
.
dealWithParam
(
jsonObject
);
qo
.
dealWithParam
(
jsonObject
);
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
new
StoreGroupCommonQO
()
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
new
StoreGroupCommonQO
()
.
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
()));
.
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
())
.
setStatusList
(
statusList
)
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_point_anal_hb_app_clerk"
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_point_anal_hb_app_clerk"
);
DataPageVO
<
WechatEventTrackingClerkVO
>
vo
=
new
DataPageVO
<>();
DataPageVO
<
WechatEventTrackingClerkVO
>
vo
=
new
DataPageVO
<>();
...
@@ -255,7 +257,10 @@ public class EventTrackingController extends NewBaseController {
...
@@ -255,7 +257,10 @@ public class EventTrackingController extends NewBaseController {
@RequestMapping
(
value
=
"get-unaffiliated-store"
)
@RequestMapping
(
value
=
"get-unaffiliated-store"
)
public
RestResponse
<
List
<
String
>>
getUnaffiliatedStoreByStoreGroupId
(
String
storeGroupId
)
{
public
RestResponse
<
List
<
String
>>
getUnaffiliatedStoreByStoreGroupId
(
String
storeGroupId
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
return
RestResponse
.
successResult
(
storeAuthUtils
.
getPreStoreIdList
(
storeGroupId
,
login
.
getEnterpriseId
()));
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
return
RestResponse
.
successResult
(
storeAuthUtils
.
getPreStoreIdListCommon
(
storeGroupId
,
login
.
getEnterpriseId
(),
statusList
));
}
}
/**
/**
...
@@ -275,8 +280,10 @@ public class EventTrackingController extends NewBaseController {
...
@@ -275,8 +280,10 @@ public class EventTrackingController extends NewBaseController {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
qo
.
dealWithParam
(
jsonObject
);
qo
.
dealWithParam
(
jsonObject
);
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
new
StoreGroupCommonQO
()
storeAuthUtils
.
setStoreGroupJsonParam
(
jsonObject
,
new
StoreGroupCommonQO
()
.
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
()));
.
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
())
.
setStatusList
(
statusList
)
);
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_clerk"
);
jsonObject
.
put
(
"apolloKey"
,
"data_point_anal_hb_app_clerk"
);
//Excel的标题是字段进行计算
//Excel的标题是字段进行计算
List
<
String
>
indexList
=
new
ArrayList
<>();
List
<
String
>
indexList
=
new
ArrayList
<>();
...
@@ -318,7 +325,10 @@ public class EventTrackingController extends NewBaseController {
...
@@ -318,7 +325,10 @@ public class EventTrackingController extends NewBaseController {
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
qo
);
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
qo
);
jsonObject
.
remove
(
"storeGroupId"
);
jsonObject
.
remove
(
"storeGroupId"
);
jsonObject
.
remove
(
"storeId"
);
jsonObject
.
remove
(
"storeId"
);
storeAuthUtils
.
setCommonParam
(
jsonObject
,
new
StoreGroupCommonQO
().
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
()));
List
<
String
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
"2"
);
storeAuthUtils
.
setCommonParam
(
jsonObject
,
new
StoreGroupCommonQO
().
setStoreGroupId
(
qo
.
getStoreGroupId
()).
setStoreId
(
qo
.
getStoreId
()).
setStatusList
(
statusList
));
return
jsonObject
;
return
jsonObject
;
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/handle/WechatEventTrackingStoreGroupHandle.java
View file @
cab699bc
...
@@ -26,9 +26,8 @@ public class WechatEventTrackingStoreGroupHandle extends DownloadHandlerAbstract
...
@@ -26,9 +26,8 @@ public class WechatEventTrackingStoreGroupHandle extends DownloadHandlerAbstract
@Override
@Override
public
List
<
WechatEventTrackingStoreGroupVO
>
getData
(
Context
context
,
String
searchDataParams
,
Integer
currentPage
)
{
public
List
<
WechatEventTrackingStoreGroupVO
>
getData
(
Context
context
,
String
searchDataParams
,
Integer
currentPage
)
{
List
<
JSONObject
>
list
=
storeAuthUtils
.
getDataCommon
(
searchDataParams
,
currentPage
,
List
<
JSONObject
>
list
=
storeAuthUtils
.
getDataCommonParent
(
searchDataParams
,
currentPage
,
"数据-登录数据-好办使用详情导出日志进来"
,
getPageSize
(),
false
).
getRows
();
"数据-登录数据-好办使用详情导出日志进来"
,
getPageSize
(),
false
,
true
).
getRows
();
list
=
storeAuthUtils
.
deleteTotalData
(
list
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
WechatEventTrackingStoreGroupVO
>
result
=
JSONObject
.
parseArray
(
JSON
.
toJSONString
(
list
),
WechatEventTrackingStoreGroupVO
.
class
);
List
<
WechatEventTrackingStoreGroupVO
>
result
=
JSONObject
.
parseArray
(
JSON
.
toJSONString
(
list
),
WechatEventTrackingStoreGroupVO
.
class
);
return
result
;
return
result
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/eventtracking/WechatEventTrackingClerkDetailQO.java
View file @
cab699bc
...
@@ -101,7 +101,7 @@ public class WechatEventTrackingClerkDetailQO implements Serializable {
...
@@ -101,7 +101,7 @@ public class WechatEventTrackingClerkDetailQO implements Serializable {
jsonObject
.
put
(
"orderByType"
,
orderByType
);
jsonObject
.
put
(
"orderByType"
,
orderByType
);
}
}
if
(
orderByFields
!=
null
)
{
if
(
orderByFields
!=
null
)
{
jsonObject
.
put
(
"orderByFields"
,
getDataApiOrderField
()
);
jsonObject
.
put
(
"orderByFields"
,
orderByFields
);
}
}
if
(
isLogin
!=
null
)
{
if
(
isLogin
!=
null
)
{
jsonObject
.
put
(
"isLogin"
,
isLogin
);
jsonObject
.
put
(
"isLogin"
,
isLogin
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/eventtracking/WechatEventTrackingStoreGroupQO.java
View file @
cab699bc
...
@@ -82,7 +82,7 @@ public class WechatEventTrackingStoreGroupQO extends StoreGroupCommonQO implemen
...
@@ -82,7 +82,7 @@ public class WechatEventTrackingStoreGroupQO extends StoreGroupCommonQO implemen
jsonObject
.
put
(
"orderByType"
,
orderByType
);
jsonObject
.
put
(
"orderByType"
,
orderByType
);
}
}
if
(
orderByFields
!=
null
)
{
if
(
orderByFields
!=
null
)
{
jsonObject
.
put
(
"orderByFields"
,
getDataApiOrderField
()
);
jsonObject
.
put
(
"orderByFields"
,
orderByFields
);
}
}
jsonObject
.
put
(
"pageNum"
,
pageNum
);
jsonObject
.
put
(
"pageNum"
,
pageNum
);
jsonObject
.
put
(
"pageSize"
,
pageSize
);
jsonObject
.
put
(
"pageSize"
,
pageSize
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/wechatwork/StoreGroupCommonQO.java
View file @
cab699bc
...
@@ -4,6 +4,7 @@ import lombok.Data;
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* @Author guojx
* @Author guojx
...
@@ -42,6 +43,11 @@ public class StoreGroupCommonQO implements Serializable {
...
@@ -42,6 +43,11 @@ public class StoreGroupCommonQO implements Serializable {
*/
*/
private
Integer
showStore
;
private
Integer
showStore
;
/**
* 门店状态
*/
private
List
<
String
>
statusList
;
public
boolean
isRecycle
()
{
public
boolean
isRecycle
()
{
return
"-3"
.
equals
(
nextStoreGroupId
);
return
"-3"
.
equals
(
nextStoreGroupId
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/data/StoreAuthUtils.java
View file @
cab699bc
...
@@ -55,6 +55,11 @@ public class StoreAuthUtils {
...
@@ -55,6 +55,11 @@ public class StoreAuthUtils {
List
<
String
>
storeIdList
=
new
ArrayList
<>();
List
<
String
>
storeIdList
=
new
ArrayList
<>();
List
<
String
>
statusList
=
getAllStoreStatus
();
List
<
String
>
statusList
=
getAllStoreStatus
();
List
<
String
>
statusListParam
=
storeCommonQO
.
getStatusList
();
if
(
CollectionUtils
.
isNotEmpty
(
statusListParam
))
{
statusList
.
retainAll
(
statusListParam
);
}
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
storeIdList
.
addAll
(
Arrays
.
stream
(
storeId
.
split
(
","
)).
collect
(
Collectors
.
toList
()));
storeIdList
.
addAll
(
Arrays
.
stream
(
storeId
.
split
(
","
)).
collect
(
Collectors
.
toList
()));
}
}
...
@@ -156,6 +161,10 @@ public class StoreAuthUtils {
...
@@ -156,6 +161,10 @@ public class StoreAuthUtils {
}
}
public
DataPageVO
getDataCommon
(
String
searchDataParams
,
Integer
currentPage
,
String
logStr
,
Integer
pageSize
,
boolean
hasCountPerPage
)
{
public
DataPageVO
getDataCommon
(
String
searchDataParams
,
Integer
currentPage
,
String
logStr
,
Integer
pageSize
,
boolean
hasCountPerPage
)
{
return
getDataCommonParent
(
searchDataParams
,
currentPage
,
logStr
,
pageSize
,
hasCountPerPage
,
false
);
}
public
DataPageVO
getDataCommonParent
(
String
searchDataParams
,
Integer
currentPage
,
String
logStr
,
Integer
pageSize
,
boolean
hasCountPerPage
,
boolean
noTotal
)
{
boolean
isFirst
=
currentPage
!=
null
&&
currentPage
==
1
;
boolean
isFirst
=
currentPage
!=
null
&&
currentPage
==
1
;
if
(
isFirst
)
{
if
(
isFirst
)
{
log
.
info
(
logStr
);
log
.
info
(
logStr
);
...
@@ -180,55 +189,37 @@ public class StoreAuthUtils {
...
@@ -180,55 +189,37 @@ public class StoreAuthUtils {
Integer
totalCount
=
page
.
getTotalCount
();
Integer
totalCount
=
page
.
getTotalCount
();
vo
.
setTotalNum
(
totalCount
);
vo
.
setTotalNum
(
totalCount
);
//调用一次合计
if
(!
noTotal
)
{
if
(
hasCountPerPage
||
(
isFirst
&&
CollectionUtils
.
isNotEmpty
(
list
)))
{
//调用一次合计
if
(
hasCountPerPage
&&
CollectionUtils
.
isEmpty
(
list
))
{
if
(
hasCountPerPage
||
(
isFirst
&&
CollectionUtils
.
isNotEmpty
(
list
)))
{
list
=
new
ArrayList
<>();
if
(
hasCountPerPage
&&
CollectionUtils
.
isEmpty
(
list
))
{
}
list
=
new
ArrayList
<>();
jsonObject
.
put
(
"pageNum"
,
1
);
}
jsonObject
.
put
(
"pageNum"
,
1
);
jsonObject
.
put
(
"storeGroup"
,
8
);
jsonObject
.
put
(
"storeGroup"
,
8
);
String
totalApolloKey
=
apolloKey
;
String
totalApolloKey
=
apolloKey
;
if
(
StringUtils
.
isNotBlank
(
allApolloKey
))
{
if
(
StringUtils
.
isNotBlank
(
allApolloKey
))
{
totalApolloKey
=
allApolloKey
;
totalApolloKey
=
allApolloKey
;
}
}
JSONObject
total
=
getTotalJson
(
jsonObject
,
totalApolloKey
);
JSONObject
total
=
getTotalJson
(
jsonObject
,
totalApolloKey
);
if
(
total
==
null
)
{
if
(
total
==
null
)
{
total
=
new
JSONObject
();
total
=
new
JSONObject
();
}
}
if
(
isStore
)
{
if
(
isStore
)
{
total
.
put
(
"storeName"
,
"合计("
+
totalCount
+
")"
);
total
.
put
(
"storeName"
,
"合计("
+
totalCount
+
")"
);
}
else
{
}
else
{
total
.
put
(
"storeGroupName"
,
"合计("
+
totalCount
+
")"
);
total
.
put
(
"storeGroupName"
,
"合计("
+
totalCount
+
")"
);
}
}
total
.
put
(
"storeGroupId"
,
"all"
);
total
.
put
(
"storeGroupId"
,
"all"
);
list
.
add
(
0
,
total
);
list
.
add
(
0
,
total
);
}
}
}
vo
.
setRows
(
list
);
vo
.
setRows
(
list
);
return
vo
;
return
vo
;
}
}
/**
* 删除合计的那条数据
* @param vo
*/
public
void
deleteTotalData
(
DataPageVO
vo
)
{
deleteTotalData
(
vo
.
getRows
());
}
public
List
<
JSONObject
>
deleteTotalData
(
List
<
JSONObject
>
list
)
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
list
.
size
()
==
1
&&
"all"
.
equals
(
list
.
get
(
0
).
getString
(
"storeGroupId"
)))
{
return
Collections
.
EMPTY_LIST
;
}
else
{
//删除合计的那条数据
list
.
remove
(
0
);
}
}
return
list
;
}
private
List
<
String
>
getStore
(
String
enterpriseId
,
String
userId
,
String
search
,
List
<
String
>
storeGroupIdList
,
List
<
String
>
status
,
List
<
String
>
storeIdList
)
{
private
List
<
String
>
getStore
(
String
enterpriseId
,
String
userId
,
String
search
,
List
<
String
>
storeGroupIdList
,
List
<
String
>
status
,
List
<
String
>
storeIdList
)
{
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
...
@@ -260,10 +251,19 @@ public class StoreAuthUtils {
...
@@ -260,10 +251,19 @@ public class StoreAuthUtils {
}
}
public
List
<
String
>
getPreStoreIdList
(
String
preStoreGroupId
,
String
enterpriseId
)
{
public
List
<
String
>
getPreStoreIdList
(
String
preStoreGroupId
,
String
enterpriseId
)
{
return
getPreStoreIdListCommon
(
preStoreGroupId
,
enterpriseId
,
null
);
}
public
List
<
String
>
getPreStoreIdListCommon
(
String
preStoreGroupId
,
String
enterpriseId
,
List
<
String
>
statusList
)
{
preStoreGroupId
=
getPreStoreGroupId
(
preStoreGroupId
,
enterpriseId
);
preStoreGroupId
=
getPreStoreGroupId
(
preStoreGroupId
,
enterpriseId
);
String
[]
queryArr
=
new
String
[]{
preStoreGroupId
};
String
[]
queryArr
=
new
String
[]{
preStoreGroupId
};
List
<
String
>
defaultStatusList
=
getAllStoreStatus
();
if
(
CollectionUtils
.
isNotEmpty
(
statusList
))
{
defaultStatusList
.
retainAll
(
statusList
);
}
List
<
String
>
storeIdList
=
storeService
.
getStoreIdListByGroupId
(
queryArr
,
List
<
String
>
storeIdList
=
storeService
.
getStoreIdListByGroupId
(
queryArr
,
getAllStoreStatus
()
.
stream
().
mapToInt
(
e
->
Integer
.
parseInt
(
e
)).
boxed
().
collect
(
Collectors
.
toList
()));
defaultStatusList
.
stream
().
mapToInt
(
e
->
Integer
.
parseInt
(
e
)).
boxed
().
collect
(
Collectors
.
toList
()));
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
storeIdList
.
add
(
NO_EXIST_STORE_ID
);
storeIdList
.
add
(
NO_EXIST_STORE_ID
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/eventtracking/DateExpandUtils.java
View file @
cab699bc
...
@@ -35,8 +35,12 @@ public class DateExpandUtils {
...
@@ -35,8 +35,12 @@ public class DateExpandUtils {
list
=
DateUtil
.
getBetweenDates
(
df
.
format
(
calendar
.
getTime
()),
dateType
==
1
?
startDate
:
endDate
);
list
=
DateUtil
.
getBetweenDates
(
df
.
format
(
calendar
.
getTime
()),
dateType
==
1
?
startDate
:
endDate
);
break
;
break
;
case
4
:
case
4
:
calendar
.
setTime
(
DateUtil
.
strToDate
(
startDate
,
"yyyy-MM-dd"
));
calendar
.
add
(
Calendar
.
WEEK_OF_YEAR
,
-
11
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"startDate"
,
startDate
);
jsonObject
.
put
(
"startDate"
,
df
.
format
(
calendar
.
getTime
()));
jsonObject
.
put
(
"endDate"
,
startDate
);
jsonObject
.
put
(
"pageNum"
,
1
);
jsonObject
.
put
(
"pageNum"
,
1
);
jsonObject
.
put
(
"pageSize"
,
100
);
jsonObject
.
put
(
"pageSize"
,
100
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_pub_date_week"
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
"data_pub_date_week"
);
...
@@ -60,4 +64,37 @@ public class DateExpandUtils {
...
@@ -60,4 +64,37 @@ public class DateExpandUtils {
}
}
return
list
;
return
list
;
}
}
public
static
String
getVisitTimeStr
(
Long
avgVisitTime
)
{
if
(
avgVisitTime
!=
null
)
{
int
hour
=
(
int
)
(
avgVisitTime
/
3600
);
String
str
=
getTimeStr
(
hour
);
if
(
hour
>
0
)
{
avgVisitTime
=
avgVisitTime
-
(
3600
*
hour
);
}
int
minute
=
(
int
)
(
avgVisitTime
/
60
);
str
=
str
+
":"
+
getTimeStr
(
minute
);
if
(
minute
>
0
)
{
avgVisitTime
=
avgVisitTime
-
(
60
*
minute
);
}
str
=
str
+
":"
+
getTimeStr
(
avgVisitTime
.
shortValue
());
return
str
;
}
return
null
;
}
private
static
String
getTimeStr
(
int
time
)
{
String
str
=
""
;
if
(
time
==
0
)
{
str
=
"00"
;
}
else
if
(
time
<
10
)
{
str
=
"0"
+
time
+
""
;
}
else
{
str
=
""
+
time
;
}
return
str
;
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/eventtracking/TrendVO.java
View file @
cab699bc
...
@@ -11,6 +11,8 @@ import java.io.Serializable;
...
@@ -11,6 +11,8 @@ import java.io.Serializable;
@Data
@Data
public
class
TrendVO
implements
Serializable
{
public
class
TrendVO
implements
Serializable
{
private
Integer
avgVisitTime
;
/**
/**
* 员工总人数
* 员工总人数
*/
*/
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/eventtracking/WechatEventTrackingClerkVO.java
View file @
cab699bc
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
eventtracking
;
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
eventtracking
;
import
com.gic.haoban.manage.web.utils.eventtracking.DateExpandUtils
;
import
com.gic.haoban.manage.web.vo.wechatwork.StoreGroupCommonVO
;
import
com.gic.haoban.manage.web.vo.wechatwork.StoreGroupCommonVO
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -52,35 +53,6 @@ public class WechatEventTrackingClerkVO extends StoreGroupCommonVO implements Se
...
@@ -52,35 +53,6 @@ public class WechatEventTrackingClerkVO extends StoreGroupCommonVO implements Se
private
String
clerkCode
;
private
String
clerkCode
;
public
String
getVisitTimeStr
()
{
public
String
getVisitTimeStr
()
{
if
(
avgVisitTime
!=
null
)
{
return
DateExpandUtils
.
getVisitTimeStr
(
avgVisitTime
);
int
hour
=
(
int
)
(
avgVisitTime
/
3600
);
String
str
=
getTimeStr
(
hour
);
if
(
hour
>
0
)
{
avgVisitTime
=
avgVisitTime
-
(
3600
*
hour
);
}
int
minute
=
(
int
)
(
avgVisitTime
/
60
);
str
=
str
+
":"
+
getTimeStr
(
minute
);
if
(
minute
>
0
)
{
avgVisitTime
=
avgVisitTime
-
(
60
*
minute
);
}
str
=
str
+
":"
+
getTimeStr
(
avgVisitTime
.
shortValue
());
return
str
;
}
return
visitTimeStr
;
}
private
static
String
getTimeStr
(
int
time
)
{
String
str
=
""
;
if
(
time
==
0
)
{
str
=
"00"
;
}
else
if
(
time
<
10
)
{
str
=
"0"
+
time
+
""
;
}
else
{
str
=
""
+
time
;
}
return
str
;
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/eventtracking/WechatEventTrackingOverviewVO.java
0 → 100644
View file @
cab699bc
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
eventtracking
;
import
com.gic.haoban.manage.web.utils.eventtracking.DateExpandUtils
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author guojx
* @Date 2024/5/21 15:56
*/
@Data
public
class
WechatEventTrackingOverviewVO
implements
Serializable
{
/**
* 次均访问时长 单位秒
*/
private
Long
avgVisitTime
;
/**
* 次均访问时长较前一期
*/
private
Double
avgVisitTimeSply
;
/**
* 次均访问时长 00:00:00格式
*/
private
String
visitTimeStr
;
/**
* 访问次数
*/
private
Integer
visitCnt
;
/**
* 访问次数较前一期
*/
private
Double
visitCntSply
;
/**
* 活跃率
*/
private
Double
visitRate
;
/**
* 活跃率较前一期
*/
private
Double
visitRateSply
;
/**
* 活跃人数
*/
private
Integer
visitNum
;
/**
* 活跃人数较前一期
*/
private
Double
visitNumSply
;
/**
* 绑定率
*/
private
Double
bindingRate
;
/**
* 绑定率较前一期
*/
private
Double
bindingRateSply
;
/**
* 绑定人数
*/
private
Integer
bindingNum
;
/**
* 绑定人数较前一期
*/
private
Double
bindingSply
;
/**
* 员工总人数
*/
private
Integer
clerkNum
;
public
String
getVisitTimeStr
()
{
return
DateExpandUtils
.
getVisitTimeStr
(
avgVisitTime
);
}
}
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