Commit 71c46ac9 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents 85388bb5 dd88276d
......@@ -78,7 +78,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>();
static IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Value("${iot.async.flag}")
private boolean iotAsyncExecutorFlag;
@Autowired
public void setEquipmentSpecificIndexService(IEquipmentSpecificIndexService equipmentSpecificIndexService) {
MqttReceiveServiceImpl.equipmentSpecificIndexService = equipmentSpecificIndexService;
......@@ -2547,6 +2548,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@PostConstruct
public void iotAsyncExecutor() {
if(iotAsyncExecutorFlag) {
System.out.println("-----------------iotAsyncExecutorFlagiotAsyncExecutorFlagiotAsyncExecutorFlagiotAsyncExecutorFlagiotAsyncExecutorFlagiotAsyncExecutorFlagiotAsyncExecutorFlag");
ThreadPoolTaskExecutor workExecutor = new ThreadPoolTaskExecutor();
// 设置核心线程数
int length = Runtime.getRuntime().availableProcessors();
......@@ -2571,5 +2574,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
workExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
this.dataExecutor = workExecutor;
}
}
}
......@@ -79,11 +79,9 @@ public class ThreadCarMileageTreatment extends Thread {
&& Obj.getDoubleValue("FireCar_Latitude") != 0) {
filterList.add(list.get(j));
// 获取第一个不为空的坐标
if (lastObj == null) {
lastObj = Obj;
}
}
}
Log.info("----------------------------------------lastobj----------------------"+lastObj.toJSONString());
if (lastObj == null) {
lastObj = new JSONObject();
......@@ -116,7 +114,7 @@ public class ThreadCarMileageTreatment extends Thread {
}
last.setTravel(new BigDecimal(travel / 1000).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
Log.info("----------------------------------------last----------------------"+lastObj.toJSONString());
wlCarMileageServiceImpl.updateById(last);
// wlCarMileageServiceImpl.updateById(last);
}
}
}
......
......@@ -150,3 +150,4 @@ spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d
spring.influx.actions=10000
spring.influx.bufferLimit=20000
iot.async.flag = false
\ No newline at end of file
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