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
267e1c51
Commit
267e1c51
authored
2 years ago
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面信息流分析、页面使用习惯分析
parent
ff1957ce
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
407 additions
and
7 deletions
+407
-7
portal-manager/doc/api.md
portal-manager/doc/api.md
+146
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/PageAccessDao.java
...n/java/com/mortals/xhx/module/page/dao/PageAccessDao.java
+8
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/PageEventDao.java
...in/java/com/mortals/xhx/module/page/dao/PageEventDao.java
+9
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/ibatis/PageAccessDaoImpl.java
...mortals/xhx/module/page/dao/ibatis/PageAccessDaoImpl.java
+5
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/ibatis/PageEventDaoImpl.java
.../mortals/xhx/module/page/dao/ibatis/PageEventDaoImpl.java
+6
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/model/vo/PageAccessVo.java
...va/com/mortals/xhx/module/page/model/vo/PageAccessVo.java
+5
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/model/vo/UsageCensusVo.java
...a/com/mortals/xhx/module/page/model/vo/UsageCensusVo.java
+17
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageAccessService.java
...om/mortals/xhx/module/page/service/PageAccessService.java
+10
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageEventService.java
...com/mortals/xhx/module/page/service/PageEventService.java
+8
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageAccessServiceImpl.java
...s/xhx/module/page/service/impl/PageAccessServiceImpl.java
+26
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
...ls/xhx/module/page/service/impl/PageEventServiceImpl.java
+53
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
...com/mortals/xhx/module/page/web/PageCensusController.java
+59
-0
portal-manager/src/main/resources/sqlmap/module/page/PageAccessMapperExt.xml
...main/resources/sqlmap/module/page/PageAccessMapperExt.xml
+37
-0
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
.../main/resources/sqlmap/module/page/PageEventMapperExt.xml
+18
-1
No files found.
portal-manager/doc/api.md
View file @
267e1c51
...
@@ -5159,7 +5159,6 @@ data|object|数据对象
...
@@ -5159,7 +5159,6 @@ data|object|数据对象
  
value|int|访问次数
  
