| | |
| | | getSumValue(paymentItems, ErpFinancePaymentItemDO::getPaymentPrice, BigDecimal::add, BigDecimal.ZERO) |
| | | .subtract(createReqVO.getDiscountPrice()), null); |
| | | // 1.7 生成付款单号,并校验唯一性 |
| | | String no = noRedisDAO.generate(ErpNoRedisDAO.FINANCE_PAYMENT_NO_PREFIX); |
| | | if (financePaymentMapper.selectByNo(no) != null) { |
| | | throw exception(FINANCE_PAYMENT_NO_EXISTS); |
| | | } |
| | | String no = noRedisDAO.generate(ErpNoRedisDAO.FINANCE_PAYMENT_NO_PREFIX, |
| | | candidate -> financePaymentMapper.selectByNo(candidate) != null); |
| | | |
| | | // 2.1 插入付款单 |
| | | ErpFinancePaymentDO payment = BeanUtils.toBean(createReqVO, ErpFinancePaymentDO.class, in -> in |
| | |
| | | } |
| | | |
| | | // 2.1 生成付款单号 |
| | | String no = noRedisDAO.generate(ErpNoRedisDAO.FINANCE_PAYMENT_NO_PREFIX); |
| | | if (financePaymentMapper.selectByNo(no) != null) { |
| | | throw exception(FINANCE_PAYMENT_NO_EXISTS); |
| | | } |
| | | String no = noRedisDAO.generate(ErpNoRedisDAO.FINANCE_PAYMENT_NO_PREFIX, |
| | | candidate -> financePaymentMapper.selectByNo(candidate) != null); |
| | | // 2.2 金额按负数入账 |
| | | BigDecimal negativeAmount = reqDTO.getRefundAmount().negate(); |
| | | ErpFinancePaymentDO payment = new ErpFinancePaymentDO() |