Commit 0ae4fb91 authored by libin's avatar libin

日历价格

parent 44e035a6
......@@ -133,4 +133,5 @@ public interface UserFeign {
@GetMapping("/member/user")
BaseUserMember findBaseUserMemberByUserId(@RequestParam(value = "userId") Integer userId);
}
package com.github.wxiaoqi.security.admin.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 用户信息表
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppUserVo {
......
......@@ -39,30 +39,14 @@ import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPriceMapper, VehicleModelCalendarPrice> {
/**
* 一个星期的第一天
*/
private static final int START_OF_WEEK = 1;
/**
* 一个星期的最后一天
*/
private static final int END_OF_WEEK = 7;
/**
* 默认折扣
*/
private static final Integer DEFAULT_DISCOUNT = 100;
/**
* 默认免费天数
*/
private static final Integer DEFAULT_FREE_DAYS = 1;
/**
* 默认会员等级
*/
private static final Integer DEFAULT_MEMBER_LEVEL = 0;
private static final String PRICE_VAL = "price";
private static final String DAYS_VAL = "freeDays";
private final VehicleModelHolidayPriceBiz vehicleModelHolidayPriceBiz;
private final VehicleModelBiz vehicleModelBiz;
private final UserFeign userFeign;
......@@ -263,8 +247,8 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
memberLevel = baseUserMember == null ? memberLevel : baseUserMember.getMemberLevel();
}
VehicleModelCalendarPriceDTO vehicleModelCalendarPriceDTO;
LocalDate final_startLocalDate = startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate final_endLocalDate = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate final_startLocalDate = dateToLocalDate(startDate);
LocalDate final_endLocalDate = dateToLocalDate(endDate);
while (final_startLocalDate.isBefore(final_endLocalDate) || final_startLocalDate.isEqual(final_endLocalDate)) {
vehicleModelCalendarPriceDTO = new VehicleModelCalendarPriceDTO();
//价格重置
......@@ -275,7 +259,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
Integer free_days = DEFAULT_FREE_DAYS;
//节假日对应的价格和免费天数
Map<String, Object> price_freeDays_map = null;
Date current_date = Date.from(final_startLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
Date current_date = localDateToDate(final_startLocalDate);
vehicleModelCalendarPriceDTO.setDate(current_date);
if (calendarPriceMap != null && !calendarPriceMap.isEmpty()) {
VehicleModelCalendarPrice vehicleModelCalendarPrice = calendarPriceMap.get(current_date);
......
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