| | |
| | | ProductionPlan productionPlan = new ProductionPlan(); |
| | | productionPlan.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId()); |
| | | productionPlan.setSalesLedgerProductId(salesLedgerProduct.getId()); |
| | | productionPlan.setMpsNo(generateNextPlanNo(salesLedger.getEntryDate().toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")))); |
| | | productionPlan.setMpsNo(generateNextPlanNo(com.ruoyi.common.utils.DateUtils.toLocalDate(salesLedger.getEntryDate()) |
| | | .format(DateTimeFormatter.ofPattern("yyyyMMdd")))); |
| | | productionPlan.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | | productionPlan.setQtyRequired(salesLedgerProduct.getQuantity()); |
| | | productionPlan.setSource("销售"); |
| | |
| | | BigDecimal remain = stockInventory.getQualitity() |
| | | .subtract(stockInventory.getLockedQuantity()) |
| | | .subtract(required) |
| | | .divide(BigDecimal.ONE, 2, RoundingMode.CEILING); |
| | | .divide(BigDecimal.ONE, 6, RoundingMode.CEILING); |
| | | if (remain.compareTo(BigDecimal.ZERO) < 0) { |
| | | count++; |
| | | stringBuffer.append(structure.getProductName()) |