Commit 7be3c65d authored by libin's avatar libin

提现账号

parent 447bf340
...@@ -84,4 +84,9 @@ public class VehicleModelCalendarPrice implements Serializable { ...@@ -84,4 +84,9 @@ public class VehicleModelCalendarPrice implements Serializable {
@Column(name = "is_del") @Column(name = "is_del")
private Integer isDel; private Integer isDel;
/**
* 会员等级 1:普通 2:黄金 3:钻石
*/
private Integer level;
} }
...@@ -22,7 +22,8 @@ import java.util.Date; ...@@ -22,7 +22,8 @@ import java.util.Date;
public class VehicleModelCalendarPriceDTO implements Serializable { public class VehicleModelCalendarPriceDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Date date;
private BigDecimal price; private BigDecimal price;
private Date bookDate;
private Integer freeDays; private Integer freeDays;
private Boolean isSelect;
} }
...@@ -51,4 +51,8 @@ public class VehicleModelCalendarPriceSaveDTO implements Serializable { ...@@ -51,4 +51,8 @@ public class VehicleModelCalendarPriceSaveDTO implements Serializable {
*/ */
private BigDecimal price; private BigDecimal price;
/**
* 会员等级 1:普通 2:黄金 3:钻石
*/
private Integer level;
} }
package com.xxfc.platform.vehicle.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/15 9:43
*/
@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class VehicleModelCalendarPriceVo implements Serializable {
private static final long serialVersionUID = 1L;
private Date date;
private BigDecimal price;
private Integer days;
private Boolean isSelect;
}
package com.xxfc.platform.vehicle.biz; package com.xxfc.platform.vehicle.biz;
import com.github.wxiaoqi.security.admin.entity.BaseUserMember; import com.github.wxiaoqi.security.admin.entity.BaseUserMember;
import com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.vehicle.entity.VehicleModelCalendarPrice; import com.xxfc.platform.vehicle.entity.VehicleModelCalendarPrice;
...@@ -9,7 +10,6 @@ import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO; ...@@ -9,7 +10,6 @@ import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceSaveDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceSaveDTO;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelDTO;
import com.xxfc.platform.vehicle.pojo.dto.VehicleModelHolidayPriceDTO; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelHolidayPriceDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleModelCalendarPriceVo;
import com.xxfc.platform.vehicle.pojo.vo.VehicleModelDayPriceVo; import com.xxfc.platform.vehicle.pojo.vo.VehicleModelDayPriceVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -46,20 +46,18 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -46,20 +46,18 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* 一个星期的最后一天 * 一个星期的最后一天
*/ */
private static final int END_OF_WEEK = 7; private static final int END_OF_WEEK = 7;
/**
* 价格类型查询
*/
private static final int PRICE_OF_TYPE = 0;
/**
* 天数类型查询
*/
private static final int DAYS_OF_TYPE = 1;
private final VehicleModelHolidayPriceBiz vehicleModelHolidayPriceBiz; private final VehicleModelHolidayPriceBiz vehicleModelHolidayPriceBiz;
private final VehicleModelBiz vehicleModelBiz; private final VehicleModelBiz vehicleModelBiz;
private final UserFeign userFeign; private final UserFeign userFeign;
/**
* 保存
*
* @param vehicleModelCalendarPrices
* @param userId
*/
public void addVehicleModelCalendarPrice(List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPrices, Integer userId) { public void addVehicleModelCalendarPrice(List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPrices, Integer userId) {
if (CollectionUtils.isNotEmpty(vehicleModelCalendarPrices)) { if (CollectionUtils.isNotEmpty(vehicleModelCalendarPrices)) {
List<VehicleModelCalendarPrice> vehicleModelCalendarPriceList = new ArrayList<>(); List<VehicleModelCalendarPrice> vehicleModelCalendarPriceList = new ArrayList<>();
...@@ -86,6 +84,11 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -86,6 +84,11 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
} }
/**
* 查询全部车型
*
* @return
*/
public List<VehicleModelDayPriceVo> listVehicleModelPrice() { public List<VehicleModelDayPriceVo> listVehicleModelPrice() {
List<VehicleModelDayPriceVo> vehicleModelDayPriceVos = new ArrayList<>(); List<VehicleModelDayPriceVo> vehicleModelDayPriceVos = new ArrayList<>();
List<VehicleModelDTO> vehicleModelDTOS = vehicleModelBiz.findAllVehicleModel(); List<VehicleModelDTO> vehicleModelDTOS = vehicleModelBiz.findAllVehicleModel();
...@@ -98,6 +101,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -98,6 +101,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return vehicleModelDayPriceVos; return vehicleModelDayPriceVos;
} }
/**
* 根据俱体日期查询
*
* @param currentDate
* @return
*/
public List<VehicleModelDayPriceVo> findVehicleModelcalendarPriceByDateWithDay(Date currentDate) { public List<VehicleModelDayPriceVo> findVehicleModelcalendarPriceByDateWithDay(Date currentDate) {
List<VehicleModelDayPriceVo> vehicleModelDayPriceVos = new ArrayList<>(); List<VehicleModelDayPriceVo> vehicleModelDayPriceVos = new ArrayList<>();
Map<Integer, VehicleModelCalendarPrice> vehicleModelCalendarPriceMap = null; Map<Integer, VehicleModelCalendarPrice> vehicleModelCalendarPriceMap = null;
...@@ -124,7 +133,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -124,7 +133,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return vehicleModelDayPriceVos; return vehicleModelDayPriceVos;
} }
/**
* 根据月份查询
*
* @param currentDate
* @return
*/
public List<VehicleModelCalendarPriceSaveDTO> findVehicleModelCalendarPricesByDateWithMonth(Date currentDate) { public List<VehicleModelCalendarPriceSaveDTO> findVehicleModelCalendarPricesByDateWithMonth(Date currentDate) {
List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPriceSaveDTOS = new ArrayList<>(); List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPriceSaveDTOS = new ArrayList<>();
Example example = new Example(VehicleModelCalendarPrice.class); Example example = new Example(VehicleModelCalendarPrice.class);
...@@ -149,121 +163,88 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -149,121 +163,88 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return vehicleModelCalendarPriceSaveDTOS; return vehicleModelCalendarPriceSaveDTOS;
} }
/**
* 根据下单时间查询
*
* @param startDate
* @param endDate
* @param vehicleModelId
* @param userId
* @return
*/
public List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) { public List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) {
List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceDTOS = new ArrayList<>(); return findVehicleModelCalendarPrice(startDate, endDate, vehicleModelId, userId);
//车型的原价
BigDecimal vehicle_price = new BigDecimal(0);
Integer discount = 100;
int free_days = 1;
//日历价格转map
List<VehicleModelCalendarPrice> vehicleModelCalendarPrices = getVehicleModelCalendarPricesByVehicleModelIdAndDate(vehicleModelId, startDate, endDate);
Map<Date, VehicleModelCalendarPrice> calendarPriceMap = vehicleModelCalendarPrices.stream().collect(Collectors.toMap(VehicleModelCalendarPrice::getVehicleModelDay, Function.identity()));
//节假日转map
List<VehicleModelHolidayPriceDTO> vehicleModelHolidayPrices = vehicleModelHolidayPriceBiz.findVehicleModelHolidayPriceByMonth(startDate, endDate);
Map<Date, VehicleModelHolidayPriceDTO> festivalDayMap = vehicleModelHolidayPrices.stream().collect(Collectors.toMap(VehicleModelHolidayPriceDTO::getFestivalDay, Function.identity()));
vehicle_price = vehicleModelBiz.findVehicleModelPriceByVehicleModelId(vehicleModelId);
if (Objects.nonNull(userId)) {
BaseUserMember baseUserMember = userFeign.findBaseUserMemberByUserId(userId);
discount = baseUserMember == null ? discount : baseUserMember.getDiscount();
} }
VehicleModelCalendarPriceVo vehicleModelCalendarPriceVo; /**
LocalDate final_startLocalDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); * 日历展示车型价格
LocalDate final_endLocalDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); *
* @param startDate
VehicleModelCalendarPriceDTO vehicleModelCalendarPriceDTO; * @param endDate
while (final_startLocalDate.isBefore(final_endLocalDate) || final_startLocalDate.isEqual(final_endLocalDate)) { * @param vehicleModelId
vehicleModelCalendarPriceDTO = new VehicleModelCalendarPriceDTO(); * @param userId
Date current_date = Date.from(final_startLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); * @return
vehicleModelCalendarPriceDTO.setBookDate(current_date); */
public List<VehicleModelCalendarPriceDTO> listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) {
LocalDate startLocalDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate endLocalDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
if (calendarPriceMap != null && !calendarPriceMap.isEmpty()) { //处理后延伸的开始时间
VehicleModelCalendarPrice vehicleModelCalendarPrice = calendarPriceMap.get(Date.from(final_startLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant())); AtomicReference<Date> startReference = new AtomicReference<>(startDate);
if (Objects.isNull(vehicleModelCalendarPrice)) { //处理后延伸的结束时间
if (festivalDayMap != null && !festivalDayMap.isEmpty()) { AtomicReference<Date> endReference = new AtomicReference<>(endDate);
VehicleModelHolidayPriceDTO vehicleModelHolidayPriceDTO = festivalDayMap.get(current_date); transformStartDateAndEndDate(startReference, endReference);
if (Objects.nonNull(vehicleModelHolidayPriceDTO)) { List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPrice = findVehicleModelCalendarPrice(startReference.get(), endReference.get(), vehicleModelId, userId);
vehicle_price = vehicle_price.multiply(new BigDecimal(vehicleModelHolidayPriceDTO.getMultiple().doubleValue() * (discount / 100))); for (VehicleModelCalendarPriceDTO vehicleModelCalendarPriceDTO : vehicleModelCalendarPrice) {
free_days = vehicleModelHolidayPriceDTO.getFreeDays(); LocalDate current_date = vehicleModelCalendarPriceDTO.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
} boolean isSelect = (current_date.isAfter(startLocalDate) && current_date.isBefore(endLocalDate)) || current_date.isEqual(startLocalDate) || current_date.isEqual(endLocalDate);
} if (isSelect) {
vehicleModelCalendarPriceDTO.setIsSelect(true);
} else { } else {
switch (vehicleModelCalendarPrice.getType()) { vehicleModelCalendarPriceDTO.setIsSelect(false);
case VehicleModelPriceType.MULTIPLE:
vehicle_price = vehicle_price.multiply(new BigDecimal(vehicleModelCalendarPrice.getMultiple().doubleValue() * (discount / 100)));
break;
case VehicleModelPriceType.ABS:
vehicle_price = vehicleModelCalendarPrice.getPrice().multiply(new BigDecimal(discount / 100));
break;
case VehicleModelPriceType.MEMBER:
//todo
break;
default:
break;
} }
free_days = vehicleModelCalendarPrice.getFreeDays();
} }
} return vehicleModelCalendarPrice;
vehicleModelCalendarPriceDTO.setFreeDays(free_days);
vehicleModelCalendarPriceDTO.setPrice(vehicle_price);
final_startLocalDate = final_startLocalDate.plusDays(1);
vehicleModelCalendarPriceDTOS.add(vehicleModelCalendarPriceDTO);
}
return vehicleModelCalendarPriceDTOS;
} }
/** /**
* 日历价格查询
*
* @param startDate * @param startDate
* @param endDate * @param endDate
* @param vehicleModelId * @param vehicleModelId
* @return * @return
*/ */
public List<VehicleModelCalendarPriceVo> listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) { public List<VehicleModelCalendarPriceDTO> findVehicleModelCalendarPrice(Date startDate, Date endDate, Integer vehicleModelId, Integer userId) {
List<VehicleModelCalendarPriceVo> vehicleModelCalendarPriceVos = new ArrayList<>(); List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceVos = new ArrayList<>();
//车型的原价 //默认折扣
BigDecimal vehicle_price = new BigDecimal(0);
Integer discount = 100; Integer discount = 100;
//默认免费天数
int free_days = 1; int free_days = 1;
//会员默认等级
AtomicReference<Date> startReference = new AtomicReference<>(startDate); Integer memberLevel = 0;
AtomicReference<Date> endReference = new AtomicReference<>(endDate);
transformStartDateAndEndDate(startReference, endReference);
//处理后延伸的开始时间
Date final_startDate = startReference.get();
//处理后延伸的结束时间
Date final_endDate = endReference.get();
//日历价格转map //日历价格转map
List<VehicleModelCalendarPrice> vehicleModelCalendarPrices = getVehicleModelCalendarPricesByVehicleModelIdAndDate(vehicleModelId, final_startDate, final_endDate); List<VehicleModelCalendarPrice> vehicleModelCalendarPrices = getVehicleModelCalendarPricesByVehicleModelIdAndDate(vehicleModelId, startDate, endDate);
Map<Date, VehicleModelCalendarPrice> calendarPriceMap = vehicleModelCalendarPrices.stream().collect(Collectors.toMap(VehicleModelCalendarPrice::getVehicleModelDay, Function.identity())); Map<Date, VehicleModelCalendarPrice> calendarPriceMap = vehicleModelCalendarPrices.stream().collect(Collectors.toMap(VehicleModelCalendarPrice::getVehicleModelDay, Function.identity()));
//节假日转map //节假日转map
List<VehicleModelHolidayPriceDTO> vehicleModelHolidayPrices = vehicleModelHolidayPriceBiz.findVehicleModelHolidayPriceByMonth(final_startDate, final_endDate); List<VehicleModelHolidayPriceDTO> vehicleModelHolidayPrices = vehicleModelHolidayPriceBiz.findVehicleModelHolidayPriceByMonth(startDate, endDate);
Map<Date, VehicleModelHolidayPriceDTO> festivalDayMap = vehicleModelHolidayPrices.stream().collect(Collectors.toMap(VehicleModelHolidayPriceDTO::getFestivalDay, Function.identity())); Map<Date, VehicleModelHolidayPriceDTO> festivalDayMap = vehicleModelHolidayPrices.stream().collect(Collectors.toMap(VehicleModelHolidayPriceDTO::getFestivalDay, Function.identity()));
Map<Integer, Integer> levelAndDiscountMap = userFeign.levels().stream().collect(Collectors.toMap(BaseUserMemberLevel::getLevel, BaseUserMemberLevel::getDiscount));
vehicle_price = vehicleModelBiz.findVehicleModelPriceByVehicleModelId(vehicleModelId); //车型的原价
BigDecimal vehicle_price = vehicleModelBiz.findVehicleModelPriceByVehicleModelId(vehicleModelId);
if (Objects.nonNull(userId)) { if (Objects.nonNull(userId)) {
BaseUserMember baseUserMember = userFeign.findBaseUserMemberByUserId(userId); BaseUserMember baseUserMember = userFeign.findBaseUserMemberByUserId(userId);
discount = baseUserMember == null ? discount : baseUserMember.getDiscount(); discount = baseUserMember == null ? discount : baseUserMember.getDiscount();
memberLevel = baseUserMember == null ? memberLevel : baseUserMember.getMemberLevel();
} }
VehicleModelCalendarPriceVo vehicleModelCalendarPriceVo; VehicleModelCalendarPriceDTO vehicleModelCalendarPriceDTO;
LocalDate startLocalDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate final_startLocalDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate endLocalDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate final_endLocalDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate final_startLocalDate = final_startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate final_endLocalDate = final_endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
while (final_startLocalDate.isBefore(final_endLocalDate) || final_startLocalDate.isEqual(final_endLocalDate)) { while (final_startLocalDate.isBefore(final_endLocalDate) || final_startLocalDate.isEqual(final_endLocalDate)) {
vehicleModelCalendarPriceVo = new VehicleModelCalendarPriceVo(); vehicleModelCalendarPriceDTO = new VehicleModelCalendarPriceDTO();
Date current_date = Date.from(final_startLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); Date current_date = Date.from(final_startLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
vehicleModelCalendarPriceVo.setDate(current_date); vehicleModelCalendarPriceDTO.setDate(current_date);
if (final_startLocalDate.isAfter(startLocalDate) || final_startLocalDate.isEqual(startLocalDate) || final_startLocalDate.isEqual(endLocalDate)) {
vehicleModelCalendarPriceVo.setIsSelect(true);
} else {
vehicleModelCalendarPriceVo.setIsSelect(false);
}
if (calendarPriceMap != null && !calendarPriceMap.isEmpty()) { if (calendarPriceMap != null && !calendarPriceMap.isEmpty()) {
VehicleModelCalendarPrice vehicleModelCalendarPrice = calendarPriceMap.get(current_date); VehicleModelCalendarPrice vehicleModelCalendarPrice = calendarPriceMap.get(current_date);
if (Objects.isNull(vehicleModelCalendarPrice)) { if (Objects.isNull(vehicleModelCalendarPrice)) {
...@@ -283,22 +264,32 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -283,22 +264,32 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
vehicle_price = vehicleModelCalendarPrice.getPrice().multiply(new BigDecimal(discount / 100)); vehicle_price = vehicleModelCalendarPrice.getPrice().multiply(new BigDecimal(discount / 100));
break; break;
case VehicleModelPriceType.MEMBER: case VehicleModelPriceType.MEMBER:
//todo memberLevel = vehicleModelCalendarPrice.getLevel() > memberLevel ? vehicleModelCalendarPrice.getLevel() : memberLevel;
Integer level_discount = levelAndDiscountMap.get(memberLevel);
vehicle_price = level_discount == null ? vehicleModelCalendarPrice.getPrice() : vehicleModelCalendarPrice.getPrice().multiply(new BigDecimal(level_discount / 100));
break; break;
default: default:
break; break;
} }
free_days = vehicleModelCalendarPrice.getFreeDays(); free_days = vehicleModelCalendarPrice.getFreeDays();
} }
vehicleModelCalendarPriceVo.setPrice(vehicle_price); vehicleModelCalendarPriceDTO.setPrice(vehicle_price);
vehicleModelCalendarPriceVo.setDays(free_days); vehicleModelCalendarPriceDTO.setFreeDays(free_days);
} }
final_startLocalDate = final_startLocalDate.plusDays(1); final_startLocalDate = final_startLocalDate.plusDays(1);
vehicleModelCalendarPriceVos.add(vehicleModelCalendarPriceVo); vehicleModelCalendarPriceVos.add(vehicleModelCalendarPriceDTO);
} }
return vehicleModelCalendarPriceVos; return vehicleModelCalendarPriceVos;
} }
/**
* 根据时间范围查询
*
* @param vehicleModelId
* @param final_startDate
* @param final_endDate
* @return
*/
private List<VehicleModelCalendarPrice> getVehicleModelCalendarPricesByVehicleModelIdAndDate(Integer vehicleModelId, Date final_startDate, Date final_endDate) { private List<VehicleModelCalendarPrice> getVehicleModelCalendarPricesByVehicleModelIdAndDate(Integer vehicleModelId, Date final_startDate, Date final_endDate) {
Example example = new Example(VehicleModelCalendarPrice.class); Example example = new Example(VehicleModelCalendarPrice.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
...@@ -309,6 +300,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr ...@@ -309,6 +300,12 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return CollectionUtils.isEmpty(vehicleModelCalendarPrices) ? Collections.EMPTY_LIST : vehicleModelCalendarPrices; return CollectionUtils.isEmpty(vehicleModelCalendarPrices) ? Collections.EMPTY_LIST : vehicleModelCalendarPrices;
} }
/**
* 时间处理
*
* @param startDatee
* @param endDatee
*/
public static void transformStartDateAndEndDate(AtomicReference<Date> startDatee, AtomicReference<Date> endDatee) { public static void transformStartDateAndEndDate(AtomicReference<Date> startDatee, AtomicReference<Date> endDatee) {
Date startDate = startDatee.get(); Date startDate = startDatee.get();
Date endDate = endDatee.get(); Date endDate = endDatee.get();
......
...@@ -3,7 +3,7 @@ package com.xxfc.platform.vehicle.rest; ...@@ -3,7 +3,7 @@ package com.xxfc.platform.vehicle.rest;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.VehicleModelCalendarPriceBiz; import com.xxfc.platform.vehicle.biz.VehicleModelCalendarPriceBiz;
import com.xxfc.platform.vehicle.pojo.vo.VehicleModelCalendarPriceVo; import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -30,11 +30,11 @@ public class VehicleModelCalendarPriceController { ...@@ -30,11 +30,11 @@ public class VehicleModelCalendarPriceController {
@ApiOperation("返回车型日历价格") @ApiOperation("返回车型日历价格")
@GetMapping("/list/vehicle_model/calendar_price/{vehicleModelId}/{type}") @GetMapping("/list/vehicle_model/calendar_price/{vehicleModelId}/{type}")
public ObjectRestResponse<VehicleModelCalendarPriceVo> listVehicleModelCalendarPriceByDateAndVehicleModelId(@RequestParam(value = "start",required = false) Date startDate, public ObjectRestResponse<VehicleModelCalendarPriceDTO> listVehicleModelCalendarPriceByDateAndVehicleModelId(@RequestParam(value = "start",required = false) Date startDate,
@RequestParam(value = "end",required = false) Date endDate, @RequestParam(value = "end",required = false) Date endDate,
@PathVariable(value = "vehicleModelId") Integer vehicleModelId, @PathVariable(value = "vehicleModelId") Integer vehicleModelId,
AppUserDTO appUserDTO){ AppUserDTO appUserDTO){
List<VehicleModelCalendarPriceVo> vehicleModelCalendarPriceVos = vehicleModelCalendarPriceBiz.listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(startDate,endDate,vehicleModelId,appUserDTO.getUserid()); List<VehicleModelCalendarPriceDTO> vehicleModelCalendarPriceVos = vehicleModelCalendarPriceBiz.listVehicleModelCalendarPriceByDateAndVehicleModelIdAndUserId(startDate,endDate,vehicleModelId,appUserDTO.getUserid());
return ObjectRestResponse.succ(vehicleModelCalendarPriceVos); return ObjectRestResponse.succ(vehicleModelCalendarPriceVos);
} }
} }
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