From 3ee0d6d5ae1747481e359b68c0c56d219726aa0b Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Sun, 10 Jul 2022 15:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 1 + .../java/org/nl/acs/device/wql/task_inst.xls | Bin 189440 -> 189952 bytes .../HailiangEngravingCacheDeviceDriver.java | 17 +- .../HailiangEngravingMachineDeviceDriver.java | 5 + .../HailiangPackerStationDeviceDriver.java | 207 +++++++++--------- ...ailiangSpecialFullStationDeviceDriver.java | 82 ++++++- ...ailiangSpecialPourStationDeviceDriver.java | 74 +++++++ .../acs/ext/wms/rest/AcsToWmsController.java | 15 ++ .../acs/ext/wms/service/AcsToWmsService.java | 16 ++ .../wms/service/impl/AcsToWmsServiceImpl.java | 69 +++++- .../service/impl/InstructionServiceImpl.java | 11 +- .../org/nl/acs/task/service/dto/TaskDto.java | 5 + .../modules/quartz/task/AutoCleanUpLogs.java | 4 +- 13 files changed, 376 insertions(+), 130 deletions(-) diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 0ce84a6f..22fbec58 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -937,6 +937,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial obj.setHasgoods(hasGoodStatus); obj.setMaterial_type(material_type); obj.setBatch(batch); + obj.setIslock(islock); hailiangEngravingCacheDeviceDriver.setMaterial(material_type); if (hailiangEngravingCacheDeviceDriver.getMove() != Integer.parseInt(hasGoodStatus)){ hailiangEngravingCacheDeviceDriver.writing("to_cache_write",hasGoodStatus); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls index aebc15e620a56f5da4a9ab7fa97624a3af1870fe..50a6b4406253df7851dc0b68b678f0037c881c84 100644 GIT binary patch delta 13076 zcmai52V7Lg)}OgsSy(z!m1RKzY1?QD!m_(4NKrwtkVso(Bd`c-i)GiEs4=1&bEEM+ zOY)*Iwurh(Y!G`lCeK(BTVhM}*3`vANP0f+&TB0^FMQD?woTjU^(n= zIqu$CiXXEPQ?cKtO|5uwlW+;c#k<;g3~F47Ik(`j^8HNVU{i0|3<9=|NuYVICnO_dC= zUJl_~ABX3(nI-j%`xWGm(h))!iL95T;ry>q!j&7_+BlIjz42!2bVZ!?Q>DVXK-mkQ zB0YS%?UHhSfcf++kUNrJc99;LNbXvgZImiR$T%=scRM|3?^z-7t7l?}tjV-3-!XUKV zdNXfmY!R;(#_IfGkQYMt(|DxMzaIoGp3R^&&|BR$F8>+VYRUJv))$8e#t8_cp>1KY zJ4c*^@cmFOj06epM_D7d0p?DpLPzWEBZX%-Il#l6v*FgyqVH87e&*kB=2C@lM+fGT^X+MR`qy#V&ciCC!g(nva^r0Sukih@9Q@p@x$^c|9!*esg|b+dq=D-kPeTlh?x6{X_Wr$lV@sPJOAa$!-s`67sBUc zT^mrHm!mk-+w}gYs>BbYOm}AfbI-k5?iq!=5vM+Uu&w%Y1#e*L&Cj=NX?{v@|v<%eQ>on za7Dz;pFVplZ&P=xd#^ivYCYRJ6&{GPr2h9t$kpHz0K-;_NM9v?EFdGgxufSCucUAXaE zzv6#rFXpfEScftyJnMLqe(xa@3_4gnwkCe=j(gFo^ea*?j@ z_>$XwKTurM7xkMmIe&b&8;?f5|8>|mJ!cqJ&0*eDw8)F)>D$TFj9_|B^RuT&Z6+Yj^X|$-d8v z9v|Jg!2i32z+(HkqVcSc;IQ9@58PrtD%%}?XX*-Nhw^&-&>n)z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apj7%KbuQ55K-_XsH4;=J?%huE}cP3;m zkQDsb;&V04LI2kCpughVS-Ec?^0Y;OG+K|woaMr{XV*-vyQeZ4qq`9JLo4S&pmeNs}KfL<; z=9}L!o|wINhVf;WoMvKJ-C;)F#a_>z#n#VBU3=CM&}mdJx2e8LX>K{p3}*O`Vs5#x z1CB5;oo^|Q5zH3Tz(Y(V+agibLBCnKgRj&SI3!HGMqP$Gcioy z3^w2dvxWy++1)3Y2xgLsy?Fv2NIKYnllC_IBr}q^mf!rzN#+!T=QmG2&HTn2n3R;H zOH5DGC8=IK3frZfNfhUep##FREfOf2t?i6e G@c#f0?}H2g 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 222d754b..64c97340 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 @@ -250,31 +250,22 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver instructionService.update(inst); // TODO 指令中根据起始点位驱动类型判断空满 String start_device_code = inst.getStart_device_code(); + log.warn("起点设备为:{}",start_device_code); String next_device_code = inst.getNext_device_code(); + log.warn("终点设备为:{}",next_device_code); Device start_device = deviceAppservice.findDeviceByCode(start_device_code); Device next_device = deviceAppservice.findDeviceByCode(next_device_code); - WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); if (start_device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ writing("to_cache_write", "2"); this.setMaterial(inst.getMaterial()); next_device.setMaterial_type(inst.getMaterial()); - JSONObject updatejson = new JSONObject(); - updatejson.put("hasgoods","2"); - updatejson.put("islock","0"); - updatejson.put("material_type",inst.getMaterial()); - runpointwo.update(updatejson, "device_code = '" + device_code + "'"); - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位锁定成功"); + logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位解锁成功"); } if (start_device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ writing("to_cache_write", "1"); this.setMaterial(""); next_device.setMaterial_type(""); - JSONObject updatejson = new JSONObject(); - updatejson.put("hasgoods","1"); - 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); 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 acaa89f6..b7b6b67d 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 @@ -364,6 +364,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive if ( move == 1 && mode == 1 && full_req == 1 ) { // 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); @@ -589,6 +590,10 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); } + if (order.getIs_needmove().equals("0")){ + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运"); + return false; + } //查找当前工单对应的物料编号 String cpbh = order.getMaterial_code(); 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 991d4194..9949577e 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 @@ -179,69 +179,69 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i await_time = this.itemProtocol.getItem_await_time(); //待机时间(S) order = this.itemProtocol.getItem_order(); //工单号 if (mode != last_mode) { - logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); - logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); + logServer.deviceLog(this.device_code, "mode", String.valueOf(mode)); + logServer.deviceLogToacs(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (move != last_move) { - logServer.deviceLog(this.device_code,"move" ,String.valueOf(move)); - logServer.deviceLogToacs(this.device_code,"","","信号move(取反):" + last_move + "->" + move); + logServer.deviceLog(this.device_code, "move", String.valueOf(move)); + logServer.deviceLogToacs(this.device_code, "", "", "信号move(取反):" + last_move + "->" + move); } if (packer_ready != last_packer_ready) { - logServer.deviceLog(this.device_code,"packer_ready" ,String.valueOf(packer_ready)); - logServer.deviceLogToacs(this.device_code,"","","信号packer_ready:" + last_packer_ready + "->" + packer_ready); + logServer.deviceLog(this.device_code, "packer_ready", String.valueOf(packer_ready)); + logServer.deviceLogToacs(this.device_code, "", "", "信号packer_ready:" + last_packer_ready + "->" + packer_ready); } if (lack_req != last_lack_req) { - if(lack_req == 0){ + if (lack_req == 0) { this.setRequireSucess(false); } - logServer.deviceLog(this.device_code,"lack_req" ,String.valueOf(lack_req)); - logServer.deviceLogToacs(this.device_code,"","","信号lack_req:" + last_lack_req + "->" + lack_req); + logServer.deviceLog(this.device_code, "lack_req", String.valueOf(lack_req)); + logServer.deviceLogToacs(this.device_code, "", "", "信号lack_req:" + last_lack_req + "->" + lack_req); } if (hopper_already != last_hopper_already) { - logServer.deviceLog(this.device_code,"hopper_already" ,String.valueOf(hopper_already)); - logServer.deviceLogToacs(this.device_code,"","","信号hopper_already:" + last_hopper_already + "->" + hopper_already); + logServer.deviceLog(this.device_code, "hopper_already", String.valueOf(hopper_already)); + logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_already:" + last_hopper_already + "->" + hopper_already); } if (req_task_empty != last_req_task_empty) { - if(req_task_empty==0){ + if (req_task_empty == 0) { this.setRequireSucess(false); } - logServer.deviceLog(this.device_code,"req_task_empty" ,String.valueOf(req_task_empty)); - logServer.deviceLogToacs(this.device_code,"","","信号req_task_empty:" + last_req_task_empty + "->" + req_task_empty); + logServer.deviceLog(this.device_code, "req_task_empty", String.valueOf(req_task_empty)); + logServer.deviceLogToacs(this.device_code, "", "", "信号req_task_empty:" + last_req_task_empty + "->" + req_task_empty); } if (hopper_removed != last_hopper_removed) { - logServer.deviceLog(this.device_code,"hopper_removed" ,String.valueOf(hopper_removed)); - logServer.deviceLogToacs(this.device_code,"","","信号hopper_removed:" + last_hopper_removed + "->" + hopper_removed); + logServer.deviceLog(this.device_code, "hopper_removed", String.valueOf(hopper_removed)); + logServer.deviceLogToacs(this.device_code, "", "", "信号hopper_removed:" + last_hopper_removed + "->" + hopper_removed); } if (order_finish != last_order_finish) { - logServer.deviceLog(this.device_code,"order_finish" ,String.valueOf(order_finish)); - logServer.deviceLogToacs(this.device_code,"","","信号order_finish:" + last_order_finish + "->" + order_finish); + logServer.deviceLog(this.device_code, "order_finish", String.valueOf(order_finish)); + logServer.deviceLogToacs(this.device_code, "", "", "信号order_finish:" + last_order_finish + "->" + order_finish); } if (error != last_error) { - logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); - logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); + logServer.deviceLog(this.device_code, "error", String.valueOf(error)); + logServer.deviceLogToacs(this.device_code, "", "", "信号error:" + last_error + "->" + error); } if (order_now != last_order_now) { - logServer.deviceLog(this.device_code,"order_now" ,String.valueOf(order_now)); - logServer.deviceLogToacs(this.device_code,"","","信号order_now:" + last_order_now + "->" + order_now); + logServer.deviceLog(this.device_code, "order_now", String.valueOf(order_now)); + logServer.deviceLogToacs(this.device_code, "", "", "信号order_now:" + last_order_now + "->" + order_now); } if (open_ready_time != last_open_ready_time) { - logServer.deviceLog(this.device_code,"open_ready_time" ,String.valueOf(open_ready_time)); - logServer.deviceLogToacs(this.device_code,"","","信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time); + logServer.deviceLog(this.device_code, "open_ready_time", String.valueOf(open_ready_time)); + logServer.deviceLogToacs(this.device_code, "", "", "信号open_ready_time:" + last_open_ready_time + "->" + open_ready_time); } if (device_running_time != last_device_running_time) { - logServer.deviceLog(this.device_code,"device_running_time" ,String.valueOf(device_running_time)); - logServer.deviceLogToacs(this.device_code,"","","信号device_running_time:" + last_device_running_time + "->" + device_running_time); + logServer.deviceLog(this.device_code, "device_running_time", String.valueOf(device_running_time)); + logServer.deviceLogToacs(this.device_code, "", "", "信号device_running_time:" + last_device_running_time + "->" + device_running_time); } if (await_time != last_await_time) { - logServer.deviceLog(this.device_code,"await_time" ,String.valueOf(await_time)); - logServer.deviceLogToacs(this.device_code,"","","信号await_time:" + last_await_time + "->" + await_time); + logServer.deviceLog(this.device_code, "await_time", String.valueOf(await_time)); + logServer.deviceLogToacs(this.device_code, "", "", "信号await_time:" + last_await_time + "->" + await_time); } if (order != last_order) { - logServer.deviceLog(this.device_code,"order" ,String.valueOf(order)); - logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order); + logServer.deviceLog(this.device_code, "order", String.valueOf(order)); + logServer.deviceLogToacs(this.device_code, "", "", "信号order:" + last_order + "->" + order); } /* if (mode == 2 && move != 0 && task > 0) { @@ -273,90 +273,89 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i Instruction instruction = null; List toInstructions; - if ( mode == 1 && order_finish != last_order_finish && order_finish == 1 && order > 0){ + if (mode == 1 && order_finish != last_order_finish && order_finish == 1 && order > 0) { ProduceshiftorderDto dto = new ProduceshiftorderDto(); dto.setOrder_code(order + ""); dto.setOrder_status("2"); ProduceshiftorderDto deviceInfo = produceshiftorderService.findOrderByDeviceCode(this.device_code); - if(deviceInfo != null){ + if (deviceInfo != null) { if (StrUtil.isNotEmpty(deviceInfo.getExt_order_id())) { String ext_order_id = deviceInfo.getExt_order_id(); JSONObject param = new JSONObject(); - param.put("ext_order_id",ext_order_id); + 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+":,对应的工单的没有外部标识"); + 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+":,对应的工单信息为空"); + } 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"); - logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功"); + this.writing("to_confirm_finished", "1"); + this.writing("to_clear", "1"); + this.writing("to_pause", "1"); + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功"); } else { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish); + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",order_finish>" + order_finish + ",last_order_finish>" + last_order_finish); } - if(ObjectUtil.isEmpty(inst)){ - if(!requireSucess){ - if (lack_req == 1 && move == 0) { - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请缺料请求任务"); + if (ObjectUtil.isEmpty(inst)) { + if (!requireSucess) { + if (mode == 1 && lack_req == 1 && move == 0) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请缺料请求任务"); apply_task(); } - if (req_task_empty == 1 && move == 1){ - logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务"); + if (mode == 1 && req_task_empty == 1 && move == 1) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务"); apply_take_empty_task(); } - logServer.deviceLogToacs(this.device_code,"","","lack_req:"+lack_req+"move:"+move+"req_task_empty:"+req_task_empty); + 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); + logServer.deviceLogToacs(this.device_code, "", "", "是否请求成功:requireSucess:" + requireSucess); } } - if(agvphase == 0x03) - { + if (agvphase == 0x03) { //&& lack_req =1 缺料请求 先不判断 /*if( move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)){*/ - inst.setExecute_status("1"); - instructionService.update(inst); - //writing("to_agv_ready", "1"); - byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); + inst.setExecute_status("1"); + instructionService.update(inst); + //writing("to_agv_ready", "1"); + byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); + OneNDCSocketConnectionAutoRun.write(data); + agvphase = 0; + index = 0; + inst = null; + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); /* } else { logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); }*/ } - if(agvphase == 0x05){ - if(move ==0 && error == 0 && ObjectUtil.isNotEmpty(inst)){ + if (agvphase == 0x05) { + if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) { inst.setExecute_status("2"); instructionService.update(inst); //writing("to_agv_ready", "1"); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - writing("to_agv_take_finish","1"); + writing("to_agv_take_finish", "1"); OneNDCSocketConnectionAutoRun.write(data); agvphase = 0; index = 0; inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst); } } - if(agvphase == 0x07){ - if(move ==0 && error == 0 && ObjectUtil.isNotEmpty(inst)){ + if (agvphase == 0x07) { + if (move == 0 && error == 0 && ObjectUtil.isNotEmpty(inst)) { inst.setExecute_status("5"); instructionService.update(inst); //writing("to_agv_ready", "1"); @@ -365,15 +364,15 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i agvphase = 0; index = 0; inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,原因move:"+move+",error:"+error+",inst"+inst); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,原因move:" + move + ",error:" + error + ",inst" + inst); } } - if(agvphase == 0x09){ - if(move ==1 && error == 0 && ObjectUtil.isNotEmpty(inst)){ + if (agvphase == 0x09) { + if (move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)) { inst.setExecute_status("6"); instructionService.update(inst); writing("to_agv_release_finish", "1"); @@ -385,27 +384,27 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i agvphase = 0; index = 0; inst = null; - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "反馈成功"); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); } else { - logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "等待反馈,move:"+move+",error:"+error+",inst:"+inst); + logServer.deviceLogToacs(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈,move:" + move + ",error:" + error + ",inst:" + inst); } } } - last_packer_ready = packer_ready;//包装机就绪 - last_lack_req = lack_req;//缺料请求 - last_hopper_already = hopper_already;//料斗已就位 - last_req_task_empty = req_task_empty;//请求取空料斗 - last_hopper_removed = hopper_removed;//料斗已取走 - last_move = move;//有货 - last_order_finish = order_finish;//订单完成 - last_mode = mode;//模式 所有设备就绪 - last_error = error; //报警信号 - last_order_now = order_now; //订单实时 - last_open_ready_time = open_ready_time; //开机准备时间(S) - last_device_running_time = device_running_time; //设备运转时间(S) - last_await_time = await_time; //待机时间(S) - last_order = order; //工单号 + last_packer_ready = packer_ready;//包装机就绪 + last_lack_req = lack_req;//缺料请求 + last_hopper_already = hopper_already;//料斗已就位 + last_req_task_empty = req_task_empty;//请求取空料斗 + last_hopper_removed = hopper_removed;//料斗已取走 + last_move = move;//有货 + last_order_finish = order_finish;//订单完成 + last_mode = mode;//模式 所有设备就绪 + last_error = error; //报警信号 + last_order_now = order_now; //订单实时 + last_open_ready_time = open_ready_time; //开机准备时间(S) + last_device_running_time = device_running_time; //设备运转时间(S) + last_await_time = await_time; //待机时间(S) + last_order = order; //工单号 } public boolean exe_error() { @@ -435,6 +434,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i public void set_last_container_type_desc(String type) { } + public synchronized boolean apply_take_empty_task() throws Exception { WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint"); @@ -466,13 +466,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i continue; } int num = taskserver.querySameDestinationTask(next_device_code); - if(num != 0){ + if (num != 0) { continue; } //判断缓存位是否锁定 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+"已锁定"); + if (ObjectUtil.isNotEmpty(jsonObject)) { + logServer.deviceLogToacs(this.device_code, "", "", "对应路由设备," + next_device_code + "已锁定"); continue; } TaskDto onedto = new TaskDto(); @@ -497,10 +497,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i taskserver.create(onedto); //任务创建成功 锁定 JSONObject map = new JSONObject(); - map.put("islock","1"); - map.put("update_by","auto"); + map.put("islock", "1"); + map.put("update_by", "auto"); map.put("update_time", DateUtil.now()); - runpointwo.update(map,"device_code = '" + next_device_code + "'"); + runpointwo.update(map, "device_code = '" + next_device_code + "'"); flag = true; break; } catch (Exception e) { @@ -522,6 +522,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i } return true; } + public synchronized boolean apply_task() throws Exception { Date date = new Date(); if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) { @@ -540,6 +541,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); } + if (order.getIs_needmove().equals("0")) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单,不需要agv搬运"); + return false; + } //查找当前工单对应的物料编号 String cpbh = order.getMaterial_code(); @@ -550,18 +555,18 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i Device route_link_device = deviceAppservice.findDeviceByCode(start_device_code); if (route_link_device.getDeviceDriver() instanceof HailiangEngravingCacheDeviceDriver) { hailiangEngravingCacheDeviceDriver = (HailiangEngravingCacheDeviceDriver) route_link_device.getDeviceDriver(); - if (hailiangEngravingCacheDeviceDriver.getMove() == 0 || hailiangEngravingCacheDeviceDriver.getMove() == 1 ) { + if (hailiangEngravingCacheDeviceDriver.getMove() == 0 || hailiangEngravingCacheDeviceDriver.getMove() == 1) { continue; } int num = taskserver.querySameOriginTask(start_device_code); - if(num != 0){ + if (num != 0) { continue; } String material = hailiangEngravingCacheDeviceDriver.getMaterial(); - if(StrUtil.isEmpty(material)){ + if (StrUtil.isEmpty(material)) { continue; } - if (material.equals(cpbh)){ + if (material.equals(cpbh)) { TaskDto onedto = new TaskDto(); String now = DateUtil.now(); onedto.setTask_id(IdUtil.simpleUUID()); @@ -659,7 +664,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i Server server = ReadUtil.getServer(opcservcerid); Map itemMap = new HashMap(); itemMap.put(to_command, value); - logServer.deviceLogToacs(this.device_code,"","","下发信号:" + key + ",value:"+value); + logServer.deviceLogToacs(this.device_code, "", "", "下发信号:" + key + ",value:" + value); ReadUtil.write(itemMap, server); } @@ -707,7 +712,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i dto.setCreate_time(now); WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); wo.insert(json); requireSucess = false; 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 84c784f2..0f177bb8 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 @@ -4,16 +4,19 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import net.sf.json.JSONObject; import org.nl.acs.agv.server.AgvService; import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line.HailiangCleaningFeedingLineDefination; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver; @@ -394,27 +397,27 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri String empty_device = this.getDevice().getExtraValue().get("empty_device_code").toString(); //通过满料位设备关联的设备tw查找订单 ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device); - //判断是否需要agv搬运 - if (order.getIs_needmove().equals("0")){ - requireSucess = true; - logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运,工单号:"+order.getOrder_code()); - return true; - } if (ObjectUtil.isEmpty(order)) { logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单"); throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单"); } + //判断是否需要agv搬运 + if (order.getIs_needmove().equals("0")){ + requireSucess = true; + logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运,工单号:"+order.getOrder_code()); + return true; + } //查找当前工单对应的物料编号 String cpbh = order.getMaterial_code(); HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver; HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver; + HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver; String clear_storage_device =null; //遍历路由,找到对应所有的物料进行匹配 for (int i = 0; i < list.size(); i++) { RouteLineDto dto = list.get(i); //找到路由对应工位 清洗机设备编号 String route_device_code = dto.getNext_device_code(); - //根据清洗机设备编号获取清洗剂设备信息 Device route_link_device = deviceAppservice.findDeviceByCode(route_device_code); //找到路由工位对应设备 String route_link_device_code = (String)route_link_device.getExtraValue().get("link_device_code"); @@ -480,6 +483,51 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri } } + else if (route_link_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver){ + JSONObject json = new JSONObject(); + json.put("device_code",device_code); + json.put("type","1"); + HttpResponse httpResponse = acsToWmsService.applyInCacheLineTask(json); + JSONObject jsonObject = JSONObject.parseObject(httpResponse.body()); + String ext_task_id = jsonObject.getString("ext_task_id"); + String task_code = jsonObject.getString("task_code"); + String start_device_code = jsonObject.getString("start_device_code"); + String put_device_code = jsonObject.getString("put_device_code"); + String next_device_code = jsonObject.getString("next_device_code"); + String task_type = jsonObject.getString("task_type"); + String barcodeArr = jsonObject.getString("barcodeArr"); + String[] barcodeArrs = barcodeArr.split("\\,"); + TaskDto onedto = new TaskDto(); + String now = DateUtil.now(); + onedto.setTask_id(IdUtil.simpleUUID()); + onedto.setQuantity(String.valueOf(full_number)); + onedto.setCreate_by(this.getDevice().getDevice_code()); + onedto.setUpdate_by(this.getDevice().getDevice_code()); + onedto.setExt_task_id(ext_task_id); + onedto.setRoute_plan_code("normal"); + String taskcode = CodeUtil.getNewCode("TASK_NO"); + onedto.setTask_code("-" + taskcode); + onedto.setTask_status("0"); + onedto.setPriority("101"); + onedto.setAgv_system_type("1"); + onedto.setTask_type(task_type); + onedto.setTask_id(IdUtil.simpleUUID()); + onedto.setTask_code(task_code); + onedto.setStart_device_code(start_device_code); + onedto.setStart_point_code(start_device_code); + onedto.setPut_device_code(put_device_code); + onedto.setPut_point_code(put_device_code); + onedto.setNext_point_code(next_device_code); + onedto.setNext_device_code(next_device_code); + onedto.setUpdate_time(now); + onedto.setCreate_time(now); + try { + taskserver.create(onedto); + flag = true; + } catch (Exception e) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); + } + } } else { //清洗倒料位是没有工单的 if (route_link_device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) { @@ -580,7 +628,6 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri hailiangCleaningMachineStorageStationDeviceDriver.setMaterial(""); logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); } - logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功"); break; } } @@ -601,6 +648,23 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri return true; } + public synchronized boolean applyInCacheLineTask() throws Exception { + Boolean flag = false; + + //生成任务成功 + if (flag) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); + requireSucess = true; + } else { + //如果都没有则调用mes接口申请入缓存线 + //生成任务 + //前往缓存线 + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); + } + + return true; + } + public synchronized boolean finish_instruction() throws Exception { 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 9223956f..570a2a08 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 @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; @@ -243,6 +244,21 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri Instruction instruction = null; List toInstructions; + if(!requireSucess){ + Device device = deviceAppservice.findDeviceByCode(device_code); + Integer min_num = Integer.parseInt(device.getExtraValue().get("min_num")+""); + // TODO 是否需要手自动状态开启判断条件 + if ( mode == 1 && storage_stock_num < min_num ) { + logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "开始申请任务"); + applyOutCacheLineTask(); + } else { + logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "倒料位数量:"+storage_stock_num+"最小数量:"+min_num+ "申请任务失败,不符合条件"); + } + } else { + logServer.deviceLogToacs(this.device_code,"","","是否请求成功:requireSucess:"+requireSucess); + + } + if(agvphase == 0x0B || agvphase == 0x0F ) { if(error == 0 && ObjectUtil.isNotEmpty(inst)){ @@ -295,6 +311,64 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri } } + public synchronized boolean applyOutCacheLineTask() throws Exception { + Boolean flag = false; + JSONObject json = new JSONObject(); + json.put("device_code",device_code); + json.put("type","2"); + HttpResponse httpResponse = acsToWmsService.applyOutCacheLineTask(json); + String body = httpResponse.body(); + JSONObject jsonObject = JSONObject.parseObject(body); + String ext_task_id = jsonObject.getString("ext_task_id"); + String task_code = jsonObject.getString("task_code"); + String start_device_code = jsonObject.getString("start_device_code"); + String put_device_code = jsonObject.getString("put_device_code"); + String next_device_code = jsonObject.getString("next_device_code"); + String task_type = jsonObject.getString("task_type"); + TaskDto onedto = new TaskDto(); + String now = DateUtil.now(); + onedto.setTask_id(IdUtil.simpleUUID()); + onedto.setQuantity(String.valueOf(full_number)); + onedto.setCreate_by(this.getDevice().getDevice_code()); + onedto.setUpdate_by(this.getDevice().getDevice_code()); + onedto.setRoute_plan_code("normal"); + String taskcode = CodeUtil.getNewCode("TASK_NO"); + onedto.setTask_code("-" + taskcode); + onedto.setTask_status("0"); + onedto.setPriority("101"); + onedto.setAgv_system_type("1"); + onedto.setTask_type(task_type); + onedto.setExt_task_id(ext_task_id); + onedto.setTask_id(IdUtil.simpleUUID()); + onedto.setTask_code(task_code); + onedto.setStart_device_code(start_device_code); + onedto.setStart_point_code(start_device_code); + onedto.setPut_device_code(put_device_code); + onedto.setPut_point_code(put_device_code); + onedto.setNext_point_code(next_device_code); + onedto.setNext_device_code(next_device_code); + onedto.setUpdate_time(now); + onedto.setCreate_time(now); + + try { + taskserver.create(onedto); + flag = true; + } catch (Exception e) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); + } + //生成任务成功 + if (flag) { + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功"); + requireSucess = true; + } else { + //如果都没有则调用mes接口申请入缓存线 + //生成任务 + //前往缓存线 + logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线"); + } + return true; + } + protected void thingToNothing() { log.debug("从有货到无货 清理数据"); this.setRequireSucess(false); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java index 2beec905..635dda4e 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java @@ -80,4 +80,19 @@ public class AcsToWmsController { public ResponseEntity feedbackOrderStatus(@RequestBody JSONObject param) { return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK); } + + + @PostMapping("/applyInCacheLineTask") + @Log("ACS申请缓存线入库任务") + @ApiOperation("ACS申请缓存线入库任务") + public ResponseEntity applyInCacheLineTask(@RequestBody JSONObject param) { + return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK); + } + + @PostMapping("/applyOutCacheLineTask") + @Log("ACS系统申请出库任务") + @ApiOperation("ACS系统申请出库任务") + public ResponseEntity applyOutCacheLineTask(@RequestBody JSONObject param) { + return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK); + } } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index 28f57cb0..0f6361c7 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -100,4 +100,20 @@ public interface AcsToWmsService { * @return */ HttpResponse feedbackOrderStatus(JSONObject param); + + /** + * ACS申请缓存线入库任务 + * + * @param param + * @return + */ + HttpResponse applyInCacheLineTask(JSONObject param); + + /** + * ACS系统申请出库任务 + * + * @param param + * @return + */ + HttpResponse applyOutCacheLineTask(JSONObject param); } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 67f5ed5d..4ffa2ec2 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -439,7 +439,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } @Override - @Transactional(rollbackFor = Exception.class) public HttpResponse feedbackOrderStatus(JSONObject param) { if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) { String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); @@ -466,7 +465,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "error"; } - logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, status); + logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, ""); log.info("feedbackOrderStatus----返回参数{}", result); } catch (Exception e) { String msg = e.getMessage(); @@ -479,4 +478,70 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return null; } + @Override + public HttpResponse applyInCacheLineTask(JSONObject param) { + if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) { + String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + // TODO 还没向地址表中添加 applyInCacheLineTask地址 + AddressDto addressDto = addressService.findByCode("applyInCacheLineTask"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + HttpResponse result = null; + log.info("feedbackOrderStatus----请求参数{}", param); + try { + result = HttpRequest.post(url) + .body(String.valueOf(param)) + .execute(); + String type = ""; + if (result.getStatus() == 200) { + type = "info"; + } else { + type = "error"; + } + + logServer.log("", "applyInCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, ""); + log.info("applyInCacheLineTask----返回参数{}", result); + } catch (Exception e) { + String msg = e.getMessage(); + //网络不通 + System.out.println(msg); + } + return result; + } + return null; + } + + @Override + public HttpResponse applyOutCacheLineTask(JSONObject param) { + if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) { + String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); + // TODO 还没向地址表中添加 applyOutCacheLineTask + AddressDto addressDto = addressService.findByCode("applyOutCacheLineTask"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + HttpResponse result = null; + log.info("feedbackOrderStatus----请求参数{}", param); + try { + result = HttpRequest.post(url) + .body(String.valueOf(param)) + .execute(); + String type = ""; + if (result.getStatus() == 200) { + type = "info"; + } else { + type = "error"; + } + + logServer.log("", "applyOutCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, ""); + log.info("applyOutCacheLineTask----返回参数{}", result); + } catch (Exception e) { + String msg = e.getMessage(); + //网络不通 + System.out.println(msg); + } + return result; + } + return null; + } + } diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 2fd92034..370a92a3 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -18,6 +18,7 @@ import org.nl.acs.config.server.AcsConfigService; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver; +import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver; import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver; @@ -753,15 +754,19 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } if(deviceByCode.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){ jo1.put("hasGoodStatus", "2"); + jo1.put("material_type",startdevice.getMaterial_type()); + } else if (deviceByCode.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){ + jo1.put("hasGoodStatus", "1"); + jo1.put("material_type", ""); } else { jo1.put("hasGoodStatus", "1"); + jo1.put("material_type",startdevice.getMaterial_type()); } - jo1.put("material_type", startdevice.getMaterial_type()); jo1.put("quantity", startdevice.getQuantity()); jo1.put("remark", startdevice.getRemark()); jo1.put("batch", startdevice.getBatch()); jo1.put("vehicle_code", entity.getVehicle_code()); - jo1.put("islock", "false"); + jo1.put("islock", "0"); jo1.put("barrels_code", startdevice.getBarrels_code()); jo1.put("cooperate_code", startdevice.getCooperate_code()); jo1.put("powder_name", startdevice.getPowder_name()); @@ -775,7 +780,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu jo.put("quantity", ""); jo.put("remark", ""); jo.put("batch", ""); - jo.put("islock", "false"); + jo.put("islock", "0"); deviceService.changeDeviceStatus(jo); JSONObject json = (JSONObject) JSONObject.toJSON(entity); diff --git a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index 2d15efb1..4e538394 100644 --- a/wcs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/wcs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -18,6 +18,11 @@ public class TaskDto implements Serializable { */ private String task_id; + /** + * 任务外部标识 + */ + private String ext_task_id; + /** * 任务号 */ 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 0a1aa279..aabf37ea 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 @@ -29,7 +29,7 @@ public class AutoCleanUpLogs { public void run() throws Exception { try { WQLObject wo = WQLObject.getWQLObject("acs_device"); - JSONArray array = wo.query().getResultJSONArray(0); + JSONArray array = wo.query("1=1","device_code").getResultJSONArray(0); Date now = DateUtil.parse(DateUtil.now()); DateTime dateTime = DateUtil.offsetDay(now, -15); String formatDateTime = DateUtil.formatDateTime(dateTime); @@ -39,8 +39,8 @@ public class AutoCleanUpLogs { JSONObject jsonObject = array.getJSONObject(i); String device_code = jsonObject.getString("device_code"); mongoTemplate.remove(query,device_code); + System.out.println(device_code+"设备日志清除成功---------------------"); } - System.out.println("设备日志清除成功---------------------"); } } catch (Exception e) { e.printStackTrace();