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
5ba6d6ed
Commit
5ba6d6ed
authored
Feb 03, 2026
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(设备创建) :数据比对
1.自动任务异常处理代码暂存
parent
058a7682
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
DataConsistencyJob.java
...ejoin/amos/boot/module/jg/biz/job/DataConsistencyJob.java
+2
-8
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/job/DataConsistencyJob.java
View file @
5ba6d6ed
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
job
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
job
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
...
@@ -14,9 +12,7 @@ import org.springframework.http.HttpEntity;
...
@@ -14,9 +12,7 @@ import org.springframework.http.HttpEntity;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -34,8 +30,6 @@ public class DataConsistencyJob {
...
@@ -34,8 +30,6 @@ public class DataConsistencyJob {
private
final
AmosRequestContext
requestContext
;
private
final
AmosRequestContext
requestContext
;
private
final
IdxBizJgUseInfoMapper
idxBizJgUseInfoMapper
;
private
final
DiscoveryClient
discoveryClient
;
private
final
DiscoveryClient
discoveryClient
;
private
final
RestTemplate
restTemplate
;
// 需要提前注入
private
final
RestTemplate
restTemplate
;
// 需要提前注入
...
@@ -43,8 +37,8 @@ public class DataConsistencyJob {
...
@@ -43,8 +37,8 @@ public class DataConsistencyJob {
@Value
(
"${spring.application.name}"
)
@Value
(
"${spring.application.name}"
)
private
String
applicationName
;
private
String
applicationName
;
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
//
@Scheduled(cron = "0 0 3 * * ?")
@SchedulerLock
(
name
=
"equipConsistencyJob"
,
lockAtMostFor
=
"PT1H"
)
//
@SchedulerLock(name = "equipConsistencyJob", lockAtMostFor = "PT1H")
public
void
execute
()
{
public
void
execute
()
{
List
<
ServiceInstance
>
instanceList
=
discoveryClient
.
getInstances
(
applicationName
);
List
<
ServiceInstance
>
instanceList
=
discoveryClient
.
getInstances
(
applicationName
);
int
slots
=
instanceList
.
size
();
int
slots
=
instanceList
.
size
();
...
...
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