Commit 8cac8e89 authored by jiaorz's avatar jiaorz

Merge branch 'feature-delay-add' into dev

parents 170a5101 922fe6a1
...@@ -473,7 +473,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -473,7 +473,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
dedDetailDTO.setType(OrderViolateEnum.CHANGE.getCode()); dedDetailDTO.setType(OrderViolateEnum.CHANGE.getCode());
detailName = "更换还车公司"; detailName = "更换还车公司";
} else if (type == OrderViolateEnum.DELAY_VEHICLE.getCode()) { } else if (type == OrderViolateEnum.DELAY_VEHICLE.getCode()) {
dedDetailDTO.setType(1); dedDetailDTO.setType(OrderViolateEnum.DELAY_VEHICLE.getCode());
detailName = "延长还车"; detailName = "延长还车";
} }
//900元+违约金(¥900x2天=)1800元 //900元+违约金(¥900x2天=)1800元
......
...@@ -29,6 +29,7 @@ import com.xxfc.platform.order.pojo.mq.OrderMQDTO; ...@@ -29,6 +29,7 @@ import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import com.xxfc.platform.order.pojo.order.VehicleItemDTO; import com.xxfc.platform.order.pojo.order.VehicleItemDTO;
import com.xxfc.platform.order.pojo.price.CancelStartedVO; import com.xxfc.platform.order.pojo.price.CancelStartedVO;
import com.xxfc.platform.order.pojo.price.CostDetailExtend; import com.xxfc.platform.order.pojo.price.CostDetailExtend;
import com.xxfc.platform.order.pojo.price.DelayAddPriceVO;
import com.xxfc.platform.universal.constant.DictionaryKey; import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary; import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
...@@ -447,6 +448,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -447,6 +448,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
csv.setViolateDesc(""); csv.setViolateDesc("");
//处理更改之后的违约金及描述 //处理更改之后的违约金及描述
handleCrosstownDetail(crosstown, oad, csv); handleCrosstownDetail(crosstown, oad, csv);
handleCrosstownDelayDetail(crosstown, oad);
if(StrUtil.isBlank(csv.getViolateDesc())) { if(StrUtil.isBlank(csv.getViolateDesc())) {
csv.setViolateDesc(inProgressVO.getViolateDesc()); csv.setViolateDesc(inProgressVO.getViolateDesc());
...@@ -592,16 +594,36 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -592,16 +594,36 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
} }
private void handleCrosstownDelayDetail(OrderVehicleCrosstown crosstown, OrderAccountDetail oad, CancelStartedVO csv) { private void handleCrosstownDelayDetail(OrderVehicleCrosstown crosstown, OrderAccountDetail oad) {
try{ try{
if(null != crosstown.getDelayVehicleDetail()) { if(null != crosstown.getDelayVehicleDetail()) {
//修改代码 //修改代码
List<DedDetailDTO> vios = JSONUtil.toList(JSONUtil.parseArray(crosstown.getViolateDetail()), DedDetailDTO.class); List<DedDetailDTO> vios = JSONUtil.toList(JSONUtil.parseArray(crosstown.getDelayVehicleDetail()), DedDetailDTO.class);
//DedDetailDTO vio = JSONUtil.toBean(crosstown.getViolateDetail(), DedDetailDTO.class);
for(DedDetailDTO vio : vios) { for(DedDetailDTO vio : vios) {
if(OrderViolateEnum.DELAY_VEHICLE.getCode().equals(vio.getType())) { if(OrderViolateEnum.DELAY_VEHICLE.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.OTHER_DELAY_SAFE, oad, vio, csv); Boolean flag = Boolean.FALSE;
for(OrderAccountDeduction deduction : oad.getDeductions()) {
if(DeductionTypeEnum.OTHER_DELAY_SAFE.getCode().equals(deduction.getType())) {
deduction.setName(vio.getDeductions());
BigDecimal diff = vio.getCost().subtract(deduction.getAmount());
//修改归还押金金额
oad.setDepositAmount(oad.getDepositAmount().subtract(diff));
deduction.setAmount(vio.getCost());
flag = Boolean.TRUE;
break;
}
}
//如果没有修改,则添加
if(Boolean.FALSE.equals(flag)) {
OrderAccountDeduction oadNew = initDeduction(vio.getCost(), vio.getDeductions(), DeductionTypeEnum.OTHER_DELAY_SAFE, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(oadNew);
//修改归还押金金额
oad.setDepositAmount(oad.getDepositAmount().subtract(oadNew.getAmount()));
}
} }
} }
} }
...@@ -641,7 +663,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -641,7 +663,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
} }
/** /**
* 获取每日订单账目,用于统计 * 获取每日订单账目,用于统计
* @param term * @param term
......
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