add 大屏真实数据

This commit is contained in:
张江玮
2023-09-22 17:57:28 +08:00
parent 122147fc24
commit 283ba69e11
14 changed files with 609 additions and 357 deletions

View File

@@ -144,6 +144,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
this.setRequireSucess(false);
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + " -> " + mode);
if ("true".equals(this.getExtraValue().get("ignore_release_check"))) {
acsToWmsService.deactivatePoint(this.device_code, mode != 0);
}
}
if (move != last_move) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));

View File

@@ -184,4 +184,6 @@ public interface AcsToWmsService {
HttpResponse fjNeed(JSONObject param);
void equipmentFailure(String deviceCode);
void deactivatePoint(String deviceCode, boolean isUsed);
}

View File

@@ -1183,4 +1183,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.remove(log_file_type);
}
}
@Override
public void deactivatePoint(String deviceCode, boolean isUsed) {
try {
MDC.put(log_file_type, log_type);
String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue();
JSONObject param = new JSONObject();
param.put("device_code", deviceCode);
param.put("is_used", isUsed);
log.info("deactivatePoint - 请求参数 {}", param);
AddressDto addressDto = addressService.findByCode("deactivatePoint");
String methods_url = addressDto.getMethods_url();
try {
HttpResponse response = HttpRequest
.post(wmsurl + methods_url)
.timeout(2000)
.body(param.toJSONString())
.execute();
log.info("deactivatePoint - 响应参数 {}", response.body());
} catch (Exception e) {
log.error("deactivatePoint - 请求错误!", e);
}
} finally {
MDC.remove(log_file_type);
}
}
}