zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java
@@ -359,4 +359,15 @@ return siteStatus.toLowerCase().replaceAll("_", "-"); } public Long getConveyorDeviceId() { if (null == this.conveyorId){ return null; } BasConveyorService basConveyorService = SpringUtils.getBean(BasConveyorService.class); BasConveyor basConveyor = basConveyorService.getById(this.conveyorId); if (basConveyor == null) { return null; } return basConveyor.getDeviceId(); } } zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -54,6 +54,8 @@ @Autowired private BasConveyorStaService basConveyorStaService; @Autowired private BasConveyorService basConveyorService; @Autowired private TaskCtgService taskCtgService; public List<Motion> generateMotion(Task task) { @@ -1409,6 +1411,7 @@ if(basConveyorStaOrigin == null || basConveyorStaDest == null) { return motionList; } // 提升机移动托盘 motionList.addAll(kernelService.liftMoveGoods( MotionDto.build((dto -> { @@ -1419,6 +1422,7 @@ , MotionDto.build((dto -> { dto.setLiftNo(device.getId().intValue()); dto.setLev(Utils.getLev(basConveyorStaDest.getLocNo())); dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue()); dto.setStaNo(Integer.parseInt(task.getDestSite())); })) )); zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
@@ -86,6 +86,7 @@ } motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev()))); motion.setTarDrt(target.getStaNo());//目标站 motion.setDockNo(String.valueOf(target.getDevpNo()));//输送线ID if (target.getSync() != null) { motion.setSync(target.getSync()); zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java
@@ -17,6 +17,8 @@ import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType; import com.zy.asrs.wcs.rcs.model.enums.SlaveType; import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol; import com.zy.asrs.wcs.rcs.model.protocol.StaProtocol; import com.zy.asrs.wcs.rcs.thread.DevpThread; import com.zy.asrs.wcs.rcs.thread.LiftThread; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -227,6 +229,20 @@ return false; } //判断目标站是否有托盘 Integer conveyorDeviceId = Integer.parseInt(motion.getDockNo()); DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, conveyorDeviceId); if (devpThread == null) { return false; } StaProtocol staProtocol = devpThread.getStation().get(motion.getTarDrt()); if(staProtocol == null) { return false; } if (!staProtocol.isLoading()) { return false; } if (motion.getReleaseLift() == 1) {//释放提升机 task.setLiftNo(0); task.setUpdateTime(new Date()); zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateMapData.java
@@ -136,6 +136,17 @@ mapNode.setNo(object.getString("row") + "-" + object.getString("bay")); mapNode.setXBase(object.getInteger("refx")); mapNode.setYBase(object.getInteger("refy")); if(mapNode.getValue() == MapNodeType.CONVEYOR.id) { //输送线,判断小车是否可走 if (object.containsKey("conveyorHasGo")) { if(object.getBoolean("conveyorHasGo")) { //小车可走 mapNode.setValue(MapNodeType.CONVEYOR_CAR_GO.id); } } } nodes.add(mapNode); } zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -29,7 +29,7 @@ boolean reset(ShuttleCommand command);//复位开关 boolean updateLocation(ShuttleCommand param);//更新坐标 boolean updateLocation(ShuttleCommand command);//更新坐标 boolean isIdle(); zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -216,7 +216,7 @@ //是否有托盘 shuttleProtocol.setHasPallet(data.getInteger("loadState") == 1 ? true : false); //行驶方向 shuttleProtocol.setRunDirection(data.getString("runDir") == null ? "none" : data.getString("direction")); shuttleProtocol.setRunDirection(data.getString("runDir") == null ? "none" : data.getString("runDir")); //是否为充电状态 shuttleProtocol.setHasCharge(data.getInteger("chargState") == 1 ? true : false); @@ -458,8 +458,19 @@ } @Override public boolean updateLocation(ShuttleCommand param) { return true;//还没移植过来 public boolean updateLocation(ShuttleCommand command) { try { //发出请求 NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class); JSONObject result = requestCommand(httpCommand); if (result == null) { return false;//请求失败 } this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间 return true; } catch (IOException e) { return false; } } @Override @@ -804,7 +815,21 @@ @Override public ShuttleCommand getUpdateLocationCommand(Integer taskNo, String locNo) { return null;//还没移植过来 NyShuttleHttpCommand httpStandard = getHttpStandard(Integer.parseInt(device.getDeviceNo()), taskNo); NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest(); HashMap<String, Object> body = new HashMap<>(); body.put("requestType", "updateFloor");//更新层Z body.put("z", Utils.getLev(locNo));//坐标Z request.setBody(body); httpStandard.setRequest(request); ShuttleCommand command = new ShuttleCommand(); command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo())); command.setBody(JSON.toJSONString(httpStandard)); command.setMode(ShuttleCommandModeType.UPDATE_LOCATION.id); return command; } //获取小车复位响应命令