Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
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
廖旭伟
self-service
Commits
e2241381
Commit
e2241381
authored
Jul 06, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天府通办数据汇聚接口修改
parent
d242eb2e
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
535 additions
and
372 deletions
+535
-372
sst-manager/src/main/java/com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
...com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
+3
-1
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
...ortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
+2
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
...module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
+4
-4
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/ConvergeAppsEntity.java
...mortals/xhx/module/converge/model/ConvergeAppsEntity.java
+14
-8
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/ConvergeAppsQuery.java
.../mortals/xhx/module/converge/model/ConvergeAppsQuery.java
+285
-229
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/AppVO.java
.../java/com/mortals/xhx/module/converge/model/vo/AppVO.java
+6
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/AppsAccessVo.java
...om/mortals/xhx/module/converge/model/vo/AppsAccessVo.java
+6
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsAccessService.java
...hx/module/converge/service/ConvergeAppsAccessService.java
+2
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsService.java
...tals/xhx/module/converge/service/ConvergeAppsService.java
+1
-1
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsAccessServiceImpl.java
.../converge/service/impl/ConvergeAppsAccessServiceImpl.java
+4
-4
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsServiceImpl.java
...module/converge/service/impl/ConvergeAppsServiceImpl.java
+10
-9
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
...module/converge/service/impl/ConvergeSiteServiceImpl.java
+3
-0
sst-manager/src/main/java/com/mortals/xhx/module/converge/web/ConvergeSiteController.java
...rtals/xhx/module/converge/web/ConvergeSiteController.java
+33
-0
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsAccessMapperExt.xml
...es/sqlmap/module/converge/ConvergeAppsAccessMapperExt.xml
+20
-6
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsMapper.xml
...n/resources/sqlmap/module/converge/ConvergeAppsMapper.xml
+142
-102
No files found.
sst-manager/src/main/java/com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
View file @
e2241381
...
...
@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.converge.service.ConvergeAppsService
;
import
com.mortals.xhx.module.converge.service.ConvergeDeviceService
;
...
...
@@ -41,7 +42,8 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
log
.
error
(
"汇聚设备数据出错"
,
e
);
}
try
{
convergeAppsService
.
doConvergeApps
();
String
dateTime
=
DateUtils
.
getCurrStrDate
();
convergeAppsService
.
doConvergeApps
(
dateTime
);
}
catch
(
Exception
e
){
log
.
error
(
"汇聚应用数据出错"
,
e
);
...
...
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
View file @
e2241381
...
...
@@ -19,11 +19,11 @@ public interface ConvergeAppsAccessDao extends ICRUDDao<ConvergeAppsAccessEntit
* 应用浏览量PV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessPv
();
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
);
/**
* 应用浏览量UV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessUv
();
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
);
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
View file @
e2241381
...
...
@@ -19,12 +19,12 @@ public class ConvergeAppsAccessDaoImpl extends BaseCRUDDaoMybatis<ConvergeAppsAc
@Override
public
List
<
AppsAccessVo
>
getAppsAccessPv
()
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessPv"
));
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessPv"
)
,
startTime
);
}
@Override
public
List
<
AppsAccessVo
>
getAppsAccessUv
()
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessUv"
));
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessUv"
)
,
startTime
);
}
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/ConvergeAppsEntity.java
View file @
e2241381
...
...
@@ -10,12 +10,16 @@ import lombok.Data;
* 设备应用实体对象
*
* @author zxfei
* @date 2023-0
6-12
* @date 2023-0
7-06
*/
@Data
public
class
ConvergeAppsEntity
extends
ConvergeAppsVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 站点id
*/
private
Long
siteId
;
/**
* 设备ID
*/
...
...
@@ -43,19 +47,19 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
/**
* 应用访问数
*/
private
Integer
p
v
;
private
Integer
totalP
v
;
/**
* 应用访客数
*/
private
Integer
u
v
;
private
Integer
totalU
v
;
/**
* 操作类型
*/
private
String
opr
;
/**
*
站点i
d
*
统计月份,格式yyyy-MM-d
d
*/
private
Long
siteId
;
private
String
statYearMonth
;
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
...
...
@@ -74,6 +78,8 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
public
void
initAttrValue
(){
this
.
siteId
=
-
1L
;
this
.
equipmentId
=
-
1L
;
this
.
appEname
=
""
;
...
...
@@ -86,12 +92,12 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
this
.
origin
=
""
;
this
.
p
v
=
-
1
;
this
.
totalP
v
=
-
1
;
this
.
u
v
=
-
1
;
this
.
totalU
v
=
-
1
;
this
.
opr
=
""
;
this
.
s
iteId
=
-
1L
;
this
.
s
tatYearMonth
=
""
;
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/ConvergeAppsQuery.java
View file @
e2241381
This diff is collapsed.
Click to expand it.
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/AppVO.java
View file @
e2241381
...
...
@@ -27,11 +27,15 @@ public class AppVO {
/**
* 应用访问数
*/
private
Integer
p
v
;
private
Integer
totalP
v
;
/**
* 应用访客数
*/
private
Integer
uv
;
private
Integer
totalUv
;
/**
* 统计月份,格式yyyy-MM-dd
*/
private
String
statYearMonth
;
/**
* 操作类型
*/
...
...
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/AppsAccessVo.java
View file @
e2241381
...
...
@@ -35,10 +35,14 @@ public class AppsAccessVo {
/**
* 应用访问数
*/
private
Integer
p
v
;
private
Integer
totalP
v
;
/**
* 应用访客数
*/
private
Integer
uv
;
private
Integer
totalUv
;
/**
* 统计月份,格式yyyy-MM-dd
*/
private
String
statYearMonth
;
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsAccessService.java
View file @
e2241381
...
...
@@ -23,11 +23,11 @@ public interface ConvergeAppsAccessService extends ICRUDService<ConvergeAppsAcce
* 应用浏览量PV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessPv
()
throws
AppException
;
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
throws
AppException
;
/**
* 应用浏览量UV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessUv
()
throws
AppException
;
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
throws
AppException
;
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsService.java
View file @
e2241381
...
...
@@ -19,5 +19,5 @@ public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Lon
* 天府通办数据汇聚
* @throws AppException
*/
void
doConvergeApps
()
throws
AppException
;
void
doConvergeApps
(
String
startTime
)
throws
AppException
;
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsAccessServiceImpl.java
View file @
e2241381
...
...
@@ -23,12 +23,12 @@ import java.util.List;
public
class
ConvergeAppsAccessServiceImpl
extends
AbstractCRUDServiceImpl
<
ConvergeAppsAccessDao
,
ConvergeAppsAccessEntity
,
Long
>
implements
ConvergeAppsAccessService
{
@Override
public
List
<
AppsAccessVo
>
getAppsAccessPv
()
throws
AppException
{
return
dao
.
getAppsAccessPv
();
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
throws
AppException
{
return
dao
.
getAppsAccessPv
(
startTime
);
}
@Override
public
List
<
AppsAccessVo
>
getAppsAccessUv
()
throws
AppException
{
return
dao
.
getAppsAccessUv
();
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
throws
AppException
{
return
dao
.
getAppsAccessUv
(
startTime
);
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsServiceImpl.java
View file @
e2241381
...
...
@@ -38,15 +38,15 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp
private
ConvergeDeviceService
convergeDeviceService
;
@Override
public
void
doConvergeApps
()
throws
AppException
{
List
<
AppsAccessVo
>
accessPvList
=
convergeAppsAccessService
.
getAppsAccessPv
();
List
<
AppsAccessVo
>
accessUvList
=
convergeAppsAccessService
.
getAppsAccessUv
();
public
void
doConvergeApps
(
String
startTime
)
throws
AppException
{
List
<
AppsAccessVo
>
accessPvList
=
convergeAppsAccessService
.
getAppsAccessPv
(
startTime
);
List
<
AppsAccessVo
>
accessUvList
=
convergeAppsAccessService
.
getAppsAccessUv
(
startTime
);
if
(
CollectionUtils
.
isEmpty
(
accessPvList
)||
CollectionUtils
.
isEmpty
(
accessUvList
)){
return
;
}
else
{
Map
<
String
,
AppsAccessVo
>
uvMap
=
new
HashMap
<>();
for
(
AppsAccessVo
vo:
accessUvList
){
String
key
=
vo
.
getSiteId
()+
"_"
+
vo
.
getEquipmentId
()+
"_"
+
vo
.
getAppEname
();
String
key
=
vo
.
getSiteId
()+
"_"
+
vo
.
getEquipmentId
()+
"_"
+
vo
.
getAppEname
()
+
"_"
+
vo
.
getStatYearMonth
()
;
uvMap
.
put
(
key
,
vo
);
}
List
<
ConvergeAppsEntity
>
appsList
=
new
ArrayList
<>();
...
...
@@ -70,19 +70,20 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp
entity
.
setProvider
(
item
.
getProvider
());
entity
.
setOrigin
(
item
.
getOrigin
());
entity
.
setSiteId
(
item
.
getSiteId
());
entity
.
setPv
(
item
.
getPv
());
String
key
=
item
.
getSiteId
()+
"_"
+
item
.
getEquipmentId
()+
"_"
+
item
.
getAppEname
();
entity
.
setTotalPv
(
item
.
getTotalPv
());
entity
.
setStatYearMonth
(
item
.
getStatYearMonth
());
String
key
=
item
.
getSiteId
()+
"_"
+
item
.
getEquipmentId
()+
"_"
+
item
.
getAppEname
()+
"_"
+
item
.
getStatYearMonth
();
if
(
uvMap
.
containsKey
(
key
))
{
entity
.
set
Uv
(
uvMap
.
get
(
key
).
get
Uv
());
entity
.
set
TotalUv
(
uvMap
.
get
(
key
).
getTotal
Uv
());
}
appsList
.
add
(
entity
);
}
for
(
ConvergeAppsEntity
item:
appsList
){
ConvergeAppsEntity
temp
=
this
.
selectOne
(
new
ConvergeAppsQuery
().
appEname
(
item
.
getAppEname
()).
equipmentId
(
item
.
getEquipmentId
()).
siteId
(
item
.
getSiteId
()));
ConvergeAppsEntity
temp
=
this
.
selectOne
(
new
ConvergeAppsQuery
().
appEname
(
item
.
getAppEname
()).
equipmentId
(
item
.
getEquipmentId
()).
siteId
(
item
.
getSiteId
())
.
statYearMonth
(
item
.
getStatYearMonth
())
);
if
(
temp
!=
null
){
item
.
setId
(
temp
.
getId
());
if
(
temp
.
get
Pv
()==
item
.
getPv
()&&
temp
.
getUv
()==
item
.
get
Uv
()){
if
(
temp
.
get
TotalPv
()==
item
.
getTotalPv
()&&
temp
.
getTotalUv
()==
item
.
getTotal
Uv
()){
item
.
setOpr
(
"P"
);
}
else
{
item
.
setOpr
(
"U"
);
...
...
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
View file @
e2241381
...
...
@@ -62,6 +62,9 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
EquipmentVO
equipmentVO
=
new
EquipmentVO
();
BeanUtils
.
copyProperties
(
deviceEntity
,
equipmentVO
,
BeanUtil
.
getNullPropertyNames
(
deviceEntity
));
List
<
ConvergeAppsEntity
>
apps
=
convergeAppsService
.
find
(
new
ConvergeAppsQuery
().
siteId
(
deviceEntity
.
getSiteId
()).
equipmentId
(
deviceEntity
.
getId
()));
if
(
CollectionUtils
.
isEmpty
(
apps
)){
continue
;
}
equipmentVO
.
setAppStats
(
convertAppVO
(
apps
));
equipments
.
add
(
equipmentVO
);
}
...
...
sst-manager/src/main/java/com/mortals/xhx/module/converge/web/ConvergeSiteController.java
View file @
e2241381
package
com.mortals.xhx.module.converge.web
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.converge.model.vo.BranchVO
;
import
com.mortals.xhx.module.converge.service.ConvergeAppsService
;
import
com.mortals.xhx.module.converge.service.ConvergeDeviceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -38,6 +42,10 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
@Autowired
private
ParamService
paramService
;
@Autowired
private
ConvergeDeviceService
convergeDeviceService
;
@Autowired
private
ConvergeAppsService
convergeAppsService
;
public
ConvergeSiteController
(){
super
.
setModuleDesc
(
"网点信息"
);
...
...
@@ -80,4 +88,29 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
}
return
JSONObject
.
toJSONString
(
model
.
get
(
"data"
));
}
// @Override
// protected void doListBefore(ConvergeSiteEntity query, Map<String, Object> model, Context context) throws AppException {
// log.info("开始执行省平台数据汇聚任务...");
// try {
// this.service.doConvergeSite();
//
// }catch (Exception e){
// log.error("汇聚网点数据执行出错",e);
// }
// try {
// convergeDeviceService.doConvergeDevice();
//
// }catch (Exception e){
// log.error("汇聚设备数据出错",e);
// }
// try {
// String dateTime = DateUtils.getCurrStrDate();
// convergeAppsService.doConvergeApps(dateTime);
//
// }catch (Exception e){
// log.error("汇聚应用数据出错",e);
// }
// log.info("省平台数据汇聚任务执行完成");
// }
}
\ No newline at end of file
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsAccessMapperExt.xml
View file @
e2241381
...
...
@@ -3,46 +3,60 @@
"mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mortals.xhx.module.converge.dao.ibatis.ConvergeAppsAccessDaoImpl"
>
<!-- 页面浏览量PV统计 -->
<select
id=
"getAppsAccessPv"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
<select
id=
"getAppsAccessPv"
parameterType=
"String"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
SELECT
siteId,
ecode as equipmentId,
applicationId as appEname,
applicationName AS appName,
appSimpleName,
provider,
origin,
count(1) as pv
DATE_FORMAT(startTime,'%Y-%m-%d') as statYearMonth,
count(1) as totalPv
FROM
mortals_xhx_converge_apps_access
WHERE
startTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{startTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND
startTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{startTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
siteId,
applicationId,
ecode
ecode,
DATE_FORMAT(startTime,'%Y-%m-%d')
</select>
<!-- 页面浏览量UV统计 -->
<select
id=
"getAppsAccessUv"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
<select
id=
"getAppsAccessUv"
parameterType=
"String"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
SELECT
siteId,
ecode AS equipmentId,
applicationId AS appEname,
applicationName AS appName,
appSimpleName,
provider,
origin,
count(1) AS uv
statYearMonth,
count(1) AS totalUv
FROM
(
SELECT
siteId,
ecode,
applicationId,
applicationName,
appSimpleName,
provider,
origin,
count(1),
DATE_FORMAT(startTime,'%Y-%m-%d') AS
accessTime
DATE_FORMAT(startTime,'%Y-%m-%d') AS
statYearMonth
FROM
mortals_xhx_converge_apps_access
WHERE
startTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{startTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
AND
startTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{startTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
siteId,
applicationId,
...
...
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsMapper.xml
View file @
e2241381
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