提交代码

master
胡锐 6 months ago
parent 1e22027b94
commit 4586e01e46
  1. 6
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -287,7 +287,7 @@ public class BsOrderServiceImpl implements BsOrderService {
} else if (3 == discount.getType()) {
deduction.setCouponDiscountActualPrice(
order.getTotalPrice()
.multiply(discount.getPrice().divide(new BigDecimal("100")))
.multiply(discount.getPercentage().divide(new BigDecimal("100")))
.setScale(2, BigDecimal.ROUND_DOWN)
);
} else {
@ -298,12 +298,10 @@ public class BsOrderServiceImpl implements BsOrderService {
.add(new BigDecimal(deduction.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100"))));
orderDeductionService.editData(deduction);
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分交易异常");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券使用异常");
} finally {
redisTemplate.delete(key);
}
return deduction;
}

Loading…
Cancel
Save