| | |
| | | |
| | | int result; |
| | | Long salesLedgerId = salesLedgerProduct.getSalesLedgerId(); |
| | | salesLedgerProduct.setSingleQuantity(normalizeSingleQuantity(salesLedgerProduct.getSingleQuantity())); |
| | | if (salesLedgerProduct.getId() == null) { |
| | | salesLedgerProduct.setRegisterDate(LocalDateTime.now()); |
| | | result = salesLedgerProductMapper.insert(salesLedgerProduct); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private BigDecimal normalizeSingleQuantity(BigDecimal singleQuantity) { |
| | | if (singleQuantity == null || singleQuantity.compareTo(BigDecimal.ZERO) <= 0) { |
| | | return BigDecimal.ONE; |
| | | } |
| | | return singleQuantity; |
| | | } |
| | | |
| | | private String generateNextPlanNo(String datePrefix) { |
| | | QueryWrapper<ProductionPlan> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.likeRight("mps_no", "JH" + datePrefix); |