Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
85ce1d63
Commit
85ce1d63
authored
Jul 14, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug及去掉不使用的配置文件
parent
1e3b8f04
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
14 deletions
+87
-14
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+1
-4
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+4
-5
AsyncConfig.java
...rc/main/java/com/yeejoin/amos/fas/config/AsyncConfig.java
+80
-0
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+2
-5
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
85ce1d63
...
...
@@ -823,10 +823,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
});
}
<<<<<<<
HEAD
=======
// 异步数据同步之消息发送
if
(!
planList
.
isEmpty
()
&&
dataSyncSwitch
)
{
if
(!
planList
.
isEmpty
())
{
try
{
dataSyncService
.
asyncInvoke
(()
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -845,7 +843,6 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
planStepService
.
initPlanStep
();
planStepService
.
initPlanTask
();
>>>>>>>
824
e5c019383569502d9457a413770a699dd18ce
}
catch
(
Exception
e
)
{
bool
.
set
(
false
);
e
.
printStackTrace
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
85ce1d63
...
...
@@ -554,14 +554,13 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
contingencyRo
.
setIsMock
(
isMock
);
contingencyRo
.
setPosition
(
equipmentSpecific
.
getPosition
());
log
.
info
(
"开始调用规则 参数 contingencyRo{},reservePlan{},equipmentNames"
+
contingencyRo
.
toString
()
+
","
+
equipment
.
getReservePlan
()
+
","
+
ArrayUtils
.
toArray
(
equipment
.
getName
()));
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
log
.
info
(
"规则调用返回=="
,
result
);
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
contingencyOriginalData
.
setFireEquipmentPosition
(
contingencyRo
.
getPosition
());
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
log
.
info
(
"开始调用规则 参数 contingencyRo{},reservePlan{},equipmentNames"
+
contingencyRo
.
toString
()
+
","
+
equipment
.
getReservePlan
()
+
","
+
ArrayUtils
.
toArray
(
equipment
.
getName
()));
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
log
.
info
(
"规则调用返回=="
,
result
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/AsyncConfig.java
0 → 100644
View file @
85ce1d63
package
com
.
yeejoin
.
amos
.
fas
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.AsyncConfigurer
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.SchedulingConfigurer
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.scheduling.config.ScheduledTaskRegistrar
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
/**
* @author keyong
* @title: AsyncConfig
* <pre>
* @description: TODO
* </pre>
* @date 2023/7/14 16:31
*/
@Configuration
@EnableAsync
@EnableScheduling
@Slf4j
public
class
AsyncConfig
implements
SchedulingConfigurer
,
AsyncConfigurer
{
/**
* 定时任务使用的线程池
* @return
*/
@Bean
(
destroyMethod
=
"shutdown"
,
name
=
"taskScheduler"
)
public
ThreadPoolTaskScheduler
taskScheduler
(){
ThreadPoolTaskScheduler
scheduler
=
new
ThreadPoolTaskScheduler
();
scheduler
.
setPoolSize
(
10
);
scheduler
.
setThreadNamePrefix
(
"task-"
);
scheduler
.
setAwaitTerminationSeconds
(
600
);
scheduler
.
setWaitForTasksToCompleteOnShutdown
(
true
);
return
scheduler
;
}
/**
* 异步任务执行线程池
* @return
*/
@Bean
(
name
=
"asyncExecutor"
)
public
ThreadPoolTaskExecutor
asyncExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setCorePoolSize
(
10
);
executor
.
setQueueCapacity
(
1000
);
executor
.
setKeepAliveSeconds
(
600
);
executor
.
setMaxPoolSize
(
20
);
executor
.
setThreadNamePrefix
(
"taskExecutor-"
);
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
executor
.
initialize
();
return
executor
;
}
@Override
public
void
configureTasks
(
ScheduledTaskRegistrar
scheduledTaskRegistrar
)
{
ThreadPoolTaskScheduler
taskScheduler
=
taskScheduler
();
scheduledTaskRegistrar
.
setTaskScheduler
(
taskScheduler
);
}
@Override
public
Executor
getAsyncExecutor
()
{
return
asyncExecutor
();
}
@Override
public
AsyncUncaughtExceptionHandler
getAsyncUncaughtExceptionHandler
()
{
return
(
throwable
,
method
,
objects
)
->
{
log
.
error
(
"异步任务执行出现异常, message {}, emthod {}, params {}"
,
throwable
,
method
,
objects
);
};
}
}
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
85ce1d63
#DB properties:
spring.datasource.url
=
jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3
_pyh_0510
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
...
...
@@ -90,7 +90,7 @@ rocketmq.producer.groupName2=groupName2
rocketmq.producer.namesrvAddr2
=
172.16.3.135:9876
#\u89C4\u5219ip\u914D\u7F6E\uFF0C\u7528\u4E8E\u591A\u7F51\u5361\u53CAdocker\u955C\u50CF\u542F\u52A8\u65F6\u6DFB\u52A0
#
rule.definition.local-ip=172.16.3.51
rule.definition.local-ip
=
172.16.3.51
rocket-plan-topic
=
topic_fire_emergency_plan
rocket-equip-alarm-topic
=
topic_fire_equip_alarm
...
...
@@ -98,9 +98,6 @@ rocket-equip-alarm-topic=topic_fire_equip_alarm
#3Dtype \u5206\u4E3Aweb\u548Cue
integrated3Dtype
=
web
#\u6570\u636E\u540C\u6B65\u5F00\u5173
systemctl.sync.switch
=
false
#\u6570\u5B57\u5316\u5E94\u6025\u9884\u6848V1.0.0.2\u7248\u672C\uFF0CWEB\u6570\u636E\u7EC4\u88C5\uFF0C\u503C\u4E3Atrue\uFF0C\u9ED8\u8BA4false
plan.web.isUpdatePlanStep
=
false
...
...
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