diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java index 49c0fbf4..542b2321 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/common/HailiangxjplcDevice.java @@ -5,6 +5,10 @@ import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_xj_plc_test.Hai import org.nl.acs.opc.Device; import org.springframework.stereotype.Service; +/** + * @author geng by + * 海亮-海亮迅捷plc测试 + */ @Service("hailiang_xj_plc_test") public class HailiangxjplcDevice extends AbstractDriverService { @Override diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java index ede2fa2b..55bf62d2 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_cleaning_machine_storage_station/HailiangCleaningMachineStorageStationDeviceDriver.java @@ -236,6 +236,9 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO NDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); + } } @@ -247,6 +250,9 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO NDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); + } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java index af551c00..222d754b 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_cache/HailiangEngravingCacheDeviceDriver.java @@ -205,7 +205,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "move=" +move + ",等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "move=" +move + ",等待反馈,inst:"+inst); } } @@ -223,7 +223,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } @@ -240,7 +240,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } @@ -274,7 +274,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver updatejson.put("islock","0"); updatejson.put("material_type",""); runpointwo.update(updatejson, "device_code = '" + device_code + "'"); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位锁定成功"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位锁定成功"); } byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); OneNDCSocketConnectionAutoRun.write(data); @@ -283,7 +283,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java index 9252a81a..acaa89f6 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_engraving_machine/HailiangEngravingMachineDeviceDriver.java @@ -365,13 +365,22 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive // if ( full_req == 1 ) { logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); apply_task(); + } else { + logServer.deviceLogToacs(this.device_code,"","","不满足下发满框请求任务条件,mode:"+mode+"move:"+move+"full_req:"+full_req); + } if (move == 0 && mode == 1 && empty_req == 1){ // if (empty_req == 1) { logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请空箱请求任务"); apply_empty_task(); + }else { + logServer.deviceLogToacs(this.device_code,"","","不满足下发空框请求任务条件,mode:"+mode+"move:"+move+"empty_req:"+empty_req); + } + + }else { + logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); } if(agvphase == 0x03) @@ -387,7 +396,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } @@ -404,7 +413,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } @@ -421,7 +430,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } @@ -436,7 +445,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,inst为空"); } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java index 729a53a6..991d4194 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_packer_station/HailiangPackerStationDeviceDriver.java @@ -277,7 +277,6 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i ProduceshiftorderDto dto = new ProduceshiftorderDto(); dto.setOrder_code(order + ""); dto.setOrder_status("2"); - produceshiftorderService.updateByOrderCode(dto); ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); if(deviceInfo != null){ if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { @@ -292,6 +291,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i }else { logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单信息为空"); } + produceshiftorderService.updateByOrderCode(dto); this.writing("to_confirm_finished","1"); this.writing("to_clear","1"); this.writing("to_pause","1"); @@ -303,7 +303,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i if(ObjectUtil.isEmpty(inst)){ if(!requireSucess){ if (lack_req == 1 && move == 0) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); + logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请缺料请求任务"); apply_task(); } @@ -311,7 +311,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务"); apply_take_empty_task(); } + logServer.deviceLogToacs(this.device_code,"","","lack_req:"+lack_req+"move:"+move+"req_task_empty:"+req_task_empty); + } else { + logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); } } @@ -330,7 +333,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); /* } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); }*/ } @@ -348,8 +351,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); - + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); } } @@ -365,7 +367,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); } } @@ -470,6 +472,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i //判断缓存位是否锁定 JSONObject jsonObject = runpointwo.query("device_code = '" + next_device_code + "' and islock = '1'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonObject)){ + logServer.deviceLogToacs(this.device_code, "", "", "对应路由设备,"+next_device_code+"已锁定"); continue; } TaskDto onedto = new TaskDto(); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java index b96a9e56..0efa50ad 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_device/HailiangSpecialDeviceDriver.java @@ -372,7 +372,6 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme ProduceshiftorderDto dto = new ProduceshiftorderDto(); dto.setOrder_code(order + ""); dto.setOrder_status("2"); - produceshiftorderService.updateByOrderCode(dto); ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); if(deviceInfo != null){ if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { @@ -380,10 +379,17 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme JSONObject param = new JSONObject(); param.put("ext_order_id",ext_order_id); acsToWmsService.feedbackOrderStatus(param); + logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的外部标识:"+ext_order_id); + }else { + logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单的没有外部标识"); } + }else { + logServer.deviceLogToacs(this.device_code,"","",device_code+":,对应的工单信息为空"); } - this.writing("to_confirm_finished","1"); - this.writing("to_pause","0"); + produceshiftorderService.updateByOrderCode(dto); + this.writing("to_confirm_finished","1"); + this.writing("to_clear","1"); + this.writing("to_pause","1"); } else { logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ finish +",last_finish>"+last_finish); } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java index a5f61133..88c5de3b 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_empty_station/HailiangSpecialEmptyStationDeviceDriver.java @@ -249,6 +249,8 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr NDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); } } //放空箱完成 @@ -260,6 +262,8 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr NDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); } } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java index d27653e4..84c784f2 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_full_station/HailiangSpecialFullStationDeviceDriver.java @@ -254,7 +254,12 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri if ( move == 1 && mode == 1 ) { logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务"); apply_task(); + } else { + logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "申请任务失败,不符合条件"); } + } else { + logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); + } if(agvphase == 0x03 || agvphase == 0x07 ) @@ -270,7 +275,8 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri inst = null; logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst+",allready:"+allready+",full_number:"+full_number); + } } @@ -288,7 +294,8 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst+",allready:"+allready+",full_number:"+full_number); + } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java index b90b4aa3..9223956f 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_special_pour_station/HailiangSpecialPourStationDeviceDriver.java @@ -253,6 +253,9 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri NDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); + } } @@ -264,6 +267,8 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0); agvphase = 0; index = 0; + }else { + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因error:"+error+",inst"+inst); } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanUpLogs.java b/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanUpLogs.java index 556044fe..0a1aa279 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanUpLogs.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCleanUpLogs.java @@ -4,13 +4,10 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.mongodb.client.MongoCollection; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.bson.Document; import org.nl.wql.core.bean.WQLObject; import org.springframework.data.mongodb.core.MongoTemplate; -import org.springframework.data.mongodb.core.index.IndexOperations; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; @@ -19,6 +16,7 @@ import java.util.Date; /** + * @author geng by * 自动清理大于十五天的日志 */ @Slf4j