Commit 855078a1 authored by 周健威's avatar 周健威

修改代码

parent c98b7db1
package com.xxfc.platform.order.pojo.price;
import cn.hutool.json.JSONUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
......@@ -16,4 +18,13 @@ public class CostDetailExtend {
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细
*/
protected Integer type;
/**
* 参数json
*/
public String paramJson = "";
public void initParamJson() {
paramJson = JSONUtil.toJsonStr(this);
}
}
......@@ -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,7 @@ 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 {
......@@ -200,7 +202,9 @@ public class OrderCancelBiz {
setViolateAmount(deduction.getAmount());
setViolateDesc(deduction.getName());
}};
orderTemplateBiz.handleCostDetailExtend(cnsv);
cnsv.initParamJson();
//orderTemplateBiz.handleCostDetailExtend(cnsv);
orvd.handelCostDetailExtend(cnsv);
orderRentVehicleBiz.updateSelectiveByIdRe(orvd);
}
......
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