Commit 64edbb1f authored by 周健威's avatar 周健威

Merge branch 'feature_chw_zjw' into dev-chw

parents 311cb8b5 44bbdd2a
...@@ -8,6 +8,7 @@ public enum ItemTypeEnum { ...@@ -8,6 +8,7 @@ public enum ItemTypeEnum {
VEHICLE_MODEL(101, "租车车型"), VEHICLE_MODEL(101, "租车车型"),
DAMAGE_SAFE(102, "车损免赔"), DAMAGE_SAFE(102, "车损免赔"),
DRIVER(103, "司机"), DRIVER(103, "司机"),
PERSON_INSURANCE(104, "人身保险"),
TOUR_ADULT(201, "旅游成人"), TOUR_ADULT(201, "旅游成人"),
TOUR_CHILD(202, "旅游儿童"), TOUR_CHILD(202, "旅游儿童"),
TOUR_INSURE(203, "旅游保险"), TOUR_INSURE(203, "旅游保险"),
......
...@@ -45,6 +45,11 @@ public class InProgressVO { ...@@ -45,6 +45,11 @@ public class InProgressVO {
*/ */
Integer usedDays = 0; Integer usedDays = 0;
/**
* 已使用小时数
*/
Integer usedHours = 0;
/** /**
* 已使用的金额 * 已使用的金额
*/ */
......
package com.xxfc.platform.order.pojo.order.add; package com.xxfc.platform.order.pojo.order.add;
import com.xxfc.platform.order.entity.OrderPersonInsurance;
import com.xxfc.platform.order.pojo.OrderAccompanyDTO; import com.xxfc.platform.order.pojo.OrderAccompanyDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -12,8 +13,7 @@ import java.time.format.DateTimeFormatter; ...@@ -12,8 +13,7 @@ import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.DATE_TIME_LINE_FORMATTER; import static com.github.wxiaoqi.security.common.constant.CommonConstants.*;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.YMR_SLASH_FORMATTER;
@Data @Data
public class AddRentVehicleDTO extends AddOrderCommonDTO{ public class AddRentVehicleDTO extends AddOrderCommonDTO{
...@@ -137,6 +137,9 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{ ...@@ -137,6 +137,9 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
public static final int GOODS_DEPOSIT_TYPE_UP = 1; public static final int GOODS_DEPOSIT_TYPE_UP = 1;
public static final int GOODS_DEPOSIT_TYPE_DOWN = 2; public static final int GOODS_DEPOSIT_TYPE_DOWN = 2;
private Integer needPersonInsurance = SYS_FALSE;
private List<OrderPersonInsurance> insurances;
public void setStartTime(Long startTime) { public void setStartTime(Long startTime) {
this.startTime = startTime; this.startTime = startTime;
this.bookStartDate = YMR_SLASH_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneOffset.ofHours(8))); this.bookStartDate = YMR_SLASH_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneOffset.ofHours(8)));
...@@ -164,4 +167,5 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{ ...@@ -164,4 +167,5 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
} }
} }
...@@ -52,6 +52,7 @@ import static com.xxfc.platform.order.pojo.account.OrderAccountDeduction.ORIGIN_ ...@@ -52,6 +52,7 @@ import static com.xxfc.platform.order.pojo.account.OrderAccountDeduction.ORIGIN_
import static com.xxfc.platform.order.pojo.account.OrderAccountDeduction.ORIGIN_ORDER_DEPOSIT; import static com.xxfc.platform.order.pojo.account.OrderAccountDeduction.ORIGIN_ORDER_DEPOSIT;
import static com.xxfc.platform.order.pojo.pay.NotifyUrlDTO.PAY_WAY_ALI; import static com.xxfc.platform.order.pojo.pay.NotifyUrlDTO.PAY_WAY_ALI;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER; import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
import static com.xxfc.platform.universal.constant.DictionaryKey.RENT_PERSON_INSURANCE;
/** /**
* 订单帐目 * 订单帐目
...@@ -342,6 +343,31 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -342,6 +343,31 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
return deductGoodsAmount; return deductGoodsAmount;
} }
public BigDecimal calculatePersonInsurance(Long timeLag) {
BigDecimal amount = BigDecimal.ZERO;
//获取天
Integer remainder = Long.valueOf(timeLag%(1000L * 60L * 60L * 24L)).intValue();
Integer dayLag = Long.valueOf(timeLag/(1000L * 60L * 60L * 24L)).intValue() + remainder > 0? 1: 0;
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Set<Dictionary> personInsurances = dictionaryMap.get(RENT_PERSON_INSURANCE).getChildrens();
for(com.xxfc.platform.universal.entity.Dictionary dic : personInsurances) {
if(StrUtil.isBlank(dic.getName())) {
continue;
}
//符合范围
if(IntervalUtil.staticIsInTheInterval(dayLag.toString(), dic.getName())){
amount = new BigDecimal(dic.getDetail());
break;
}
}
return amount;
}
/** /**
* 初始化deduction * 初始化deduction
* @param subtract * @param subtract
......
...@@ -31,6 +31,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey; ...@@ -31,6 +31,7 @@ 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;
import com.xxfc.platform.universal.inter.CalculateInterface; import com.xxfc.platform.universal.inter.CalculateInterface;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO; import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO;
...@@ -94,6 +95,242 @@ public class OrderCalculateBiz implements CalculateInterface { ...@@ -94,6 +95,242 @@ public class OrderCalculateBiz implements CalculateInterface {
} }
public InProgressVO inProgressCalculate(BaseOrder baseOrder, VehicleItemDTO vehicleItemDTO, OrderRentVehicleDetail orvd, Integer useDays, OrderAccountDetail oad, Boolean isCancel) { public InProgressVO inProgressCalculate(BaseOrder baseOrder, VehicleItemDTO vehicleItemDTO, OrderRentVehicleDetail orvd, Integer useDays, OrderAccountDetail oad, Boolean isCancel) {
if(Vehicle.PRICE_TYPE_DAY == orvd.getPriceType()) {
return inProgressCalculateDay(baseOrder, vehicleItemDTO, orvd, useDays, oad, isCancel);
}else {
return inProgressCalculateHour(baseOrder, vehicleItemDTO, orvd, useDays, oad, isCancel);
}
}
public InProgressVO inProgressCalculateDay(BaseOrder baseOrder, VehicleItemDTO vehicleItemDTO, OrderRentVehicleDetail orvd, Integer useDays, OrderAccountDetail oad, Boolean isCancel){
BigDecimal refundAmount = BigDecimal.ZERO;
BigDecimal consumeAmount = BigDecimal.ZERO;
BigDecimal topViolateAmount = BigDecimal.ZERO;
BigDecimal itemChangeAmount = BigDecimal.ZERO;
//免费天数
Integer freeDays = (null == vehicleItemDTO.getCutNum())?0 :vehicleItemDTO.getCutNum();
//融入日期价格
List<VMCalendarPriceCostDTO> vmcpds = vehicleItemDTO.getVehicleDetail();
VehicleItemDTO.ParamDTO paramDTO = vehicleItemDTO.initParam(freeDays, vmcpds);
List<VMCalendarPriceCostDTO> useAmountList = CollUtil.newArrayList();
//抵消的天数
Integer offsetDays = paramDTO.getOffsetNum();
//商品真实价格
BigDecimal goodsRealAmount = baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount());
//其他消费金额 = 商品真实价格 - 主要商品真实价格 = (商品价格 - 优惠价格)- 主要商品真实价格
BigDecimal otherItemRealAmount = goodsRealAmount.subtract(vehicleItemDTO.getRealAmount());
InProgressVO inProgressVO = new InProgressVO();
inProgressVO.setUsedDays(useDays);
//处理不记免赔违约金
if(useDays > 0) {
inProgressVO.setDelayAddPriceVO(orvd.obtainDelayAddDetail());
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(orvd.obtainDelayAddDetail().getDelayDamageSafeAmount(), "", DeductionTypeEnum.OTHER_DELAY_SAFE, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction);
}
inProgressVO.setMetaOrderUsedAmount(vehicleItemDTO.getUsedAmount(useDays));
//查看是否有增加的延期天数-->添加分别原订单和延期的使用金额
if(orvd.getDelayAddDays() > 0 && useDays > vehicleItemDTO.getTotalNum()) {
inProgressVO.setDelayAddUsedAmount(orvd.obtainDelayAddDetail().delayAddUseAmount(useDays - vehicleItemDTO.getTotalNum()));
}
inProgressVO.setUsedAmount(inProgressVO.getMetaOrderUsedAmount().add(inProgressVO.getDelayAddUsedAmount()));
//使用的天数对应的免费天数
Integer useDaysMapFreeDays = vehicleItemDTO.mapFreeDays(useDays);
//计算:剩余免费天数
Integer backFreeDays = freeDays - useDaysMapFreeDays;
//待返还的优惠券编号
List<String> backCouponNos = Lists.newArrayList();
//剩余天数
Integer realResidueDays = orvd.obtainRealDayNum() - useDays;
//过了出发时间取消订单 ,优先使用免费天数
if(backFreeDays <= 0) {
//设置免费天数
inProgressVO.setUsedfreeDays(freeDays);
inProgressVO.setUsedFreeDaysAmount(vehicleItemDTO.getFreeAmount(null));
//消费天数
Integer consumeDays = useDays - offsetDays;
//如果使用天数 大于 总天数
if(useDays > vehicleItemDTO.getTotalNum()) {
//消费天数
consumeDays = vehicleItemDTO.getTotalNum() - offsetDays;
}
//需要扣除订单费用
//判断是否达到优惠券条件 不符合则返还优惠券
//计算使用天数的费用
//融入日期价格
//consumeAmount = orderItem.getUnitPrice().multiply(new BigDecimal(consumeDays+""));
for(int i = offsetDays; i < (offsetDays+ consumeDays); i++) {
consumeAmount = consumeAmount.add(vmcpds == null || vmcpds.size() <=0 ? new BigDecimal(0) : vmcpds.get(i).getConsumeAmount());
}
if(StrUtil.isNotBlank(baseOrder.getCouponTickerNos())) {
List<BigDecimal> couponAmounts = Lists.newArrayList();
for(String tickerNo : baseOrder.getCouponTickerNos().split(",")) {
//如果优惠券已经使用了,则会返回 0 元
BigDecimal couponAmount = activityFeign.use(baseOrder.getUserId(), Lists.newArrayList(tickerNo), baseOrder.getNo(), Coupon.CHANNEL_RENT, consumeAmount, ActivityFeign.TYPE_CHECK);
if(couponAmount.compareTo(BigDecimal.ZERO) > 0) {
//能够使用优惠券,则不返还
couponAmounts.add(couponAmount);
//叠加优惠券金额
inProgressVO.setCouponAmount(inProgressVO.getCouponAmount().add(couponAmount));
//叠加优惠券描述
List<Coupon> ableUsedCoupons = activityFeign.couponsByTickerNoList(CollUtil.newArrayList(tickerNo));
if(null != ableUsedCoupons && ableUsedCoupons.size() > 0) {
inProgressVO.setCouponDesc(inProgressVO.getCouponDesc()+ ableUsedCoupons.get(0).getTitle());
}
} else {
backCouponNos.add(tickerNo);
}
}
for(BigDecimal couponAmount : couponAmounts) {
consumeAmount = consumeAmount.subtract(couponAmount);
}
}
//设置消费金额,添加租车以外的消费金额
consumeAmount = consumeAmount.add(otherItemRealAmount);
inProgressVO.setConsumeAmount(consumeAmount);
refundAmount = handleConsumeAmount(oad, refundAmount, consumeAmount, goodsRealAmount, inProgressVO);
//查看是否有增加的延期天数-->添加分别原订单和延期的返回天数
if(orvd.getDelayAddDays() > 0 && realResidueDays > 0) {
inProgressVO.setDelayAddBackFreeDays(orvd.obtainDelayAddDetail().residueDelayFreeDays(realResidueDays));
inProgressVO.setBackFreeDays(inProgressVO.getDelayAddBackFreeDays());
}
//查看是否有增加的延期天数-->添加延期的已使用免费天数 和 已使用免费天数金额
if(orvd.getDelayAddDays() > 0 && useDays > vehicleItemDTO.getTotalNum()) {
inProgressVO.setUsedfreeDays(inProgressVO.getUsedfreeDays() + (orvd.getDelayAddFreeDays() - inProgressVO.getDelayAddBackFreeDays()));
inProgressVO.setUsedFreeDaysAmount(inProgressVO.getUsedFreeDaysAmount().add(orvd.obtainDelayAddDetail().delayAddFreeAmount(useDays - vehicleItemDTO.getTotalNum())));
}
}else {
//设置免费天数
inProgressVO.setUsedfreeDays(useDaysMapFreeDays);
inProgressVO.setUsedFreeDaysAmount(vehicleItemDTO.getFreeAmount(useDays));
//融入日期价格
Integer trueBackFreeDays = backFreeDays;
inProgressVO.setMetaOrderBackFreeDays(trueBackFreeDays);
//查看是否有增加的延期天数-->添加分别原订单和延期的返回天数
if(orvd.getDelayAddDays() > 0) {
inProgressVO.setDelayAddBackFreeDays(orvd.getDelayAddFreeDays());
}
inProgressVO.setBackFreeDays(inProgressVO.getMetaOrderBackFreeDays()+ inProgressVO.getDelayAddBackFreeDays());
//查看是否有增加的延期天数-->添加延期的已使用免费天数 和 已使用免费天数金额
//不需要
//返回优惠券
if(StrUtil.isNotBlank(baseOrder.getCouponTickerNos())) {
//没有租车消费金额,所以返回所有优惠券
backCouponNos.addAll(StrUtil.split(baseOrder.getCouponTickerNos(), ','));
}
//设置消费金额,添加租车以外的消费金额
consumeAmount = consumeAmount.add(otherItemRealAmount);
inProgressVO.setConsumeAmount(consumeAmount);
refundAmount = handleConsumeAmount(oad, refundAmount, consumeAmount, goodsRealAmount, inProgressVO);
}
inProgressVO.setRefundOrderAmount(refundAmount);
inProgressVO.setBackCoupons(backCouponNos);
List<VMCalendarPriceCostDTO> realVmcpds = Convert.toList(VMCalendarPriceCostDTO.class, vmcpds);
//查看是否有增加的延期天数-->添加延期的费用列表
if(orvd.getDelayAddDays() > 0) {
realVmcpds.addAll(orvd.obtainDelayAddDetail().getDelayAmountList());
}
//计算违约金
//residueDays * 身份价格
if(realResidueDays > 0) { //提前还车
//设置消耗费用列表
for(int i = 0; i < useDays; i++) {
useAmountList.add(BeanUtil.toBean(realVmcpds.get(i), VMCalendarPriceCostDTO.class));
}
//"{}元/天 x{}天"
BigDecimal residueAmount = BigDecimal.ZERO;
for(int i = useDays; i < realVmcpds.size(); i++) {
residueAmount = residueAmount.add(realVmcpds.get(i).getPrice());
inProgressVO.getViolateAmountList().add(realVmcpds.get(i));
}
String violateDesc = StrUtil.format("{}元", residueAmount.toString());
if(realResidueDays >= 2) {
realResidueDays = 2;
residueAmount = BigDecimal.ZERO;
inProgressVO.setViolateAmountList(CollUtil.newArrayList());
for(int i = useDays; i < (useDays + realResidueDays); i++) {
residueAmount = residueAmount.add(realVmcpds.get(i).getPrice());
inProgressVO.getViolateAmountList().add(realVmcpds.get(i));
}
violateDesc += StrUtil.format("(封顶{}元)", residueAmount);
}
inProgressVO.setViolateType(VIOLATE_TYPE_ADVANCE);
inProgressVO.setViolateAmount(residueAmount);
inProgressVO.setViolateDesc(" 提前还车违约金:"+ violateDesc);
//提前还车 修改ORIGIN_DEPOSIT 为 ORIGIN_ORDER_DEPOSIT
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_ADVANCE, OrderAccountDeduction.ORIGIN_ORDER_DEPOSIT);
oad.getDeductions().add(violateDeduction);
}else if (realResidueDays.equals(0)) { //准时还车
//设置消耗费用列表
useAmountList.addAll(Convert.toList(VMCalendarPriceCostDTO.class, realVmcpds));
}else if(realResidueDays < 0 && !isCancel){
//isCancel 表示是否为取消,取消则不计算延期还车(因为没有出车)
//设置消耗费用列表
useAmountList.addAll(Convert.toList(VMCalendarPriceCostDTO.class, realVmcpds));
//如果订单 出发中 或者 已完成 或者定损中
if(OrderStatusEnum.ORDER_WAIT.getCode().equals(baseOrder.getStatus()) ||
OrderStatusEnum.ORDER_FINISH.getCode().equals(baseOrder.getStatus()) ||
OrderStatusEnum.ORDER_FIXED_LOSS.getCode().equals(baseOrder.getStatus())) {
Integer overDays = 0 - realResidueDays;
String violateDesc = StrUtil.format(" 延迟{}天", overDays);
List<VMCalendarPriceCostDTO> overAmountList = orderItemBiz.getOverAmountList(realVmcpds.get(realVmcpds.size() - 1).getDate(), overDays, vehicleItemDTO.getGoodId(), baseOrder.getUserId());
BigDecimal overAmount = overAmountList.parallelStream()
.map(VMCalendarPriceCostDTO::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add).multiply(new BigDecimal(2+ ""));
//超过的天数 价格 * 200%
inProgressVO.setViolateType(VIOLATE_TYPE_DELAY);
inProgressVO.setViolateAmount(overAmount);
inProgressVO.setViolateDesc(" 延期还车违约金:"+ violateDesc);
inProgressVO.setOverAmountList(overAmountList);
inProgressVO.setViolateAmountList(overAmountList);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction);
}
}
//设置消耗费用列表
inProgressVO.setUseAmountList(useAmountList);
return inProgressVO;
}
public InProgressVO inProgressCalculateHour(BaseOrder baseOrder, VehicleItemDTO vehicleItemDTO, OrderRentVehicleDetail orvd, Integer useDays, OrderAccountDetail oad, Boolean isCancel){
BigDecimal refundAmount = BigDecimal.ZERO; BigDecimal refundAmount = BigDecimal.ZERO;
BigDecimal consumeAmount = BigDecimal.ZERO; BigDecimal consumeAmount = BigDecimal.ZERO;
BigDecimal topViolateAmount = BigDecimal.ZERO; BigDecimal topViolateAmount = BigDecimal.ZERO;
...@@ -153,14 +390,14 @@ public class OrderCalculateBiz implements CalculateInterface { ...@@ -153,14 +390,14 @@ public class OrderCalculateBiz implements CalculateInterface {
Integer consumeDays = useDays - offsetDays; Integer consumeDays = useDays - offsetDays;
//如果使用天数 大于 总天数 //如果使用天数 大于 总天数
if(useDays > vehicleItemDTO.getTotalNum()) { if(useDays > vehicleItemDTO.getTotalNum()) {
//消费天数 //消费天数
consumeDays = vehicleItemDTO.getTotalNum() - offsetDays; consumeDays = vehicleItemDTO.getTotalNum() - offsetDays;
} }
//需要扣除订单费用 //需要扣除订单费用
//判断是否达到优惠券条件 不符合则返还优惠券 //判断是否达到优惠券条件 不符合则返还优惠券
//计算使用天数的费用 //计算使用天数的费用
//融入日期价格 //融入日期价格
//consumeAmount = orderItem.getUnitPrice().multiply(new BigDecimal(consumeDays+"")); //consumeAmount = orderItem.getUnitPrice().multiply(new BigDecimal(consumeDays+""));
for(int i = offsetDays; i < (offsetDays+ consumeDays); i++) { for(int i = offsetDays; i < (offsetDays+ consumeDays); i++) {
consumeAmount = consumeAmount.add(vmcpds == null || vmcpds.size() <=0 ? new BigDecimal(0) : vmcpds.get(i).getConsumeAmount()); consumeAmount = consumeAmount.add(vmcpds == null || vmcpds.size() <=0 ? new BigDecimal(0) : vmcpds.get(i).getConsumeAmount());
...@@ -253,7 +490,7 @@ public class OrderCalculateBiz implements CalculateInterface { ...@@ -253,7 +490,7 @@ public class OrderCalculateBiz implements CalculateInterface {
} }
//计算违约金 //计算违约金
//residueDays * 身份价格 //residueDays * 身份价格
if(realResidueDays > 0) { //提前还车 if(realResidueDays > 0) { //提前还车
//设置消耗费用列表 //设置消耗费用列表
......
...@@ -456,6 +456,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -456,6 +456,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
OrderItem driverOrderItem = orderItemBiz.initOrderItem(DRIVER_PRICE, detail.getDayNum(), "平台司机", null, ItemTypeEnum.DRIVER); OrderItem driverOrderItem = orderItemBiz.initOrderItem(DRIVER_PRICE, detail.getDayNum(), "平台司机", null, ItemTypeEnum.DRIVER);
OrderItem damageSafeOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.DAMAGE_SAFE); OrderItem damageSafeOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.DAMAGE_SAFE);
//OrderItem personInsuranceOrderItem = orderItemBiz.initOrderItem(DAMAGE_SAFE, detail.getDayNum(), "免赔费用", null, ItemTypeEnum.PERSON_INSURANCE);
detail.setItems(new ArrayList<OrderItem>()); detail.setItems(new ArrayList<OrderItem>());
detail.getItems().add(vehicleOrderItem); detail.getItems().add(vehicleOrderItem);
......
...@@ -62,6 +62,8 @@ public class DictionaryKey { ...@@ -62,6 +62,8 @@ public class DictionaryKey {
public static final String DAMAGE_SAFE = "DAMAGE_SAFE"; public static final String DAMAGE_SAFE = "DAMAGE_SAFE";
public static final String ILLEGAL_RESERVE = "ILLEGAL_RESERVE"; public static final String ILLEGAL_RESERVE = "ILLEGAL_RESERVE";
public static final String RENT_TIME_BUFFER = "RENT_TIME_BUFFER"; public static final String RENT_TIME_BUFFER = "RENT_TIME_BUFFER";
public static final String RENT_TIME_HOUR_BUFFER = "RENT_TIME_HOUR_BUFFER";
public static final String RENT_PERSON_INSURANCE = "RENT_PERSON_INSURANCE";
/** /**
* 旅游:保险费用 * 旅游:保险费用
......
...@@ -58,7 +58,7 @@ public interface CalculateInterface { ...@@ -58,7 +58,7 @@ public interface CalculateInterface {
Map<String, Dictionary> dictionaryMap = getThirdFeign().dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = getThirdFeign().dictionaryGetAll4Map().getData();
Long hourLong = (60L * 60L * 1000L); Long hourLong = (60L * 60L * 1000L);
//Long dayLong = hourLong * 24; //Long dayLong = hourLong * 24;
Long bufferLong = 0L; Long bufferLong = Long.valueOf(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_TIME_HOUR_BUFFER).getDetail()) * hourLong;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒 //计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long bookTimeLag = endLong - startLong; Long bookTimeLag = endLong - startLong;
......
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