设备无关联集中站测试不予处理
This commit is contained in:
parent
6afb8fbde8
commit
2e485d0de1
@ -43,6 +43,7 @@ import java.util.concurrent.locks.Lock;
|
|||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
//@Component
|
//@Component
|
||||||
@RestController()
|
@RestController()
|
||||||
@RequestMapping("/mock/server")
|
@RequestMapping("/mock/server")
|
||||||
|
@Slf4j
|
||||||
public class MockOccServer {
|
public class MockOccServer {
|
||||||
|
|
||||||
@PostMapping("send")
|
@PostMapping("send")
|
||||||
@ -134,6 +136,10 @@ public class MockOccServer {
|
|||||||
}
|
}
|
||||||
for (DeviceNameInfo di : md.getDeviceInfos()) {
|
for (DeviceNameInfo di : md.getDeviceInfos()) {
|
||||||
Integer rtuId_ = findDeviceRtuId((int) lineId, di.getDeviceType(), di.getDeviceName(), md.getAlertType());
|
Integer rtuId_ = findDeviceRtuId((int) lineId, di.getDeviceType(), di.getDeviceName(), md.getAlertType());
|
||||||
|
if (Objects.isNull(rtuId_)) {
|
||||||
|
log.error("{}没有找到对应的集中站,不予处理", di.getDeviceName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (messageId == MessageId.DEVICE_STATUS_CHANGE) {
|
if (messageId == MessageId.DEVICE_STATUS_CHANGE) {
|
||||||
MockDeviceStatusReq mockDeviceStatusReq = new MockDeviceStatusReq(messageId, lineId, rtuId_.shortValue(), di.getDeviceType(), di.getDeviceName(),
|
MockDeviceStatusReq mockDeviceStatusReq = new MockDeviceStatusReq(messageId, lineId, rtuId_.shortValue(), di.getDeviceType(), di.getDeviceName(),
|
||||||
md.deviceStatus());
|
md.deviceStatus());
|
||||||
|
Loading…
Reference in New Issue
Block a user