Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
947575df
Commit
947575df
authored
Jul 04, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改异步方法
parent
66f81852
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+2
-1
StationDataTaskImpl.java
...ot/module/jxiop/biz/service/impl/StationDataTaskImpl.java
+17
-13
StationDataTask.java
...oin/amos/boot/module/jxiop/biz/tasks/StationDataTask.java
+3
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
947575df
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IMonitorFanIndicator
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -21,11 +22,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
@Override
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
)
{
monitorFanIndicatorregionMapper
.
UpdateMonitorFanIndicator
(
list
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationDataTaskImpl.java
View file @
947575df
...
...
@@ -13,6 +13,7 @@ import org.influxdb.dto.QueryResult;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
...
...
@@ -71,7 +72,7 @@ public class StationDataTaskImpl {
}
@Async
(
"jxiopAsyncExecutor"
)
public
void
getIndexDto
(
DeviceDto
deviceDto
)
{
public
List
<
IndexDto
>
getIndexDto
(
DeviceDto
deviceDto
)
{
//每个分机的指标数据
List
<
IndexDto
>
list
=
null
;
...
...
@@ -89,21 +90,24 @@ public class StationDataTaskImpl {
}
}
return
list
;
}
@Async
(
"jxiopAsyncExecutor"
)
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
){
if
(
list
!=
null
&&
list
.
size
()>
0
){
//对数据切片处理 默认创建
if
(
stationSection
>
list
.
size
()||!
isok
){
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
list
);
}
else
{
//进行分片处理
List
<
List
<
IndexDto
>>
listfp
=
Lists
.
partition
(
list
,
list
.
size
()%
stationSection
);
for
(
List
<
IndexDto
>
indexDtos
:
listfp
)
{
//每个分级信息处理
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
indexDtos
);
}
}
if
(
stationSection
>
list
.
size
()||!
isok
){
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
list
);
}
else
{
//进行分片处理
List
<
List
<
IndexDto
>>
listfp
=
Lists
.
partition
(
list
,
list
.
size
()%
stationSection
);
for
(
List
<
IndexDto
>
indexDtos
:
listfp
)
{
//每个分级信息处理
monitorFanIndicatorImpl
.
UpdateMonitorFanIndicator
(
indexDtos
);
}
}
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tasks/StationDataTask.java
View file @
947575df
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
tasks
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationDataTaskImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -33,7 +33,8 @@ public class StationDataTask {
List
<
DeviceDto
>
listDeviceDto
=
stationDataTask
.
getListDevice
(
stationTaksDto
);
if
(
listDeviceDto
!=
null
&&
listDeviceDto
.
size
()>
0
){
for
(
DeviceDto
deviceDto
:
listDeviceDto
)
{
stationDataTask
.
getIndexDto
(
deviceDto
);
List
<
IndexDto
>
listIndexDto
=
stationDataTask
.
getIndexDto
(
deviceDto
);
stationDataTask
.
UpdateMonitorFanIndicator
(
listIndexDto
);
}
}
}
...
...
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