| | |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { continue; } |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOwner()); |
| | | List<LocDetl> locDetls = locDetlService.queryStock2(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOwner()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | @PostMapping("/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | List<LocDto> locDtos1 = locDtos; |
| | | R r = pakout2(locDtos1); |
| | | if (!r.equals(R.ok())){ |
| | | return r; |
| | | } |
| | | int[][] is=new int[locDtos.size()][2]; |
| | | for (int i=0;i<locDtos.size();i++){ |
| | | LocDto locDto=locDtos.get(locDtos.size()-1-i); |
| | | if (locDto.getLocNo()==null || locDto.getManu().equals("平库")){ |
| | | is[i][0]=1; |
| | | } else { |
| | | }else { |
| | | is[i][0]=0; |
| | | } |
| | | is[i][1]=locDtos.size()-1-i; |
| | |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locDtos)) { |
| | | return R.ok(); |
| | | return R.ok("立库参数为空,请生成拣货单,平库拣货出库"); |
| | | } |
| | | boolean lack = true; |
| | | for (LocDto locDto : locDtos) { |
| | |
| | | } |
| | | } |
| | | if (lack) { |
| | | return R.ok(""); |
| | | return R.error("库存不足"); |
| | | } |
| | | |
| | | Thread.sleep(1000L); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | public synchronized R pakout2(List<LocDto> locDtos) throws InterruptedException { |
| | | @PostMapping("/out/pakout2/auth") |
| | | @ManagerAuth(memo = "生成拣货单") |
| | | public synchronized R pakout2(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | int[][] is = new int[locDtos.size()][2]; |
| | | List<String> matnrs=new ArrayList<>(); |
| | | for (int i = 0; i < locDtos.size(); i++) { |