Commit 85ce1d63 authored by KeYong's avatar KeYong

修改bug及去掉不使用的配置文件

parent 1e3b8f04
......@@ -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();
>>>>>>> 824e5c019383569502d9457a413770a699dd18ce
} catch (Exception e) {
bool.set(false);
e.printStackTrace();
......
......@@ -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);
}
}
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);
};
}
}
#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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment