This commit is contained in:
2023-05-10 14:32:09 +08:00
6 changed files with 37 additions and 30 deletions

View File

@@ -118,7 +118,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
String message = null; String message = null;
Boolean iserror = false; Boolean iserror = false;
String barcode = null; String hand_barcode = null;
Integer heartbeat_tag; Integer heartbeat_tag;
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
@@ -201,7 +201,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
message = null; message = null;
if (move == 0) { if (move == 0) {
inst_message = null; inst_message = null;
this.barcode = null; this.hand_barcode = null;
this.clearWrite(); this.clearWrite();
} }
if (move == 0 && last_move == 1) { if (move == 0 && last_move == 1) {
@@ -516,7 +516,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", this.getMessage()); jo.put("message", this.getMessage());
jo.put("barcode", barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("is_click", true); jo.put("is_click", true);
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
jo.put("driver_type", "siemens_conveyor"); jo.put("driver_type", "siemens_conveyor");
@@ -531,7 +532,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
} else if (StrUtil.equals(requestSucess, "1")) { } else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true; this.requireSucess = true;
} }
this.barcode = data.getString("barcode"); this.hand_barcode = data.getString("hand_barcode");
} }
@Override @Override
@@ -863,7 +864,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
this.require_empty_in_time = date; this.require_empty_in_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
message = "申请空盘入库任务中..."; //message = "申请空盘入库任务中...";
// if(taskserver.querySameOriginTask(this.device_code) > 0 ){ // if(taskserver.querySameOriginTask(this.device_code) > 0 ){
// message = "已存在空盘出库任务不再请求"; // message = "已存在空盘出库任务不再请求";
@@ -901,12 +902,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
this.instruction_require_time = date; this.instruction_require_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
//判断是否有手动补码 如果有就申请补码agv任务 //判断是否有手动补码 如果有就申请补码agv任务
if (StrUtil.isNotEmpty(barcode)) { if (StrUtil.isNotEmpty(hand_barcode)) {
message = "申请补码AGV搬运任务中..."; message = "申请补码AGV搬运任务中...";
JSONObject apply = new JSONObject(); JSONObject apply = new JSONObject();
apply.put("device_code", device_code); apply.put("device_code", device_code);
apply.put("type", "4"); apply.put("type", "4");
apply.put("vehicle_code", barcode); apply.put("vehicle_code", hand_barcode);
String str = acsToWmsService.applyTaskToWms(apply); String str = acsToWmsService.applyTaskToWms(apply);
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数," + str); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数," + str);

View File

@@ -103,6 +103,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
int hasGoods = 0; int hasGoods = 0;
String message = null; String message = null;
Boolean iserror = false; Boolean iserror = false;
String hand_barcode = null;
String barcode = null; String barcode = null;
Integer heartbeat_tag; Integer heartbeat_tag;
@@ -186,10 +187,16 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
} }
if (task != last_task) {
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
}
if (move != last_move) { if (move != last_move) {
message = null; message = null;
if (move == 0) { if (move == 0) {
inst_message = null; inst_message = null;
hand_barcode = null;
barcode = null; barcode = null;
requireSucess = false; requireSucess = false;
this.clearWrite(); this.clearWrite();
@@ -212,10 +219,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
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);
} }
if (task != last_task) {
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
}
if (move != 0 && task > 0) { if (move != 0 && task > 0) {
inst = instructionService.findByCodeFromCache(String.valueOf(task)); inst = instructionService.findByCodeFromCache(String.valueOf(task));
@@ -461,7 +465,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("task", task); jo.put("task", task);
jo.put("last_task", last_task); jo.put("last_task", last_task);
jo.put("task_code", task_code); jo.put("task_code", task_code);
jo.put("barcode", barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
// jo.put("last_task", last_task); // jo.put("last_task", last_task);
jo.put("inst_message", this.inst_message); jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message); jo.put("last_inst_message", this.last_inst_message);
@@ -483,8 +488,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
} else if (StrUtil.equals(requestSucess, "1")) { } else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true; this.requireSucess = true;
} }
String barcode = data.getString("barcode"); String hand_barcode = data.getString("hand_barcode");
this.setBarcode(barcode); this.setHand_barcode(hand_barcode);
} }
@Override @Override
@@ -528,12 +533,12 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
return false; return false;
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
if (!StrUtil.isEmpty(barcode) && task == 0) { if (!StrUtil.isEmpty(hand_barcode) && task == 0) {
Instruction inst = instructionService.findByBarcodeFromCache(barcode); Instruction inst = instructionService.findByBarcodeFromCache(hand_barcode);
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {
TaskDto taskDto = taskserver.findByContainer(barcode); TaskDto taskDto = taskserver.findByContainer(hand_barcode);
if (ObjectUtil.isEmpty(taskDto)) { if (ObjectUtil.isEmpty(taskDto)) {
message = "未找到手动补码:" + barcode + "对应立库指令,请检查"; message = "未找到手动补码:" + hand_barcode + "对应立库指令,请检查";
return false; return false;
} }
String next_device_code = taskDto.getNext_device_code(); String next_device_code = taskDto.getNext_device_code();
@@ -545,7 +550,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
instdto.setQuantity(taskDto.getQuantity()); instdto.setQuantity(taskDto.getQuantity());
instdto.setTask_id(taskDto.getTask_id()); instdto.setTask_id(taskDto.getTask_id());
instdto.setTask_code(taskDto.getTask_code()); instdto.setTask_code(taskDto.getTask_code());
instdto.setVehicle_code(barcode); instdto.setVehicle_code(hand_barcode);
String now = DateUtil.now(); String now = DateUtil.now();
instdto.setCreate_time(now); instdto.setCreate_time(now);
instdto.setCreate_by("auto"); instdto.setCreate_by("auto");

View File

@@ -469,6 +469,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("message", this.getMessage()); jo.put("message", this.getMessage());
jo.put("is_click", true); jo.put("is_click", true);
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);

View File

@@ -122,7 +122,7 @@
<el-input v-model="form.device_code" :disabled="true" /> <el-input v-model="form.device_code" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="条码" label-width="120px"> <el-form-item label="条码" label-width="120px">
<el-input v-model="form.barcode" :disabled="false" /> <el-input v-model="form.hand_barcode" :disabled="false" />
</el-form-item> </el-form-item>
<el-form-item label="请求标记" prop="requireSucess" label-width="120px"> <el-form-item label="请求标记" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess"> <el-radio-group v-model="form.requireSucess">
@@ -216,6 +216,7 @@ export default {
device_code: '', device_code: '',
hasGoodStatus: null, hasGoodStatus: null,
barcode: '', barcode: '',
hand_barcode: '',
suspended: null, suspended: null,
material_type: '', material_type: '',
requireSucess: '', requireSucess: '',
@@ -376,6 +377,7 @@ export default {
this.form.is_disable = clickObj.data.is_disable1 this.form.is_disable = clickObj.data.is_disable1
this.form.applySucess = clickObj.data.applySucess this.form.applySucess = clickObj.data.applySucess
this.form.barcode = clickObj.data.barcode this.form.barcode = clickObj.data.barcode
this.form.hand_barcode = clickObj.data.hand_barcode
}, },
moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息 moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息
let item = '' let item = ''
@@ -563,6 +565,9 @@ export default {
} else if (val === 'inventory_qty') { } else if (val === 'inventory_qty') {
const obj = { name: '库存数量', value: data[val] } const obj = { name: '库存数量', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'hand_barcode') {
const obj = { name: '手补条码', value: data[val] }
this.arr.push(obj)
} }
} }
} }

