Commit 321a895b authored by 周健威's avatar 周健威

修改租车 和 申请接口

parent ddedcb87
...@@ -97,6 +97,21 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -97,6 +97,21 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return ObjectRestResponse.succ(baseBiz.selectList(entity)); return ObjectRestResponse.succ(baseBiz.selectList(entity));
} }
@ApiOperation("根据参数查询,等于")
@RequestMapping(value = "/entityListPost",method = RequestMethod.POST)
@ResponseBody
public ObjectRestResponse<List<Entity>> entityListPost(@RequestBody Entity entity){
//查询列表数据
return ObjectRestResponse.succ(baseBiz.selectList(entity));
}
//
// @ApiOperation("根据参数查询,等于")
// @RequestMapping(value = "/entityListPost",method = RequestMethod.POST)
// @ResponseBody
// public ObjectRestResponse<List<Entity>> entityListPost(@RequestBody Entity entity){
// //查询列表数据
// return ObjectRestResponse.succ(baseBiz.selectList(entity));
// }
@ApiOperation("查询所有") @ApiOperation("查询所有")
@RequestMapping(value = "/alls",method = RequestMethod.GET) @RequestMapping(value = "/alls",method = RequestMethod.GET)
......
...@@ -274,6 +274,10 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -274,6 +274,10 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "优惠天数") @ApiModelProperty(value = "优惠天数")
private Integer freeDays; private Integer freeDays;
public void setFreeDays(Integer freeDays) {
this.freeDays = freeDays;
}
/** /**
* 折扣 80 即 8折 * 折扣 80 即 8折
*/ */
...@@ -295,6 +299,10 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -295,6 +299,10 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "剩余需要退还的钱(押金)") @ApiModelProperty(value = "剩余需要退还的钱(押金)")
private BigDecimal returnPayResidue; private BigDecimal returnPayResidue;
public void setReturnPayResidue(BigDecimal returnPayResidue) {
this.returnPayResidue = returnPayResidue;
}
/** /**
* 预定记录id * 预定记录id
*/ */
...@@ -392,6 +400,20 @@ public class OrderRentVehicleDetail implements Serializable { ...@@ -392,6 +400,20 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty(value = "车辆公司(门店)id") @ApiModelProperty(value = "车辆公司(门店)id")
private Integer vehicleCompanyId; private Integer vehicleCompanyId;
@Column(name = "vehicle_deposit")
@ApiModelProperty(value = "车辆押金")
private BigDecimal vehicleDeposit;
@Column(name = "traffic_deposit")
@ApiModelProperty(value = "交通违章押金")
private BigDecimal trafficDeposit;
/**
* 商品押金方式 1--线上;2--线下
*/
@Column(name = "goods_deposit_type")
private Integer goodsDepositType;
public Long getEndTime() { public Long getEndTime() {
return endTime; return endTime;
} }
......
...@@ -205,4 +205,11 @@ public class ShuntApply implements Serializable { ...@@ -205,4 +205,11 @@ public class ShuntApply implements Serializable {
@ApiModelProperty(value = "预约记录id", hidden = true ) @ApiModelProperty(value = "预约记录id", hidden = true )
private Long bookRecordId; private Long bookRecordId;
@Column(name = "brand_id")
@ApiModelProperty("品牌id")
private Integer brandId;
@Column(name = "category_id")
@ApiModelProperty("型号id")
private Integer categoryId;
} }
...@@ -22,6 +22,7 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail ...@@ -22,6 +22,7 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
private BaseOrder order; private BaseOrder order;
private VehicleModel vehicleModel; private VehicleModel vehicleModel;
private BookVehicleVO bookVehicleVO; private BookVehicleVO bookVehicleVO;
private Vehicle vehicle;
/** /**
* 是否调车申请下订单 * 是否调车申请下订单
...@@ -93,6 +94,6 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail ...@@ -93,6 +94,6 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
this.startDate = DateUtil.date(getStartTime()); this.startDate = DateUtil.date(getStartTime());
this.endDate = DateUtil.date(getEndTime()); this.endDate = DateUtil.date(getEndTime());
this.startDateStr = DateUtil.formatDate(this.startDate); this.startDateStr = DateUtil.formatDate(this.startDate);
this.startDateStr = DateUtil.formatDate(this.endDate); this.endDateStr = DateUtil.formatDate(this.endDate);
} }
} }
...@@ -131,6 +131,12 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{ ...@@ -131,6 +131,12 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
@ApiModelProperty(value = "车辆id") @ApiModelProperty(value = "车辆id")
private String vehicleId; private String vehicleId;
//
@ApiModelProperty(value = "商品押金类型 1--线上;2--线下")
private Integer goodsDepositType;
public static final int GOODS_DEPOSIT_TYPE_UP = 1;
public static final int GOODS_DEPOSIT_TYPE_DOWN = 2;
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)));
......
...@@ -764,7 +764,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -764,7 +764,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
RestResponse<Integer> result = vehicleFeign.rentProveVehicleBooking(orvd.getBookRecordId()); RestResponse<Integer> result = vehicleFeign.rentProveVehicleBooking(orvd.getBookRecordId());
//确认免费天数 //确认免费天数
if (orvd.getFreeDays() > 0) { if (null != orvd.getFreeDays() && orvd.getFreeDays() > 0) {
userFeign.memberDays(baseOrder.getUserId(), orvd.getFreeDays(), UserFeign.MEMBER_DAYS_CONFIRM); userFeign.memberDays(baseOrder.getUserId(), orvd.getFreeDays(), UserFeign.MEMBER_DAYS_CONFIRM);
} }
......
...@@ -27,9 +27,8 @@ import com.xxfc.platform.order.mqhandler.RabbitProduct; ...@@ -27,9 +27,8 @@ import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.order.OrderPageVO; import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.RentVehicleBO; import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO; import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO;
import com.xxfc.platform.order.rest.background.BgShuntApplyController;
import com.xxfc.platform.order.service.OrderRentVehicleService; import com.xxfc.platform.order.service.OrderRentVehicleService;
import com.xxfc.platform.vehicle.entity.VehicleCategory;
import com.xxfc.platform.vehicle.entity.VehicleModel; import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.BookVehicleVO; import com.xxfc.platform.vehicle.pojo.BookVehicleVO;
...@@ -136,7 +135,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -136,7 +135,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
return w; return w;
}, " crt_time desc "), ShuntApplyVO.class); }, " crt_time desc "), ShuntApplyVO.class);
pages.getData().forEach(data -> { pages.getData().forEach(data -> {
data.setVehicleModel(vehicleFeign.get(data.getModelId()).getData()); data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
}); });
return ObjectRestResponse.succ(pages); return ObjectRestResponse.succ(pages);
...@@ -189,8 +188,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -189,8 +188,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data @Data
public static class ShuntApplyVO extends ShuntApply { public static class ShuntApplyVO extends ShuntApply {
VehicleModel vehicleModel; // VehicleModel vehicleModel;
OrderPageVO orderPageVO; OrderPageVO orderPageVO;
VehicleCategory vehicleCategory;
} }
@Data @Data
...@@ -208,20 +208,20 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -208,20 +208,20 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping(value = "/appBusiness/list", method = RequestMethod.GET) @RequestMapping(value = "/appBusiness/list", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据城市查询待确认申请列表") @ApiOperation(value = "根据城市查询待确认申请列表")
public ObjectRestResponse<PageDataVO<BgShuntApplyController.StewardShuntApply>> stewardList(BgShuntApplyController.ListDTO dto) { public ObjectRestResponse<PageDataVO<StewardShuntApply>> stewardList(ListDTO dto) {
AssertUtils.isBlank(getBusinessUserByAppUser()); AssertUtils.isBlank(getBusinessUserByAppUser());
//获取该城市的申请最大和最小时间 //获取该城市的申请最大和最小时间
//获取该店铺 //获取该店铺
PageDataVO<BgShuntApplyController.StewardShuntApply> list = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> { PageDataVO<StewardShuntApply> list = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
if(null != dto.getCityCode()) { if(null != dto.getCityCode()) {
w.andEqualTo(ShuntApply::getStartCityCode, dto.getCityCode()); w.andEqualTo(ShuntApply::getStartCityCode, dto.getCityCode());
} }
w.andEqualTo(ShuntApply::getStatus, STATUS_CRT); w.andEqualTo(ShuntApply::getStatus, STATUS_CRT);
return w; return w;
}, " crt_time desc "), BgShuntApplyController.StewardShuntApply.class); }, " crt_time desc "), StewardShuntApply.class);
list.getData().forEach(data -> { list.getData().forEach(data -> {
data.setVehicleModel(vehicleFeign.get(data.getModelId()).getData()); data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
}); });
return ObjectRestResponse.succ(list); return ObjectRestResponse.succ(list);
...@@ -230,7 +230,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -230,7 +230,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping(value = "/appBusiness/confirmApply", method = RequestMethod.POST) @RequestMapping(value = "/appBusiness/confirmApply", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "app商家用户确认申请") @ApiOperation(value = "app商家用户确认申请")
public ObjectRestResponse stewardConfirmApply(@RequestBody BgShuntApplyController.ConfirmApplyDTO dto) { public ObjectRestResponse stewardConfirmApply(@RequestBody ConfirmApplyDTO dto) {
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
//查询列表数据 //查询列表数据
...@@ -289,8 +289,8 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -289,8 +289,8 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
Integer companyId = userDTO.getCompanyId(); Integer companyId = userDTO.getCompanyId();
ShuntApply shuntApply = baseBiz.selectById(applyId); ShuntApply shuntApply = baseBiz.selectById(applyId);
BgShuntApplyController.StewardShuntApply shuntApplyVO = BeanUtil.toBean(shuntApply, BgShuntApplyController.StewardShuntApply.class); StewardShuntApply shuntApplyVO = BeanUtil.toBean(shuntApply, StewardShuntApply.class);
shuntApplyVO.setVehicleModel(vehicleFeign.get(shuntApply.getModelId()).getData()); shuntApplyVO.setVehicleCategory(vehicleFeign.getVehicleCategory(shuntApply.getCategoryId()).getData());
RentVehicleBookDTO rbd = new RentVehicleBookDTO(); RentVehicleBookDTO rbd = new RentVehicleBookDTO();
rbd.setModelId(shuntApply.getModelId()); rbd.setModelId(shuntApply.getModelId());
rbd.setParkBranchCompanyId(companyId); rbd.setParkBranchCompanyId(companyId);
...@@ -334,7 +334,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -334,7 +334,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping(value = "/appBusiness/myApplyList", method = RequestMethod.GET) @RequestMapping(value = "/appBusiness/myApplyList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "我的申请") @ApiOperation(value = "我的申请")
public ObjectRestResponse myApplyList(BgShuntApplyController.PageDTO dto) { public ObjectRestResponse myApplyList(PageDTO dto) {
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> { PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
...@@ -346,7 +346,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -346,7 +346,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
}), ShuntApplyController.ShuntApplyVO.class); }), ShuntApplyController.ShuntApplyVO.class);
pages.getData().forEach(data -> { pages.getData().forEach(data -> {
data.setVehicleModel(vehicleFeign.get(data.getModelId()).getData()); data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
if(StrUtil.isNotBlank(data.getOrderNo())) { if(StrUtil.isNotBlank(data.getOrderNo())) {
Map<String, Object> map = CollUtil.newHashMap(); Map<String, Object> map = CollUtil.newHashMap();
...@@ -381,14 +381,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -381,14 +381,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@Data @Data
public static class StewardShuntApply extends ShuntApply { public static class StewardShuntApply extends ShuntApply {
List<UsableVeicleVO> vehicles; List<UsableVeicleVO> vehicles;
VehicleModel vehicleModel; VehicleCategory vehicleCategory;
public VehicleModel getVehicleModel() {
return vehicleModel;
}
public void setVehicleModel(VehicleModel vehicleModel) {
this.vehicleModel = vehicleModel;
}
} }
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Dict; import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
...@@ -58,6 +59,7 @@ import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.NO ...@@ -58,6 +59,7 @@ import static com.github.wxiaoqi.security.admin.constant.enumerate.MemberEnum.NO
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.order.contant.enumerate.ItemTypeEnum.ACCOMPANY; import static com.xxfc.platform.order.contant.enumerate.ItemTypeEnum.ACCOMPANY;
import static com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO.GOODS_DEPOSIT_TYPE_UP;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER; import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@Service @Service
...@@ -195,6 +197,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -195,6 +197,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//商品类型 //商品类型
bo.getOrder().setGoodsType(vehicle.getGoodsType()); bo.getOrder().setGoodsType(vehicle.getGoodsType());
bo.setVehicle(vehicle);
} }
} }
...@@ -397,6 +400,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -397,6 +400,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//车型信息 //车型信息
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData(); VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
//车型信息
Vehicle vehicle = detail.getVehicle();
detail.initDate(); detail.initDate();
List<VehicleModelCalendarPriceDTO> metaVmcpds = vehicleFeign.getPriceByVehicleIdFeignV2(detail.getVehicleId(), detail.getStartDateStr(), detail.getEndDateStr(), dto.getUserid(), detail.getStartCompanyId()).getData(); List<VehicleModelCalendarPriceDTO> metaVmcpds = vehicleFeign.getPriceByVehicleIdFeignV2(detail.getVehicleId(), detail.getStartDateStr(), detail.getEndDateStr(), dto.getUserid(), detail.getStartCompanyId()).getData();
...@@ -513,7 +519,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -513,7 +519,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
} }
//总价格(包含押金) //总价格(包含押金)
orderAmount = orderAmount.add(goodsAmount).add(vehicleModel.getDeposit()); //判断商品押金方式
detail.setVehicleDeposit(vehicle.getDeposit());
detail.setTrafficDeposit(vehicle.getVioDeposit());
detail.setReturnPayResidue(vehicle.getVioDeposit());
if(GOODS_DEPOSIT_TYPE_UP == detail.getGoodsDepositType()) {
orderAmount = orderAmount.add(goodsAmount).add(detail.getVehicleDeposit()).add(detail.getTrafficDeposit());
}else {
orderAmount = orderAmount.add(goodsAmount).add(detail.getTrafficDeposit());
}
realAmount = orderAmount.subtract(couponAmount); realAmount = orderAmount.subtract(couponAmount);
//生成订单明细 //生成订单明细
...@@ -571,6 +585,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -571,6 +585,9 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//车型信息 //车型信息
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData(); VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
//车辆信息
Vehicle vehicle = detail.getVehicle();
detail.initDate(); detail.initDate();
List<VehicleModelCalendarPriceDTO> metaVmcpds = vehicleFeign.getPriceByVehicleIdFeignV2(detail.getVehicleId(), detail.getStartDateStr(), detail.getEndDateStr(), dto.getUserid(), detail.getStartCompanyId()).getData(); List<VehicleModelCalendarPriceDTO> metaVmcpds = vehicleFeign.getPriceByVehicleIdFeignV2(detail.getVehicleId(), detail.getStartDateStr(), detail.getEndDateStr(), dto.getUserid(), detail.getStartCompanyId()).getData();
...@@ -619,20 +636,20 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -619,20 +636,20 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//如果用户存在,并且为会员,并且车辆有优惠价 //如果用户存在,并且为会员,并且车辆有优惠价
//默认折扣默认100 //默认折扣默认100
detail.setRebate(100); detail.setRebate(100);
if(null != dto && SYS_TRUE.equals(dto.getIsMember()) && !NONE.getCode().equals(dto.getMemberLevel()) && !DISCOUNT_STATUS_NONE.equals(vehicleModel.getRentDiscountStatus())) { // if(null != dto && SYS_TRUE.equals(dto.getIsMember()) && !NONE.getCode().equals(dto.getMemberLevel()) && !DISCOUNT_STATUS_NONE.equals(vehicleModel.getRentDiscountStatus())) {
String[] prices = StrUtil.isBlank(vehicleModel.getRentDiscountPrice()) // String[] prices = StrUtil.isBlank(vehicleModel.getRentDiscountPrice())
?new String[]{vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString()} // ?new String[]{vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString(),vehicleModel.getPrice().toString()}
:vehicleModel.getRentDiscountPrice().split(","); // :vehicleModel.getRentDiscountPrice().split(",");
//设置是否使用会员权益 // //设置是否使用会员权益
for(VMCalendarPriceCostDTO vmcpcd : vehicleOrderItem.getVehicleDetail()) { // for(VMCalendarPriceCostDTO vmcpcd : vehicleOrderItem.getVehicleDetail()) {
if(!vmcpcd.getNo_discount_price().equals(vmcpcd.getPrice())) { // if(!vmcpcd.getNo_discount_price().equals(vmcpcd.getPrice())) {
detail.getOrder().setHasMemberRight(SYS_TRUE); // detail.getOrder().setHasMemberRight(SYS_TRUE);
break; // break;
} // }
} // }
//
detail.setRebate(dto.getDiscount()); // detail.setRebate(dto.getDiscount());
} // }
//计算价格 //计算价格
if(vehicleHourNum > 0) { if(vehicleHourNum > 0) {
...@@ -690,8 +707,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -690,8 +707,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
} }
//总价格(包含押金) //总价格(包含押金)
orderAmount = orderAmount.add(goodsAmount).add(vehicleModel.getDeposit()); //判断商品押金方式
realAmount = orderAmount.subtract(couponAmount); detail.setVehicleDeposit(vehicle.getDeposit());
detail.setTrafficDeposit(vehicle.getVioDeposit());
detail.setReturnPayResidue(vehicle.getVioDeposit());
if(GOODS_DEPOSIT_TYPE_UP == detail.getGoodsDepositType()) {
orderAmount = orderAmount.add(goodsAmount).add(detail.getVehicleDeposit()).add(detail.getTrafficDeposit());
}else {
orderAmount = orderAmount.add(goodsAmount).add(detail.getTrafficDeposit());
}
//生成订单明细 //生成订单明细
RentVehiclePriceVO rvp = new RentVehiclePriceVO(); RentVehiclePriceVO rvp = new RentVehiclePriceVO();
...@@ -713,6 +737,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -713,6 +737,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rvp.setVehicleHourNum(vehicleHourNum); rvp.setVehicleHourNum(vehicleHourNum);
rvp.setFreeHourNum(0); rvp.setFreeHourNum(0);
rvp.setFreeDayNum(0);
rvp.setCutDayNum(offsetNum); rvp.setCutDayNum(offsetNum);
rvp.setFreeAmount(vehicleOrderItem.getCutAmount()); rvp.setFreeAmount(vehicleOrderItem.getCutAmount());
rvp.setBuyVehicleAmount(vehicleOrderItem.getBuyAmount()); rvp.setBuyVehicleAmount(vehicleOrderItem.getBuyAmount());
...@@ -771,7 +796,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -771,7 +796,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
if(DRIVER_TYPE_DAMAGE_SAFE.equals(detail.getDamageSafe())) { if(DRIVER_TYPE_DAMAGE_SAFE.equals(detail.getDamageSafe())) {
childrenStr.append(",${tem_0104}"); childrenStr.append(",${tem_0104}");
} }
if(detail.getFreeDays() > 0) { if(null != detail.getFreeDays() && detail.getFreeDays() > 0) {
childrenStr.append(",${tem_0105}"); childrenStr.append(",${tem_0105}");
} }
if(StrUtil.isNotBlank(detail.getOrder().getCouponTickerNos())) { if(StrUtil.isNotBlank(detail.getOrder().getCouponTickerNos())) {
......
...@@ -26,6 +26,9 @@ import java.util.*; ...@@ -26,6 +26,9 @@ import java.util.*;
*/ */
@FeignClient(name = "vehicle", contextId = "vh") @FeignClient(name = "vehicle", contextId = "vh")
public interface VehicleFeign { public interface VehicleFeign {
@GetMapping(value = "/vehicleCategory/{id}")
public ObjectRestResponse<VehicleCategory> getVehicleCategory(@PathVariable(value = "id") int id);
@GetMapping(value = "/vehicleModel/{id}") @GetMapping(value = "/vehicleModel/{id}")
public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id); public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id);
......
...@@ -5,6 +5,7 @@ import com.xxfc.platform.vehicle.entity.VehiclePlatCata; ...@@ -5,6 +5,7 @@ import com.xxfc.platform.vehicle.entity.VehiclePlatCata;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -16,6 +17,13 @@ public class RentVehicleBookDTO extends PageParam { ...@@ -16,6 +17,13 @@ public class RentVehicleBookDTO extends PageParam {
//根据车型、时间、距离,门店,预定车辆 //根据车型、时间、距离,门店,预定车辆
@ApiModelProperty("车型id") @ApiModelProperty("车型id")
private Integer modelId; private Integer modelId;
@ApiModelProperty("品牌id")
private Integer brandId;
@ApiModelProperty("型号id")
private Integer categoryId;
/** /**
* 预定目标日期(开始) * 预定目标日期(开始)
*/ */
......
...@@ -411,7 +411,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements ...@@ -411,7 +411,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
public List<VehicleModelCalendarPriceDTO> getSynthesizePrice (String vehicleId, String startDate, String endDate, Integer userId, Integer companyId) { public List<VehicleModelCalendarPriceDTO> getSynthesizePrice (String vehicleId, String startDate, String endDate, Integer userId, Integer companyId) {
List<VehicleModelCalendarPriceDTO> priceDTOS = CollUtil.newArrayList(); List<VehicleModelCalendarPriceDTO> priceDTOS = CollUtil.newArrayList();
cn.hutool.core.date.DateTime beginOfStartDate = DateUtil.beginOfDay(DateUtil.parse(startDate)); cn.hutool.core.date.DateTime beginOfStartDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
cn.hutool.core.date.DateTime endOfStartDate = DateUtil.endOfDay(DateUtil.parse(endDate)); cn.hutool.core.date.DateTime endOfEndDate = DateUtil.endOfDay(DateUtil.parse(endDate));
//获取基本和周末价格 //获取基本和周末价格
Vehicle vehicle = vehicleBiz.selectOne(new Vehicle(){{ Vehicle vehicle = vehicleBiz.selectOne(new Vehicle(){{
setParkBranchCompanyId(companyId); setParkBranchCompanyId(companyId);
...@@ -424,7 +424,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements ...@@ -424,7 +424,7 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
//Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate)); //Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
for(cn.hutool.core.date.DateTime currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate)); for(cn.hutool.core.date.DateTime currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
(currentDate.isAfterOrEquals(beginOfStartDate) && currentDate.isBeforeOrEquals(endOfStartDate)); (currentDate.isAfterOrEquals(beginOfStartDate) && currentDate.isBeforeOrEquals(endOfEndDate));
currentDate = DateUtil.offsetDay(currentDate, 1)) { currentDate = DateUtil.offsetDay(currentDate, 1)) {
cn.hutool.core.date.DateTime finalCurrentDate = currentDate; cn.hutool.core.date.DateTime finalCurrentDate = currentDate;
VehicleModelCalendarPriceDTO dto = new VehicleModelCalendarPriceDTO(){{ VehicleModelCalendarPriceDTO dto = new VehicleModelCalendarPriceDTO(){{
......
...@@ -1135,6 +1135,12 @@ ...@@ -1135,6 +1135,12 @@
<if test="memberUse != null and memberUse>0"> <if test="memberUse != null and memberUse>0">
and (v.member_use = 1 or v.member_use = #{memberUse}) and (v.member_use = 1 or v.member_use = #{memberUse})
</if> </if>
<if test="brandId != null ">
and brand_id = #{brandId}
</if>
<if test="categoryId != null ">
and category_id = #{categoryId}
</if>
<if test="lon != null and lat != null"> <if test="lon != null and lat != null">
order by order by
distance asc distance asc
......
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