更新
This commit is contained in:
@@ -137,7 +137,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
@@ -158,8 +157,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
message = null;
|
||||
if (move == 0 && mode == 2) {
|
||||
message = null;
|
||||
inst_message = null;
|
||||
this.clearWrite();
|
||||
}
|
||||
@@ -183,7 +182,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
if (move != 0 && task > 0) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,指令号:" + task);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,指令号:" + task);
|
||||
//inst_message
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (inst != null) {
|
||||
@@ -211,7 +210,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +296,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
break;
|
||||
case 7:
|
||||
//空盘出库申请
|
||||
if (move == 0 && !requireEmptyOutSuccess) {
|
||||
if (move == 0 && !requireSucess) {
|
||||
emptyOut();
|
||||
}
|
||||
break;
|
||||
@@ -755,6 +754,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
String vehicle_code = "";
|
||||
if (task > 0) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if(ObjectUtil.isEmpty(instruction)){
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到对应指令";
|
||||
throw new RuntimeException("该电气任务号未找到对应指令!");
|
||||
}
|
||||
vehicle_code = instruction.getVehicle_code();
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常");
|
||||
@@ -839,12 +842,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
message = "申请空盘入库接口不通";
|
||||
requireEmptyInSuccess = true;
|
||||
} else {
|
||||
if (jo.getInteger("status") == 200) {
|
||||
message = "申请空盘入库成功";
|
||||
requireEmptyInSuccess = true;
|
||||
} else {
|
||||
requireEmptyInSuccess = false;
|
||||
requireEmptyInSuccess = true;
|
||||
message = "申请空盘入库失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
@@ -871,12 +875,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
message = "申请AGV搬运任务接口不通";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
if (jo.getInteger("status") == 200) {
|
||||
message = "申请AGV搬运任务成功";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireSucess = false;
|
||||
requireSucess = true;
|
||||
message = "申请AGV搬运任务失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
@@ -901,12 +906,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
message = "申请空盘出库接口不通";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
if (jo.getInteger("status") == 200) {
|
||||
message = "申请空盘出库成功";
|
||||
requireEmptyOutSuccess = true;
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireEmptyOutSuccess = false;
|
||||
requireSucess = true;
|
||||
message = "申请空盘出库失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,9 +491,13 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
TaskDto taskdto = taskserver.findByContainer(container_code);
|
||||
if (!ObjectUtil.isEmpty(taskdto)) {
|
||||
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
|
||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务时该载具号"+container_code
|
||||
+"已存在对应任务,不再请求");
|
||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||
if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
|
||||
message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务"
|
||||
+"当前载具号"+container_code+"查找对应指令起点与当前设备不符");
|
||||
// this.setIserror(true);
|
||||
// List list = new ArrayList();
|
||||
// Map map = new HashMap();
|
||||
@@ -540,10 +544,12 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
message = "下发电气任务号成功";
|
||||
if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务时该载具号"+container_code
|
||||
+"已存在对应任务,下发电气信号");
|
||||
// if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||
// this.writing(list);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||
// }
|
||||
requireSucess = true;
|
||||
applySucess = true;
|
||||
} else {
|
||||
@@ -671,10 +677,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
map3.put("value","1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
// if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||
// this.writing(list);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||
// }
|
||||
requireSucess = true;
|
||||
applySucess = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user