Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
669bcad7
Commit
669bcad7
authored
May 22, 2025
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户使用行为分析增加按站点统计
parent
4623f837
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
205 additions
and
6 deletions
+205
-6
portal-manager/src/main/java/com/mortals/xhx/module/page/model/pdu/PageCensusPdu.java
.../com/mortals/xhx/module/page/model/pdu/PageCensusPdu.java
+3
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
...com/mortals/xhx/module/page/web/PageCensusController.java
+136
-6
portal-manager/src/main/resources/sqlmap/module/page/PageAccessDepthMapperExt.xml
...resources/sqlmap/module/page/PageAccessDepthMapperExt.xml
+6
-0
portal-manager/src/main/resources/sqlmap/module/page/PageAccessMapperExt.xml
...main/resources/sqlmap/module/page/PageAccessMapperExt.xml
+6
-0
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
.../main/resources/sqlmap/module/page/PageEventMapperExt.xml
+36
-0
portal-manager/src/main/resources/sqlmap/module/page/PageRouteMapperExt.xml
.../main/resources/sqlmap/module/page/PageRouteMapperExt.xml
+18
-0
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/page/model/pdu/PageCensusPdu.java
View file @
669bcad7
...
...
@@ -26,4 +26,7 @@ public class PageCensusPdu {
/** 业务编码 **/
private
String
businessCode
;
private
List
<
String
>
businessCodeList
;
/** 设备编码 */
private
List
<
String
>
deviceNumList
;
private
Long
siteId
;
}
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
View file @
669bcad7
...
...
@@ -2,10 +2,11 @@ package com.mortals.xhx.module.page.web;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.feign.device.IDeviceFeign
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
...
...
@@ -13,15 +14,16 @@ import com.mortals.xhx.module.page.model.vo.UsageCensusVo;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
com.mortals.xhx.module.page.service.PageEventService
;
import
com.mortals.xhx.module.page.service.PageRouteService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 用户行为分析
...
...
@@ -36,6 +38,8 @@ public class PageCensusController extends BaseJsonBodyController {
private
PageRouteService
pageRouteService
;
@Autowired
private
PageAccessService
pageAccessService
;
@Autowired
private
IDeviceFeign
deviceFeign
;
/**
* 事件分析
...
...
@@ -50,6 +54,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询事件分析结果"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
List
<
PageEventCensusVo
>
result
=
pageEventService
.
getPageEventCensus
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -77,6 +102,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询产品热力图"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
Map
<
String
,
Object
>
result
=
pageEventService
.
getProductHotCensus
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -104,6 +150,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询页面访问分析"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
Map
<
String
,
Object
>
result
=
pageEventService
.
getPageAccessAnalyse
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -131,6 +198,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询页面路径访问分析"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
Map
<
String
,
Object
>
result
=
pageRouteService
.
getWayAccessAnalyse
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -158,6 +246,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询页面使用习惯分析"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
List
<
UsageCensusVo
>
result
=
pageEventService
.
getUsageCensus
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
@@ -185,6 +294,27 @@ public class PageCensusController extends BaseJsonBodyController {
String
busiDesc
=
"查询信息流分析"
;
int
code
=
1
;
try
{
if
(
query
.
getSiteId
()!=
null
)
{
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
query
.
getSiteId
());
devicePdu
.
setProductId
(
query
.
getProductId
());
devicePdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
// log.info("deviceRest:{}", JSON.toJSONString(deviceRest));
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
String
>
deviceCodeList
=
devicePduList
.
stream
().
map
(
d
->
d
.
getDeviceCode
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
deviceCodeList
)){
query
.
setDeviceNumList
(
deviceCodeList
);
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
else
{
query
.
setDeviceNumList
(
Arrays
.
asList
(
"abd"
));
}
}
}
List
<
PageAccessEntity
>
result
=
pageAccessService
.
getInformationFlow
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
...
...
portal-manager/src/main/resources/sqlmap/module/page/PageAccessDepthMapperExt.xml
View file @
669bcad7
...
...
@@ -12,6 +12,12 @@
mortals_xhx_page_access_depth t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</select>
...
...
portal-manager/src/main/resources/sqlmap/module/page/PageAccessMapperExt.xml
View file @
669bcad7
...
...
@@ -24,6 +24,12 @@
mortals_xhx_page_access t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
...
...
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
View file @
669bcad7
...
...
@@ -13,6 +13,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
AND t.eventCode IS NOT NULL
...
...
@@ -35,6 +41,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
AND t.businessCode IS NOT NULL
...
...
@@ -62,6 +74,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
AND t.businessCode IS NOT NULL
...
...
@@ -84,6 +102,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
...
...
@@ -101,6 +125,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
...
...
@@ -119,6 +149,12 @@
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
AND t.businessCode IS NOT NULL
...
...
portal-manager/src/main/resources/sqlmap/module/page/PageRouteMapperExt.xml
View file @
669bcad7
...
...
@@ -14,6 +14,12 @@
mortals_xhx_page_route t
WHERE
t.productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND t.deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
...
...
@@ -34,6 +40,12 @@
mortals_xhx_page_route
WHERE
productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
...
...
@@ -46,6 +58,12 @@
mortals_xhx_page_route
WHERE
productId = #{productId}
<if
test=
"deviceNumList!=null and deviceNumList.size() > 0"
>
AND deviceNum in
<foreach
collection=
"deviceNumList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
AND createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
) AS a
...
...
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