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

修改车辆代码

parent 8deb88e8
...@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> { ...@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
//根据延期的天数算出 对应的日期价格 //根据延期的天数算出 对应的日期价格
Date overStart = DateUtil.offsetDay(endDate, 1); Date overStart = DateUtil.offsetDay(endDate, 1);
Date overEnd = DateUtil.offsetDay(endDate, overDays); Date overEnd = DateUtil.offsetDay(endDate, overDays);
List<VehicleModelCalendarPriceDTO> overlist = vehicleFeign.findVehicleModelCalendarPriceByDate(overStart, overEnd, modelId, userId).getData(); List<VehicleModelCalendarPriceDTO> overlist = vehicleFeign.findVehicleModelCalendarPriceByDate(overStart.getTime(), overEnd.getTime(), modelId, userId).getData();
for(VehicleModelCalendarPriceDTO vmcpd : overlist) { for(VehicleModelCalendarPriceDTO vmcpd : overlist) {
overAmountList.add((VMCalendarPriceCostDTO) vmcpd); overAmountList.add((VMCalendarPriceCostDTO) vmcpd);
......
...@@ -238,7 +238,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -238,7 +238,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData(); VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
detail.initDate(); detail.initDate();
List<VehicleModelCalendarPriceDTO> vmcpds = vehicleFeign.findVehicleModelCalendarPriceByDate(detail.getStartDate(), detail.getEndDate(), detail.getModelId(), dto.getUserid()).getData(); List<VehicleModelCalendarPriceDTO> vmcpds = vehicleFeign.findVehicleModelCalendarPriceByDate(detail.getStartTime(), detail.getEndTime(), detail.getModelId(), dto.getUserid()).getData();
//设置Item //设置Item
......
...@@ -189,8 +189,8 @@ public interface VehicleFeign { ...@@ -189,8 +189,8 @@ public interface VehicleFeign {
* @return * @return
*/ */
@GetMapping(value = "/vehicle_model/calendar_price/app/unauth/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @GetMapping(value = "/vehicle_model/calendar_price/app/unauth/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate, ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Long startDate,
@RequestParam(value = "endDate") Date endDate, @RequestParam(value = "endDate") Long endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId, @RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@RequestParam(value = "userId") Integer userId); @RequestParam(value = "userId") Integer userId);
......
package com.xxfc.platform.vehicle.rest; package com.xxfc.platform.vehicle.rest;
import cn.hutool.core.date.DateUtil;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
...@@ -53,12 +54,15 @@ public class VehicleModelCalendarPriceController { ...@@ -53,12 +54,15 @@ public class VehicleModelCalendarPriceController {
} }
@GetMapping(value = "/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @GetMapping(value = "/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate, public ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Long startDate,
@RequestParam(value = "endDate") Date endDate, @RequestParam(value = "endDate") Long endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId, @RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@RequestParam(value = "userId") Integer userId) { @RequestParam(value = "userId") Integer userId) {
startDate = Date.from(startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
endDate = Date.from(endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant()); Date startDateDay = DateUtil.beginOfDay(DateUtil.date(startDate));
return ObjectRestResponse.succ(vehicleModelCalendarPriceBiz.findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(startDate, endDate, vehicleModelId, userId)); //Date.from(startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
Date endDateDay = DateUtil.beginOfDay(DateUtil.date(endDate));
//Date.from(endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
return ObjectRestResponse.succ(vehicleModelCalendarPriceBiz.findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(startDateDay, endDateDay, vehicleModelId, userId));
} }
} }
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