| | |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { continue; } |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), hostId); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (!Cools.isEmpty(locDetl.getMemo())){ |
| | | continue; |
| | | } |
| | | List<LocDetl> locMats = locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locDetl.getLocNo()) |
| | | .eq(LocDetl::getHostId, hostId)); |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103, hostId); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), ((issued >= locDetl.getAnfme()) && (locMats.size() == 1)) ? 101 : 103, hostId); |
| | | locDto.setStaNos(staNos); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | |
| | | LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>() |
| | | .eq(LocMast::getLocNo, locDto.getLocNo()) |
| | | .eq(LocMast::getHostId, hostId)); |
| | | if (locMast.getWhsType()!=0){ |
| | | continue; |
| | | } |
| | | if(!Cools.isEmpty(locMast) && !locMast.getLocSts().equals("F")){ |
| | | return R.error("库位号非在库状态,请重新选择出库库位===>>" + locDto.getLocNo()); |
| | | } |
| | |
| | | BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo(), false, hostId); |
| | | workService.stockOut(staNo.getDevNo(), taskDto, getUserId(), hostId); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("立体仓库生成出库任务成功,平库请使用PDA进行出库!!!"); |
| | | } |
| | | |
| | | } |