| | |
| | | DocType docType = docTypeService.selectById(param.getDocType()); |
| | | if(!Cools.isEmpty(docType)){ |
| | | prefix = docType.getPakin() == 1 ? "RK" : "CK"; |
| | | status = (prefix == "RK" ? 1 : (prefix == "CK" ? 2 : 0)); |
| | | status = (prefix.equals("RK") ? 1 : (prefix.equals("CK") ? 2 : 0)); |
| | | } |
| | | param.setOrderNo(prefix + snowflakeIdWorker.nextId()); |
| | | } else { |
| | | DocType docType = docTypeService.selectById(param.getDocType()); |
| | | if(!Cools.isEmpty(docType)){ |
| | | status = (docType.getPakin() == 1 ? 1 : 2 ); |
| | | } |
| | | } |
| | | |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | |
| | | totalQty = totalQty + orderDetl.getAnfme(); |
| | | wrkQty = wrkQty + orderDetl.getWorkQty(); |
| | | endQty = endQty + orderDetl.getQty(); |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued > 0.0) { |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | if (!Cools.isEmpty(order.getPakinPakoutStatus$()) && order.getPakinPakoutStatus$().equals("N")){ |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued > 0.0) { |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (issued > 0.0) { |
| | | lackQty = lackQty + issued; |
| | | if (issued > 0.0) { |
| | | lackQty = lackQty + issued; |
| | | } |
| | | } |
| | | } |
| | | // 任务追溯 |