Commit f16326a1 authored by 周健威's avatar 周健威

Merge branch 'master-modify-cutAmount' into dev

parents 7bff2eb3 82412f0d
package com.xxfc.platform.order.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
......@@ -9,6 +11,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.IntervalUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
import com.xxfc.platform.order.biz.inner.OrderMsgBiz;
import com.xxfc.platform.order.contant.enumerate.*;
......@@ -80,6 +83,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
@Autowired
UserFeign userFeign;
@Autowired
ActivityFeign activityFeign;
/**
* 租车退款流程
......@@ -355,6 +361,21 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
OrderAccountDetail oad = new OrderAccountDetail();
InProgressVO inProgressVO = orderCalculateBiz.calculateOrderComplete(orderMQDTO, orderMQDTO.getOrderRentVehicleDetail(), oad, orderItem, orderMQDTO.getOrderRentVehicleDetail().getUsedDay(), Boolean.FALSE);
//返回优惠券和免费天数
//取消租车免费天数使用
if(inProgressVO.getBackFreeDays() > 0) {
int result = userFeign.memberDays(orderMQDTO.getUserId(), inProgressVO.getBackFreeDays(), UserFeign.MEMBER_DAYS_WITHDRAW);
if(result < 0) {
throw new BaseException(ResultCode.FAILED_CODE);
}
}
//返还优惠券
if(inProgressVO.getBackCoupons().size() > 0) {
for(String backCoupon : inProgressVO.getBackCoupons()) {
activityFeign.cancelUse(backCoupon);
}
}
//还车扣除款 剩余的 钱,再减去违章预备金
oad.getDeductions().add(
initDeduction(illegalReserve, "违章保证金", DeductionTypeEnum.VIOLATE_TRAFFIC_KEEP, OrderAccountDeduction.ORIGIN_DEPOSIT)
......
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