Commit 09cf806b authored by 周健威's avatar 周健威

修改代码

parent 4188859c
...@@ -7,7 +7,7 @@ public enum AccountTypeEnum { ...@@ -7,7 +7,7 @@ public enum AccountTypeEnum {
//账款类型 1*--入账;2*--出账 //账款类型 1*--入账;2*--出账
//账款类型 记帐类型 101--订单支付;201--取消订单退款;202--全部押金退款;203--部分押金退款;204--剩余押金退款 //账款类型 记帐类型 101--订单支付;201--取消订单退款;202--全部押金退款;203--部分押金退款;204--剩余押金退款
IN_ORDER_PAY(101, "订单支付"), IN_ORDER_PAY(101, "订单支付"),
OUT_ORDER_FUND(201, "订单款"), OUT_ORDER_FUND(201, "取消订单退款"),
OUT_DEPOSIT(202, "所有押金"), OUT_DEPOSIT(202, "所有押金"),
OUT_PART_DEPOSIT(203, "部分押金(扣除该扣除的 + 保留违章预备金)"), OUT_PART_DEPOSIT(203, "部分押金(扣除该扣除的 + 保留违章预备金)"),
OUT_RESIDUE_DEPOSIT(204, "剩余押金(扣除该扣除的)"), OUT_RESIDUE_DEPOSIT(204, "剩余押金(扣除该扣除的)"),
......
...@@ -11,7 +11,7 @@ public class InProgressVO { ...@@ -11,7 +11,7 @@ public class InProgressVO {
/** /**
* 违约金 * 违约金
*/ */
BigDecimal ViolateAmount = BigDecimal.ZERO; BigDecimal violateAmount = BigDecimal.ZERO;
/** /**
* 赔偿金 * 赔偿金
...@@ -67,4 +67,6 @@ public class InProgressVO { ...@@ -67,4 +67,6 @@ public class InProgressVO {
String advanceDelayCostDetail = ""; String advanceDelayCostDetail = "";
String violateDesc = "";
} }
...@@ -88,9 +88,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -88,9 +88,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
@Autowired @Autowired
OrderUserLicenseBiz orderUserLicenseBiz; OrderUserLicenseBiz orderUserLicenseBiz;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired @Autowired
OrderItemBiz orderItemBiz; OrderItemBiz orderItemBiz;
......
...@@ -7,9 +7,12 @@ import com.xxfc.platform.activity.feign.ActivityFeign; ...@@ -7,9 +7,12 @@ import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.app.feign.ConfigFeign; import com.xxfc.platform.app.feign.ConfigFeign;
import com.xxfc.platform.order.biz.OrderAccountBiz; import com.xxfc.platform.order.biz.OrderAccountBiz;
import com.xxfc.platform.order.biz.OrderItemBiz; import com.xxfc.platform.order.biz.OrderItemBiz;
import com.xxfc.platform.order.biz.OrderRefundBiz; import com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum;
import com.xxfc.platform.order.contant.enumerate.*; import com.xxfc.platform.order.contant.enumerate.ItemTypeEnum;
import com.xxfc.platform.order.entity.*; import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderItem;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.pojo.account.OrderAccountDeduction; import com.xxfc.platform.order.pojo.account.OrderAccountDeduction;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail; import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import com.xxfc.platform.order.pojo.calculate.InProgressVO; import com.xxfc.platform.order.pojo.calculate.InProgressVO;
...@@ -49,9 +52,6 @@ public class OrderCalculateBiz { ...@@ -49,9 +52,6 @@ public class OrderCalculateBiz {
@Autowired @Autowired
ActivityFeign activityFeign; ActivityFeign activityFeign;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired @Autowired
OrderItemBiz orderItemBiz; OrderItemBiz orderItemBiz;
...@@ -152,6 +152,7 @@ public class OrderCalculateBiz { ...@@ -152,6 +152,7 @@ public class OrderCalculateBiz {
violateDesc += StrUtil.format("(封顶{}元)", orderItem.getUnitPrice().multiply(new BigDecimal((residueDays + "")))); violateDesc += StrUtil.format("(封顶{}元)", orderItem.getUnitPrice().multiply(new BigDecimal((residueDays + ""))));
} }
inProgressVO.setViolateAmount(orderItem.getUnitPrice().multiply(new BigDecimal((residueDays + "")))); inProgressVO.setViolateAmount(orderItem.getUnitPrice().multiply(new BigDecimal((residueDays + ""))));
inProgressVO.setViolateDesc(violateDesc);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_ADVANCE, OrderAccountDeduction.ORIGIN_DEPOSIT); OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_ADVANCE, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction); oad.getDeductions().add(violateDeduction);
}else if(residueDays < 0 && !isCancel){ }else if(residueDays < 0 && !isCancel){
...@@ -167,6 +168,7 @@ public class OrderCalculateBiz { ...@@ -167,6 +168,7 @@ public class OrderCalculateBiz {
// } // }
//超过的天数 * 200% * 单价 //超过的天数 * 200% * 单价
inProgressVO.setViolateAmount(orderItem.getUnitPrice().multiply(new BigDecimal(2+ "")).multiply(new BigDecimal((overDays + "")))); inProgressVO.setViolateAmount(orderItem.getUnitPrice().multiply(new BigDecimal(2+ "")).multiply(new BigDecimal((overDays + ""))));
inProgressVO.setViolateDesc(violateDesc);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT); OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction); oad.getDeductions().add(violateDeduction);
} }
......
...@@ -27,12 +27,13 @@ import org.springframework.beans.BeanUtils; ...@@ -27,12 +27,13 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.universal.constant.DictionaryKey.*; import static com.xxfc.platform.universal.constant.DictionaryKey.*;
...@@ -63,9 +64,6 @@ public class OrderCancelBiz { ...@@ -63,9 +64,6 @@ public class OrderCancelBiz {
@Autowired @Autowired
OrderRentVehicleBiz orderRentVehicleBiz; OrderRentVehicleBiz orderRentVehicleBiz;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired @Autowired
OrderMsgBiz orderMsgBiz; OrderMsgBiz orderMsgBiz;
...@@ -180,6 +178,9 @@ public class OrderCancelBiz { ...@@ -180,6 +178,9 @@ public class OrderCancelBiz {
csv.setUsedfreeDayNum(inProgressVO.getUsedfreeDays()); csv.setUsedfreeDayNum(inProgressVO.getUsedfreeDays());
csv.setUsedFreeAmount(inProgressVO.getUsedFreeDaysAmount()); csv.setUsedFreeAmount(inProgressVO.getUsedFreeDaysAmount());
csv.setHadConpon((StrUtil.isNotBlank(baseOrder.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE)); csv.setHadConpon((StrUtil.isNotBlank(baseOrder.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE));
csv.setViolateAmount(BigDecimal.ZERO);
csv.setViolateDesc("");
//如果有扣款项,则生成额外的费用明细 //如果有扣款项,则生成额外的费用明细
if(oad.getDeductions().size() > 0) { if(oad.getDeductions().size() > 0) {
for(OrderAccountDeduction deduction : oad.getDeductions()) { for(OrderAccountDeduction deduction : oad.getDeductions()) {
......
...@@ -68,9 +68,6 @@ public class OrderMsgBiz { ...@@ -68,9 +68,6 @@ public class OrderMsgBiz {
@Autowired @Autowired
ConfigFeign configFeign; ConfigFeign configFeign;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired @Autowired
OrderAccountBiz orderAccountBiz; OrderAccountBiz orderAccountBiz;
...@@ -283,10 +280,10 @@ public class OrderMsgBiz { ...@@ -283,10 +280,10 @@ public class OrderMsgBiz {
CompanyDetail endCompanyDetail = vehicleFeign.getCompanyDetail(orvd.getEndCompanyId()).getData(); CompanyDetail endCompanyDetail = vehicleFeign.getCompanyDetail(orvd.getEndCompanyId()).getData();
if(null != orvd.getEndCompanyId() && !SYS_FALSE.equals(orvd.getEndCompanyId())) { if(null != orvd.getEndCompanyId() && !SYS_FALSE.equals(orvd.getEndCompanyId())) {
//新的账单 记录 //新的账单 记录 OUT_ORDER_FUND 返回订单款取消订单
OrderAccount orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{ OrderAccount orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
setAccountType(AccountTypeEnum.IN_ORDER_PAY.getCode()); setAccountType(AccountTypeEnum.OUT_ORDER_FUND.getCode());
}}); }});
if(BigDecimal.ZERO.equals(orderAccount.getDeductAmount())) { if(BigDecimal.ZERO.equals(orderAccount.getDeductAmount())) {
...@@ -387,26 +384,26 @@ public class OrderMsgBiz { ...@@ -387,26 +384,26 @@ public class OrderMsgBiz {
BigDecimal refundAmount; BigDecimal refundAmount;
BigDecimal residueAmount; BigDecimal residueAmount;
//查询订单退款记录 //查询订单退款记录
OrderRefund orderRefund; OrderAccount orderAccount;
if(RefundStatusEnum.RESIDUE_ILLEGAL.equals(baseOrder.getRefundStatus())) { if(RefundStatusEnum.RESIDUE_ILLEGAL.equals(baseOrder.getRefundStatus())) {
smstype = SmsTemplateDTO.REFUND_A; smstype = SmsTemplateDTO.REFUND_A;
orderRefund = orderRefundBiz.selectOne(new OrderRefund(){{ orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
setRefundType(RefundTypeEnum.PART_DEPOSIT.getCode()); setAccountType(AccountTypeEnum.OUT_PART_DEPOSIT.getCode());
}}); }});
originalAmount = orvd.getDeposit(); originalAmount = orvd.getDeposit();
violateAmount = orderRefund.getDeductAmount(); violateAmount = orderAccount.getDeductAmount();
refundAmount = orderRefund.getRefundAmount(); refundAmount = orderAccount.getAccountAmount();
residueAmount = orvd.getReturnPayResidue(); residueAmount = orvd.getReturnPayResidue();
}else if(RefundStatusEnum.REFUND_DEPOSIT.equals(baseOrder.getRefundStatus())){ }else if(RefundStatusEnum.REFUND_DEPOSIT.equals(baseOrder.getRefundStatus())){
smstype = SmsTemplateDTO.REFUND_B; smstype = SmsTemplateDTO.REFUND_B;
orderRefund = orderRefundBiz.selectOne(new OrderRefund(){{ orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
setRefundType(RefundTypeEnum.RESIDUE_DEPOSIT.getCode()); setAccountType(AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode());
}}); }});
originalAmount = orderRefund.getOriginalRefundAmount(); originalAmount = orderAccount.getOriginalAmount();
violateAmount = orderRefund.getDeductAmount(); violateAmount = orderAccount.getDeductAmount();
refundAmount = orderRefund.getRefundAmount(); refundAmount = orderAccount.getAccountAmount();
residueAmount = BigDecimal.ZERO; residueAmount = BigDecimal.ZERO;
}else { }else {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, new HashSet<String>() {{ throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, new HashSet<String>() {{
......
...@@ -2,7 +2,6 @@ package com.xxfc.platform.order.jobhandler; ...@@ -2,7 +2,6 @@ package com.xxfc.platform.order.jobhandler;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.google.common.collect.Lists;
import com.xxfc.platform.order.biz.*; import com.xxfc.platform.order.biz.*;
import com.xxfc.platform.order.biz.inner.OrderMsgBiz; import com.xxfc.platform.order.biz.inner.OrderMsgBiz;
import com.xxfc.platform.order.contant.enumerate.*; import com.xxfc.platform.order.contant.enumerate.*;
...@@ -19,7 +18,6 @@ import com.xxl.job.core.biz.model.ReturnT; ...@@ -19,7 +18,6 @@ import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler; import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler; import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger; import com.xxl.job.core.log.XxlJobLogger;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -27,7 +25,6 @@ import tk.mybatis.mapper.entity.Example; ...@@ -27,7 +25,6 @@ import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls; import tk.mybatis.mapper.weekend.WeekendSqls;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -60,9 +57,6 @@ public class RentDepositJobHandler extends IJobHandler { ...@@ -60,9 +57,6 @@ public class RentDepositJobHandler extends IJobHandler {
@Autowired @Autowired
OrderViolationBiz orderViolationBiz; OrderViolationBiz orderViolationBiz;
@Autowired
OrderRefundBiz orderRefundBiz;
@Autowired @Autowired
OrderAccountBiz orderAccountBiz; OrderAccountBiz orderAccountBiz;
......
...@@ -77,6 +77,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe ...@@ -77,6 +77,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
BigDecimal orderRefundAmount = BigDecimal.ZERO; BigDecimal orderRefundAmount = BigDecimal.ZERO;
StringBuilder refundDescBuilder = new StringBuilder(""); StringBuilder refundDescBuilder = new StringBuilder("");
String refundDesc = "";
switch (orderTypeEnum) { switch (orderTypeEnum) {
case RENT_VEHICLE: case RENT_VEHICLE:
......
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