From f0992ed9ce4742c8613cf9925a2ef9717dfd442b Mon Sep 17 00:00:00 2001 From: LGH <1746689524@qq.com> Date: Fri, 15 Jul 2022 15:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=B2=E5=8E=8B=E5=8F=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mt/wms/empty/task/RunTaskUtils.java | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java index 711fbbb..c8aaff3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java @@ -80,9 +80,15 @@ public class RunTaskUtils { //type=1为 入 yeya.put("type", 1); if ("YYT003".equals(startPoint.getNote())){ - yeya.put("number", 2); + yeya.put("number", 3); } if ("YYT004".equals(startPoint.getNote())){ + yeya.put("number", 4); + } + if ("YYT002".equals(startPoint.getNote())){ + yeya.put("number", 2); + } + if ("YYT001".equals(startPoint.getNote())){ yeya.put("number", 1); } String yeyaJudgeStatus = JSON.toJSONString(yeya); @@ -95,7 +101,7 @@ public class RunTaskUtils { logger.error(new Date() + "WCS接口超时未响应!"); } //taskStatus==3满足条件,其他状态值说明液压台不满足开始任务的条件(无货物或者有货物但是没提升到位) - if (Integer.parseInt(JSONObject.parseObject(yeyaStatus).get("taskStatus").toString()) != 3){ + if (Integer.parseInt(JSONObject.parseObject(yeyaStatus).get("taskStatus").toString()) != 1){ return R.failed(startPoint.getName()+"号液压台不满足任务执行所必须的条件,请检查液压台是否有货物且提升到位!"); } } @@ -292,12 +298,34 @@ public class RunTaskUtils { //有小车在运行,提示当前有车辆在运行,请稍后 return R.failed("当前轨道有RGV车辆在运动,请等待当前RGV车辆执行完毕再执行任务!"); } - Boolean platFormStatus = platFormStatus(yeyaTaiCode); - if (!platFormStatus){ - // TODO: 2022/3/19 delete - System.out.println("当前选定的液压台为在线或未提升到位,请检查后重试!"); - return R.failed("当前选定的液压台为在线或未提升到位,请检查后重试!"); - } + Map yeya = new HashMap(); + //type=1随意赋值,不用type了 + yeya.put("type", 1); + if ("YYT003".equals(yeyaTaiCode)){ + yeya.put("number", 3); + } + if ("YYT004".equals(yeyaTaiCode)){ + yeya.put("number", 4); + } + if ("YYT002".equals(yeyaTaiCode)){ + yeya.put("number", 2); + } + if ("YYT001".equals(yeyaTaiCode)){ + yeya.put("number", 1); + } + String yeyaJudgeStatus = JSON.toJSONString(yeya); + //判断起点液压台是否在线且提升到位 + String yeyaStatus=null; + try { + yeyaStatus = HttpClient.httpPost("http://192.168.6.51:8009/yeya/isReadyForYeyaStatus", yeyaJudgeStatus); + } catch (IOException e) { + e.printStackTrace(); + logger.error(new Date() + "WCS接口超时未响应!"); + } + //taskStatus==3满足条件,其他状态值说明液压台不满足开始任务的条件(无货物或者有货物但是没提升到位) + if (Integer.parseInt(JSONObject.parseObject(yeyaStatus).get("taskStatus").toString()) != 1){ + return R.failed("液压台"+yeyaTaiCode+"不满足任务执行所必须的条件,请检查液压台是否有货物且提升到位!"); + } //计算出路径最短的车辆id Long vehicleId = taskDistanceUtils.chooseVehicle(location.getCode(), yeyaTaiCode); if (vehicleId==0){