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
c3f63132
Commit
c3f63132
authored
Jul 07, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天府通办数据汇聚接口修改
parent
b990d5f1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
84 additions
and
53 deletions
+84
-53
sst-manager/src/main/java/com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
...com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
+17
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
...ortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
+4
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
...module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
+6
-4
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsAccessService.java
...hx/module/converge/service/ConvergeAppsAccessService.java
+3
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsService.java
...tals/xhx/module/converge/service/ConvergeAppsService.java
+5
-1
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsAccessServiceImpl.java
.../converge/service/impl/ConvergeAppsAccessServiceImpl.java
+5
-4
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsServiceImpl.java
...module/converge/service/impl/ConvergeAppsServiceImpl.java
+4
-7
sst-manager/src/main/java/com/mortals/xhx/module/converge/web/ConvergeSiteController.java
...rtals/xhx/module/converge/web/ConvergeSiteController.java
+33
-24
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsAccessMapperExt.xml
...es/sqlmap/module/converge/ConvergeAppsAccessMapperExt.xml
+7
-7
No files found.
sst-manager/src/main/java/com/mortals/xhx/daemon/task/ProvinceConvergeTaskImpl.java
View file @
c3f63132
...
...
@@ -5,6 +5,7 @@ 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.model.ConvergeAppsAccessEntity
;
import
com.mortals.xhx.module.converge.service.ConvergeAppsService
;
import
com.mortals.xhx.module.converge.service.ConvergeDeviceService
;
import
com.mortals.xhx.module.converge.service.ConvergeSiteService
;
...
...
@@ -12,6 +13,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 省平台数据汇聚任务
*/
...
...
@@ -42,8 +48,16 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
log
.
error
(
"汇聚设备数据出错"
,
e
);
}
try
{
String
dateTime
=
DateUtils
.
getCurrStrDate
();
convergeAppsService
.
doConvergeApps
(
dateTime
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
String
startTime
=
format
.
format
(
calendar
.
getTime
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
String
endTime
=
format
.
format
(
calendar
.
getTime
());
Map
<
String
,
String
>
condition
=
new
HashMap
<>();
condition
.
put
(
"startTime"
,
startTime
);
condition
.
put
(
"endTime"
,
endTime
);
convergeAppsService
.
doConvergeApps
(
condition
);
}
catch
(
Exception
e
){
log
.
error
(
"汇聚应用数据出错"
,
e
);
...
...
@@ -55,4 +69,5 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ConvergeAppsAccessDao.java
View file @
c3f63132
...
...
@@ -5,6 +5,8 @@ import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import
com.mortals.xhx.module.converge.model.vo.AppsAccessVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 应用访问Dao
* 应用访问 DAO接口
...
...
@@ -19,11 +21,11 @@ public interface ConvergeAppsAccessDao extends ICRUDDao<ConvergeAppsAccessEntit
* 应用浏览量PV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
);
List
<
AppsAccessVo
>
getAppsAccessPv
(
Map
<
String
,
String
>
condition
);
/**
* 应用浏览量UV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
);
List
<
AppsAccessVo
>
getAppsAccessUv
(
Map
<
String
,
String
>
condition
);
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/dao/ibatis/ConvergeAppsAccessDaoImpl.java
View file @
c3f63132
...
...
@@ -8,6 +8,8 @@ import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import
java.util.Date
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
java.util.List
;
import
java.util.Map
;
/**
* 应用访问DaoImpl DAO接口
*
...
...
@@ -19,12 +21,12 @@ public class ConvergeAppsAccessDaoImpl extends BaseCRUDDaoMybatis<ConvergeAppsAc
@Override
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessPv"
),
startTime
);
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
Map
<
String
,
String
>
condition
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessPv"
),
condition
);
}
@Override
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessUv"
),
startTime
);
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
Map
<
String
,
String
>
condition
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getAppsAccessUv"
),
condition
);
}
}
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsAccessService.java
View file @
c3f63132
...
...
@@ -6,6 +6,7 @@ import com.mortals.xhx.module.converge.dao.ConvergeAppsAccessDao;
import
com.mortals.xhx.module.converge.model.vo.AppsAccessVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* ConvergeAppsAccessService
...
...
@@ -23,11 +24,11 @@ public interface ConvergeAppsAccessService extends ICRUDService<ConvergeAppsAcce
* 应用浏览量PV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
throws
AppException
;
List
<
AppsAccessVo
>
getAppsAccessPv
(
Map
<
String
,
String
>
condition
)
throws
AppException
;
/**
* 应用浏览量UV统计
* @return
*/
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
throws
AppException
;
List
<
AppsAccessVo
>
getAppsAccessUv
(
Map
<
String
,
String
>
condition
)
throws
AppException
;
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/ConvergeAppsService.java
View file @
c3f63132
package
com.mortals.xhx.module.converge.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity
;
import
com.mortals.xhx.module.converge.model.ConvergeAppsEntity
;
import
com.mortals.xhx.module.converge.dao.ConvergeAppsDao
;
import
java.util.Map
;
/**
* ConvergeAppsService
*
...
...
@@ -19,5 +23,5 @@ public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Lon
* 天府通办数据汇聚
* @throws AppException
*/
void
doConvergeApps
(
String
startTime
)
throws
AppException
;
void
doConvergeApps
(
Map
<
String
,
String
>
condition
)
throws
AppException
;
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsAccessServiceImpl.java
View file @
c3f63132
...
...
@@ -10,6 +10,7 @@ import com.mortals.xhx.module.converge.service.ConvergeAppsAccessService;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
import
java.util.Map
;
/**
* ConvergeAppsAccessService
...
...
@@ -23,12 +24,12 @@ import java.util.List;
public
class
ConvergeAppsAccessServiceImpl
extends
AbstractCRUDServiceImpl
<
ConvergeAppsAccessDao
,
ConvergeAppsAccessEntity
,
Long
>
implements
ConvergeAppsAccessService
{
@Override
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
String
startTime
)
throws
AppException
{
return
dao
.
getAppsAccessPv
(
startTime
);
public
List
<
AppsAccessVo
>
getAppsAccessPv
(
Map
<
String
,
String
>
condition
)
throws
AppException
{
return
dao
.
getAppsAccessPv
(
condition
);
}
@Override
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
String
startTime
)
throws
AppException
{
return
dao
.
getAppsAccessUv
(
startTime
);
public
List
<
AppsAccessVo
>
getAppsAccessUv
(
Map
<
String
,
String
>
condition
)
throws
AppException
{
return
dao
.
getAppsAccessUv
(
condition
);
}
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeAppsServiceImpl.java
View file @
c3f63132
package
com.mortals.xhx.module.converge.service.impl
;
import
com.mortals.xhx.module.converge.model.ConvergeAppsQuery
;
import
com.mortals.xhx.module.converge.model.ConvergeDeviceEntity
;
import
com.mortals.xhx.module.converge.model.ConvergeDeviceQuery
;
import
com.mortals.xhx.module.converge.model.*
;
import
com.mortals.xhx.module.converge.model.vo.AppsAccessVo
;
import
com.mortals.xhx.module.converge.service.ConvergeAppsAccessService
;
import
com.mortals.xhx.module.converge.service.ConvergeDeviceService
;
...
...
@@ -11,7 +9,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.converge.dao.ConvergeAppsDao
;
import
com.mortals.xhx.module.converge.model.ConvergeAppsEntity
;
import
com.mortals.xhx.module.converge.service.ConvergeAppsService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -38,9 +35,9 @@ public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeApp
private
ConvergeDeviceService
convergeDeviceService
;
@Override
public
void
doConvergeApps
(
String
startTime
)
throws
AppException
{
List
<
AppsAccessVo
>
accessPvList
=
convergeAppsAccessService
.
getAppsAccessPv
(
startTime
);
List
<
AppsAccessVo
>
accessUvList
=
convergeAppsAccessService
.
getAppsAccessUv
(
startTime
);
public
void
doConvergeApps
(
Map
<
String
,
String
>
condition
)
throws
AppException
{
List
<
AppsAccessVo
>
accessPvList
=
convergeAppsAccessService
.
getAppsAccessPv
(
condition
);
List
<
AppsAccessVo
>
accessUvList
=
convergeAppsAccessService
.
getAppsAccessUv
(
condition
);
if
(
CollectionUtils
.
isEmpty
(
accessPvList
)||
CollectionUtils
.
isEmpty
(
accessUvList
)){
return
;
}
else
{
...
...
sst-manager/src/main/java/com/mortals/xhx/module/converge/web/ConvergeSiteController.java
View file @
c3f63132
...
...
@@ -23,6 +23,7 @@ import com.mortals.xhx.module.converge.service.ConvergeSiteService;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -89,28 +90,36 @@ 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("省平台数据汇聚任务执行完成");
// }
@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
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
String
startTime
=
format
.
format
(
calendar
.
getTime
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
String
endTime
=
format
.
format
(
calendar
.
getTime
());
Map
<
String
,
String
>
condition
=
new
HashMap
<>();
condition
.
put
(
"startTime"
,
startTime
);
condition
.
put
(
"endTime"
,
endTime
);
convergeAppsService
.
doConvergeApps
(
condition
);
}
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 @
c3f63132
...
...
@@ -3,7 +3,7 @@
"mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mortals.xhx.module.converge.dao.ibatis.ConvergeAppsAccessDaoImpl"
>
<!-- 页面浏览量PV统计 -->
<select
id=
"getAppsAccessPv"
parameterType=
"
String
"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
<select
id=
"getAppsAccessPv"
parameterType=
"
map
"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
SELECT
siteId,
ecode as equipmentId,
...
...
@@ -12,23 +12,23 @@
appSimpleName,
provider,
origin,
DATE_FORMAT(startTime,'%Y-%m
-%d
') as statYearMonth,
DATE_FORMAT(startTime,'%Y-%m') 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(#{
start
Time},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
startTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{
end
Time},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
siteId,
applicationId,
ecode,
DATE_FORMAT(startTime,'%Y-%m
-%d
')
DATE_FORMAT(startTime,'%Y-%m')
</select>
<!-- 页面浏览量UV统计 -->
<select
id=
"getAppsAccessUv"
parameterType=
"
String
"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
<select
id=
"getAppsAccessUv"
parameterType=
"
map
"
resultType=
"com.mortals.xhx.module.converge.model.vo.AppsAccessVo"
>
SELECT
siteId,
ecode AS equipmentId,
...
...
@@ -50,13 +50,13 @@
provider,
origin,
count(1),
DATE_FORMAT(startTime,'%Y-%m
-%d
') AS statYearMonth
DATE_FORMAT(startTime,'%Y-%m') 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(#{
start
Time},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
startTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{
end
Time},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
GROUP BY
siteId,
applicationId,
...
...
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