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
0ef583b5
Commit
0ef583b5
authored
Aug 25, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据汇聚接口只查询当前月份汇聚结果
parent
66b7366a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/ConvergeAppsInterfaceVo.java
...xhx/module/converge/model/vo/ConvergeAppsInterfaceVo.java
+2
-1
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
...module/converge/service/impl/ConvergeSiteServiceImpl.java
+11
-1
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsInterfaceMapperExt.xml
...sqlmap/module/converge/ConvergeAppsInterfaceMapperExt.xml
+6
-0
No files found.
sst-manager/src/main/java/com/mortals/xhx/module/converge/model/vo/ConvergeAppsInterfaceVo.java
View file @
0ef583b5
...
...
@@ -15,5 +15,6 @@ import java.util.Date;
*/
@Data
public
class
ConvergeAppsInterfaceVo
extends
BaseEntityLong
{
private
String
currMonthStart
;
private
String
currMonthEnd
;
}
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/converge/service/impl/ConvergeSiteServiceImpl.java
View file @
0ef583b5
...
...
@@ -26,6 +26,7 @@ import com.mortals.xhx.module.converge.dao.ConvergeSiteDao;
import
com.mortals.xhx.module.converge.service.ConvergeSiteService
;
import
lombok.extern.slf4j.Slf4j
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -54,6 +55,13 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
List
<
BranchVO
>
result
=
new
ArrayList
<>();
List
<
ConvergeSiteEntity
>
siteList
=
this
.
find
(
new
ConvergeSiteQuery
());
if
(
CollectionUtils
.
isNotEmpty
(
siteList
)){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
String
currMonthStart
=
format
.
format
(
calendar
.
getTime
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
String
currMonthEnd
=
format
.
format
(
calendar
.
getTime
());
String
currMonth
=
DateUtils
.
getCurrDateTime
(
"yyyy-MM"
);
for
(
ConvergeSiteEntity
siteEntity:
siteList
){
BranchVO
branchVO
=
new
BranchVO
();
BeanUtils
.
copyProperties
(
siteEntity
,
branchVO
,
BeanUtil
.
getNullPropertyNames
(
siteEntity
));
...
...
@@ -66,7 +74,7 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
ConvergeAppsQuery
appsQuery
=
new
ConvergeAppsQuery
();
appsQuery
.
setSiteId
(
deviceEntity
.
getSiteId
());
appsQuery
.
setEquipmentId
(
deviceEntity
.
getId
());
appsQuery
.
setStatYearMonth
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM"
)
);
appsQuery
.
setStatYearMonth
(
currMonth
);
List
<
ConvergeAppsEntity
>
apps
=
convergeAppsService
.
find
(
appsQuery
);
if
(
CollectionUtils
.
isEmpty
(
apps
)){
continue
;
...
...
@@ -75,6 +83,8 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
ConvergeAppsInterfaceEntity
query
=
new
ConvergeAppsInterfaceEntity
();
query
.
setEcode
(
deviceEntity
.
getLogo
());
query
.
setApplicationId
(
item
.
getAppEname
());
query
.
setCurrMonthStart
(
currMonthStart
);
query
.
setCurrMonthEnd
(
currMonthEnd
);
List
<
InterfaceStatsVO
>
interfaceEntityList
=
convergeAppsInterfaceService
.
getTotalInvokeSum
(
query
);
if
(
CollectionUtils
.
isEmpty
(
interfaceEntityList
)
||
interfaceEntityList
.
get
(
0
)
==
null
){
continue
;
...
...
sst-manager/src/main/resources/sqlmap/module/converge/ConvergeAppsInterfaceMapperExt.xml
View file @
0ef583b5
...
...
@@ -16,5 +16,11 @@
WHERE 1=1
<if
test=
"ecode != null and ecode!=''"
>
AND ecode = #{ecode}
</if>
<if
test=
"applicationId != null and applicationId!=''"
>
AND applicationId = #{applicationId}
</if>
<if
test=
"currMonthStart != null and currMonthStart !=''"
>
AND createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{currMonthStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if
test=
"currMonthEnd != null and currMonthEnd !=''"
>
AND createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{currMonthEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</select>
</mapper>
\ No newline at end of file
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