| | |
| | | } |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(wrkMast.getWmsWrkNo()); |
| | | ledCommand.setIoType(wrkMast.getIoType()); |
| | | // 出库模式 |
| | | switch (wrkMast.getIoType()) { |
| | | case 1: |
| | | ledCommand.setTitle("全板入库"); |
| | | break; |
| | | case 10: |
| | | ledCommand.setTitle("空板入库"); |
| | | break; |
| | | case 101: |
| | | ledCommand.setTitle("全板出库"); |
| | | break; |
| | | case 103: |
| | | ledCommand.setTitle("拣料出库"); |
| | | break; |
| | | case 104: |
| | | ledCommand.setTitle("并板出库"); |
| | | break; |
| | | case 107: |
| | | ledCommand.setTitle("盘点出库"); |
| | | break; |
| | | case 110: |
| | | ledCommand.setTitle("空板出库"); |
| | | ledCommand.setEmptyMk(true); |
| | | break; |
| | | case 53: |
| | | ledCommand.setTitle("拣料入库"); |
| | | break; |
| | | case 57: |
| | | ledCommand.setTitle("盘点入库"); |
| | | break; |
| | | case 54: |
| | | ledCommand.setTitle("并板入库"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setLocNo(wrkMast.getLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("taskNo", wrkMast.getWmsWrkNo()); |
| | |
| | | continue; |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if (Cools.isEmpty(shuttleProtocol.getErrorCode())) { |
| | | continue; |
| | | } |
| | | int i = Integer.parseInt(shuttleProtocol.getErrorCode()); |
| | | if (i > 0) { |
| | | BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(i); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && isInEnable(devpThread, inSta.getStaNo()) && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) && staProtocol.isPakMk()) { |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (Cools.isEmpty(barcode) || "?".endsWith(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) { |
| | | continue; |
| | | } |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_sta_no", inSta.getStaNo()).eq("barcode", barcode)); |
| | | if (wrkMast != null && wrkMast.getWrkSts() == WrkStsType.NEW_INBOUND.sts) { |
| | |
| | | ledThread.error(errMsg); |
| | | } |
| | | } |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (Cools.isEmpty(barcode) || "?".endsWith(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) { |
| | | return false; |
| | | } |
| | | if (!staProtocol.isAutoing()) { |
| | | News.info("{}任务,{}站点,不在自动状态", wrkMast.getWrkNo(), staProtocol.getSiteId()); |
| | | return false; |
| | |
| | | assignCommand.setAuto(true);//自动模式 |
| | | |
| | | //获取小车到提升机行走命令 |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.NORMAL.id, assignCommand, shuttleThread); |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.DFX.id, assignCommand, shuttleThread); |
| | | if (commands == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | |
| | | assignCommand.setLocNo(wrkMast.getLocNo());//目标库位 |
| | | |
| | | List<ShuttleCommand> commands = new ArrayList<>(); |
| | | Integer mapType = NavigationMapType.NORMAL.id; |
| | | Integer mapType = NavigationMapType.DFX.id; |
| | | |
| | | List<ShuttleCommand> moveCommands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo(), mapType, assignCommand, shuttleThread); |
| | | if (moveCommands == null) { |
| | |
| | | assignCommand.setAuto(true);//自动模式 |
| | | |
| | | //获取小车到提升机行走命令 |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.NORMAL.id, assignCommand, shuttleThread); |
| | | List<ShuttleCommand> commands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftThread.getLiftLocNo(Utils.getLev(shuttleProtocol.getCurrentLocNo())), NavigationMapType.DFX.id, assignCommand, shuttleThread); |
| | | if (commands == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.rmi.CORBA.Util; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | if (wrkMast1 != null) { |
| | | wrkMast1.setShuttleNo(shuttleProtocol.getShuttleNo()); |
| | | wrkMastService.updateById(wrkMast1); |
| | | sameLev.add(0,shuttleThread); |
| | | sameLev.add(0, shuttleThread); |
| | | //return true; |
| | | } |
| | | break; |
| | |
| | | */ |
| | | public boolean searchDispatchShuttleNoLift(Integer wrkNo, String sourceLocNo, String locNo, String flag) { |
| | | ArrayList<ShuttleThread> diffLev = new ArrayList<>();//不同楼层的穿梭车 |
| | | |
| | | int lev1 = 0; |
| | | boolean tongLev = false; |
| | | for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { |
| | | //获取四向穿梭车线程 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); |
| | |
| | | } |
| | | } |
| | | diffLev.add(shuttleThread); |
| | | if (lev1 != 0) { |
| | | if (lev1 == Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | | tongLev = true; |
| | | } |
| | | } else { |
| | | lev1 = Utils.getLev(shuttleProtocol.getCurrentLocNo()); |
| | | } |
| | | } |
| | | |
| | | //寻找离任务楼层最近的穿梭车(不考虑跨楼层小车移动距离) |
| | |
| | | //当前穿梭车库位号 |
| | | String currentLocNo = shuttleProtocol.getCurrentLocNo(); |
| | | int currentLev = Utils.getLev(currentLocNo); |
| | | |
| | | if (wrkMast1.getIoType() == 101 && currentLocNo.equals(locNo)) { |
| | | //车辆当前位置已经是目标库位,调度该车 |
| | | //给工作档绑定小车号 |
| | | diffShuttles.put(-1, shuttleThread); |
| | | } else { |
| | | //ABS(目标楼层 - 当前楼层) 得到差距,取最小差值 |
| | | int currentValue = Math.abs(lev - currentLev); |
| | | if (diffShuttles.get(currentValue) != null) { |
| | | diffShuttles.put(currentValue + 1, shuttleThread); |
| | | if (tongLev) { |
| | | //当前穿梭车线程到目标地点距离 |
| | | List<NavigateNode> currentShuttlePath = navigateUtils.calc(currentLocNo, locNo, NavigationMapType.NORMAL.id, Utils.getShuttlePoints(shuttleProtocol.getShuttleNo(), Utils.getLev(currentLocNo)), null);//搜索空闲穿梭车,使用正常通道地图 |
| | | if (currentShuttlePath == null) { |
| | | continue; |
| | | } |
| | | Integer currentAllDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | diffShuttles.put(currentAllDistance, shuttleThread); |
| | | } else { |
| | | diffShuttles.put(currentValue, shuttleThread); |
| | | //ABS(目标楼层 - 当前楼层) 得到差距,取最小差值 |
| | | int currentValue = Math.abs(lev - currentLev); |
| | | if (diffShuttles.get(currentValue) != null) { |
| | | diffShuttles.put(currentValue + 1, shuttleThread); |
| | | } else { |
| | | diffShuttles.put(currentValue, shuttleThread); |
| | | } |
| | | } |
| | | } |
| | | } |