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