View File

@@ -474,8 +474,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject point_jo = rowArr.getJSONObject(i); JSONObject point_jo = rowArr.getJSONObject(i);
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0); JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0);
// TODO pointArr.size() == 8 if (pointArr.size() == 8) {
if (pointArr.size() == 4) {
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0); JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
point_code = jsonNewRow.getString("point_code"); point_code = jsonNewRow.getString("point_code");
break; break;
@@ -515,8 +514,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject point_jo = rowArr.getJSONObject(i); JSONObject point_jo = rowArr.getJSONObject(i);
JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0); JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' and IFNULL(vehicle_code,'') = '' order by out_order_seq ASC").getResultJSONArray(0);
// TODO pointArr.size() == 8 if (pointArr.size() == 8) {
if (pointArr.size() == 4) {
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0); JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq,layer_num").uniqueResult(0);
point_code = jsonNewRow.getString("point_code"); point_code = jsonNewRow.getString("point_code");
break; break;

View File

@@ -61,16 +61,13 @@ public class SendOutTask extends AbstractAcsTask {
.task_code(json.getString("task_code")) .task_code(json.getString("task_code"))
.task_type(json.getString("acs_task_type")) .task_type(json.getString("acs_task_type"))
.start_device_code(json.getString("point_code1")) .start_device_code(json.getString("point_code1"))
// TODO .next_device_code(jsonPoint.getString("device_code")) .next_device_code(jsonPoint.getString("device_code"))
.next_device_code(json.getString("point_code2"))
.agv_system_type("1") .agv_system_type("1")
.vehicle_code(json.getString("vehicle_code")) .vehicle_code(json.getString("vehicle_code"))
.priority(json.getString("priority")) .priority(json.getString("priority"))
.remark(json.getString("remark")) .remark(json.getString("remark"))
// TODO 暂时不上线 .start_height(start_high)
// .start_height(start_high) .next_height(next_high)
// .next_height(next_high)
.build(); .build();
resultList.add(dto); resultList.add(dto);
System.out.println(resultList.toString()); System.out.println(resultList.toString());