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
51c5b9e7
Commit
51c5b9e7
authored
Jul 25, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.分布式定时任务锁
parent
2d187912
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
146 additions
and
14 deletions
+146
-14
pom.xml
...amos-boot-module-96333/amos-boot-module-96333-api/pom.xml
+9
-0
Amos96333Application.java
.../src/main/java/com/yeejoin/amos/Amos96333Application.java
+2
-0
ShedLockConfig.java
.../amos/boot/module/elevator/biz/config/ShedLockConfig.java
+19
-0
VoiceRecordLogServiceImpl.java
.../elevator/biz/service/impl/VoiceRecordLogServiceImpl.java
+4
-2
pom.xml
...oot-module-cylinder/amos-boot-module-cylinder-api/pom.xml
+9
-0
AmosCylinderApplication.java
...c/main/java/com/yeejoin/amos/AmosCylinderApplication.java
+2
-0
ShedLockConfig.java
.../amos/boot/module/cylinder/biz/config/ShedLockConfig.java
+19
-0
ESAlertCalledService.java
...odule/cylinder/biz/service/impl/ESAlertCalledService.java
+1
-1
CylinderSchedulerJob.java
.../module/cylinder/flc/biz/quartz/CylinderSchedulerJob.java
+2
-0
CylinderDateInfoServiceImpl.java
...der/flc/biz/service/impl/CylinderDateInfoServiceImpl.java
+8
-2
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+2
-0
CylinderInfoServiceImpl.java
...ylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
+23
-0
ESAlertCalledService.java
...ot/module/jczs/biz/service/impl/ESAlertCalledService.java
+1
-1
pom.xml
...tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/pom.xml
+9
-0
AmosTcmApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
+2
-1
ShedLockConfig.java
...ejoin/amos/boot/module/tcm/biz/config/ShedLockConfig.java
+19
-0
PlatformUserTopicMessage.java
...oot/module/tcm/biz/listener/PlatformUserTopicMessage.java
+1
-1
ESAlertCalledService.java
...oot/module/tcm/biz/service/impl/ESAlertCalledService.java
+1
-1
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+2
-0
PlatformUserTopicMessage.java
...oot/module/ymt/biz/listener/PlatformUserTopicMessage.java
+0
-3
ESAlertCalledService.java
...oot/module/ymt/biz/service/impl/ESAlertCalledService.java
+1
-1
pom.xml
amos-boot-system-tzs/pom.xml
+10
-1
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/pom.xml
View file @
51c5b9e7
...
...
@@ -21,6 +21,14 @@
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-spring
</artifactId>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-provider-redis-spring
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/Amos96333Application.java
View file @
51c5b9e7
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
com.yeejoin.amos.boot.module.elevator.biz.service.impl.StartPlatformTokenService
;
import
net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -40,6 +41,7 @@ import java.net.UnknownHostException;
@EnableAsync
@EnableSwagger2WebMvc
@EnableEurekaClient
@EnableSchedulerLock
(
defaultLockAtMostFor
=
"10m"
)
//@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/config/ShedLockConfig.java
0 → 100644
View file @
51c5b9e7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
biz
.
config
;
import
net.javacrumbs.shedlock.core.LockProvider
;
import
net.javacrumbs.shedlock.provider.redis.spring.RedisLockProvider
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
/**
* @author Administrator
*/
@Configuration
public
class
ShedLockConfig
{
@Bean
public
LockProvider
lockProvider
(
RedisConnectionFactory
connectionFactory
)
{
return
new
RedisLockProvider
(
connectionFactory
);
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/VoiceRecordLogServiceImpl.java
View file @
51c5b9e7
...
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.VoiceRecordLog;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.VoiceRecordLogMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.service.ICtiService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IVoiceRecordLogService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
...
...
@@ -72,6 +73,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
private
TzsAuthServiceImpl
tzsAuthServiceImpl
;
@Scheduled
(
fixedDelay
=
ONE_Minute
)
@SchedulerLock
(
name
=
"voiceRecordLogTask"
,
lockAtMostFor
=
"PT1H"
)
public
void
fixedDelayJob
(){
// 设置token
tzsAuthServiceImpl
.
setRequestContext
();
...
...
@@ -93,7 +95,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
this
.
updateById
(
l
);
continue
;
}
if
(
ctiInfos
==
null
||
ctiInfos
.
size
()
==
0
)
{
if
(
ctiInfos
==
null
||
ctiInfos
.
isEmpty
()
)
{
this
.
updateById
(
l
);
continue
;
}
...
...
@@ -160,7 +162,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
}
l
.
setIsDeal
(
true
);
this
.
updateById
(
l
);
}
;
}
}
System
.
out
.
println
(
"执行通话记录任务"
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/pom.xml
View file @
51c5b9e7
...
...
@@ -22,6 +22,14 @@
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-spring
</artifactId>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-provider-redis-spring
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/AmosCylinderApplication.java
View file @
51c5b9e7
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
com.yeejoin.amos.boot.module.cylinder.biz.listener.FillingRecordSyncListener
;
import
net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
...
...
@@ -44,6 +45,7 @@ import java.net.UnknownHostException;
@EnableSwagger2WebMvc
@EnableEurekaClient
@EnableScheduling
@EnableSchedulerLock
(
defaultLockAtMostFor
=
"10m"
)
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/config/ShedLockConfig.java
0 → 100644
View file @
51c5b9e7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
biz
.
config
;
import
net.javacrumbs.shedlock.core.LockProvider
;
import
net.javacrumbs.shedlock.provider.redis.spring.RedisLockProvider
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
/**
* @author Administrator
*/
@Configuration
public
class
ShedLockConfig
{
@Bean
public
LockProvider
lockProvider
(
RedisConnectionFactory
connectionFactory
)
{
return
new
RedisLockProvider
(
connectionFactory
);
}
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/service/impl/ESAlertCalledService.java
View file @
51c5b9e7
...
...
@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public
void
init
()
throws
Exception
{
//初始化ES,重建索引
initEs
();
//
initEs();
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/quartz/CylinderSchedulerJob.java
View file @
51c5b9e7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
flc
.
biz
.
quartz
;
import
com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.ScheduleService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -20,6 +21,7 @@ public class CylinderSchedulerJob {
* 每天9点-日报生成
*/
@Scheduled
(
cron
=
"${cylinder-early-warning-cron:0 0 9 * * ?}"
)
@SchedulerLock
(
name
=
"calEarlyWarningLevelTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
dayReport
()
{
scheduleService
.
calEarlyWarningLevel
();
}
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderDateInfoServiceImpl.java
View file @
51c5b9e7
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTableDto;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.*
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderDateInfoMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -160,10 +161,15 @@ public class CylinderDateInfoServiceImpl extends BaseService<CylinderDateInfoDto
return
page
;
}
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
//每天凌晨两点执行
/**
* 每天凌晨两点执行
*/
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"fixedDelayJobCylinderDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
fixedDelayJob
()
{
// 每天更新或者添加昨天的数据
Date
date
=
new
Date
();
//取时间
//取时间
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DATE
,
-
1
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
51c5b9e7
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingRecordDt
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingRecordMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.service.ICylinderFillingRecordService
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
...
...
@@ -127,6 +128,7 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
@Scheduled
(
cron
=
"${tzs.cylinder.fill.cron}"
)
@SchedulerLock
(
name
=
"cylinderFillingRecord2ESTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
setTimeSaveCylinderInfoToES
(){
Page
<
ESCylinderFillingRecordDto
>
cylinderFillingRecordPage
=
new
Page
<>();
Page
<
ESCylinderFillingRecordDto
>
cyinderInfoList
=
cylinderFillingRecordMapper
.
getCyinderFillingRecord
(
cylinderFillingRecordPage
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
51c5b9e7
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.component.rule.RuleTrigger;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
lombok.extern.slf4j.Slf4j
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
...
...
@@ -214,8 +215,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synFillingUnloadDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synFillingUnloadData
()
{
cylinderFillingUnloadDataServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderFillingUnloadData
>());
countByRegion
(
regionModel
->
{
...
...
@@ -240,8 +243,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 按区域统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synAreaDataTask"
,
lockAtMostFor
=
"PT60M"
)
public
void
synAreaData
()
{
cylinderAreaDataServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderAreaData
>());
countByRegion
(
regionModel
->
{
...
...
@@ -275,6 +280,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"* * 2 * * ?"
)
@SchedulerLock
(
name
=
"addIntegrityDataTask"
,
lockAtMostFor
=
"PT60M"
)
public
void
addIntegrityData
()
{
System
.
out
.
println
(
"====================数据完整性开始============================"
);
cylinderIntegrityDataServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderIntegrityData
>());
...
...
@@ -337,8 +343,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 企业总量按区域统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"cylinderUnitInfoTask"
,
lockAtMostFor
=
"PT60M"
)
public
void
getCylinderUnitInfo
()
{
cylinderUnitDataServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderUnitData
>());
countByRegion
(
regionModel
->
{
...
...
@@ -371,8 +379,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 气瓶总量按区域统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"cylinderInfoTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
getCylinderInfo
()
{
cylinderInfoDataServiceImpl
.
remove
(
new
LambdaQueryWrapper
<>());
countByRegion
(
regionModel
->
{
...
...
@@ -404,8 +414,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synUnitCylinderInfoDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synUnitCylinderInfoData
()
{
cylinderInfoDataUnitServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderInfoDataUnit
>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -437,8 +449,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 充装量按单位和月统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synUnitCylinderFillingDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synUnitCylinderFillingData
()
{
cylinderFillingDataUnitServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderFillingDataUnit
>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -480,8 +494,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synUnitCylinderTagsDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synUnitCylinderTagsData
()
{
cylinderTagsDataUnitServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderTagsDataUnit
>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -511,8 +527,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synUnitIntegrityDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synUnitIntegrityData
()
{
cylinderIntegrityDataUnitServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderIntegrityDataUnit
>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -570,8 +588,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 充装详情按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synUnitFillingCheckDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synUnitFillingCheckData
()
{
// cylinderFillingCheckDataUnitServiceImpl.remove(new LambdaQueryWrapper<CylinderFillingCheckDataUnit>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -669,8 +689,10 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
/**
* 充装量、卸液量按单位统计
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@SchedulerLock
(
name
=
"synFillingUnloadUnitDataTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
synFillingUnloadUnitData
()
{
cylinderFillingUnloadDataUnitServiceImpl
.
remove
(
new
LambdaQueryWrapper
<
CylinderFillingUnloadDataUnit
>());
countByUnit
(
cylinderUnit
->
{
...
...
@@ -693,6 +715,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
}
@Scheduled
(
cron
=
"${tzs.cylinder.info.cron}"
)
@SchedulerLock
(
name
=
"cylinderInfoToESTask"
,
lockAtMostFor
=
"PT6H"
)
public
void
setTimeSaveCylinderInfoToES
(){
Page
<
CylinderInfoDto
>
cylinderInfoPage
=
new
Page
<>();
Page
<
CylinderInfoDto
>
cyinderInfoList
=
cylinderInfoMapper
.
getCyinderInfoList
(
cylinderInfoPage
);
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/service/impl/ESAlertCalledService.java
View file @
51c5b9e7
...
...
@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public
void
init
()
throws
Exception
{
//初始化ES,重建索引
initEs
();
//
initEs();
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/pom.xml
View file @
51c5b9e7
...
...
@@ -21,6 +21,14 @@
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-spring
</artifactId>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-provider-redis-spring
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/AmosTcmApplication.java
View file @
51c5b9e7
...
...
@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.UnitInfoServiceImpl
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
...
...
@@ -58,7 +59,7 @@ import java.util.List;
@EnableAsync
@EnableSwagger2WebMvc
@EnableEurekaClient
//@EnableScheduling
@EnableSchedulerLock
(
defaultLockAtMostFor
=
"10m"
)
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/config/ShedLockConfig.java
0 → 100644
View file @
51c5b9e7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
config
;
import
net.javacrumbs.shedlock.core.LockProvider
;
import
net.javacrumbs.shedlock.provider.redis.spring.RedisLockProvider
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
/**
* @author Administrator
*/
@Configuration
public
class
ShedLockConfig
{
@Bean
public
LockProvider
lockProvider
(
RedisConnectionFactory
connectionFactory
)
{
return
new
RedisLockProvider
(
connectionFactory
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/listener/PlatformUserTopicMessage.java
View file @
51c5b9e7
...
...
@@ -67,7 +67,7 @@ public class PlatformUserTopicMessage extends EmqxListener {
try
{
if
(
StringUtils
.
isNotEmpty
(
path
))
{
if
(
path
.
contains
(
"company"
)
&&
!
"company"
.
equals
(
dataResult
.
get
(
"level"
)))
{
equipmentCategoryService
.
creatTree
();
//
equipmentCategoryService.creatTree();
}
else
if
(
path
.
contains
(
"agencyuser"
))
{
regUnitInfoService
.
updateAdminInfo
(
dataResult
);
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/ESAlertCalledService.java
View file @
51c5b9e7
...
...
@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public
void
init
()
throws
Exception
{
//初始化ES,重建索引
initEs
();
//
initEs();
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
51c5b9e7
...
...
@@ -41,6 +41,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.entity.ContentType
;
...
...
@@ -237,6 +238,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
return
model
;
}
@SchedulerLock
(
name
=
"asyncSetQrCodeTask"
,
lockAtMostFor
=
"PT30M"
)
@Scheduled
(
cron
=
"${async.set.qr-code.cron:0 0/1 * * * ?}"
)
public
void
asyncSetQrCode
()
{
// 给所有新注册的企业创建二维码,每次处理1000个,不排序
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/listener/PlatformUserTopicMessage.java
View file @
51c5b9e7
...
...
@@ -68,13 +68,10 @@ public class PlatformUserTopicMessage extends EmqxListener {
if
(
StringUtils
.
isNotEmpty
(
path
))
{
if
(
path
.
contains
(
"company"
)
&&
!
"company"
.
equals
(
dataResult
.
get
(
"level"
)))
{
equipmentCategoryService
.
creatTree
();
}
else
if
(
path
.
contains
(
"agencyuser"
))
{
regUnitInfoService
.
updateAdminInfo
(
dataResult
);
}
}
}
catch
(
Exception
e
)
{
log
.
info
(
"平台同步消息失败:{}"
,
e
.
getMessage
());
e
.
printStackTrace
();
}
log
.
info
(
"平台推送消息同步完成"
);
}
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/ESAlertCalledService.java
View file @
51c5b9e7
...
...
@@ -57,7 +57,7 @@ public class ESAlertCalledService {
public
void
init
()
throws
Exception
{
//初始化ES,重建索引
initEs
();
//
initEs();
}
/**
...
...
amos-boot-system-tzs/pom.xml
View file @
51c5b9e7
...
...
@@ -67,7 +67,16 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-spring
</artifactId>
<version>
4.44.0
</version>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-provider-redis-spring
</artifactId>
<version>
4.44.0
</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
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