| | |
| | | return false;//站点必须自动、空闲、没有托盘 |
| | | } |
| | | |
| | | if (wrkMast.getStaNo() == 300) { |
| | | //出300站,检测300站任务数量 |
| | | List<WrkMast> wrkMasts = wrkMastMapper.select300Wrk(); |
| | | if (wrkMasts.size() >= 4) { |
| | | News.info("{}任务,输送线任务过载{}", wrkMast.getWrkNo(), wrkMasts.size()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | if (wrkMast.getShuttleNo() == null) {//没有绑定小车,进行调度 |
| | | //强制预留一台小车给入库任务 |
| | | int lev = Utils.getLev(wrkMast.getSourceLocNo()); |
| | |
| | | Utils.wapperSetCondition(wrapper, "three_code", locDetl.getThreeCode()); |
| | | Utils.wapperSetCondition(wrapper, "dead_time", locDetl.getDeadTime()); |
| | | Utils.wapperSetCondition(wrapper, "supp_code", locDetl.getSuppCode());//料箱码 |
| | | WrkDetl detl = wrkDetlService.selectOne(wrapper); |
| | | |
| | | List<WrkDetl> detl = wrkDetlService.selectList(wrapper); |
| | | if (Cools.isEmpty(detl)) { |
| | | String suppCode = ""; |
| | | if (locDetl.getSuppCode() != null) { |
| | |
| | | } |
| | | ledCommand.getMatDtos().add(new MatDto(locDetl.getMatnr(), locDetl.getMaktx(), 0D, locDetl.getAnfme(), locDetl.getSpecs(), suppCode)); |
| | | } else { |
| | | String suppCode = ""; |
| | | String orderNo = detl.getOrderNo(); |
| | | if (detl.getSuppCode() != null) { |
| | | suppCode = detl.getSuppCode(); |
| | | //出库数量累计 |
| | | Double conut = 0.0; |
| | | for (WrkDetl wrkDetl : detl) { |
| | | conut = conut + wrkDetl.getAnfme(); |
| | | } |
| | | if (isJson(orderNo)) { |
| | | JSONArray orders = JSON.parseArray(orderNo); |
| | | for (Object order : orders) { |
| | | JSONObject order1 = (JSONObject) order; |
| | | ledCommand.getMatDtos().add(new MatDto(detl.getMatnr(), detl.getMaktx(), (Double) order1.get("anfme"), (locDetl.getAnfme() - detl.getAnfme()), detl.getSpecs(), suppCode, (String) order1.get("orderNo"))); |
| | | |
| | | for (WrkDetl wrkDetl : detl) { |
| | | String suppCode = ""; |
| | | if (wrkDetl.getSuppCode() != null) { |
| | | suppCode = wrkDetl.getSuppCode(); |
| | | } |
| | | } else { |
| | | ledCommand.getMatDtos().add(new MatDto(detl.getMatnr(), detl.getMaktx(), detl.getAnfme(), (locDetl.getAnfme() - detl.getAnfme()), detl.getSpecs(), suppCode, detl.getOrderNo())); |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), (locDetl.getAnfme() - conut), wrkDetl.getSpecs(), suppCode, wrkDetl.getOrderNo())); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | }); |
| | | |
| | | if (locDetls.isEmpty()) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (shuttleProtocol.getSuspendState() == 1) { |
| | | continue;//管制中 |
| | | } |
| | | |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(wrkCharge.getLocNo())) { |
| | | //小车不在充电桩位置 |
| | | shuttleDispatchUtils.dispatchShuttle(wrkCharge.getWrkNo(), wrkCharge.getLocNo(), shuttle.getId());//调度小车去充电桩 |