| | |
| | | private BigDecimal totalPoints; |
| | | /**非必填 折扣(单位:百分比) 必填,默认100,不传后台默认100*/ |
| | | private BigDecimal discount; |
| | | /**抵扣现金金额*/ |
| | | private BigDecimal cash = BigDecimal.ZERO; |
| | | /**抵扣现金金额需要支付的积分*/ |
| | | private BigDecimal integralCash = BigDecimal.ZERO; |
| | | /**必填 购买数量 必填,默认0*/ |
| | | private Integer buyNum; |
| | | /**必填 项目id/商品id/套餐标识/其他标识(公用标识) 必填*/ |
| | |
| | | /**是否划扣计算:0否1是*/ |
| | | private Integer isExecute; |
| | | |
| | | /** 抵扣类型 */ |
| | | private String deductionType; |
| | | /** 抵扣退款总值(积分) */ |
| | | private BigDecimal refundDeductionTotal; |
| | | |
| | | /** 转换方式编码 (实际退款方式编码) */ |
| | | private String refundNumberNo; |
| | | /** 转换方式名称 (实际退款方式编码)*/ |
| | |
| | | public OrderPayMethodDto() { |
| | | } |
| | | |
| | | public OrderPayMethodDto(String payMethodNo, String payMethodName, BigDecimal payTotal,Integer isMoneyPay,Integer isExecute) { |
| | | // public OrderPayMethodDto(String payMethodNo, String payMethodName, BigDecimal payTotal,Integer isMoneyPay,Integer isExecute) { |
| | | // this.payMethodNo = payMethodNo; |
| | | // this.payMethodName = payMethodName; |
| | | // this.payTotal = payTotal; |
| | | // this.isMoneyPay = isMoneyPay; |
| | | // this.isExecute = isExecute; |
| | | // } |
| | | |
| | | public OrderPayMethodDto(String payMethodNo, String payMethodName, BigDecimal payTotal |
| | | , Integer isMoneyPay, Integer isExecute, String deductionType, BigDecimal refundDeductionTotal) { |
| | | this.payMethodNo = payMethodNo; |
| | | this.payMethodName = payMethodName; |
| | | this.payTotal = payTotal; |
| | | this.isMoneyPay = isMoneyPay; |
| | | this.isExecute = isExecute; |
| | | this.deductionType = deductionType; |
| | | this.refundDeductionTotal = refundDeductionTotal; |
| | | } |
| | | } |
| | |
| | | private BigDecimal amount; |
| | | /**必填 支付方式*/ |
| | | private String method; |
| | | /**必填 抵扣实际支付的金额 如果是积分抵扣现金这里存的是要支付的积分*/ |
| | | private BigDecimal deductionAmount = BigDecimal.ZERO; |
| | | |
| | | /**非必填 商品/项目id/组合项标识(卡项支付时必传组合项标识)*/ |
| | | private String commonId; |
New file |
| | |
| | | package com.hz.his.vo.project; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | /** |
| | | * SKU抵扣数据 |
| | | */ |
| | | @Data |
| | | public class SkuDeductionVo { |
| | | /**sku标识*/ |
| | | private String skuId; |
| | | /**sku最大可抵扣现金金额*/ |
| | | private BigDecimal maxCash = BigDecimal.ZERO; |
| | | /**sku抵扣最大现金金额需要支付的积分*/ |
| | | private BigDecimal maxIntegralCash = BigDecimal.ZERO; |
| | | |
| | | /**总单购买项目数量*/ |
| | | private Integer totalBuyNum = 0; |
| | | /**项目数量占总单比*/ |
| | | private BigDecimal skuNumRate = BigDecimal.ZERO; |
| | | /**子单购买数量*/ |
| | | private Integer buyNum = 0; |
| | | /**子单现价总需要支付的金额*/ |
| | | private BigDecimal skuPrice = BigDecimal.ZERO; |
| | | /**子单分摊系统金额(储值金+增值金)*/ |
| | | private BigDecimal skuSystemPrice = BigDecimal.ZERO; |
| | | /**子单优惠金额*/ |
| | | private BigDecimal skuDiscountPrice = BigDecimal.ZERO; |
| | | /**子单剩余还需支付的金额*/ |
| | | private BigDecimal skuRemainingPrice = BigDecimal.ZERO; |
| | | /**子单可抵扣最大现金金额*/ |
| | | private BigDecimal skuMaxCash = BigDecimal.ZERO; |
| | | |
| | | /**剩余可分配*/ |
| | | private BigDecimal cash = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 计算抵扣金额 |
| | | * */ |
| | | public void handlerMoney() { |
| | | //计算剩余还要支付的金额 |
| | | this.skuRemainingPrice = this.skuPrice.subtract(this.skuSystemPrice).subtract(this.skuDiscountPrice).setScale(2, RoundingMode.HALF_UP); |
| | | //计算子单最大可抵扣 |
| | | this.skuMaxCash = this.maxCash.multiply(new BigDecimal(this.buyNum)); |
| | | //如果Sku本身计算的最大抵扣现金 大于 剩余要支付的现金,取剩余要支付的现金 |
| | | if (this.skuMaxCash.compareTo(this.skuRemainingPrice) > 0){ |
| | | this.skuMaxCash = this.skuRemainingPrice; |
| | | } |
| | | } |
| | | |
| | | /**计算数量*/ |
| | | public void handlerNum(Integer totalBuyNum) { |
| | | this.totalBuyNum = totalBuyNum; |
| | | if (totalBuyNum != 0){ |
| | | this.skuNumRate = new BigDecimal(this.buyNum).divide(new BigDecimal(this.totalBuyNum),2,RoundingMode.HALF_UP); |
| | | } |
| | | } |
| | | |
| | | /**计算数量*/ |
| | | public void handlerCash(BigDecimal totalMoney) { |
| | | this.cash = this.skuMaxCash.subtract(totalMoney).setScale(2,RoundingMode.HALF_UP); |
| | | } |
| | | } |