| | |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, TaskDto taskDto, Long userId) { |
| | | Date now = new Date(); |
| | | taskDto.sortLocDtos(); |
| | | List<LocDto> locDtos = taskDto.getLocDtos(); |
| | | for (LocDto locDto : locDtos) { |
| | | if (!taskDto.getLocNo().equals(locDto.getLocNo()) && !taskDto.getStaNo().equals(locDto.getStaNo())) { |
| | |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | if (locDto.getAnfme()==null) { continue; } |
| | | LocDetl locDetl = locDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch(), locDto.getContainerCode()); |
| | | if (locDetl == null || locDetl.getAnfme() < locDto.getAnfme()) { |
| | | throw new CoolException(locDto.getLocNo() + "库位中" + locDto.getMatnr() + "商品库存不足!"); |
| | |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setBatch(locDto.getBatch()); |
| | | wrkDetl.setOrderNo(locDto.getOrderNo()); |
| | | wrkDetl.setAnfme(locDto.getAnfme()); // 数量 |
| | | wrkDetl.setAnfme(locDto.getAnfme()); // 作业数量 |
| | | wrkDetl.setStock(locDto.getStock()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | |
| | | }); |
| | | } |
| | | |
| | | if (locDto.getAnfme() > 0) { |
| | | // 修改订单明细 |
| | | if (!BaseController.isJSON(locDto.getOrderNo())) { |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch(),locDto.getCsocode(),locDto.getIsoseq()); |
| | |
| | | throw new CoolException("修改订单明细数量失败"); |
| | | } |
| | | orderService.updateSettle(orderDetl.getOrderId(), 2L, userId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private void generateAgvWaitpakin(WrkDetl wrkDetl){ |
| | | if (wrkDetl.getAnfme() <= 0D) { |
| | | return; |
| | | } |
| | | |
| | | String orderNo = wrkDetl.getOrderNo(); |
| | | if(orderNo.contains("{")){ |
| | | JSONArray orderArray = JSON.parseArray(orderNo); |