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

Merge branch 'holiday-price' into dev

parents 9516871e fc72588d
......@@ -81,4 +81,9 @@ public class InProgressVO {
* 延期 详情列表
*/
List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList();
/**
* 违约金 费用详情列表
*/
List<VMCalendarPriceCostDTO> violateAmountList = CollUtil.newArrayList();
}
package com.xxfc.platform.order.pojo.price;
import cn.hutool.core.collection.CollUtil;
import com.xxfc.platform.order.pojo.account.OrderAccountDeduction;
import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO;
import lombok.Data;
......@@ -24,6 +25,11 @@ public class CancelStartedVO extends CostDetailExtend {
*/
private Integer usedDayNum = 0;
/**
* 允许使用天数
*/
private Integer ableUsedDayNum = 0;
/**
* 使用金额
*/
......@@ -69,34 +75,17 @@ public class CancelStartedVO extends CostDetailExtend {
*/
private BigDecimal damagesAmount = BigDecimal.ZERO;
private List<OrderAccountDeduction> deductionList = CollUtil.newArrayList();
/**
* 延期 详情列表
*/
List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList();
//标记是否单价一样
private Integer sameUseUnitPrice = 1;
//标记是否单价一样
private Integer sameOverUnitPrice = 1;
public void setSameUseUnitPriceFromList(List<VMCalendarPriceCostDTO> useAmountList) {
this.sameUseUnitPrice = judgeSame(useAmountList);
}
public void setSameOverUnitPriceFromList(List<VMCalendarPriceCostDTO> overAmountList) {
this.sameOverUnitPrice = judgeSame(overAmountList);
}
private Integer judgeSame(List<VMCalendarPriceCostDTO> useAmountList) {
BigDecimal tempUnitPrice = null;
for(VMCalendarPriceCostDTO vmcpcd : useAmountList) {
if(null == tempUnitPrice) {
tempUnitPrice = vmcpcd.getPrice();
}else if(!tempUnitPrice.equals(vmcpcd.getPrice())) {
return 0;
}
}
return 1;
}
}
......@@ -42,7 +42,38 @@ public class CostDetailExtend {
/**
* 使用(消耗)详情列表
*/
List<VMCalendarPriceCostDTO> useAmountList = CollUtil.newArrayList();;
List<VMCalendarPriceCostDTO> useAmountList = CollUtil.newArrayList();
/**
* 违约金 费用详情列表
*/
List<VMCalendarPriceCostDTO> violateAmountList = CollUtil.newArrayList();
//标记是否单价一样
private Integer sameUseUnitPrice = 1;
//标记是否单价一样
private Integer sameViolateUnitPrice = 1;
public void setSameUseUnitPriceFromList(List<VMCalendarPriceCostDTO> useAmountList) {
this.sameUseUnitPrice = judgeSame(useAmountList);
}
public void setSameViolateUnitPriceFromList(List<VMCalendarPriceCostDTO> violateAmountList) {
this.sameViolateUnitPrice = judgeSame(violateAmountList);
}
protected Integer judgeSame(List<VMCalendarPriceCostDTO> useAmountList) {
BigDecimal tempUnitPrice = null;
for(VMCalendarPriceCostDTO vmcpcd : useAmountList) {
if(null == tempUnitPrice) {
tempUnitPrice = vmcpcd.getPrice();
}else if(!tempUnitPrice.equals(vmcpcd.getPrice())) {
return 0;
}
}
return 1;
}
public void initParamJson() {
paramJson = JSONUtil.toJsonStr(this);
......
......@@ -483,6 +483,8 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
csv.setUsedfreeDayNum(inProgressVO.getUsedfreeDays());
csv.setUsedFreeAmount(inProgressVO.getUsedFreeDaysAmount());
csv.setHadConpon((StrUtil.isNotBlank(orderMQDTO.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE));
csv.setAbleUsedDayNum(inProgressVO.getUseAmountList().size());
csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList());
csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList());
csv.setUseAmountList(inProgressVO.getUseAmountList());
......@@ -499,6 +501,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
csv.setDeductionList(oad.getDeductions());
csv.initParamJson();
//设置明细
orderRentVehicleBiz.updateSelectiveByIdRe(new OrderRentVehicleDetail(){{
......
......@@ -214,6 +214,7 @@ public class OrderCalculateBiz {
residueAmount = BigDecimal.ZERO;
for(int i = useDays; i < (useDays + residueDays); i++) {
residueAmount = residueAmount.add(vmcpds.get(i).getPrice());
inProgressVO.getViolateAmountList().add(vmcpds.get(i));
}
violateDesc += StrUtil.format("(封顶{}元)", residueAmount);
}
......@@ -240,6 +241,8 @@ public class OrderCalculateBiz {
inProgressVO.setViolateAmount(overAmount);
inProgressVO.setViolateDesc(" 延期还车违约金:"+ violateDesc);
inProgressVO.setOverAmountList(overAmountList);
inProgressVO.setViolateAmountList(overAmountList);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction);
}
......
......@@ -175,6 +175,8 @@ public class OrderCancelBiz {
csv.setHadConpon((StrUtil.isNotBlank(baseOrder.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE));
csv.setViolateAmount(BigDecimal.ZERO);
csv.setViolateDesc("");
csv.setAbleUsedDayNum(inProgressVO.getUseAmountList().size());
csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList());
csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList());
csv.setUseAmountList(inProgressVO.getUseAmountList());
......@@ -194,6 +196,8 @@ public class OrderCancelBiz {
baseOrder.setViolateAmount(csv.getViolateAmount());
baseOrder.setExtraAmount(inProgressVO.getExtraAmount());
//最后设置DeductionList
csv.setDeductionList(oad.getDeductions());
csv.initParamJson();
//orderTemplateBiz.handleCostDetailExtend(csv);
orvd.handelCostDetailExtend(csv);
......@@ -226,6 +230,10 @@ public class OrderCancelBiz {
CancelNoStartVO cnsv = new CancelNoStartVO(){{
setViolateAmount(deduction.getAmount());
setViolateDesc(deduction.getName());
//设置违约金日期费用列表
setViolateAmountList(vehicleItemDTO.getVehicleDetail());
setSameViolateUnitPriceFromList(vehicleItemDTO.getVehicleDetail());
}};
//设置订单数据
......
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