add 反馈设备状态
This commit is contained in:
@@ -72,6 +72,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
int angle = 0; //角度
|
int angle = 0; //角度
|
||||||
int electric_qty = 0; //电量
|
int electric_qty = 0; //电量
|
||||||
int status = 0; //三色灯状态
|
int status = 0; //三色灯状态
|
||||||
|
int last_status = 0; //三色灯状态
|
||||||
int error = 0;
|
int error = 0;
|
||||||
int last_error = 0;
|
int last_error = 0;
|
||||||
String error_message = "";
|
String error_message = "";
|
||||||
@@ -442,6 +443,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
dto.setError_code(String.valueOf(error_code));
|
dto.setError_code(String.valueOf(error_code));
|
||||||
dto.setError_info(error_message);
|
dto.setError_info(error_message);
|
||||||
deviceErrorLogService.create(dto);
|
deviceErrorLogService.create(dto);
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("error", error);
|
||||||
|
param.put("error_msg", this.getError_message());
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
last_error = error;
|
last_error = error;
|
||||||
@@ -460,6 +467,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} else if (phase == 0x74) {
|
} else if (phase == 0x74) {
|
||||||
//三色灯状态
|
//三色灯状态
|
||||||
status = ikey;
|
status = ikey;
|
||||||
|
|
||||||
|
if (status != last_status) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("mode", status);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
last_status = status;
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(data)) {
|
if (!ObjectUtil.isEmpty(data)) {
|
||||||
phase = 0;
|
phase = 0;
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
int angle = 0; //角度
|
int angle = 0; //角度
|
||||||
int electric_qty = 0; //电量
|
int electric_qty = 0; //电量
|
||||||
int status = 0; //三色灯状态
|
int status = 0; //三色灯状态
|
||||||
|
int last_status = 0; //三色灯状态
|
||||||
String error_message = "";
|
String error_message = "";
|
||||||
String error_type = "agv_error_type";
|
String error_type = "agv_error_type";
|
||||||
private Instruction instruction;
|
private Instruction instruction;
|
||||||
@@ -685,6 +686,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
dto.setError_code(String.valueOf(error_code));
|
dto.setError_code(String.valueOf(error_code));
|
||||||
dto.setError_info(error_message);
|
dto.setError_info(error_message);
|
||||||
deviceErrorLogService.create(dto);
|
deviceErrorLogService.create(dto);
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("error", error);
|
||||||
|
param.put("error_msg", this.getError_message());
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
last_error = error;
|
last_error = error;
|
||||||
@@ -703,6 +710,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} else if (phase == 0x74) {
|
} else if (phase == 0x74) {
|
||||||
//三色灯状态
|
//三色灯状态
|
||||||
status = ikey;
|
status = ikey;
|
||||||
|
|
||||||
|
if (status != last_status) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("mode", status);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
last_status = status;
|
||||||
}
|
}
|
||||||
//进入区域(phase值)
|
//进入区域(phase值)
|
||||||
else if (phase == 0x50) {
|
else if (phase == 0x50) {
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
String task_id = "";
|
String task_id = "";
|
||||||
|
|
||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
|
Boolean last_iserror = false;
|
||||||
Boolean hasGoods = false;
|
Boolean hasGoods = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -115,4 +116,15 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
jo.put("hasGoods", this.getHasGoods());
|
jo.put("hasGoods", this.getHasGoods());
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
public void setIserror(Boolean iserror) {
|
||||||
|
this.iserror = iserror;
|
||||||
|
if (this.iserror != this.last_iserror && this.iserror && device_id.startsWith("RGV")) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_id);
|
||||||
|
param.put("error", alarm);
|
||||||
|
param.put("error_msg", ErrorUtil.getDictDetail("ssx_error_type", alarm));
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
|
this.last_iserror = iserror;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,6 +177,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||||
}
|
}
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("mode", mode);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess:" + requireSucess);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess:" + requireSucess);
|
||||||
this.setRequireSucess(false);
|
this.setRequireSucess(false);
|
||||||
@@ -208,8 +213,15 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||||
dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
dto.setError_code(String.valueOf(error));
|
dto.setError_code(String.valueOf(error));
|
||||||
dto.setError_info(ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error)));
|
String errorInfo = ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error));
|
||||||
|
dto.setError_info(errorInfo);
|
||||||
deviceErrorLogService.create(dto);
|
deviceErrorLogService.create(dto);
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("error", error);
|
||||||
|
param.put("error_msg", errorInfo);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||||
|
|||||||
@@ -228,6 +228,14 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
requireEmptyInSuccess = false;
|
requireEmptyInSuccess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("mode", mode);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||||
}
|
}
|
||||||
@@ -258,8 +266,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||||
dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
dto.setError_code(String.valueOf(error));
|
dto.setError_code(String.valueOf(error));
|
||||||
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
|
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
|
||||||
|
dto.setError_info(errorInfo);
|
||||||
deviceErrorLogService.create(dto);
|
deviceErrorLogService.create(dto);
|
||||||
|
|
||||||
|
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("error", error);
|
||||||
|
param.put("error_msg", errorInfo);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||||
|
|||||||
@@ -230,6 +230,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat);
|
||||||
// }
|
// }
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("mode", mode);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
|
||||||
inst_type = null;
|
inst_type = null;
|
||||||
cache_inst = null;
|
cache_inst = null;
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
@@ -252,8 +257,15 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||||
dto.setDevice_code(device_code);
|
dto.setDevice_code(device_code);
|
||||||
dto.setError_code(String.valueOf(error));
|
dto.setError_code(String.valueOf(error));
|
||||||
dto.setError_info(ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)));
|
String errorInfo = ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error));
|
||||||
|
dto.setError_info(errorInfo);
|
||||||
deviceErrorLogService.create(dto);
|
deviceErrorLogService.create(dto);
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_code);
|
||||||
|
param.put("error", error);
|
||||||
|
param.put("error_msg", errorInfo);
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||||
|
|||||||
@@ -104,4 +104,6 @@ public interface AcsToWmsService {
|
|||||||
|
|
||||||
// 输送线有货变成无货时向lms请求
|
// 输送线有货变成无货时向lms请求
|
||||||
HttpResponse shipDeviceUpdate(JSONObject param);
|
HttpResponse shipDeviceUpdate(JSONObject param);
|
||||||
|
|
||||||
|
void sendDeviceStatus(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -538,4 +538,28 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendDeviceStatus(JSONObject param) {
|
||||||
|
try {
|
||||||
|
MDC.put(log_file_type, log_type);
|
||||||
|
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
AddressDto addressDto = addressService.findByCode("sendDeviceStatus");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
// log.info("sendDeviceStatus - 请求参数 {}", param);
|
||||||
|
HttpRequest
|
||||||
|
.post(url)
|
||||||
|
.body(param.toString())
|
||||||
|
.execute();
|
||||||
|
// log.info("sendDeviceStatus - 返回参数 {}", response.body());
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
MDC.remove(log_file_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -147,6 +147,11 @@
|
|||||||
<el-switch v-model="form.special_flag" />
|
<el-switch v-model="form.special_flag" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="反馈设备状态" label-width="150px">
|
||||||
|
<el-switch v-model="form.sendDeviceStatus" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -320,7 +325,8 @@ export default {
|
|||||||
is_release: true,
|
is_release: true,
|
||||||
link_device_code: [],
|
link_device_code: [],
|
||||||
ship_device_update: true,
|
ship_device_update: true,
|
||||||
special_flag: true
|
special_flag: true,
|
||||||
|
sendDeviceStatus: true
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user