| | |
| | | |
| | | @SuppressWarnings("all") |
| | | @Transactional |
| | | public void generateBusAndTask(OpenBusSubmitParam busSubmitParam, String memo) { |
| | | public Bus generateBusAndTask(OpenBusSubmitParam busSubmitParam, String memo) { |
| | | String errorMsg = busService.checkoutValid(busSubmitParam); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | throw new BusinessException(errorMsg); |
| | | } |
| | | String batch = busSubmitParam.getBatch(); |
| | | List<TaskDto> taskDtoList = busSubmitParam.getTaskList(); |
| | | if (Cools.isEmpty(taskDtoList)) { |
| | |
| | | Date now = new Date(); |
| | | Bus bus = new Bus(); |
| | | bus.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3)); |
| | | bus.setSeqNum(batch); |
| | | bus.setBusNo(batch); |
| | | bus.setStartTime(now); |
| | | bus.setBusSts(BusStsType.RECEIVE.val()); |
| | | bus.setMemo(memo); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | return bus; |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new CoolException("generate [task] action fail, cause can not acquire lock ..."); |
| | | } |
| | | Date now = new Date(); |
| | | final String sameGroupXy = configService.getVal( "sameGroupXy"); |
| | | final String sameGroupXy = configService.getVal( "sameGroupXy", String.class); |
| | | |
| | | Agv agv = agvService.getById(agvId); |
| | | if (!agvService.judgeEnable(agv.getId(), agvDetail -> agvDetail.getVol() > agv.getChargeLine())) { |
| | |
| | | try { |
| | | if (Cools.isEmpty(agvId, segmentList)) { return; } |
| | | Date now = new Date(); |
| | | JSONObject storeDirection = JSON.parseObject(configService.getVal("storeDirection")); |
| | | JSONObject storeDirection = configService.getVal("storeDirection", JSONObject.class); |
| | | Agv agv = agvService.getById(agvId); |
| | | if (!agvService.judgeEnable(agv.getId())) { |
| | | throw new CoolException("AGV[" + agv.getUuid() + "]当前不可用..."); |