rev:自动线程修改
This commit is contained in:
@@ -53,7 +53,8 @@ public class DeviceExecuteAutoRunable extends AbstractAutoRunnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoRun() throws Exception {
|
public void autoRun() throws Exception {
|
||||||
for (int i = 0; !OpcConfig.OPC_START_TAG; ++i) {
|
// TODO本项目没有OPC
|
||||||
|
/*for (int i = 0; !OpcConfig.OPC_START_TAG; ++i) {
|
||||||
log.info("设备执行线程等待opc同步线程...");
|
log.info("设备执行线程等待opc同步线程...");
|
||||||
Thread.sleep(1000L);
|
Thread.sleep(1000L);
|
||||||
if (i > 60) {
|
if (i > 60) {
|
||||||
@@ -87,6 +88,6 @@ public class DeviceExecuteAutoRunable extends AbstractAutoRunnable {
|
|||||||
executorService.submit(runnable);
|
executorService.submit(runnable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class AutoRunController {
|
|||||||
|
|
||||||
|
|
||||||
@Log("查询自动线程")
|
@Log("查询自动线程")
|
||||||
|
@GetMapping
|
||||||
public ResponseEntity<Object> query(Map map) throws Exception {
|
public ResponseEntity<Object> query(Map map) throws Exception {
|
||||||
List<AutoRunDto> ThreadDtos = autoRunService.findAll();
|
List<AutoRunDto> ThreadDtos = autoRunService.findAll();
|
||||||
return new ResponseEntity<>(PageUtil.toPage(ThreadDtos, ThreadDtos.size()), HttpStatus.OK);
|
return new ResponseEntity<>(PageUtil.toPage(ThreadDtos, ThreadDtos.size()), HttpStatus.OK);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.acs.autoThread.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.ApplicationAutoInitial;
|
import org.nl.ApplicationAutoInitial;
|
||||||
@@ -79,6 +80,9 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
|||||||
AutoRunDto autoRunDto = new AutoRunDto();
|
AutoRunDto autoRunDto = new AutoRunDto();
|
||||||
BeanUtil.copyProperties(autoRunnable, autoRunDto, true);
|
BeanUtil.copyProperties(autoRunnable, autoRunDto, true);
|
||||||
Thread thread = code_Thread_Map.get(autoRunnable.getCode());
|
Thread thread = code_Thread_Map.get(autoRunnable.getCode());
|
||||||
|
if (ObjectUtil.isEmpty(thread)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
autoRunDto.setCode(autoRunnable.getCode());
|
autoRunDto.setCode(autoRunnable.getCode());
|
||||||
autoRunDto.setName(autoRunnable.getName());
|
autoRunDto.setName(autoRunnable.getName());
|
||||||
autoRunDto.setThread_alive(thread.isAlive());
|
autoRunDto.setThread_alive(thread.isAlive());
|
||||||
|
|||||||
Reference in New Issue
Block a user