Commit a0cc1a76 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/master-modify-cutAmount' into master-modify-cutAmount

parents 4d948e81 9922fd11
......@@ -11,7 +11,7 @@ public class CancelNoStartVO extends CostDetailExtend{
/**
* 违约金描述
*/
private String violateDesc;
private String violateDesc = "";
/**
* 违约金额
......
package com.xxfc.platform.order.pojo.price;
import cn.hutool.json.JSONUtil;
import lombok.Data;
@Data
......@@ -10,10 +11,20 @@ public class CostDetailExtend {
public static final int FINLISH_ADVANCE = 3;
public static final int FINLISH_DELAY = 4;
private String costDetail;
private String costDetail = "";
/**
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细
*/
protected Integer type;
/**
* 参数json
*/
public String paramJson = "";
public void initParamJson() {
paramJson = JSONUtil.toJsonStr(this);
}
}
......@@ -8,31 +8,31 @@ import java.math.BigDecimal;
@Data
public class RentVehiclePriceVO extends OrderPriceVO{
@ApiModelProperty(value = "车辆价格")
BigDecimal vehicleAmount;
BigDecimal vehicleAmount = BigDecimal.ZERO;
@ApiModelProperty(value = "司机价格")
BigDecimal driverAmount;
BigDecimal driverAmount = BigDecimal.ZERO;
@ApiModelProperty(value = "免赔付价格")
BigDecimal damageSafeAmount;
BigDecimal damageSafeAmount = BigDecimal.ZERO;
@ApiModelProperty(value = "押金价格")
BigDecimal deposit;
BigDecimal deposit = BigDecimal.ZERO;
@ApiModelProperty(value = "天数")
Integer dayNum;
Integer dayNum = 0;
@ApiModelProperty(value = "车辆天数")
Integer vehicleDayNum;
Integer vehicleDayNum = 0;
@ApiModelProperty(value = "车辆个数")
Integer vehicleNum;
Integer vehicleNum = 0;
@ApiModelProperty(value = "司机个数")
Integer driverNum;
Integer driverNum = 0;
@ApiModelProperty(value = "车型名称")
String modelName;
String modelName = "";
@ApiModelProperty(value = "车型价格")
BigDecimal modelAmount;
BigDecimal modelAmount = BigDecimal.ZERO;
@ApiModelProperty(value = "司机单价")
BigDecimal driverPrice;
BigDecimal driverPrice = BigDecimal.ZERO;
@ApiModelProperty(value = "免赔付单价")
BigDecimal damageSafePrice;
BigDecimal damageSafePrice = BigDecimal.ZERO;
@ApiModelProperty(value = "费用详情")
private String costDetail;
private String costDetail = "";
// /**
// * 原租车天数
......@@ -42,17 +42,17 @@ public class RentVehiclePriceVO extends OrderPriceVO{
/**
* 免费天数
*/
private Integer freeDayNum;
private Integer freeDayNum = 0;
/**
* 免费价格
*/
private BigDecimal freeAmount;
private BigDecimal freeAmount = BigDecimal.ZERO;
/**
* 购买的租车金额
*/
private BigDecimal buyVehicleAmount;
private BigDecimal buyVehicleAmount = BigDecimal.ZERO;
/**
* 优惠描述
......
......@@ -8,49 +8,49 @@ import java.math.BigDecimal;
@Data
public class TourPriceVO extends OrderPriceVO{
@ApiModelProperty(value = "费用详情")
private String costDetail;
private String costDetail = "";
@ApiModelProperty(value = "成人人数")
private Integer number;
private Integer number = 0;
@ApiModelProperty(value = "儿童人数")
private Integer childNumber;
private Integer childNumber = 0;
//大人单价"
@ApiModelProperty(value = "大人单价")
private BigDecimal price;
private BigDecimal price = BigDecimal.ZERO;
//大人总价
@ApiModelProperty(value = "大人总价")
private BigDecimal totalPrice;
private BigDecimal totalPrice = BigDecimal.ZERO;
//大人真实总价(优惠后的价格)
@ApiModelProperty(value = "大人真实总价(优惠后的价格)")
private BigDecimal realPrice;
private BigDecimal realPrice = BigDecimal.ZERO;
//儿童单价
@ApiModelProperty(value = "儿童单价")
private BigDecimal childPrice;
private BigDecimal childPrice = BigDecimal.ZERO;
//儿童总价
@ApiModelProperty(value = "儿童总价")
private BigDecimal totalChildPrice;
private BigDecimal totalChildPrice = BigDecimal.ZERO;
//儿童真实总价(优惠后的价格)
@ApiModelProperty(value = "儿童真实总价(优惠后的价格)")
private BigDecimal realChildPrice;
private BigDecimal realChildPrice = BigDecimal.ZERO;
//保险费用
@ApiModelProperty(value = "保险费用")
private BigDecimal insureAmount;
private BigDecimal insureAmount = BigDecimal.ZERO;
//保险单价
@ApiModelProperty(value = "保险单价")
private BigDecimal insurePrice;
private BigDecimal insurePrice = BigDecimal.ZERO;
//天数
@ApiModelProperty(value = "天数")
private Integer dayNum;
private Integer dayNum = 0;
//总人数
@ApiModelProperty(value = "总人数")
private Integer totalNumber;
private Integer totalNumber = 0;
}
......@@ -71,12 +71,18 @@ public class OrderTemplateBiz extends BaseBiz<OrderTemplateMapper,OrderTemplate>
}
public <T extends CostDetailExtend> void handleCostDetailExtend(T costDetailExtend) {
OrderTemplate template = new OrderTemplate();
switch (costDetailExtend.getType()) {
case CostDetailExtend.CANCEL_NO_START :
template = selectByCode(OrderCostEnum.RENT_VEHICLE.getCode());
template.setTemplate(result(template.getTemplate(), new HashMap(){{
put("paramJson", costDetailExtend.getParamJson());
}}));
break;
case CostDetailExtend.CANCEL_STARTED :
OrderTemplate template = selectByCode(OrderCostEnum.RENT_VEHICLE.getCode());
template = selectByCode(OrderCostEnum.RENT_VEHICLE.getCode());
template.setTemplate(result(template.getTemplate(), new HashMap(){{
put("paramJson", costDetailExtend.getParamJson());
put("children", handleChildren(costDetailExtend));
put("consumeAmount", ((CancelStartedVO)costDetailExtend).getConsumeAmount());
}}));
......@@ -88,7 +94,6 @@ public class OrderTemplateBiz extends BaseBiz<OrderTemplateMapper,OrderTemplate>
default:
break;
}
OrderTemplate template = selectByCode(OrderCostEnum.CANCEL_NO_START.getCode());
costDetailExtend.setCostDetail(result(template.getTemplate(), Dict.parse(costDetailExtend)));
}
......
......@@ -174,7 +174,9 @@ public class OrderCancelBiz {
}
}
}
orderTemplateBiz.handleCostDetailExtend(csv);
csv.initParamJson();
//orderTemplateBiz.handleCostDetailExtend(csv);
orvd.handelCostDetailExtend(csv);
orderRentVehicleBiz.updateSelectiveByIdRe(orvd);
}else {
......@@ -251,7 +253,9 @@ public class OrderCancelBiz {
setViolateAmount(deduction.getAmount());
setViolateDesc(deduction.getName());
}};
orderTemplateBiz.handleCostDetailExtend(cnsv);
cnsv.initParamJson();
//orderTemplateBiz.handleCostDetailExtend(cnsv);
otd.setCostDetailExtend(cnsv.getCostDetail());
orderTourDetailBiz.updateSelectiveByIdRe(otd);
}
......
......@@ -417,6 +417,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
put("children", children);
put("vehicleAmount", vo.getVehicleAmount());
put("realAmount", vo.getRealAmount());
put("paramJson", vo.getParamJson());
}}));
String result = orderTemplateBiz.result(template, Dict.parse(vo));
vo.setCostDetail(result);
......
......@@ -314,6 +314,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
OrderTemplate template = orderTemplateBiz.selectByCode(OrderCostEnum.RENT_VEHICLE.getCode());
template.setTemplate(orderTemplateBiz.result(template.getTemplate(), new HashMap(){{
put("children", children);
put("paramJson", vo.getParamJson());
}}));
String result = orderTemplateBiz.result(template, Dict.parse(vo));
vo.setCostDetail(result);
......
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