| | |
| | | if (Objects.isNull(basStation)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | List<WarehouseAreas> warehouseAreasList = new ArrayList<>(); |
| | | if (basStation.getIsWcs() == 1){ |
| | | DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(basStation.getStationName())); |
| | | if (Cools.isEmpty(deviceBind)) { |
| | | throw new CoolException("库位规则未知"); |
| | |
| | | if (Cools.isEmpty(warehouseArea)) { |
| | | throw new CoolException("未找到所属库区信息"); |
| | | } |
| | | warehouseAreasList.add(warehouseArea); |
| | | } else { |
| | | List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class); |
| | | if (areaList.isEmpty()) { |
| | | throw new CoolException("当前站点库区未配置"); |
| | | } |
| | | warehouseAreasList = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().in(WarehouseAreas::getId,areaList)); |
| | | } |
| | | |
| | | if (Cools.isEmpty(warehouseAreasList) || warehouseAreasList.size() == 0) { |
| | | throw new CoolException("未找到所属库区信息"); |
| | | } |
| | | final String[] errMsg = {""}; |
| | | for (WarehouseAreas warehouseArea : warehouseAreasList) { |
| | | /**获取组拖*/ |
| | | List<Long> ids = waitPakin.getWaitPakins().stream().map(WaitPakin::getId).collect(Collectors.toList()); |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() |
| | |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("请检查组拖状态是否完成!!"); |
| | | } |
| | | waitPakins.forEach(pakin -> { |
| | | |
| | | |
| | | //验证基础信息 |
| | | boolean sign = true; |
| | | for (WaitPakin pakin : waitPakins) {//验证基础信息 |
| | | try { |
| | | checkStaStatus(pakin.getBarcode(),basStation.getStationName(),warehouseArea.getId().toString()); |
| | | } catch (Exception e) { |
| | | errMsg[0] = errMsg[0] + e.getMessage(); |
| | | sign = false; |
| | | break; |
| | | } |
| | | // BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>() |
| | | // .eq(BasContainer::getCode, pakin.getBarcode())); |
| | | // if (Objects.isNull(container)) { |
| | |
| | | throw new CoolException("组托明细修执行数量修改失败!!"); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | if (!sign){ |
| | | continue; |
| | | } |
| | | |
| | | if (!waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>() |
| | | .in(WaitPakin::getId, ids) |
| | |
| | | } |
| | | return R.ok("任务生成完毕!"); |
| | | } |
| | | String msg = "未找库位" + Arrays.toString(errMsg); |
| | | throw new CoolException(msg); |
| | | } |
| | | |
| | | /** |
| | | * 入库任务 |