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

修改车辆代码

parent 8deb88e8
......@@ -55,7 +55,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
//根据延期的天数算出 对应的日期价格
Date overStart = DateUtil.offsetDay(endDate, 1);
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) {
overAmountList.add((VMCalendarPriceCostDTO) vmcpd);
......
......@@ -238,7 +238,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
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
......
......@@ -189,8 +189,8 @@ public interface VehicleFeign {
* @return
*/
@GetMapping(value = "/vehicle_model/calendar_price/app/unauth/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate,
@RequestParam(value = "endDate") Date endDate,
ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Long startDate,
@RequestParam(value = "endDate") Long endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@RequestParam(value = "userId") Integer userId);
......
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.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.exception.BaseException;
......@@ -53,12 +54,15 @@ public class VehicleModelCalendarPriceController {
}
@GetMapping(value = "/price",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Date startDate,
@RequestParam(value = "endDate") Date endDate,
public ObjectRestResponse<List<VehicleModelCalendarPriceDTO>> findVehicleModelCalendarPriceByDate(@RequestParam(value = "startDate") Long startDate,
@RequestParam(value = "endDate") Long endDate,
@RequestParam(value = "vehicleModelId") Integer vehicleModelId,
@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());
return ObjectRestResponse.succ(vehicleModelCalendarPriceBiz.findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(startDate, endDate, vehicleModelId, userId));
Date startDateDay = DateUtil.beginOfDay(DateUtil.date(startDate));
//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