日志调整
This commit is contained in:
parent
c9b8724195
commit
19dc3b31bc
@ -9,16 +9,33 @@ import org.mybatis.spring.annotation.MapperScan;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
@OpenAPIDefinition(info = @Info(title = "西安NCC调度辅助决策系统API", version = "0.1"))
|
@OpenAPIDefinition(info = @Info(title = "西安NCC调度辅助决策系统API", version = "0.1"))
|
||||||
@SecurityScheme(name = "jwt", scheme = "bearer", type = SecuritySchemeType.HTTP, in = SecuritySchemeIn.HEADER)
|
@SecurityScheme(name = "jwt", scheme = "bearer", type = SecuritySchemeType.HTTP, in = SecuritySchemeIn.HEADER)
|
||||||
|
//@RestController
|
||||||
public class XianNccDaApplication {
|
public class XianNccDaApplication {
|
||||||
|
|
||||||
|
public static ConfigurableApplicationContext applicationContext;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(XianNccDaApplication.class, args);
|
ConfigurableApplicationContext ac = SpringApplication.run(XianNccDaApplication.class, args);
|
||||||
|
applicationContext = ac;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*@PostMapping("/tmpRestart")
|
||||||
|
public String shutdown() {
|
||||||
|
Thread t = new Thread(() -> {
|
||||||
|
applicationContext.close();
|
||||||
|
|
||||||
|
});
|
||||||
|
t.setDaemon(false);
|
||||||
|
t.start();
|
||||||
|
return "1";
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,12 @@ public class OccMessageManage implements ApplicationRunner {
|
|||||||
clientMap.put(client.lineId, client);
|
clientMap.put(client.lineId, client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
for (XianOccMessagingClient client : this.clientMap.values()) {
|
||||||
|
client.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
log.info("初始化 occ tcp连接.... 是否监控cpu,内存信息:{}", this.monitorHandwareChange);
|
log.info("初始化 occ tcp连接.... 是否监控cpu,内存信息:{}", this.monitorHandwareChange);
|
||||||
|
@ -4,9 +4,11 @@ import club.joylink.xiannccda.ats.message.line3.req.LoadHistoryTGDataRequest;
|
|||||||
import club.joylink.xiannccda.ats.message.line3.req.LoadHistoryTGDataRequest.ApplyTypeEnum;
|
import club.joylink.xiannccda.ats.message.line3.req.LoadHistoryTGDataRequest.ApplyTypeEnum;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -113,40 +115,33 @@ public class XianOccMessagingClient {
|
|||||||
private Long lastReceiveMessageTime;
|
private Long lastReceiveMessageTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
this.timeOutHandler.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
public static class ConnectionTimeOutHandler {
|
public static class ConnectionTimeOutHandler {
|
||||||
|
|
||||||
final int HeartBeatTimeout = 20 * 1000;
|
final int HeartBeatTimeout = 20 * 1000;
|
||||||
static final int Period = 2;
|
static final int Period = 2;
|
||||||
|
|
||||||
static final ScheduledExecutorService Executor = Executors.newSingleThreadScheduledExecutor();
|
static ScheduledExecutorService Executor = Executors.newSingleThreadScheduledExecutor();
|
||||||
private final LinkedList<OccTcpClientConnection> clientConnections = new LinkedList<>();
|
private final LinkedList<OccTcpClientConnection> clientConnections = new LinkedList<>();
|
||||||
private final SystemInfo systemInfo;
|
private final SystemInfo systemInfo;
|
||||||
// private long[] ticks = null;
|
|
||||||
|
|
||||||
private boolean monitorHandwareChange;
|
private boolean monitorHandwareChange;
|
||||||
// private OSProcess osProcess;
|
|
||||||
// private Integer processId;
|
|
||||||
private long[] ticks;
|
private long[] ticks;
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
Executor.shutdownNow();
|
||||||
|
}
|
||||||
|
|
||||||
public ConnectionTimeOutHandler() {
|
public ConnectionTimeOutHandler() {
|
||||||
this.systemInfo = new SystemInfo();
|
this.systemInfo = new SystemInfo();
|
||||||
/* List<OSProcess> osProcesses = systemInfo.getOperatingSystem().getProcesses();
|
if (Executor.isShutdown()) {
|
||||||
for (OSProcess osProcess : osProcesses) {
|
Executor = Executors.newSingleThreadScheduledExecutor();
|
||||||
String processName = osProcess.getName();
|
|
||||||
if (StringUtils.contains(processName, "java")) {
|
|
||||||
log.info(osProcess.getArguments().toString());
|
|
||||||
for (String arg : osProcess.getArguments()) {
|
|
||||||
if (StringUtils.containsAny(arg, "XianNccDaApplication", "xian-ncc-da")) {
|
|
||||||
*//*System.out.println(osProcess.getProcessID());
|
|
||||||
System.out.println(osProcess.getName());
|
|
||||||
System.out.println(osProcess.getProcessCpuLoadBetweenTicks(osProcess) * 100);*//*
|
|
||||||
this.osProcess = osProcess;
|
|
||||||
this.processId = osProcess.getProcessID();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addConnection(OccTcpClientConnection conn) {
|
public void addConnection(OccTcpClientConnection conn) {
|
||||||
this.clientConnections.add(conn);
|
this.clientConnections.add(conn);
|
||||||
@ -192,6 +187,7 @@ public class XianOccMessagingClient {
|
|||||||
log.info(moitorContent);
|
log.info(moitorContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (OccTcpClientConnection cc : this.clientConnections) {
|
for (OccTcpClientConnection cc : this.clientConnections) {
|
||||||
if (cc.connected) {
|
if (cc.connected) {
|
||||||
long ctm = System.currentTimeMillis();
|
long ctm = System.currentTimeMillis();
|
||||||
@ -204,7 +200,9 @@ public class XianOccMessagingClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, Period, Period, TimeUnit.SECONDS);
|
}, Period, Period, TimeUnit.SECONDS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,9 +77,6 @@ public class DeviceStatusBitmapResponse extends MessageResponse {
|
|||||||
GeneratedMessageV3.Builder builder = DeviceStatusConvertor.convert(dt, deviceEntity.status);
|
GeneratedMessageV3.Builder builder = DeviceStatusConvertor.convert(dt, deviceEntity.status);
|
||||||
// DeviceStatusConvertor.fillField(builder, "id", deviceEntity.devName);
|
// DeviceStatusConvertor.fillField(builder, "id", deviceEntity.devName);
|
||||||
String newOccName = DeviceNameChangerManage.findMatch(dt, deviceEntity.devName);
|
String newOccName = DeviceNameChangerManage.findMatch(dt, deviceEntity.devName);
|
||||||
if (dt == DeviceType.DEVICE_TYPE_PLATFORM) {
|
|
||||||
log.info("接受屏蔽门全量状态 屏蔽门[{}] 状态[{}] 接受时间[{}]", newOccName, deviceEntity.status, this.getTime());
|
|
||||||
}
|
|
||||||
DeviceStatusConvertor.fillField(builder, "id", newOccName);
|
DeviceStatusConvertor.fillField(builder, "id", newOccName);
|
||||||
DeviceStatusConvertor.fillField(builder, "rtuId", this.rtuId);
|
DeviceStatusConvertor.fillField(builder, "rtuId", this.rtuId);
|
||||||
DeviceStatusConvertor.fillField(builder, "timestamp", this.getTime());
|
DeviceStatusConvertor.fillField(builder, "timestamp", this.getTime());
|
||||||
@ -90,7 +87,7 @@ public class DeviceStatusBitmapResponse extends MessageResponse {
|
|||||||
DeviceStatusConvertor.convertForTrack(deviceEntity.getStatus(), builder);
|
DeviceStatusConvertor.convertForTrack(deviceEntity.getStatus(), builder);
|
||||||
DeviceStatusConvertor.convertForPlatform(deviceEntity.getStatus(), (Objects.isNull(deviceEntity.getSpare()) ? 0 : deviceEntity.getSpare()), builder);
|
DeviceStatusConvertor.convertForPlatform(deviceEntity.getStatus(), (Objects.isNull(deviceEntity.getSpare()) ? 0 : deviceEntity.getSpare()), builder);
|
||||||
DeviceStatusConvertor.convertForSwitch(Objects.isNull(deviceEntity.getSpare()) ? 0 : deviceEntity.getSpare(), builder);
|
DeviceStatusConvertor.convertForSwitch(Objects.isNull(deviceEntity.getSpare()) ? 0 : deviceEntity.getSpare(), builder);
|
||||||
|
log.info("接受全量状态设备类型:[{}] 对应状态[{}]", dt.name(), builder);
|
||||||
msgBuildList.add(builder);
|
msgBuildList.add(builder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,9 +102,6 @@ public class DeviceStatusChangeResponse extends MessageResponse {
|
|||||||
// }
|
// }
|
||||||
GeneratedMessageV3.Builder builder = DeviceStatusConvertor.convert(this.type, this.deviceStatus);
|
GeneratedMessageV3.Builder builder = DeviceStatusConvertor.convert(this.type, this.deviceStatus);
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.info("设备状态变更 设备类型[{}] 设备名称[{}] 状态[{}] 接受时间[{}]", this.type.name(), occName, this.deviceStatus, this.getTime());
|
|
||||||
}
|
|
||||||
// DeviceStatusConvertor.fillField(builder, "id", this.devName);
|
// DeviceStatusConvertor.fillField(builder, "id", this.devName);
|
||||||
DeviceStatusConvertor.fillField(builder, "id", occName);
|
DeviceStatusConvertor.fillField(builder, "id", occName);
|
||||||
DeviceStatusConvertor.fillField(builder, "dataFrom", MessageId.DEVICE_STATUS_CHANGE.name());
|
DeviceStatusConvertor.fillField(builder, "dataFrom", MessageId.DEVICE_STATUS_CHANGE.name());
|
||||||
@ -115,6 +112,7 @@ public class DeviceStatusChangeResponse extends MessageResponse {
|
|||||||
DeviceStatusConvertor.convertForTrack(this.deviceStatus, builder);
|
DeviceStatusConvertor.convertForTrack(this.deviceStatus, builder);
|
||||||
DeviceStatusConvertor.convertForPlatform(this.deviceStatus, Objects.isNull(this.spare) ? 0 : this.spare, builder);
|
DeviceStatusConvertor.convertForPlatform(this.deviceStatus, Objects.isNull(this.spare) ? 0 : this.spare, builder);
|
||||||
DeviceStatusConvertor.convertForSwitch(Objects.isNull(this.spare) ? 0 : this.spare, builder);
|
DeviceStatusConvertor.convertForSwitch(Objects.isNull(this.spare) ? 0 : this.spare, builder);
|
||||||
|
log.info("接受全量状态设备类型[{}] 对应状态[{}]", this.type.name(), builder);
|
||||||
return List.of(builder);
|
return List.of(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +86,12 @@ public class InusedScheduleResponse extends MessageResponse {
|
|||||||
public List<GeneratedMessageV3.Builder> generateProto() {
|
public List<GeneratedMessageV3.Builder> generateProto() {
|
||||||
List<GeneratedMessageV3.Builder> planBuilds = Lists.newArrayList();
|
List<GeneratedMessageV3.Builder> planBuilds = Lists.newArrayList();
|
||||||
if (CollectionUtils.isEmpty(this.entityList)) {
|
if (CollectionUtils.isEmpty(this.entityList)) {
|
||||||
|
Plan.Builder planBuild = Plan.newBuilder();
|
||||||
|
planBuild.setLineId(this.lineId);
|
||||||
|
planBuild.setDate(DateTimeUtil.epochSecond(this.date));
|
||||||
|
planBuild.setActionId(this.subId.val());
|
||||||
|
planBuild.setTrainId(this.trainId);
|
||||||
|
planBuilds.add(planBuild);
|
||||||
return planBuilds;
|
return planBuilds;
|
||||||
}
|
}
|
||||||
for (InusedScheduleEntity entity : this.entityList) {
|
for (InusedScheduleEntity entity : this.entityList) {
|
||||||
|
@ -28,6 +28,7 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -115,7 +116,7 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
} else if (isOpen && Objects.equals(false, platformBuild.getPsdOpen())) {
|
} else if (isOpen && Objects.equals(false, platformBuild.getPsdOpen())) {
|
||||||
//开门后,在阈值内关门
|
//开门后,在阈值内关门
|
||||||
alertManager.putAlterDevice(platformBuild.getLineId(), PLATFORM_IS_CLOSE, platformBuild.getId());
|
alertManager.putAlterDevice(platformBuild.getLineId(), PLATFORM_IS_CLOSE, platformBuild.getId());
|
||||||
} else if (isOpen && this.timeOver(platformBuild.getReceiveTime(), (int) stayTimeSecond + guardConfig.getCanNotCloseTimes())) {
|
} else if (isOpen /*&& !isClose*/ && this.timeOver(platformBuild.getReceiveTime(), (int) stayTimeSecond + guardConfig.getCanNotCloseTimes())) {
|
||||||
//车辆停靠,只开门 超过等待时间+阈值时间
|
//车辆停靠,只开门 超过等待时间+阈值时间
|
||||||
this.alert(platformBuild, AlertType.PLATFORM_DOOR_CANNOT_CLOSE, PLATFORM_IS_CLOSE, isUpWay, record);
|
this.alert(platformBuild, AlertType.PLATFORM_DOOR_CANNOT_CLOSE, PLATFORM_IS_CLOSE, isUpWay, record);
|
||||||
} else if (!isOpen && !isClose && platformBuild.getTrainberth() && this.timeOver(platformBuild.getReceiveTime(), guardConfig.getCanNotOpenTimes())) {
|
} else if (!isOpen && !isClose && platformBuild.getTrainberth() && this.timeOver(platformBuild.getReceiveTime(), guardConfig.getCanNotOpenTimes())) {
|
||||||
@ -128,11 +129,9 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
int lineId = platformBuild.getLineId();
|
int lineId = platformBuild.getLineId();
|
||||||
boolean alertAdd = alertManager.putAlterDevice(lineId, customName, platformBuild.getId());
|
boolean alertAdd = alertManager.putAlterDevice(lineId, customName, platformBuild.getId());
|
||||||
if (alertAdd) {
|
if (alertAdd) {
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
log.info("列车开关门是否已经报警检测,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}], 告警类型[{}] 告警名称[{}]",
|
log.info("列车开关门是否已经报警检测,线路[{}] 列车表号[{}] 列车车次号[{}] 车站id[{}] 站台门id[{}] 上下行[{}] 解析屏蔽门code[{}],接收时间[{}], 告警类型[{}] 告警名称[{}]",
|
||||||
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), alertType,
|
record.getLineId(), record.getTrainId(), record.getGlobalId(), record.getStationId(), record.getSideId(), isUpWay, platformBuild.getId(), platformBuild.getReceiveTime(), alertType,
|
||||||
customName);
|
customName);
|
||||||
}
|
|
||||||
|
|
||||||
LayoutGraphicsProto.Platform platform = LineGraphicDataRepository.getDeviceByCode(lineId, platformBuild.getId(), LayoutGraphicsProto.Platform.class);
|
LayoutGraphicsProto.Platform platform = LineGraphicDataRepository.getDeviceByCode(lineId, platformBuild.getId(), LayoutGraphicsProto.Platform.class);
|
||||||
String openClose = alertType == AlertType.PLATFORM_DOOR_CANNOT_CLOSE ? "关闭" : "打开";
|
String openClose = alertType == AlertType.PLATFORM_DOOR_CANNOT_CLOSE ? "关闭" : "打开";
|
||||||
@ -146,7 +145,6 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
alertManager.emit(alertInfo);
|
alertManager.emit(alertInfo);
|
||||||
this.removeTrainRecord(record);
|
this.removeTrainRecord(record);
|
||||||
}
|
}
|
||||||
// this.removeTrainRecordOnly(record);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -154,9 +152,11 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
for (Builder record : this.trainRecordMap.values()) {
|
for (Builder record : this.trainRecordMap.values()) {
|
||||||
boolean isUpWay = record.getDir() == DirectionEnum.Up.getValue();
|
boolean isUpWay = record.getDir() == DirectionEnum.Up.getValue();
|
||||||
Platform.Builder platformBuild = this.parsePlatform(record, isUpWay);
|
Platform.Builder platformBuild = this.parsePlatform(record, isUpWay);
|
||||||
|
|
||||||
if (Objects.nonNull(platformBuild)) {
|
|
||||||
int lineId = record.getLineId();
|
int lineId = record.getLineId();
|
||||||
|
if (Objects.isNull(platformBuild)) {
|
||||||
|
this.removeTrainRecord(record);
|
||||||
|
break;
|
||||||
|
}
|
||||||
boolean isOpen = alertManager.deviceIsExist(lineId, PLATFORM_IS_OPEN, platformBuild.getId());
|
boolean isOpen = alertManager.deviceIsExist(lineId, PLATFORM_IS_OPEN, platformBuild.getId());
|
||||||
boolean isClose = alertManager.deviceIsExist(lineId, PLATFORM_IS_CLOSE, platformBuild.getId());
|
boolean isClose = alertManager.deviceIsExist(lineId, PLATFORM_IS_CLOSE, platformBuild.getId());
|
||||||
if (isOpen && isClose && Objects.equals(false, platformBuild.getTrainberth())) {
|
if (isOpen && isClose && Objects.equals(false, platformBuild.getTrainberth())) {
|
||||||
@ -190,9 +190,6 @@ public class PlatformAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
}
|
}
|
||||||
Plan.Builder planBuild = planBuildOpt.get();
|
Plan.Builder planBuild = planBuildOpt.get();
|
||||||
this.handle(record, isUpWay, platformBuild, isOpen, isClose, planBuild);
|
this.handle(record, isUpWay, platformBuild, isOpen, isClose, planBuild);
|
||||||
} else {
|
|
||||||
this.removeTrainRecord(record);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public class SwitchLostAlertMonitoringTask implements AlertMonitoringTask {
|
|||||||
public void putSwitchIfNotExist(Switch.Builder switchBuilder) {
|
public void putSwitchIfNotExist(Switch.Builder switchBuilder) {
|
||||||
if (!deviceMap.containsKey(switchBuilder.getId())) {
|
if (!deviceMap.containsKey(switchBuilder.getId())) {
|
||||||
deviceMap.put(switchBuilder.getId(), switchBuilder);
|
deviceMap.put(switchBuilder.getId(), switchBuilder);
|
||||||
log.info("线路[{}] 道岔[{}] 添加到道岔失表监控中... 设备状态参数[{}]", switchBuilder.getLineId(), switchBuilder.getId(), switchBuilder);
|
log.info("线路[{}] 道岔[{}] 添加到道岔失表监控中... 设备状态参数[{}]", switchBuilder.getLineId(), switchBuilder.getId(), switchBuilder.getIpSingleSwitchStusLostIndication());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ public class SystemContext implements ApplicationContextAware {
|
|||||||
@Override
|
@Override
|
||||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
|
||||||
if (Objects.isNull(appContext)) {
|
// if (Objects.isNull(appContext)) {
|
||||||
System.out.println("获取 spring appContext");
|
System.out.println("获取 spring appContext");
|
||||||
appContext = applicationContext;
|
appContext = applicationContext;
|
||||||
masterEnv = applicationContext.getEnvironment().matchesProfiles("master");
|
masterEnv = applicationContext.getEnvironment().matchesProfiles("master");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,10 @@ public class MockLoadData implements ApplicationRunner {
|
|||||||
static final ScheduledExecutorService CIRCLE_QUERY_THREAD = Executors.newSingleThreadScheduledExecutor();
|
static final ScheduledExecutorService CIRCLE_QUERY_THREAD = Executors.newSingleThreadScheduledExecutor();
|
||||||
private final NccMockDataService nccMockDataService;
|
private final NccMockDataService nccMockDataService;
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
CIRCLE_QUERY_THREAD.shutdownNow();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
this.nccMockDataService.reset(10);
|
this.nccMockDataService.reset(10);
|
||||||
|
@ -56,11 +56,11 @@ public class AlertInfoService {
|
|||||||
|
|
||||||
|
|
||||||
public NccAlertInfo createAlert2(Optional<AreaConfigVO> areaConfigOpt, AlertType alertType, MessageOrBuilder mb, String alertMsg, String layoutId, AlertDeviceType deviceType, boolean mockData) {
|
public NccAlertInfo createAlert2(Optional<AreaConfigVO> areaConfigOpt, AlertType alertType, MessageOrBuilder mb, String alertMsg, String layoutId, AlertDeviceType deviceType, boolean mockData) {
|
||||||
Long timestamp = DeviceStatusDataOperate.findFieldVal(mb, "timestamp", Long.class);
|
// Long timestamp = DeviceStatusDataOperate.findFieldVal(mb, "timestamp", Long.class);
|
||||||
Integer lineId = DeviceStatusDataOperate.findFieldVal(mb, "lineId", Integer.class);
|
Integer lineId = DeviceStatusDataOperate.findFieldVal(mb, "lineId", Integer.class);
|
||||||
LocalDateTime createTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(timestamp), ZoneId.of("+8"));
|
// LocalDateTime createTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(timestamp), ZoneId.of("+8"));
|
||||||
Long areaConfigId = areaConfigOpt.map(AreaConfigVO::getId).orElse(null);
|
Long areaConfigId = areaConfigOpt.map(AreaConfigVO::getId).orElse(null);
|
||||||
return this.createAlert2(areaConfigId, alertType, lineId, createTime, alertMsg, layoutId, deviceType, mockData);
|
return this.createAlert2(areaConfigId, alertType, lineId, LocalDateTime.now(), alertMsg, layoutId, deviceType, mockData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user