| | |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount(),paramLocDetl.getBarcode())) { |
| | | LocDetl one = locDetlService.selectItemCarton(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBarcode()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | wrkDetl.setOrderNo(""); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount(); |
| | |
| | | // 生成工作档明细 |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | Order order = orderService.selectByNo(locDto.getOrderNo()); |
| | | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), locDto.getMatnr(), locDto.getBatch(),locDto.getBarcode()); |
| | | if (orderDetl == null) { |
| | | orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), null); |
| | | orderDetl = orderDetlService.selectItem(order.getId(), locDto.getMatnr(), null,locDto.getBarcode()); |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(orderDetl); |
| | |
| | | throw new CoolException("response.save_work_detail_failed"); |
| | | } |
| | | // 修改订单明细 |
| | | if (!orderDetlService.increaseWorkQty(orderDetl.getOrderId(), orderDetl.getMatnr(), orderDetl.getBatch(), locDto.getAnfme())) { |
| | | if (!orderDetlService.increaseWorkQty(orderDetl.getOrderId(), orderDetl.getMatnr(), orderDetl.getBatch(), locDto.getAnfme(),locDto.getBarcode())) { |
| | | throw new CoolException("response.update_order_detail_qty_failed"); |
| | | } |
| | | orderService.updateSettle(orderDetl.getOrderId(), 2L, userId); |
| | |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount(),paramLocDetl.getBarcode())) { |
| | | LocDetl one = locDetlService.selectItemCarton(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBarcode()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | |
| | | if (!locDetl.getAnfme().equals(adjust.getCount())) { |
| | | // todo 盘点记录 |
| | | // 修改库存 |
| | | if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBarcode())) { |
| | | throw new CoolException("response.update_stock_qty_failed|" + locDetl.getLocNo() + "," + locDetl.getMatnr() + "," + locDetl.getBatch()); |
| | | } |
| | | // 保存调整记录 |
| | |
| | | // 删除库存 |
| | | for (LocDetl locDetl : locDetls) { |
| | | // todo 盘点记录 |
| | | if (!locDetlService.updateAnfme(-1.0D, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(-1.0D, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(),locDetl.getBarcode())) { |
| | | throw new CoolException("response.delete_stock_detail_failed|" + locDetl.getLocNo() + "," + locDetl.getMatnr() + "," + locDetl.getBatch()); |
| | | } |
| | | // 保存调整记录 |