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

Merge branch 'master-modify-cutAmount' into dev

parents 7a9bc7a3 fc7d3f1c
......@@ -310,12 +310,12 @@ public class OrderRentVehicleDetail implements Serializable {
@Column(name = "fixed_loss_status")
private Integer fixedLossStatus;
// /**
// * 返还的免费天数
// */
// @ApiModelProperty(value = "返回的免费天数")
// @Column(name = "back_free_days")
// Integer backFreeDays;
/**
* 返还的免费天数
*/
@ApiModelProperty(value = "返回的免费天数")
@Column(name = "back_free_days")
Integer backFreeDays;
@ApiModelProperty(value = "违章金额")
@Column(name = "violate_traffic_amount")
......
......@@ -289,9 +289,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
stringBuilder.append(" x ");
stringBuilder.append(noUsedDay);
stringBuilder.append("天) = ");
BigDecimal cost = (inProgressVO.getExtraAmount()).add(inProgressVO.getViolateAmount());
stringBuilder.append(inProgressVO.getViolateAmount());
initDedDetail(dedDetailDTO, OrderViolateEnum.BEFORE.getCode(), cost, stringBuilder);
initDedDetail(dedDetailDTO, OrderViolateEnum.BEFORE.getCode(), inProgressVO.getExtraAmount(), stringBuilder);
}
/**
* 延期还车
......
......@@ -361,26 +361,6 @@ 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)
);
//设置定损金额
String handleDedRefundDesc = "";
handleDedRefundDesc = handleDed(crosstown, handleDedRefundDesc, csv);
......@@ -406,8 +386,42 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
refundDesc += ")";
refundTrigger(orderMQDTO, orderMQDTO.getOrderRentVehicleDetail(), illegalReserve, originalRefundAmount, refundAmont, refundDesc, RefundStatusEnum.RESIDUE_ILLEGAL.getCode(), AccountTypeEnum.OUT_PART_DEPOSIT, oad);
//修改押金退还记录状态
orderDepositRefundRecordBiz.completeRecordStatus(crosstown.getId(), depositRefundRecordStatus);
//返回优惠券和免费天数
//取消租车免费天数使用
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);
}
}
//设置订单参数
BaseOrder updateBaseOrder = new BaseOrder();
updateBaseOrder.setId(orderMQDTO.getId());
//返还优惠券
if(inProgressVO.getBackCoupons().size() > 0) {
//设置订单参数
updateBaseOrder.setBackCoupon(CollUtil.join(inProgressVO.getBackCoupons(), ","));
for(String backCoupon : inProgressVO.getBackCoupons()) {
activityFeign.cancelUse(backCoupon);
}
}
//设置订单参数
updateBaseOrder.setDamagesAmount(csv.getDamagesAmount());
updateBaseOrder.setViolateAmount(csv.getViolateAmount());
updateBaseOrder.setExtraAmount(inProgressVO.getExtraAmount());
baseOrderBiz.updateSelectiveByIdReT(updateBaseOrder, Boolean.TRUE);
//还车扣除款 剩余的 钱,再减去违章预备金
oad.getDeductions().add(
initDeduction(illegalReserve, "违章保证金", DeductionTypeEnum.VIOLATE_TRAFFIC_KEEP, OrderAccountDeduction.ORIGIN_DEPOSIT)
);
//生成额外的费用明细
csv.setConsumeAmount(inProgressVO.getConsumeAmount());
csv.setModelAmount(orderItem.getUnitPrice());
......@@ -432,6 +446,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
orderRentVehicleBiz.updateSelectiveById(new OrderRentVehicleDetail(){{
setId(orderMQDTO.getDetailId());
handelCostDetailExtend(csv);
setBackFreeDays(inProgressVO.getBackFreeDays());
}});
//捕捉异常
......@@ -506,7 +521,4 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
\ No newline at end of file
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