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

Merge branch 'feature-delay-add' into dev

parents 1b022904 ce8e6f63
......@@ -393,6 +393,14 @@ public class OrderCalculateBiz {
InProgressVO inProgressVO = new InProgressVO();
BigDecimal topAmount = BigDecimal.ZERO;
//缓冲取消时间(一个小时)
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Long autoCancelTime = Long.valueOf(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.CANCEL_TIME_BUFFER).getDetail());
//判断是否支付超过缓冲取消时间(一个小时)
Long orderCrtLag = System.currentTimeMillis() - orderPageVO.getPayTime();
Boolean overCancelBuffer = (orderCrtLag > autoCancelTime)? Boolean.TRUE: Boolean.FALSE;
switch (orderTypeEnum) {
case RENT_VEHICLE:
......@@ -406,7 +414,7 @@ public class OrderCalculateBiz {
//融入日期价格
List<VehicleModelCalendarPriceDTO> vmcpds = JSONUtil.toList(JSONUtil.parseArray(vehicleItemDTO.getDetail()), VehicleModelCalendarPriceDTO.class);
if(timeLag < 0 ) {
if(timeLag < 0 && overCancelBuffer) {
Integer useDays = getIncludeDays(orderPageVO.getOrderRentVehicleDetail().getStartTime(), DateTime.now().getMillis());
OrderAccountDetail oad = new OrderAccountDetail();
inProgressVO = inProgressCalculate(orderPageVO, vehicleItemDTO, orderPageVO.getOrderRentVehicleDetail(), useDays, oad, Boolean.FALSE);
......@@ -424,6 +432,11 @@ public class OrderCalculateBiz {
, DictionaryKey.APP_ORDER+ "_"+ key
, refundDescBuilder);
if(!overCancelBuffer) {
deductionAmount = BigDecimal.ZERO;
refundDescBuilder = new StringBuilder("");
}
topAmount = vehicleItemDTO.getTopAmount(0);
totalDeductAmount = (topAmount.compareTo(deductionAmount) < 0) ? topAmount: deductionAmount;
totalRefundAmount = orderPageVO.getRealAmount().subtract(totalDeductAmount);
......@@ -456,6 +469,11 @@ public class OrderCalculateBiz {
, DictionaryKey.APP_ORDER+ "_"+ key
, refundDescBuilder);
if(!overCancelBuffer) {
deductionAmount = BigDecimal.ZERO;
refundDescBuilder = new StringBuilder("");
}
topAmount = adultItemAmount.add(childItemAmount);
totalDeductAmount = deductionAmount;
totalRefundAmount = orderPageVO.getRealAmount().subtract(deductionAmount);
......
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