fix: 纸管库出货数量数据格式修改

This commit is contained in:
yanps
2023-12-14 15:52:46 +08:00
parent 4338fe8955
commit 870eddad41
4 changed files with 33 additions and 14 deletions

View File

@@ -428,7 +428,8 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("move", move); jo.put("move", move);
jo.put("inventory_qty", qty); jo.put("inventory_qty", qty);
jo.put("out_finish", out_finish); jo.put("out_finish", out_finish);
jo.put("material", material1); jo.put("material1", material1);
jo.put("material2", material2);
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
return jo; return jo;

View File

@@ -188,8 +188,8 @@ public class ItemProtocol {
return this.getOpcArrayValue1(item_out_seq_arr); return this.getOpcArrayValue1(item_out_seq_arr);
} }
public int[] getItem_out_qty_arr() { public String getItem_out_qty_arr() {
return this.getOpcArrayValue(item_out_qty_arr); return this.getOpcStringValue(item_out_qty_arr);
} }

View File

@@ -115,8 +115,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
String item_out_seq_arr = null; String item_out_seq_arr = null;
String last_item_out_seq_arr = null; String last_item_out_seq_arr = null;
//出库数量数组 //出库数量数组
int[] item_out_qty_arr = null; String item_out_qty_arr = null;
int[] last_item_out_qty_arr = null; String last_item_out_qty_arr = null;
String item_material1 = null; String item_material1 = null;
@@ -469,7 +469,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
} }
public synchronized void request_for_shipment(String mode, String item_out_seq_arr, int[] item_out_qty_arr) { public synchronized void request_for_shipment(String mode, String item_out_seq_arr, String item_out_qty_arr) {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) { if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
@@ -486,17 +486,26 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
if (contains) { if (contains) {
String[] split = item_out_seq_arr.split(","); String[] split = item_out_seq_arr.split(",");
applyPaperActionRequest.setMaterial1(split[0]); applyPaperActionRequest.setMaterial1(split[0]);
applyPaperActionRequest.setMaterial1(split[1]); applyPaperActionRequest.setMaterial2(split[1]);
} else if (contains1) { } else if (contains1) {
String[] split = item_out_seq_arr.split(""); String[] split = item_out_seq_arr.split("");
applyPaperActionRequest.setMaterial1(split[0]); applyPaperActionRequest.setMaterial1(split[0]);
applyPaperActionRequest.setMaterial1(split[1]); applyPaperActionRequest.setMaterial2(split[1]);
} else { } else {
applyPaperActionRequest.setMaterial1(item_out_seq_arr); applyPaperActionRequest.setMaterial1(item_out_seq_arr);
} }
if (item_out_qty_arr.length >= 1 && item_out_qty_arr.length < 4) { boolean contains2 = item_out_qty_arr.contains(",");
applyPaperActionRequest.setQty1(String.valueOf(item_out_qty_arr[0])); boolean contains3 = item_out_qty_arr.contains("");
applyPaperActionRequest.setQty2(String.valueOf(item_out_qty_arr[1])); if (contains2) {
String[] split = item_out_qty_arr.split(",");
applyPaperActionRequest.setQty1(split[0]);
applyPaperActionRequest.setQty2(split[1]);
} else if (contains3) {
String[] split = item_out_qty_arr.split("");
applyPaperActionRequest.setQty1(split[0]);
applyPaperActionRequest.setQty2(split[1]);
} else {
applyPaperActionRequest.setQty1(item_out_qty_arr);
} }
ApplyPaperActionResponse applyPaperActionResponse = acsToWmsService.applyPaperActionRequest(applyPaperActionRequest); ApplyPaperActionResponse applyPaperActionResponse = acsToWmsService.applyPaperActionRequest(applyPaperActionRequest);
if (ObjectUtil.isNull(applyPaperActionResponse)) { if (ObjectUtil.isNull(applyPaperActionResponse)) {
@@ -609,7 +618,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("指令创建失败!", e.getMessage()); log.error("指令创建失败!{}", e.getMessage());
return false; return false;
} }
taskdto.setTask_status("1"); taskdto.setTask_status("1");
@@ -744,6 +753,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
map.put("move", move); map.put("move", move);
map.put("isOnline", this.getIsonline()); map.put("isOnline", this.getIsonline());
map.put("out_seq_arr", this.getItem_out_seq_arr());
map.put("out_qty_arr", this.getItem_out_qty_arr());
map.put("material1", this.getItem_material1()); map.put("material1", this.getItem_material1());
map.put("z_qty1", this.getItem_qty1()); map.put("z_qty1", this.getItem_qty1());
map.put("material2", this.getItem_material2()); map.put("material2", this.getItem_material2());
@@ -769,6 +780,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("material12", this.getItem_material12()); map.put("material12", this.getItem_material12());
map.put("z_qty12", this.getItem_qty12()); map.put("z_qty12", this.getItem_qty12());
JSONObject jo = new JSONObject(map); JSONObject jo = new JSONObject(map);
return jo; return jo;
} }
@@ -833,8 +845,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
if (!item_out_seq_arr.equals(last_item_out_seq_arr)) { if (!item_out_seq_arr.equals(last_item_out_seq_arr)) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_seq_arr" + last_item_out_seq_arr + "->" + item_out_seq_arr); logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_seq_arr" + last_item_out_seq_arr + "->" + item_out_seq_arr);
} }
if (!arrayEquals(item_out_qty_arr, last_item_out_qty_arr)) { if (!item_out_qty_arr.equals(last_item_out_qty_arr)) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_qty_arr" + Arrays.toString(last_item_out_qty_arr) + "->" + Arrays.toString(item_out_qty_arr)); logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_qty_arr" + last_item_out_qty_arr + "->" + item_out_qty_arr);
} }
if (item_qty1 != (last_item_qty1)) { if (item_qty1 != (last_item_qty1)) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1" + last_item_qty1 + "->" + item_qty1); logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1" + last_item_qty1 + "->" + item_qty1);

View File

@@ -721,6 +721,12 @@ export default {
} else if (val === 'z_qty12') { } else if (val === 'z_qty12') {
const obj = { name: '数量12', value: data[val] } const obj = { name: '数量12', value: data[val] }
this.arr.push(obj) this.arr.push(obj)
} else if (val === 'out_seq_arr') {
const obj = { name: '出库顺序', value: data[val] }
this.arr.push(obj)
} else if (val === 'out_qty_arr') {
const obj = { name: '出库数量', value: data[val] }
this.arr.push(obj)
} }
} }
} }