value|int|访问次数
**响应消息样例:**
**响应消息样例:**
```
```
{
{
...
@@ -5449,6 +5448,152 @@ data|object|数据对象
...
@@ -5449,6 +5448,152 @@ data|object|数据对象
```
```
### 页面使用习惯分析
**请求URL:**
zwfw/act/analyse/usageCensus
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查询页面使用习惯分析
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:-------
productId|Long|是|产品id
dateTimeStart|String|是|开始时间
dateTimeStart|String|是|结束时间
**请求样例:**
```
{
"productId":1,
"dateTimeStart":"2023-04-10",
"dateTimeEnd":"2023-05-11"
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|array|数据对象
 
businessCode|String|业务功能code
 
businessName|String|业务功能name
 
accessCount|int|访问次数
 
proportion|String|占比
 
propValue|String|占比值
**响应消息样例:**
```
{
"data": [
{
"businessCode": "/",
"businessName": "首页",
"accessCount": 2,
"proportion": "50.00%",
"propValue": 0.5
},
{
"businessCode": "/floor",
"businessName": "中心导航",
"accessCount": 1,
"proportion": "25.00%",
"propValue": 0.25
},
{
"businessCode": "/Layout",
"businessName": "中心导航",
"accessCount": 1,
"proportion": "25.00%",
"propValue": 0.25
}
],
"code": 1,
"msg": "查询页面使用习惯分析成功"
}
```
### 页面信息流分析
**请求URL:**
zwfw/act/analyse/informationFlow
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
查询页面信息流分析
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:-------
productId|Long|是|产品id
dateTimeStart|String|是|开始时间
dateTimeStart|String|是|结束时间
**请求样例:**
```
{
"productId":1,
"dateTimeStart":"2023-04-10",
"dateTimeEnd":"2023-05-11"
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|array|数据对象
 
productId|long|产品id
 
productName|String|产品名称
 
firstCode|String|一级场景code
 
firstName|String|一级场景name
 
secondCode|String|二级场景code
 
secondName|String|二级场景name
 
thirdCode|String|三级场景code
 
thirdName|String|三级场景name
 
fourthCode|String|四级场景code
 
fourthName|String|四级场景name
 
accessCount|int|访问次数,打开次数
 
pageDepth|int|访问页面数
**响应消息样例:**
```
{
"data": [
{
"deleted": 0,
"accessCount": 1,
"productId": 1,
"productName": "导视机",
"firstCode": "/",
"firstName": "首页",
"secondCode": "/floor",
"secondName": "中心导航",
"thirdCode": "--",
"thirdName": "--",
"fourthCode": "--",
"fourthName": "--",
"pageDepth": 1
}
],
"code": 1,
"msg": "查询信息流分析成功"
}
```
## 字典附录
## 字典附录
### userType
### userType
字典参数key|字典参数值|其它
字典参数key|字典参数值|其它
...
...
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/PageAccessDao.java
View file @
267e1c51
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.page.dao;
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.page.dao;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* 产品页面配置Dao
* 产品页面配置Dao
...
@@ -13,5 +15,10 @@ import java.util.List;
...
@@ -13,5 +15,10 @@ import java.util.List;
public
interface
PageAccessDao
extends
ICRUDDao
<
PageAccessEntity
,
Long
>{
public
interface
PageAccessDao
extends
ICRUDDao
<
PageAccessEntity
,
Long
>{
/**
* 信息流分析
* @param pdu
* @return
*/
List
<
PageAccessEntity
>
getInformationFlow
(
PageCensusPdu
pdu
);
}
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/PageEventDao.java
View file @
267e1c51
...
@@ -6,6 +6,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
...
@@ -6,6 +6,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.UsageCensusVo
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -38,6 +39,7 @@ public interface PageEventDao extends ICRUDDao<PageEventEntity,Long>{
...
@@ -38,6 +39,7 @@ public interface PageEventDao extends ICRUDDao<PageEventEntity,Long>{
* @return
* @return
*/
*/
List
<
AccessTrendCensusVo
>
getPageAccessTrend
(
PageCensusPdu
pdu
);
List
<
AccessTrendCensusVo
>
getPageAccessTrend
(
PageCensusPdu
pdu
);
/**
/**
* 页面访问次数TOP10
* 页面访问次数TOP10
* @param pdu
* @param pdu
...
@@ -45,4 +47,11 @@ public interface PageEventDao extends ICRUDDao<PageEventEntity,Long>{
...
@@ -45,4 +47,11 @@ public interface PageEventDao extends ICRUDDao<PageEventEntity,Long>{
*/
*/
List
<
AccessTrendCensusVo
>
getPageAccessTop
(
PageCensusPdu
pdu
);
List
<
AccessTrendCensusVo
>
getPageAccessTop
(
PageCensusPdu
pdu
);
/**
* 使用习惯
* @param pdu
* @return
*/
List
<
UsageCensusVo
>
getUsageCensus
(
PageCensusPdu
pdu
);
}
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/ibatis/PageAccessDaoImpl.java
View file @
267e1c51
package
com.mortals.xhx.module.page.dao.ibatis
;
package
com.mortals.xhx.module.page.dao.ibatis
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.page.dao.PageAccessDao
;
import
com.mortals.xhx.module.page.dao.PageAccessDao
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
...
@@ -17,5 +18,8 @@ import java.util.List;
...
@@ -17,5 +18,8 @@ import java.util.List;
public
class
PageAccessDaoImpl
extends
BaseCRUDDaoMybatis
<
PageAccessEntity
,
Long
>
implements
PageAccessDao
{
public
class
PageAccessDaoImpl
extends
BaseCRUDDaoMybatis
<
PageAccessEntity
,
Long
>
implements
PageAccessDao
{
@Override
public
List
<
PageAccessEntity
>
getInformationFlow
(
PageCensusPdu
pdu
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getInformationFlow"
),
pdu
);
}
}
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/dao/ibatis/PageEventDaoImpl.java
View file @
267e1c51
...
@@ -5,6 +5,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
...
@@ -5,6 +5,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.UsageCensusVo
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.page.dao.PageEventDao
;
import
com.mortals.xhx.module.page.dao.PageEventDao
;
import
com.mortals.xhx.module.page.model.PageEventEntity
;
import
com.mortals.xhx.module.page.model.PageEventEntity
;
...
@@ -41,5 +42,10 @@ public class PageEventDaoImpl extends BaseCRUDDaoMybatis<PageEventEntity,Long> i
...
@@ -41,5 +42,10 @@ public class PageEventDaoImpl extends BaseCRUDDaoMybatis<PageEventEntity,Long> i
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getPageAccessTop"
),
pdu
);
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getPageAccessTop"
),
pdu
);
}
}
@Override
public
List
<
UsageCensusVo
>
getUsageCensus
(
PageCensusPdu
pdu
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getUsageCensus"
),
pdu
);
}
}
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/model/vo/PageAccessVo.java
View file @
267e1c51
package
com.mortals.xhx.module.page.model.vo
;
package
com.mortals.xhx.module.page.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -9,6 +11,8 @@ import java.util.List;
...
@@ -9,6 +11,8 @@ import java.util.List;
* @author zxfei
* @author zxfei
* @date 2023-04-10
* @date 2023-04-10
*/
*/
@Data
public
class
PageAccessVo
extends
BaseEntityLong
{
public
class
PageAccessVo
extends
BaseEntityLong
{
/** 访问次数 */
private
Integer
accessCount
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/model/vo/UsageCensusVo.java
0 → 100644
View file @
267e1c51
package
com.mortals.xhx.module.page.model.vo
;
import
lombok.Data
;
@Data
public
class
UsageCensusVo
{
/*** 业务场景编码 */
private
String
businessCode
;
/*** 业务场景名称 */
private
String
businessName
;
/** 点击次数 */
private
Integer
accessCount
;
/** 点击占比 */
private
String
proportion
;
/** 点击占比 */
private
float
propValue
;
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageAccessService.java
View file @
267e1c51
...
@@ -2,6 +2,9 @@ package com.mortals.xhx.module.page.service;
...
@@ -2,6 +2,9 @@ package com.mortals.xhx.module.page.service;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
java.util.List
;
/**
/**
* PageAccessService
* PageAccessService
...
@@ -14,4 +17,11 @@ import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
...
@@ -14,4 +17,11 @@ import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
public
interface
PageAccessService
extends
ICRUDService
<
PageAccessEntity
,
Long
>{
public
interface
PageAccessService
extends
ICRUDService
<
PageAccessEntity
,
Long
>{
PageAccessEntity
saveByPdu
(
BuryPointPdu
pdu
);
PageAccessEntity
saveByPdu
(
BuryPointPdu
pdu
);
/**
* 信息流分析
* @param pdu
* @return
*/
List
<
PageAccessEntity
>
getInformationFlow
(
PageCensusPdu
pdu
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageEventService.java
View file @
267e1c51
...
@@ -6,6 +6,7 @@ import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
...
@@ -6,6 +6,7 @@ import com.mortals.xhx.module.page.model.pdu.BuryPointPdu;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.UsageCensusVo
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -43,4 +44,11 @@ public interface PageEventService extends ICRUDService<PageEventEntity,Long>{
...
@@ -43,4 +44,11 @@ public interface PageEventService extends ICRUDService<PageEventEntity,Long>{
*/
*/
Map
<
String
,
Object
>
getPageAccessAnalyse
(
PageCensusPdu
pdu
)
throws
AppException
;
Map
<
String
,
Object
>
getPageAccessAnalyse
(
PageCensusPdu
pdu
)
throws
AppException
;
/**
* 使用习惯
* @param pdu
* @return
*/
List
<
UsageCensusVo
>
getUsageCensus
(
PageCensusPdu
pdu
)
throws
AppException
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageAccessServiceImpl.java
View file @
267e1c51
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.page.service.impl;
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.page.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
@@ -11,7 +12,10 @@ import com.mortals.xhx.module.page.dao.PageAccessDao;
...
@@ -11,7 +12,10 @@ import com.mortals.xhx.module.page.dao.PageAccessDao;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* PageAccessService
* PageAccessService
...
@@ -64,9 +68,30 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
...
@@ -64,9 +68,30 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
entity
.
setFourthCode
(
pdu
.
getDepthArr
().
get
(
3
).
getSourceCode
());
entity
.
setFourthCode
(
pdu
.
getDepthArr
().
get
(
3
).
getSourceCode
());
entity
.
setFourthName
(
pdu
.
getDepthArr
().
get
(
3
).
getSourceCode
());
entity
.
setFourthName
(
pdu
.
getDepthArr
().
get
(
3
).
getSourceCode
());
}
}
entity
.
setPageDepth
(
pdu
.
getDepthArr
().
size
());
entity
.
setPageDepth
(
pdu
.
getDepthArr
().
size
()
+
1
);
entity
.
setAccessContent
(
JSONObject
.
toJSONString
(
pdu
.
getDepthArr
()));
entity
.
setAccessContent
(
JSONObject
.
toJSONString
(
pdu
.
getDepthArr
()));
entity
.
setCreateTime
(
new
Date
());
entity
.
setCreateTime
(
new
Date
());
return
this
.
save
(
entity
);
return
this
.
save
(
entity
);
}
}
@Override
public
List
<
PageAccessEntity
>
getInformationFlow
(
PageCensusPdu
pdu
)
{
if
(
StringUtils
.
isEmpty
(
pdu
.
getDateTimeStart
())){
throw
new
AppException
(
"开始日期不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
pdu
.
getDateTimeEnd
())){
throw
new
AppException
(
"结束日期不能为空"
);
}
if
(
pdu
.
getProductId
()==
null
){
throw
new
AppException
(
"产品id不能为空"
);
}
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date1
=
sdf
.
parse
(
pdu
.
getDateTimeStart
());
Date
date2
=
sdf
.
parse
(
pdu
.
getDateTimeEnd
());
}
catch
(
ParseException
e
){
throw
new
AppException
(
"日期格式错误,应为yyyy-MM-dd"
);
}
return
dao
.
getInformationFlow
(
pdu
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
View file @
267e1c51
...
@@ -8,6 +8,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
...
@@ -8,6 +8,7 @@ import com.mortals.xhx.module.page.model.pdu.PageCensusPdu;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.AccessTrendCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.ProductHotCensusVo
;
import
com.mortals.xhx.module.page.model.vo.UsageCensusVo
;
import
com.mortals.xhx.module.page.service.PageInfoService
;
import
com.mortals.xhx.module.page.service.PageInfoService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -155,6 +156,13 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -155,6 +156,13 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
if
(
pdu
.
getProductId
()==
null
){
if
(
pdu
.
getProductId
()==
null
){
throw
new
AppException
(
"产品id不能为空"
);
throw
new
AppException
(
"产品id不能为空"
);
}
}
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date1
=
sdf
.
parse
(
pdu
.
getDateTimeStart
());
Date
date2
=
sdf
.
parse
(
pdu
.
getDateTimeEnd
());
}
catch
(
ParseException
e
){
throw
new
AppException
(
"日期格式错误,应为yyyy-MM-dd"
);
}
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
AccessTrendCensusVo
>
trendCensusVos
=
dao
.
getPageAccessTrend
(
pdu
);
List
<
AccessTrendCensusVo
>
trendCensusVos
=
dao
.
getPageAccessTrend
(
pdu
);
Long
clickSum
=
0
l
;
Long
clickSum
=
0
l
;
...
@@ -165,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -165,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
}
}
float
a
=
(
float
)
clickSum
;
float
a
=
(
float
)
clickSum
;
float
b
=
(
float
)
trendCensusVos
.
size
();
float
b
=
(
float
)
trendCensusVos
.
size
();
float
p
=
a
/
b
;
float
p
=
b
/
a
;
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00"
);
String
s
=
decimalFormat
.
format
(
p
);
String
s
=
decimalFormat
.
format
(
p
);
dayAccessAvg
=
Float
.
valueOf
(
s
);
dayAccessAvg
=
Float
.
valueOf
(
s
);
...
@@ -186,4 +194,48 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -186,4 +194,48 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
return
result
;
return
result
;
}
}
@Override
public
List
<
UsageCensusVo
>
getUsageCensus
(
PageCensusPdu
pdu
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
pdu
.
getDateTimeStart
())){
throw
new
AppException
(
"开始日期不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
pdu
.
getDateTimeEnd
())){
throw
new
AppException
(
"结束日期不能为空"
);
}
if
(
pdu
.
getProductId
()==
null
){
throw
new
AppException
(
"产品id不能为空"
);
}
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date1
=
sdf
.
parse
(
pdu
.
getDateTimeStart
());
Date
date2
=
sdf
.
parse
(
pdu
.
getDateTimeEnd
());
}
catch
(
ParseException
e
){
throw
new
AppException
(
"日期格式错误,应为yyyy-MM-dd"
);
}
List
<
UsageCensusVo
>
list
=
dao
.
getUsageCensus
(
pdu
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
Integer
clickSum
=
0
;
for
(
UsageCensusVo
item:
list
){
if
(
item
!=
null
&&
item
.
getAccessCount
()!=
null
)
{
clickSum
+=
item
.
getAccessCount
();
}
}
for
(
UsageCensusVo
item:
list
){
if
(
item
!=
null
&&
item
.
getAccessCount
()!=
null
)
{
float
a
=
(
float
)
clickSum
;
float
b
=
(
float
)
item
.
getAccessCount
();
float
p
=
b
/
a
;
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00%"
);
DecimalFormat
df
=
new
DecimalFormat
(
".00"
);
String
s
=
decimalFormat
.
format
(
p
);
String
s1
=
df
.
format
(
p
);
item
.
setProportion
(
s
);
item
.
setPropValue
(
Float
.
valueOf
(
s1
));
}
}
}
return
list
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
View file @
267e1c51
...
@@ -6,8 +6,11 @@ import com.mortals.framework.model.Context;
...
@@ -6,8 +6,11 @@ import com.mortals.framework.model.Context;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
import
com.mortals.xhx.module.page.model.vo.PageEventCensusVo
;
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.PageEventService
;
import
com.mortals.xhx.module.page.service.PageRouteService
;
import
com.mortals.xhx.module.page.service.PageRouteService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -31,6 +34,8 @@ public class PageCensusController extends BaseJsonBodyController {
...
@@ -31,6 +34,8 @@ public class PageCensusController extends BaseJsonBodyController {
private
PageEventService
pageEventService
;
private
PageEventService
pageEventService
;
@Autowired
@Autowired
private
PageRouteService
pageRouteService
;
private
PageRouteService
pageRouteService
;
@Autowired
private
PageAccessService
pageAccessService
;
/**
/**
* 事件分析
* 事件分析
...
@@ -139,4 +144,58 @@ public class PageCensusController extends BaseJsonBodyController {
...
@@ -139,4 +144,58 @@ public class PageCensusController extends BaseJsonBodyController {
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
return
ret
;
}
}
/**
* 页面使用习惯分析
* @param query
* @return
*/
@PostMapping
({
"usageCensus"
})
@UnAuth
public
Rest
<
Object
>
getUsageCensus
(
@RequestBody
PageCensusPdu
query
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询页面使用习惯分析"
;
int
code
=
1
;
try
{
List
<
UsageCensusVo
>
result
=
pageEventService
.
getUsageCensus
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
.
get
(
"data"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
/**
* 信息流分析
* @param query
* @return
*/
@PostMapping
({
"informationFlow"
})
@UnAuth
public
Rest
<
Object
>
getInformationFlow
(
@RequestBody
PageCensusPdu
query
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询信息流分析"
;
int
code
=
1
;
try
{
List
<
PageAccessEntity
>
result
=
pageAccessService
.
getInformationFlow
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
.
get
(
"data"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
}
This diff is collapsed.
Click to expand it.
portal-manager/src/main/resources/sqlmap/module/page/PageAccessMapperExt.xml
0 → 100644
View file @
267e1c51
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mortals.xhx.module.page.dao.ibatis.PageAccessDaoImpl"
>
<!-- 信息流分析 -->
<select
id=
"getInformationFlow"
parameterType=
"com.mortals.xhx.module.page.model.pdu.PageCensusPdu"
resultType=
"com.mortals.xhx.module.page.model.PageAccessEntity"
>
SELECT
t.productId,
t.productName,
t.firstCode,
t.firstName,
IFNULL(t.secondCode,'--') as secondCode,
IFNULL(t.secondName,'--') as secondName,
IFNULL(t.thirdCode,'--') as thirdCode,
IFNULL(t.thirdName,'--') as thirdName,
IFNULL(t.fourthCode,'--') as fourthCode,
IFNULL(t.fourthName,'--') as fourthName,
COUNT(t.id) as accessCount,
MAX(t.pageDepth) as pageDepth
FROM
mortals_xhx_page_access t
WHERE
t.productId = #{productId}
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
t.firstCode,
t.firstName,
IFNULL(t.secondCode,'--'),
IFNULL(t.secondName,'--'),
IFNULL(t.thirdCode,'--'),
IFNULL(t.thirdName,'--'),
IFNULL(t.fourthCode,'--'),
IFNULL(t.fourthName,'--')
</select>
</mapper>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
View file @
267e1c51
...
@@ -83,5 +83,22 @@
...
@@ -83,5 +83,22 @@
) as a ORDER BY accessCount DESC LIMIT 10
) as a ORDER BY accessCount DESC LIMIT 10
</select>
</select>
<!-- 使用习惯 -->
<select
id=
"getUsageCensus"
parameterType=
"com.mortals.xhx.module.page.model.pdu.PageCensusPdu"
resultType=
"com.mortals.xhx.module.page.model.vo.UsageCensusVo"
>
SELECT
t.businessCode,
t.businessName,
COUNT(t.id) as accessCount
FROM
mortals_xhx_page_event t
WHERE
t.productId = #{productId}
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
AND t.businessCode !=''
GROUP BY
t.businessCode,
t.businessName
</select>
</mapper>
</mapper>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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