diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java index f913f12..4f14f43 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java @@ -68,6 +68,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD private int instruction_require_time_out; boolean requireSucess = false; + boolean resultSucess = false; + private int instruction_finished_time_out; int branchProtocol = 0; @@ -341,6 +343,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD if (mode != last_mode) { this.setRequireSucess(false); + this.setResultSucess(false); logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code,"","","信号mode:" + last_mode + "->" + mode); } @@ -356,18 +359,18 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error)); logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error); } - if (open_time != last_open_time) { - logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); - } +// if (open_time != last_open_time) { +// logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); +// } if (standby_time != last_standby_time) { logServer.deviceItemValue(this.device_code,"standby_time" ,String.valueOf(standby_time)); logServer.deviceExecuteLog(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); } - if (production_time != last_production_time) { - logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); - } +// if (production_time != last_production_time) { +// logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); +// } if (error_time != last_error_time) { logServer.deviceItemValue(this.device_code,"error_time" ,String.valueOf(error_time)); logServer.deviceExecuteLog(this.device_code,"","","信号error_time:" + last_error_time + "->" + error_time); @@ -710,19 +713,23 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD //码垛完成 if (!requireSucess) { applyEmpty(); - palletizing(); + if (resultSucess) { + palletizing(); + } } break; case 7: //码垛强制完成 半托缓存 if (!requireSucess) { applyEmpty(); - mandatoryPalletizing("0"); + if (resultSucess) { + mandatoryPalletizing("0"); + } } break; case 8: //申请空盘 - if (!requireSucess) { + if (!resultSucess) { applyEmpty(); } case 9: @@ -741,7 +748,9 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD //强制去包装 if (!requireSucess) { applyEmpty(); - mandatoryPalletizing("1"); + if (resultSucess) { + mandatoryPalletizing("1"); + } } break; } @@ -1130,8 +1139,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { this.writing(this.mode); + this.setRequireSucess(true); } - this.setRequireSucess(true); } return true; } @@ -1164,6 +1173,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD } json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode))); json.put("is_full",type); + json.put("material_code",material); json.put("product_code",product_code); json.put("AlongSide",AlongSide); json.put("BshortSide",BshortSide); @@ -1228,8 +1238,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { this.writing(this.mode); + this.setRequireSucess(true); } - this.setRequireSucess(true); } return true; } @@ -1259,7 +1269,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { this.writing(this.mode); - this.setRequireSucess(true); + this.setResultSucess(true); } } return true; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java index 4775479..7489573 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java @@ -207,18 +207,18 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi logServer.deviceItemValue(this.device_code,"task2" ,String.valueOf(task2)); logServer.deviceExecuteLog(this.device_code,"","","信号task2:" + last_task2 + "->" + task2); } - if (open_time != last_open_time) { - logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); - } - if (standby_time != last_standby_time) { - logServer.deviceItemValue(this.device_code,"standby_time" ,String.valueOf(standby_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); - } - if (production_time != last_production_time) { - logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); - } +// if (open_time != last_open_time) { +// logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); +// } +// if (standby_time != last_standby_time) { +// logServer.deviceItemValue(this.device_code,"standby_time" ,String.valueOf(standby_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); +// } +// if (production_time != last_production_time) { +// logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); +// } if (error_time != last_error_time) { logServer.deviceItemValue(this.device_code,"error_time" ,String.valueOf(error_time)); logServer.deviceExecuteLog(this.device_code,"","","信号error_time:" + last_error_time + "->" + error_time); @@ -286,13 +286,13 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi } //给后工位下发空盘放货信号 - if(mode ==3 && action_1 == 2 && action_2 == 2 && move_1 == 1 && move_2 == 1 && task1>0 && task2>0 ){ + if(mode ==3 && action_1 == 2 && action_2 == 2 && move_1 != 0 && move_2 != 0 && task1>0 && task2>0 ){ writing("to_command2","2"); } //给前工位下发放货信号 - if(mode ==3 && action_2 == 4 && move_1 == 1 && move_2 == 0 && task1>0 ){ + if(mode ==3 && action_2 == 4 && move_1 != 0 && move_2 == 0 && task1>0 ){ writing("to_command1","2"); } @@ -386,8 +386,10 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi String demoArray[] = demosub.split(","); List device_code_list = Arrays.asList(demoArray); TaskDto task = null; - for(int i=0;i device_code_list = Arrays.asList(demoArray); TaskDto task = null; for(int i=0;i" + error); } - if (open_time != last_open_time) { - logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); - } +// if (open_time != last_open_time) { +// logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); +// } if (standby_time != last_standby_time) { logServer.deviceItemValue(this.device_code,"standby_time" ,String.valueOf(standby_time)); logServer.deviceExecuteLog(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); } - if (production_time != last_production_time) { - logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); - logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); - } +// if (production_time != last_production_time) { +// logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); +// logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); +// } if (error_time != last_error_time) { logServer.deviceItemValue(this.device_code,"error_time" ,String.valueOf(error_time)); logServer.deviceExecuteLog(this.device_code,"","","信号error_time:" + last_error_time + "->" + error_time); @@ -1356,9 +1356,9 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { this.writing(this.mode); + this.setRequireSucess(true); } } - this.setRequireSucess(true); return true; } } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/SortingUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/SortingUtil.java index 99170ca..d5214ce 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/SortingUtil.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/SortingUtil.java @@ -14,7 +14,7 @@ public class SortingUtil { public static void record(JSONObject whereJson) { String device_code = (String) whereJson.get("device_code"); String vehicle_code = (String) whereJson.get("vehicle_code"); - if (StrUtil.isEmpty(vehicle_code)){ + if (StrUtil.isEmpty(vehicle_code)) { return; } //木托盘对应刚托盘记录主表【st_buss_vehicleRelaRecord】 @@ -25,7 +25,10 @@ public class SortingUtil { WQLObject groupTable = WQLObject.getWQLObject("st_buss_vehicleRelaRecordtl"); JSONObject mstObj = ehicleRelaRecordmst.query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); String record_id = IdUtil.getSnowflake(1, 1).nextIdStr(); + + if (ObjectUtil.isEmpty(mstObj)) { + mstObj = new JSONObject(); mstObj.put("record_id", record_id); mstObj.put("vehicle_code", vehicle_code); ehicleRelaRecordmst.insert(mstObj);