Commit 117b61b5 authored by jiaorz's avatar jiaorz

延期还车费用

parent 7234c1fe
......@@ -283,7 +283,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
}
}
}
//getDaysBetweenDateTimeHasStartEnd(endTime, nowTime) == 1--同一天;>1-- 延后;<1--提前;
/**
* 提前还车
*/
......@@ -292,19 +291,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
//提前的天数, 当天就算使用一天
int noUsedDay = actualDay - userUsedDay;
//退还未使用的天数,或者金额,扣除违约金,实际未使用天数的金额,最多3000元
// InProgressVO inProgressVO = new InProgressVO();
// inProgressVO.setViolateAmount(new BigDecimal(200));
// inProgressVO.setExtraAmount(new BigDecimal(200));
InProgressVO inProgressVO = orderCalculateBiz.inProgressCalculate(orderPageVO, userUsedDay);
if (inProgressVO != null) {
//消费超额金
if(inProgressVO.getExtraAmount() != null) {
dedDetailDTO.setExcessCost(inProgressVO.getExtraAmount());
}
// stringBuilder.append("违约金( ¥");
stringBuilder.append("违约金( ");
// stringBuilder.append(amount);
// stringBuilder.append(" x ");
stringBuilder.append(noUsedDay);
stringBuilder.append("天) = ");
stringBuilder.append(inProgressVO.getViolateAmount());
......@@ -315,21 +308,21 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
*/
} else if (userUsedDay - actualDay > 0) {
StringBuilder stringBuilder = new StringBuilder();
// stringBuilder.append("违约金( ¥");
stringBuilder.append("违约金( ");
//延期的天数, 延期违约金是延期天数*200%
InProgressVO inProgressVO = orderCalculateBiz.inProgressCalculate(orderPageVO, userUsedDay);
if (inProgressVO != null) {
int extraUsedDay = userUsedDay - actualDay;
if(extraUsedDay > 0) {
// stringBuilder.append(amount);
// stringBuilder.append(" x ");
stringBuilder.append(extraUsedDay);
stringBuilder.append("(天)");
stringBuilder.append(" x 2)");
BigDecimal cost = amount.multiply(new BigDecimal(extraUsedDay+ "")).multiply(new BigDecimal(2+ ""));
stringBuilder.append(" = ");
stringBuilder.append(cost);
stringBuilder.append(inProgressVO.getViolateAmount());
stringBuilder.append("元");
initDedDetail(dedDetailDTO, OrderViolateEnum.AFTER.getCode(), cost, stringBuilder);
initDedDetail(dedDetailDTO, OrderViolateEnum.AFTER.getCode(), inProgressVO.getViolateAmount(), stringBuilder);
}
}
}
JSONArray jsonArray = new JSONArray();
......
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