设备无关联集中站测试不予处理

This commit is contained in:
tiger_zhou 2023-12-26 11:09:24 +08:00
parent 6afb8fbde8
commit 2e485d0de1

View File

@ -43,6 +43,7 @@ import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.RestController;
//@Component
@RestController()
@RequestMapping("/mock/server")
@Slf4j
public class MockOccServer {
@PostMapping("send")
@ -134,6 +136,10 @@ public class MockOccServer {
}
for (DeviceNameInfo di : md.getDeviceInfos()) {
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) {
MockDeviceStatusReq mockDeviceStatusReq = new MockDeviceStatusReq(messageId, lineId, rtuId_.shortValue(), di.getDeviceType(), di.getDeviceName(),
md.deviceStatus());