Commit 4124cf12 authored by libin's avatar libin

Merge remote-tracking branch 'origin/dev' into dev

parents 95a3c6b4 4188859c
......@@ -453,9 +453,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
//订单账款类
OrderAccountDetail oad = new OrderAccountDetail();
oad.setOriginOrderAmount(baseOrder.getGoodsAmount());
oad.setOriginOrderAmount(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()));
//账单的的orderAmount 对应 的是商品金额
oad.setOrderAmount(baseOrder.getGoodsAmount());
oad.setOrderAmount(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()));
//如果是会员订单,则触发会员效益
if (OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) {
......
......@@ -111,7 +111,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
BigDecimal refundMainGoodsAmount = originalRefundAmount.subtract(orderDeductAmount);
//退款金额 = 主要商品退款 + (其他商品退款) 即--> 主要商品退款 + (总商品款 - 主要商品款)
oad.setOrderAmount(refundMainGoodsAmount.add(baseOrder.getGoodsAmount().subtract(mainItemRealAmount)));
oad.setOrderAmount(refundMainGoodsAmount.add(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()).subtract(mainItemRealAmount)));
BigDecimal refundAmount = oad.getOrderAmount();
// 押金
......
......@@ -61,8 +61,10 @@ public class OrderCalculateBiz {
public InProgressVO inProgressCalculate(BaseOrder baseOrder, OrderItem orderItem, Integer freeDays, Integer useDays, OrderAccountDetail oad, Boolean isCancel) {
BigDecimal refundAmount = BigDecimal.ZERO;
BigDecimal consumeAmount = BigDecimal.ZERO;
//其他消费金额
BigDecimal otherItemRealAmount = baseOrder.getGoodsAmount().subtract(orderItem.getRealAmount().add(orderItem.getCouponAmount()));
//商品真实价格
BigDecimal goodsRealAmount = baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount());
//其他消费金额 = 商品真实价格 - 主要商品真实价格 = (商品价格 - 优惠价格)- 主要商品真实价格
BigDecimal otherItemRealAmount = goodsRealAmount.subtract(orderItem.getRealAmount());
InProgressVO inProgressVO = new InProgressVO();
inProgressVO.setUsedDays(useDays);
......@@ -119,13 +121,13 @@ public class OrderCalculateBiz {
oad.getDeductions().add(extraDeduction);
}
//消费金额 小于商品的金额 返回钱
if(consumeAmount.compareTo(baseOrder.getGoodsAmount()) <= 0) {
//消费金额 小于商品真实的金额 返回钱
if(consumeAmount.compareTo(goodsRealAmount) <= 0) {
//设置返回钱
refundAmount = refundAmount.add(baseOrder.getGoodsAmount().subtract(consumeAmount));
refundAmount = refundAmount.add(goodsRealAmount.subtract(consumeAmount));
}else {
//设置额外扣减(押金里面扣)
inProgressVO.setExtraAmount(consumeAmount.subtract(baseOrder.getGoodsAmount()));
inProgressVO.setExtraAmount(consumeAmount.subtract(goodsRealAmount));
}
}else {
//设置免费天数
......@@ -133,7 +135,7 @@ public class OrderCalculateBiz {
inProgressVO.setUsedFreeDaysAmount(orderItem.getUnitPrice().multiply(new BigDecimal(useDays+ "")));
//返回剩余免费天数,返回优惠券,订单款
refundAmount = refundAmount.add(baseOrder.getGoodsAmount());
refundAmount = refundAmount.add(goodsRealAmount);
inProgressVO.setBackFreeDays(backFreeDays);
}
......@@ -189,7 +191,7 @@ public class OrderCalculateBiz {
oad.setDepositAmount(orvd.getDeposit().subtract(inProgressVO.getExtraAmount().add(inProgressVO.getViolateAmount())));
oad.setOrderAmount(inProgressVO.getRefundOrderAmount());
oad.setOriginDepositAmount(orvd.getDeposit());
oad.setOriginOrderAmount(baseOrder.getGoodsAmount());
oad.setOriginOrderAmount(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()));
return inProgressVO;
}
}
\ No newline at end of file
......@@ -131,7 +131,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
OrderRefundPriceVO orpv = new OrderRefundPriceVO();
orpv.setRealAmount(orderPageVO.getRealAmount());
orpv.setRefundAmount(orderRefundAmount);
orpv.setRefundDesc(refundDescBuilder.toString());
orpv.setRefundDesc("取消操作可能会产生额外费用,是否确定取消订单");
return ObjectRestResponse.succ(orpv);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment