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

修改代码

parent e123b96e
......@@ -17,7 +17,7 @@ public class CostDetailExtend {
private String costDetail = "";
/**
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细
* type:1--取消违约金;2--取消费用明细;3--提前还车费用明细;4--延期还车费用明细 5--订单按时还车
*/
protected Integer type;
......
......@@ -273,6 +273,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if(RefundStatusEnum.NONE.getCode().equals(orderMQDTO.getRefundStatus())) {
Integer crosstownTypeEnum;
DepositRefundStatus depositRefundRecordStatus;
//生成额外的费用明细
CancelStartedVO csv = new CancelStartedVO();
//判断是否定损过
if(SYS_TRUE.equals(orderMQDTO.getOrderRentVehicleDetail().getFixedLossStatus())) {
crosstownTypeEnum = CrosstownTypeEnum.FIXED_LOSS.getCode();
......@@ -307,10 +310,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
oad.getDeductions().add(
initDeduction(illegalReserve, "违章保证金", DeductionTypeEnum.VIOLATE_TRAFFIC_KEEP, OrderAccountDeduction.ORIGIN_DEPOSIT)
);
//设置定损金额
csv.setDamagesAmount(crosstown.getDeductionCost());
if(crosstown.getDeductionCost().compareTo(BigDecimal.ZERO) > 0) {
oad.getDeductions().add(
initDeduction(crosstown.getDeductionCost(), "定损赔偿金", DeductionTypeEnum.DAMAGES, OrderAccountDeduction.ORIGIN_DEPOSIT)
);
//剩余押金 -
}
//剩余押金 = 押金 - 违章保证金 - 定损金额
oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(crosstown.getDeductionCost()));
handleCrosstownDetail(crosstown, oad);
BigDecimal refundAmont = crosstown.getRestDeposit().subtract(illegalReserve);
......@@ -323,7 +332,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
orderDepositRefundRecordBiz.completeRecordStatus(crosstown.getId(), depositRefundRecordStatus);
//生成额外的费用明细
CancelStartedVO csv = new CancelStartedVO();
csv.setConsumeAmount(inProgressVO.getConsumeAmount());
csv.setModelAmount(orderItem.getUnitPrice());
csv.setUsedAmount(inProgressVO.getUsedAmount());
......
......@@ -158,6 +158,8 @@ public class OrderCancelBiz {
Long beginOfStartDay = DateUtil.beginOfDay(DateUtil.date(orvd.getStartTime())).getTime();
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long useTimeLag = System.currentTimeMillis() - beginOfStartDay;
log.info("useTimeLag {}", new BigDecimal(useTimeLag + ""));
log.info("divide {}", new BigDecimal((24 * 60 * 60 * 1000)+ ""));
Integer useDays = new BigDecimal(useTimeLag + "").divide(new BigDecimal((24 * 60 * 60 * 1000)+ "")).setScale(0, BigDecimal.ROUND_UP).intValue();
inProgressVO = orderCalculateBiz.calculateOrderComplete(baseOrder, orvd, oad, orderItem, useDays);
//结合
......
......@@ -126,7 +126,6 @@ public class RentDepositJobHandler extends IJobHandler {
}
OrderAccountDetail oad = new OrderAccountDetail();
orderAccountBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode(), AccountTypeEnum.OUT_RESIDUE_DEPOSIT, oad);
//orderRefundBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode(), RefundTypeEnum.RESIDUE_DEPOSIT);
orderDepositRefundRecordBiz.completeRecordStatus(crosstown.getId(), DepositRefundStatus.VIOLATIONARRIVAL);
orderMsgBiz.handelMsgDeposit(orvd, baseOrder, userFeign.userDetailById(baseOrder.getUserId()).getData());
}
......
......@@ -3,6 +3,8 @@ package com.xxfc.platform.order.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -314,9 +316,12 @@ 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());
put("paramJson", "");
}}));
String result = orderTemplateBiz.result(template, Dict.parse(vo));
JSONObject jsonObject = JSONUtil.parseObj(result);
jsonObject.put("paramJson", vo.getParamJson());
result = JSONUtil.toJsonStr(jsonObject);
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