| | |
| | | if (issued <= 0.0D) { continue; } |
| | | issued = locDetlService.queryStockAndSetLocDto1(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued,orderDetl.getProcessSts()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtoList.add(locDto); |
| | | } |
| | |
| | | //issued = manLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | |
| | | //先找AGV的库存,如果返回的issued大于0,则去四项库找 |
| | | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime(),null); |
| | | |
| | | //从四项库的库存里面找, |
| | | //issued = locDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued,orderDetl.getProcessSts()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtoList.add(locDto); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | return R.ok().add(locDtoList); |
| | | |
| | | } |
| | | |
| | | //出库 |
| | | @PostMapping("/bcp/out/pakout/preview/auth") |
| | | @ManagerAuth |
| | | public R bcpPakoutPreview(@RequestBody List<Long> ids) { |
| | | |
| | | List<OrderDetl> orderDetlList = orderDetlService.selectBatchIds(ids); |
| | | //返回给前端的库位以及站点信息 |
| | | List<LocDto> locDtoList = new ArrayList<>(); |
| | | |
| | | for (OrderDetl orderDetl : orderDetlList) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); |
| | | Order order = orderService.selectByNo(orderDetl.getOrderNo()); |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if("人工补货单".equals(docType.getDocName())){ |
| | | if (issued <= 0.0D) { continue; } |
| | | issued = locDetlService.queryStockAndSetLocDto1(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued,orderDetl.getProcessSts()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtoList.add(locDto); |
| | | } |
| | | }else { |
| | | if (issued <= 0.0D) { continue; } |
| | | |
| | | //从平库寻找 |
| | | //issued = manLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | |
| | | //先找AGV的库存,如果返回的issued大于0,则去四项库找 |
| | | issued = agvLocDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime(),"bcp"); |
| | | |
| | | //从四项库的库存里面找, |
| | | //issued = locDetlService.queryStockAndSetLocDto(orderDetl.getMatnr(),orderDetl.getBatch(),orderDetl.getOrderNo(),locDtoList,issued,orderDetl.getThreeCode(),orderDetl.getDeadTime()); |
| | | |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued,orderDetl.getProcessSts()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtoList.add(locDto); |
| | | } |
| | |
| | | @Synchronized |
| | | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | |
| | | for (LocDto locDto : locDtos) { |
| | | if (locDto.getAnfme() == 0) { |
| | | return R.error(locDto.getMatnr()+":出库数量为0"); |
| | | } |
| | | } |
| | | //判断是否可以生成出库工作档 |
| | | boolean lack = true; |
| | | for (LocDto locDto : locDtos) { |
| | |
| | | if(!staNoList.contains(locDto.getAgvStaNo())){ |
| | | return R.error(locDto.getAgvStaNo()+"该站点已有出库任务,无法选择该站点出库"); |
| | | } |
| | | |
| | | } |
| | | //如果所有库都没有库存,则返回 |
| | | for (LocDto locDto : locDtos) { |
| | |
| | | continue; |
| | | } |
| | | //先找AGV的库存,如果返回的issued大于0,则去四项库找 |
| | | issued = agvLocDetlService.queryStockAndSetLocDto(vo.getMatnr(),vo.getBatch(),JSON.toJSONString(vo.getOrderDtos()),locDtoList,issued, vo.getCsocode(), vo.getIsoseq()); |
| | | issued = agvLocDetlService.queryStockAndSetLocDto(vo.getMatnr(),vo.getBatch(),JSON.toJSONString(vo.getOrderDtos()),locDtoList,issued, vo.getCsocode(), vo.getIsoseq(),null); |
| | | //从四项库的库存里面找, |
| | | issued = locDetlService.queryStockAndSetLocDto(vo.getMatnr(),vo.getBatch(),JSON.toJSONString(vo.getOrderDtos()),locDtoList,issued, vo.getCsocode(), vo.getIsoseq()); |
| | | |