Merge branch 'master-fwq-积分抵扣现金' into master-prod-new
| | |
| | | private String payMethodName; |
| | | /**支付方式的退款金额*/ |
| | | private BigDecimal refundMoney; |
| | | /**支付方式的退款抵扣值*/ |
| | | private BigDecimal refundDeductionTotal; |
| | | } |
| | |
| | | private BigDecimal totalPoints; |
| | | /**非必填 折扣(单位:百分比) 必填,默认100,不传后台默认100*/ |
| | | private BigDecimal discount; |
| | | /**抵扣现金金额*/ |
| | | private BigDecimal cash = BigDecimal.ZERO; |
| | | /**抵扣现金金额需要支付的积分*/ |
| | | private BigDecimal integralCash = BigDecimal.ZERO; |
| | | /**必填 购买数量 必填,默认0*/ |
| | | private Integer buyNum; |
| | | /**必填 项目id/商品id/套餐标识/其他标识(公用标识) 必填*/ |
| | |
| | | private Integer refundNum; |
| | | /** 实退金额 (客户填写)*/ |
| | | private BigDecimal refundMoney; |
| | | /** 实退抵扣值(积分,前端根据填写的实退金额(抵扣金额)填写换算) */ |
| | | private BigDecimal refundDeductTotal; |
| | | |
| | | /** 退款原因(员工) */ |
| | | private String remarks; |
| | | /** 退款原因(用户) */ |
| | |
| | | private BigDecimal approveRefundTotal = BigDecimal.ZERO; |
| | | /** 可退总积分(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundIntegral = BigDecimal.ZERO; |
| | | /** 可退总抵扣现金金额(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundDeductTotal = BigDecimal.ZERO; |
| | | /** 可退总抵扣积分(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundDeductIntegral = BigDecimal.ZERO; |
| | | |
| | | |
| | | |
| | | /**分配可退金额*/ |
| | | private List<OrderPayMethodDto> refundPayMethodList; |
| | | |
| | | /** 平摊积分(用于系统返回参数计算)*/ |
| | | private BigDecimal averageIntegral = BigDecimal.ZERO; |
| | | /** 平摊的抵扣现金(用于系统返回参数计算)*/ |
| | | private BigDecimal averageDeductAmount = BigDecimal.ZERO; |
| | | /** 平摊的抵扣积分(用于系统返回参数计算)*/ |
| | | private BigDecimal averageDeductIntegral = BigDecimal.ZERO; |
| | | |
| | | } |
| | |
| | | private BigDecimal approveRefundTotal = BigDecimal.ZERO; |
| | | /** 可退总积分(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundIntegral = BigDecimal.ZERO; |
| | | /** 可退总抵扣现金金额(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundDeductTotal = BigDecimal.ZERO; |
| | | /** 可退总抵扣积分(用于系统返回参数计算)*/ |
| | | private BigDecimal approveRefundDeductIntegral = BigDecimal.ZERO; |
| | | |
| | | |
| | | /**分配可退金额*/ |
| | | private List<OrderPayMethodDto> refundPayMethodList; |
| | | |
| | | /** 平摊积分(用于系统返回参数计算)*/ |
| | | private BigDecimal averageIntegral = BigDecimal.ZERO; |
| | | /** 平摊的抵扣现金(用于系统返回参数计算)*/ |
| | | private BigDecimal averageDeductAmount = BigDecimal.ZERO; |
| | | /** 平摊的抵扣积分(用于系统返回参数计算)*/ |
| | | private BigDecimal averageDeductIntegral = BigDecimal.ZERO; |
| | | |
| | | } |
| | |
| | | /**是否划扣计算:0否1是*/ |
| | | private Integer isExecute; |
| | | |
| | | /** 抵扣类型 */ |
| | | private String deductionType; |
| | | /** 抵扣退款总值(积分) */ |
| | | private BigDecimal refundDeductionTotal; |
| | | |
| | | /** 转换方式编码 (实际退款方式编码) */ |
| | | private String refundNumberNo; |
| | | /** 转换方式名称 (实际退款方式编码)*/ |
| | | private String refundNumberName; |
| | | /** 转换实退金额 (实际退款金额)*/ |
| | | private BigDecimal money; |
| | | /** 转换实退抵扣值 (实际退款积分)*/ |
| | | private BigDecimal deductionTotal; |
| | | |
| | | /** 备注 */ |
| | | private String remarks; |
| | |
| | | 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 refundTotal; |
| | | /** 选择退款总金额(额外数据),parameterVerification方法校验的时候赋值 */ |
| | | private BigDecimal refundIntegral; |
| | | |
| | | /** 可退款被积分抵扣的现金数量,parameterVerification方法校验的时候赋值 */ |
| | | private BigDecimal totalDeductAmount; |
| | | /** 可退款抵扣现金的积分数量,parameterVerification方法校验的时候赋值 */ |
| | | private BigDecimal totalDeductIntegral; |
| | | /** 填写的退款被积分抵扣的现金数量,parameterVerification方法校验的时候赋值 */ |
| | | private BigDecimal refundDeductAmount; |
| | | /** 填写的退款抵扣现金的积分数量,parameterVerification方法校验的时候赋值 */ |
| | | private BigDecimal refundDeductIntegral; |
| | | |
| | | /** 可退款方式集合 */ |
| | | private List<OrderPayMethodDto> payMethodList; |
| | | /** 可退款优惠券信息集合 */ |
| | |
| | | |
| | | //支付总金额 必填 |
| | | private BigDecimal paymentTotal; |
| | | //支付抵扣金额 必填 |
| | | private BigDecimal paymentDeductionTotal; |
| | | // 支付方式编号 必填 |
| | | private String paymentNumberNo; |
| | | //支付方式名称 必填 |
| | |
| | | private BigDecimal amount; |
| | | /**必填 支付方式*/ |
| | | private String method; |
| | | /**必填 抵扣实际支付的金额 如果是积分抵扣现金这里存的是要支付的积分*/ |
| | | private BigDecimal deductionAmount = BigDecimal.ZERO; |
| | | |
| | | /**非必填 商品/项目id/组合项标识(卡项支付时必传组合项标识)*/ |
| | | private String commonId; |
| | |
| | | import com.hz.his.dto.PageDto; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author fwq |
| | | * 项目扩展 |
| | |
| | | public class ProjectDto extends PageDto { |
| | | /**更新时间*/ |
| | | private String editTime; |
| | | |
| | | /**sku标识*/ |
| | | private List<String> skuIdList; |
| | | /**平台appId*/ |
| | | private String appId; |
| | | /**价格查询 最小价格 最大价格*/ |
| | | private String minPrice; |
| | | private String maxPrice; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/project/list/by/type") |
| | | Result getProjectByTypeId(@RequestBody ProjectDto projectDto); |
| | | Result getProjectByTypeId(@RequestBody ProjectDto projectDto); |
| | | |
| | | /**查询项目积分抵扣现金的比例*/ |
| | | @PostMapping(value = "/project/integral/cash/rate") |
| | | Result getIntegralCashRate(@RequestBody ProjectDto projectDto); |
| | | } |
| | |
| | | private String payMethodName; |
| | | /** 可退支付金额 */ |
| | | private BigDecimal payTotal; |
| | | /** 可退支付金额 -抵扣金额*/ |
| | | private BigDecimal payDeductionTotal; |
| | | /**是否现金支付 0否1是*/ |
| | | private Integer isMoneyPay; |
| | | /**是否划扣计算:0否1是*/ |
| | |
| | | private String refundMethodName; |
| | | /** 转换实退金额 (实际退款金额)*/ |
| | | private BigDecimal refundTotal; |
| | | /** 转换实退金额 (实际退款金额-抵扣金额)*/ |
| | | private BigDecimal refundDeductionTotal; |
| | | /**转换是否现金支付 0否1是*/ |
| | | private Integer isMoneyPayRefund; |
| | | /**转换是否划扣计算:0否1是*/ |
| | |
| | | private BigDecimal approveRefundTotal = BigDecimal.ZERO; |
| | | /** 可退总积分*/ |
| | | private BigDecimal approveRefundIntegral = BigDecimal.ZERO; |
| | | /** 可退 抵扣现金的积分*/ |
| | | private BigDecimal approveIntegralDeduction = BigDecimal.ZERO; |
| | | /** 可退积分抵扣的现金*/ |
| | | private BigDecimal approveIntegralCash = BigDecimal.ZERO; |
| | | /**分配金额*/ |
| | | private BigDecimal occupyRefundTotal = BigDecimal.ZERO; |
| | | /**分配积分*/ |
| | | private BigDecimal occupyRefundIntegral = BigDecimal.ZERO; |
| | | /**分配抵扣现金的积分*/ |
| | | private BigDecimal occupyRefundIntegralDeduction = BigDecimal.ZERO; |
| | | /**分配积分抵扣的现金*/ |
| | | private BigDecimal occupyRefundIntegralCash = BigDecimal.ZERO; |
| | | |
| | | } |
| | |
| | | private BigDecimal approveRefundTotal = BigDecimal.ZERO; |
| | | /** 可退总积分*/ |
| | | private BigDecimal approveRefundIntegral = BigDecimal.ZERO; |
| | | /** 可退总抵扣现金的积分*/ |
| | | private BigDecimal approveIntegralDeduction = BigDecimal.ZERO; |
| | | /** 可退总积分抵扣的现金*/ |
| | | private BigDecimal approveIntegralCash = BigDecimal.ZERO; |
| | | |
| | | |
| | | /**分配金额*/ |
| | | private BigDecimal occupyRefundTotal = BigDecimal.ZERO; |
| | | /**分配积分*/ |
| | | private BigDecimal occupyRefundIntegral = BigDecimal.ZERO; |
| | | |
| | | /**分配抵扣现金的积分*/ |
| | | private BigDecimal occupyIntegralDeduction = BigDecimal.ZERO; |
| | | /**分配积分抵扣的金额*/ |
| | | private BigDecimal occupyIntegralCash = BigDecimal.ZERO; |
| | | |
| | | } |
| | |
| | | private BigDecimal approveRefundTotal = BigDecimal.ZERO; |
| | | /**系统计算赋值-可退总积分*/ |
| | | private BigDecimal approveRefundIntegral = BigDecimal.ZERO; |
| | | /**系统计算赋值-可退抵扣现金的积分*/ |
| | | private BigDecimal approveIntegralDeduction = BigDecimal.ZERO; |
| | | /**系统计算赋值-可退积分抵扣的现金*/ |
| | | private BigDecimal approveIntegralCash = BigDecimal.ZERO; |
| | | |
| | | /**系统计算赋值-分配金额*/ |
| | | private BigDecimal occupyRefundTotal = BigDecimal.ZERO; |
| | | /**系统计算赋值-分配积分*/ |
| | | private BigDecimal occupyRefundIntegral = BigDecimal.ZERO; |
| | | /**系统计算赋值-分配抵扣现金的积分*/ |
| | | private BigDecimal occupyRefundIntegralDeduction = BigDecimal.ZERO; |
| | | /**系统计算赋值-分配积分抵扣的现金*/ |
| | | private BigDecimal occupyRefundIntegralCash = BigDecimal.ZERO; |
| | | |
| | | /**系统计算赋值-退款金额*/ |
| | | private BigDecimal refundTotal = BigDecimal.ZERO; |
| | | /**系统计算赋值-退款积分*/ |
| | | private BigDecimal refundIntegral = BigDecimal.ZERO; |
| | | /**系统计算赋值-退款抵扣的现金的积分*/ |
| | | private BigDecimal refundIntegralDeduction = BigDecimal.ZERO; |
| | | /**系统计算赋值-退款积分抵扣的现金*/ |
| | | private BigDecimal refundIntegralCash = BigDecimal.ZERO; |
| | | |
| | | /**操作类型-系统*/ |
| | | public static final String OP_TYPE_SYSTEM = "system"; |
New file |
| | |
| | | package com.hz.his.vo.project; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 积分抵扣现金配置 |
| | | */ |
| | | @Data |
| | | public class IntegralCashVo { |
| | | /**积分抵扣现金支付方式编号*/ |
| | | private String payNo; |
| | | /**积分*/ |
| | | private BigDecimal integral = BigDecimal.ZERO; |
| | | /**现金*/ |
| | | private BigDecimal cash = BigDecimal.ZERO; |
| | | /**默认比例*/ |
| | | private BigDecimal rate = BigDecimal.ZERO; |
| | | /**是否启用*/ |
| | | private Integer isUp; |
| | | /**是否全平台可用,如果这个值为0,则只有限制平台表limit_common的平台能使用【积分抵扣现金】支付方式*/ |
| | | private Integer isAllPlatform; |
| | | /**是否设置全部项目抵扣,如果这个值为0,默认的抵扣比例就是0,如果值为1,则使用设置的默认比例*/ |
| | | private Integer isNoLimit; |
| | | /**是否有限制项目,如果这个值为1,则限制项目表integral_cash_project的项目使用各自设置的比例*/ |
| | | private Integer isHaveProjectLimit; |
| | | |
| | | /**每个SKU的最大抵扣比例*/ |
| | | private Map<String,BigDecimal> skuMaxRateMap; |
| | | |
| | | } |
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; |
| | | /**子单现价x数量算出的总金额*/ |
| | | private BigDecimal skuPrice = BigDecimal.ZERO; |
| | | /**子单可抵扣最大现金金额*/ |
| | | private BigDecimal skuMaxCash = BigDecimal.ZERO; |
| | | |
| | | /**剩余可分配*/ |
| | | private BigDecimal cash = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 计算抵扣金额 |
| | | * */ |
| | | public void handlerMoney() { |
| | | //计算子单最大可抵扣 |
| | | this.skuMaxCash = this.maxCash.multiply(new BigDecimal(this.buyNum)); |
| | | //默认赋值cash |
| | | handlerCash(BigDecimal.ZERO); |
| | | } |
| | | |
| | | /**计算数量*/ |
| | | 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); |
| | | } |
| | | } |