更新
This commit is contained in:
@@ -177,28 +177,31 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == 2 && move != 0 && task > 0) {
|
if ( move != 0 && task > 0) {
|
||||||
//inst_message
|
//inst_message
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "1")) {
|
if(mode == 2){
|
||||||
if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
|
if (StrUtil.equals(inst.getInstruction_status(), "1")) {
|
||||||
vehicle_code = inst.getVehicle_code();
|
if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
|
||||||
inst.setExecute_device_code(this.device_code);
|
vehicle_code = inst.getVehicle_code();
|
||||||
finish_instruction();
|
|
||||||
} else {
|
|
||||||
if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
|
|
||||||
inst.setExecute_device_code(this.device_code);
|
inst.setExecute_device_code(this.device_code);
|
||||||
instructionService.update(inst);
|
finish_instruction();
|
||||||
|
} else {
|
||||||
|
if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
|
||||||
|
inst.setExecute_device_code(this.device_code);
|
||||||
|
instructionService.update(inst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
} else {
|
||||||
inst.setInstruction_status("1");
|
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||||
inst.setExecute_device_code(this.device_code);
|
inst.setInstruction_status("1");
|
||||||
instructionService.update(inst);
|
inst.setExecute_device_code(this.device_code);
|
||||||
|
instructionService.update(inst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -654,7 +654,11 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
}
|
}
|
||||||
if(task >0 ){
|
if(task >0 ){
|
||||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
if (ObjectUtil.isEmpty(instruction)){
|
||||||
|
instruction = instructionService.findByCode(String.valueOf(task));
|
||||||
|
}
|
||||||
vehicle_code = instruction.getVehicle_code();
|
vehicle_code = instruction.getVehicle_code();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
|
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
|
||||||
message = "申请贴标电气设备任务号:"+task+"异常";
|
message = "申请贴标电气设备任务号:"+task+"异常";
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
public void clearBarcode() throws Exception {
|
public void clearBarcode() throws Exception {
|
||||||
ScannerDeviceDriver scanner = this.getScanner();
|
ScannerDeviceDriver scanner = this.getScanner();
|
||||||
scanner.cleanBarcode();
|
scanner.cleanBarcode();
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "清理条码");
|
||||||
}
|
}
|
||||||
public synchronized boolean finish_instruction() throws Exception {
|
public synchronized boolean finish_instruction() throws Exception {
|
||||||
instructionService.finish(inst);
|
instructionService.finish(inst);
|
||||||
@@ -197,6 +198,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
if (move == 0 && mode == 2) {
|
if (move == 0 && mode == 2) {
|
||||||
message = null;
|
message = null;
|
||||||
inst_message = null;
|
inst_message = null;
|
||||||
|
clearBarcode();
|
||||||
thingToNothing();
|
thingToNothing();
|
||||||
}
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||||
@@ -292,7 +294,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
last_error = error;
|
last_error = error;
|
||||||
last_move = move;
|
last_move = move;
|
||||||
last_task = task;
|
last_task = task;
|
||||||
|
last_plcbarcode_length = plcbarcode_length;
|
||||||
|
last_plcbarcode = plcbarcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean exe_error() {
|
public boolean exe_error() {
|
||||||
@@ -426,6 +429,11 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
TaskDto task = taskserver.findByContainer(container_code);
|
TaskDto task = taskserver.findByContainer(container_code);
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
||||||
|
if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
|
||||||
|
message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
|
||||||
|
// this.setIserror(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(ObjectUtil.isNotEmpty(instdto)){
|
if(ObjectUtil.isNotEmpty(instdto)){
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
@@ -484,6 +492,27 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
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());
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||||
|
if(!StrUtil.equals(instdto.getStart_device_code(),this.device_code)){
|
||||||
|
message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
|
||||||
|
// this.setIserror(true);
|
||||||
|
// List list = new ArrayList();
|
||||||
|
// Map map = new HashMap();
|
||||||
|
// map.put("code","to_target");
|
||||||
|
// map.put("value","1011");
|
||||||
|
// list.add(map);
|
||||||
|
// Map map2 = new HashMap();
|
||||||
|
// map2.put("code","to_command");
|
||||||
|
// map2.put("value","1");
|
||||||
|
// Map map3 = new HashMap();
|
||||||
|
// map3.put("code","to_task");
|
||||||
|
// map3.put("value","0");
|
||||||
|
// list.add(map3);
|
||||||
|
// this.writing(list);
|
||||||
|
// this.setRequireSucess(true);
|
||||||
|
// this.setApplySucess(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.setIserror(false);
|
||||||
if (ObjectUtil.isNotEmpty(instdto)) {
|
if (ObjectUtil.isNotEmpty(instdto)) {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
@@ -522,6 +551,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String taskid = taskdto.getTask_id();
|
String taskid = taskdto.getTask_id();
|
||||||
String taskcode = taskdto.getTask_code();
|
String taskcode = taskdto.getTask_code();
|
||||||
String vehiclecode = taskdto.getVehicle_code();
|
String vehiclecode = taskdto.getVehicle_code();
|
||||||
@@ -571,6 +601,26 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
} else {
|
} else {
|
||||||
next_point_code = next_device_code;
|
next_point_code = next_device_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!StrUtil.equals(taskdto.getStart_device_code(),this.device_code)){
|
||||||
|
message ="当前载具号"+container_code+"查找对应指令起点与当前设备不符";
|
||||||
|
// List list = new ArrayList();
|
||||||
|
// Map map = new HashMap();
|
||||||
|
// map.put("code","to_target");
|
||||||
|
// map.put("value","1011");
|
||||||
|
// list.add(map);
|
||||||
|
// Map map2 = new HashMap();
|
||||||
|
// map2.put("code","to_command");
|
||||||
|
// map2.put("value","1");
|
||||||
|
// Map map3 = new HashMap();
|
||||||
|
// map3.put("code","to_task");
|
||||||
|
// map3.put("value","0");
|
||||||
|
// list.add(map3);
|
||||||
|
// this.writing(list);
|
||||||
|
// this.setRequireSucess(true);
|
||||||
|
// this.setApplySucess(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
instdto.setRoute_plan_code(route_plan_code);
|
instdto.setRoute_plan_code(route_plan_code);
|
||||||
@@ -646,7 +696,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
Map map2 = new HashMap();
|
Map map2 = new HashMap();
|
||||||
map2.put("code","to_command");
|
map2.put("code","to_command");
|
||||||
map2.put("value","1");
|
map2.put("value","1");
|
||||||
list.add(map2);
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_task");
|
||||||
|
map3.put("value","0");
|
||||||
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
message = "申请任务失败接口不通下发退回";
|
message = "申请任务失败接口不通下发退回";
|
||||||
} else {
|
} else {
|
||||||
@@ -666,6 +719,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
map2.put("code","to_command");
|
map2.put("code","to_command");
|
||||||
map2.put("value","1");
|
map2.put("value","1");
|
||||||
list.add(map2);
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_task");
|
||||||
|
map3.put("value","0");
|
||||||
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
message = "申请任务失败下发退回,"+message;
|
message = "申请任务失败下发退回,"+message;
|
||||||
|
|
||||||
|
|||||||
@@ -144,10 +144,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="start_point_code" label="取货点1" />
|
<el-table-column prop="start_point_code" label="取货点1" />
|
||||||
<!-- <el-table-column prop="put_point_code" label="倒料点" />-->
|
|
||||||
<el-table-column prop="next_point_code" label="放货点1" />
|
<el-table-column prop="next_point_code" label="放货点1" />
|
||||||
<el-table-column prop="start_point_code2" label="取货点2" />
|
<el-table-column prop="start_point_code2" label="取货点2" />
|
||||||
<el-table-column prop="next_point_code2" label="放货点2" />
|
<el-table-column prop="next_point_code2" label="放货点2" />
|
||||||
|
<el-table-column prop="put_point_code" label="倒料点" />
|
||||||
|
<el-table-column prop="execute_device_code" label="当前执行设备" />
|
||||||
<el-table-column prop="carno" label="车号" />
|
<el-table-column prop="carno" label="车号" />
|
||||||
<!-- <el-table-column prop="compound_inst" label="复合指令">-->
|
<!-- <el-table-column prop="compound_inst" label="复合指令">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
|
|||||||
@@ -362,6 +362,9 @@ export default {
|
|||||||
} else if (val === 'instruction_message') {
|
} else if (val === 'instruction_message') {
|
||||||
const obj = { name: '指令信息', value: data[val] }
|
const obj = { name: '指令信息', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
|
} else if (val === 'message') {
|
||||||
|
const obj = { name: '备注信息', value: data[val] }
|
||||||
|
this.arr.push(obj)
|
||||||
} else if (val === 'last_instruction_message') {
|
} else if (val === 'last_instruction_message') {
|
||||||
const obj = { name: '上次指令信息', value: data[val] }
|
const obj = { name: '上次指令信息', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user