| | |
| | | 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++) { |
| | |
| | | ManLocDetl manLocDetl = manLocDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | if (!Cools.isEmpty(manLocDetl) && !(locDto.getAnfme()>manLocDetl.getAnfme())) { |
| | | manLocDetl.setStatus(0); |
| | | if (manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>().eq("uuid", manLocDetl.getUuid()))) { |
| | | if (manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>().eq("loc_no", manLocDetl.getLocNo()).eq("matnr",manLocDetl.getMatnr()))) { |
| | | if (addPakOUT(locDto,uuid).equals(R.ok())) { |
| | | Order order = orderService.selectByNo(locDto.getOrderNo()); |
| | | if (Cools.isEmpty(order)){ |
| | |
| | | manPakOut.setMatnr(locDto.getMatnr()); |
| | | manPakOut.setMaktx(locDto.getMaktx()); |
| | | manPakOut.setDocNum(locDto.getOrderNo()); |
| | | manPakOut.setCount(0); |
| | | manPakOut.setCount(0.0); |
| | | manPakOut.setStatus(0); |
| | | manPakOut.setCreateTime(new Date()); |
| | | manPakOut.setBatch(locDto.getBatch()); |