Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c4149f10
authored
Jul 12, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调整包
1 parent
ac1f587e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
14 deletions
src/main/java/cn/com/glsx/app/modules/converter/DashboardConverter.java
src/main/java/cn/com/glsx/app/modules/mapper/DevicePowerMapper.java
src/main/java/cn/com/glsx/app/modules/entity/DevicePowerDO.java → src/main/java/cn/com/glsx/app/modules/model/domain/DevicePowerDO.java
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
src/main/resources/mapper/DevicePowerMapper.xml
src/main/java/cn/com/glsx/app/modules/converter/DashboardConverter.java
View file @
c4149f1
package
cn
.
com
.
glsx
.
app
.
modules
.
converter
;
package
cn
.
com
.
glsx
.
app
.
modules
.
converter
;
import
cn.com.glsx.app.modules.entity.DevicePowerDO
;
import
cn.com.glsx.app.modules.model.domain.DevicePowerDO
;
import
cn.com.glsx.app.modules.model.param.TrackPointSearch
;
import
cn.com.glsx.app.modules.model.view.LowPowerVO
;
import
cn.com.glsx.app.modules.model.view.LowPowerVO
;
import
cn.com.glsx.devicemonitor.api.dto.TrackPointRequestDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
import
org.mapstruct.factory.Mappers
;
...
...
src/main/java/cn/com/glsx/app/modules/mapper/DevicePowerMapper.java
View file @
c4149f1
package
cn
.
com
.
glsx
.
app
.
modules
.
mapper
;
package
cn
.
com
.
glsx
.
app
.
modules
.
mapper
;
import
cn.com.glsx.app.modules.entity.DevicePower
;
import
cn.com.glsx.app.modules.entity.DevicePower
;
import
cn.com.glsx.app.modules.
entity
.DevicePowerDO
;
import
cn.com.glsx.app.modules.
model.domain
.DevicePowerDO
;
import
cn.com.glsx.app.modules.model.DevicePowerQueryBO
;
import
cn.com.glsx.app.modules.model.DevicePowerQueryBO
;
import
com.glsx.plat.common.annotation.DataPerm
;
import
com.glsx.plat.common.annotation.DataPerm
;
import
com.glsx.plat.common.annotation.DataPermShare
;
import
com.glsx.plat.common.annotation.DataPermShare
;
...
...
src/main/java/cn/com/glsx/app/modules/
entity
/DevicePowerDO.java
→
src/main/java/cn/com/glsx/app/modules/
model/domain
/DevicePowerDO.java
View file @
c4149f1
package
cn
.
com
.
glsx
.
app
.
modules
.
entity
;
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
domain
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
...
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
View file @
c4149f1
...
@@ -6,7 +6,7 @@ import cn.com.glsx.alarm.services.model.CommonAlarmDto;
...
@@ -6,7 +6,7 @@ import cn.com.glsx.alarm.services.model.CommonAlarmDto;
import
cn.com.glsx.app.common.constants.Constants
;
import
cn.com.glsx.app.common.constants.Constants
;
import
cn.com.glsx.app.common.enums.TypeConverseEnum
;
import
cn.com.glsx.app.common.enums.TypeConverseEnum
;
import
cn.com.glsx.app.modules.converter.DashboardConverter
;
import
cn.com.glsx.app.modules.converter.DashboardConverter
;
import
cn.com.glsx.app.modules.
entity
.DevicePowerDO
;
import
cn.com.glsx.app.modules.
model.domain
.DevicePowerDO
;
import
cn.com.glsx.app.modules.mapper.*
;
import
cn.com.glsx.app.modules.mapper.*
;
import
cn.com.glsx.app.modules.model.DevicePowerQueryBO
;
import
cn.com.glsx.app.modules.model.DevicePowerQueryBO
;
import
cn.com.glsx.app.modules.model.RangeTimeDTO
;
import
cn.com.glsx.app.modules.model.RangeTimeDTO
;
...
@@ -189,37 +189,42 @@ public class DashboardService extends AbstractCommonService {
...
@@ -189,37 +189,42 @@ public class DashboardService extends AbstractCommonService {
injectSettled
(
activeSearch
);
injectSettled
(
activeSearch
);
StopWatch
stopWatch
=
new
StopWatch
();
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
//激活设备总数
//激活设备总数
stopWatch
.
start
();
List
<
Integer
>
listActiveDevice
=
vehicleDeviceMapper
.
countDeviceWithAuth
(
new
RangeTimeDTO
(),
activeSearch
);
List
<
Integer
>
listActiveDevice
=
vehicleDeviceMapper
.
countDeviceWithAuth
(
new
RangeTimeDTO
(),
activeSearch
);
int
totalActiveDevice
=
listActiveDevice
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
int
totalActiveDevice
=
listActiveDevice
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"激活设备总数查询"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"激活设备总数查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//车辆总数
//车辆总数
stopWatch
.
start
();
List
<
Integer
>
listVehicle
=
vehicleMapper
.
countDeviceWithAuth
(
activeSearch
);
List
<
Integer
>
listVehicle
=
vehicleMapper
.
countDeviceWithAuth
(
activeSearch
);
int
totalVehicle
=
listVehicle
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
int
totalVehicle
=
listVehicle
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"车辆总数查询"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"车辆总数查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//今日激活
//今日激活
stopWatch
.
start
();
RangeTimeDTO
today
=
new
RangeTimeDTO
(
DateUtil
.
getTodayFirstDateTimeStr
(),
DateUtil
.
getTodayLastDateTimeStr
());
RangeTimeDTO
today
=
new
RangeTimeDTO
(
DateUtil
.
getTodayFirstDateTimeStr
(),
DateUtil
.
getTodayLastDateTimeStr
());
List
<
Integer
>
listTodayActiveDevice
=
vehicleDeviceMapper
.
countDeviceWithAuth
(
today
,
activeSearch
);
List
<
Integer
>
listTodayActiveDevice
=
vehicleDeviceMapper
.
countDeviceWithAuth
(
today
,
activeSearch
);
int
todayActiveDevice
=
listTodayActiveDevice
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
int
todayActiveDevice
=
listTodayActiveDevice
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"今日激活查询"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"今日激活查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//在线率
//在线率
stopWatch
.
start
();
String
onLineRate
=
getOnLineRate
(
totalActiveDevice
);
String
onLineRate
=
getOnLineRate
(
totalActiveDevice
);
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"在线率查询"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"在线率查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//断电报警
//断电报警
stopWatch
.
start
();
List
<
String
>
sns
=
vehicleMapper
.
getAllDeviceSnByAuth
();
List
<
String
>
sns
=
vehicleMapper
.
getAllDeviceSnByAuth
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"sn查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
AlarmTrackRecQueryDTO
query
=
new
AlarmTrackRecQueryDTO
();
AlarmTrackRecQueryDTO
query
=
new
AlarmTrackRecQueryDTO
();
query
.
setSns
(
sns
);
query
.
setSns
(
sns
);
query
.
setStartTime
(
DateUtil
.
getTodayFirstDateTimeStr
());
query
.
setStartTime
(
DateUtil
.
getTodayFirstDateTimeStr
());
...
@@ -229,15 +234,15 @@ public class DashboardService extends AbstractCommonService {
...
@@ -229,15 +234,15 @@ public class DashboardService extends AbstractCommonService {
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"今日断电报警"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"今日断电报警"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//光感报警
//光感报警
stopWatch
.
start
();
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_LIGHT
);
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_LIGHT
);
Integer
lightCount
=
remoteAlarmService
.
getAlarmCount
(
query
);
Integer
lightCount
=
remoteAlarmService
.
getAlarmCount
(
query
);
stopWatch
.
stop
();
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"今日光感报警查询"
,
stopWatch
.
getLastTaskTimeMillis
());
log
.
info
(
"{} 耗时:{} ms"
,
"今日光感报警查询"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//围栏报警
//围栏报警
stopWatch
.
start
();
List
<
Integer
>
fenceList
=
alarmElectricFenceMapper
.
countActiveDeviceFenceAlarm
(
today
);
List
<
Integer
>
fenceList
=
alarmElectricFenceMapper
.
countActiveDeviceFenceAlarm
(
today
);
int
fenceCount
=
fenceList
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
int
fenceCount
=
fenceList
.
stream
().
reduce
(
0
,
Integer:
:
sum
);
stopWatch
.
stop
();
stopWatch
.
stop
();
...
...
src/main/resources/mapper/DevicePowerMapper.xml
View file @
c4149f1
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DevicePowerMap"
type=
"cn.com.glsx.app.modules.
entity
.DevicePowerDO"
>
<resultMap
id=
"DevicePowerMap"
type=
"cn.com.glsx.app.modules.
model.domain
.DevicePowerDO"
>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"alarm_time"
jdbcType=
"TIMESTAMP"
property=
"alarmTime"
/>
<result
column=
"alarm_time"
jdbcType=
"TIMESTAMP"
property=
"alarmTime"
/>
<result
column=
"soc"
jdbcType=
"INTEGER"
property=
"soc"
/>
<result
column=
"soc"
jdbcType=
"INTEGER"
property=
"soc"
/>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment