Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
00742ab1
Commit
00742ab1
authored
Sep 22, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改异步方法事务
parent
238f5f42
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
WindSpeedScheduled.java
...os/boot/module/hygf/biz/scheduled/WindSpeedScheduled.java
+3
-2
JpStationServiceImpl.java
...ot/module/hygf/biz/service/impl/JpStationServiceImpl.java
+9
-0
MonthPowerServiceImpl.java
...t/module/hygf/biz/service/impl/MonthPowerServiceImpl.java
+1
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/scheduled/WindSpeedScheduled.java
View file @
00742ab1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
scheduled
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpStationServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -17,7 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInvertorElecHi
public
class
WindSpeedScheduled
{
@Autowired
MonthPowerServiceImpl
monthPower
ServiceImpl
;
JpStationServiceImpl
jpStation
ServiceImpl
;
@Autowired
TdHygfJpCollectorHistoryServiceImpl
tdHygfJpCollectorHistoryServiceImpl
;
...
...
@@ -27,7 +28,7 @@ public class WindSpeedScheduled {
@Scheduled
(
cron
=
"${cheduled.crons}"
)
private
void
initData
()
{
monthPower
ServiceImpl
.
getMonthPower
();
jpStation
ServiceImpl
.
getMonthPower
();
tdHygfJpCollectorHistoryServiceImpl
.
syncData
();
tdHygfJpInvertorElecHistoryServiceImpl
.
syncData
();
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/JpStationServiceImpl.java
View file @
00742ab1
...
...
@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import
com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -32,6 +33,8 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
JpStationMapper
jpStationMapper
;
@Autowired
MonthPowerMapper
monthPowerMapper
;
@Autowired
MonthPowerServiceImpl
monthPowerServiceImpl
;
/**
* 分页查询
*/
...
...
@@ -46,6 +49,12 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
pagenew
.
setRecords
(
page
.
getList
());
return
pagenew
;
}
@Async
public
void
getMonthPower
()
{
monthPowerServiceImpl
.
getMonthPower
();
}
@Override
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/MonthPowerServiceImpl.java
View file @
00742ab1
...
...
@@ -52,7 +52,7 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,
@Override
@
Async
@
Transactional
public
void
getMonthPower
()
{
List
<
MonthPower
>
list
=
monthPowerMapper
.
getMonthPowerint
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
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