Commit 87fdcdb2 by 吕明尚

优惠卷领取记录类增加优惠卷有效时间

parent 5caa0de0
...@@ -40,17 +40,25 @@ public class SConsumerCoupon extends BaseEntity ...@@ -40,17 +40,25 @@ public class SConsumerCoupon extends BaseEntity
@Excel(name = "优惠券名称") @Excel(name = "优惠券名称")
private String name; private String name;
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */ //房间类型
@Excel(name = "优惠券类型(1:折扣券,2,满减券,3:时长券)") @Excel(name = "房间类型(1:标间,2:豪华间,3:总统套房,4:商务套房,5:行政套房,6:其他)")
private String couponType; private String roomType;
//门店类型 //门店类型
@Excel(name = "门店类型(1:标准店,2:外卖店,3:酒店,4:其他)") @Excel(name = "门店类型(1:标准店,2:外卖店,3:酒店,4:其他)")
private String storeType; private String storeType;
//房间类型 //优惠开始(有效)时段
@Excel(name = "房间类型(1:标间,2:豪华间,3:总统套房,4:商务套房,5:行政套房,6:其他)") @Excel(name = "优惠开始(有效)时段")
private String roomType; private String couponTimeStart;
//优惠结束(有效)时段
@Excel(name = "优惠结束(有效)时段")
private String couponTimeEnd;
/** 优惠券类型(1:折扣券,2,满减券,3:时长券) */
@Excel(name = "优惠券类型(1:折扣券,2,满减券,3:时长券)")
private String couponType;
/** 门槛时长 */ /** 门槛时长 */
@Excel(name = "门槛时长") @Excel(name = "门槛时长")
......
...@@ -18,11 +18,11 @@ import java.util.Date; ...@@ -18,11 +18,11 @@ import java.util.Date;
@ApiModel(value = "CouponRequest对象", description = "优惠卷请求对象") @ApiModel(value = "CouponRequest对象", description = "优惠卷请求对象")
public class CouponRequest { public class CouponRequest {
@ApiModelProperty(value = "门店ID", required = true) @ApiModelProperty(value = "门店ID", required = true)
@NotBlank(message = "门店ID不能为空") @NotNull(message = "门店ID不能为空")
private Long storeId; private Long storeId;
@ApiModelProperty(value = "房间ID", required = true) @ApiModelProperty(value = "房间ID", required = true)
@NotBlank(message = "房间ID不能为空") @NotNull(message = "房间ID不能为空")
private Long roomId; private Long roomId;
/** /**
......
...@@ -137,7 +137,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -137,7 +137,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
} }
//迭代 //迭代
sConsumerCoupons.forEach(item -> { sConsumerCoupons.forEach(item -> {
if (item.getStartDate().compareTo(couponRequest.getPreStartDate()) > 0) { if (item.getStartDate().compareTo(couponRequest.getPreStartDate()) < 0) {
SStore sStore = sStoreService.getById(couponRequest.getStoreId()); SStore sStore = sStoreService.getById(couponRequest.getStoreId());
SRoom byId = sRoomService.getById(couponRequest.getRoomId()); SRoom byId = sRoomService.getById(couponRequest.getRoomId());
BigDecimal subtract = new BigDecimal(item.getMinDuration()); BigDecimal subtract = new BigDecimal(item.getMinDuration());
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<result property="couponCode" column="coupon_code" /> <result property="couponCode" column="coupon_code" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="couponType" column="coupon_type" /> <result property="couponType" column="coupon_type" />
<result property="couponTimeStart" column="coupon_time_start" />
<result property="couponTimeEnd" column="coupon_time_end" />
<result property="minDuration" column="min_duration" /> <result property="minDuration" column="min_duration" />
<result property="maxDuration" column="max_duration" /> <result property="maxDuration" column="max_duration" />
<result property="duration" column="duration" /> <result property="duration" column="duration" />
...@@ -35,7 +37,7 @@ ...@@ -35,7 +37,7 @@
</resultMap> </resultMap>
<sql id="selectSConsumerCouponVo"> <sql id="selectSConsumerCouponVo">
select id, consumer_id, coupon_id, coupon_code, name, coupon_type, max_duration,min_duration, duration, min_price, sub_price, source_type, platform_type, start_date, end_date, use_date, use_status, is_delete, create_by, create_time, update_by, update_time, delete_by, delete_time, remark,room_type,store_type from s_consumer_coupon select id, consumer_id, coupon_id, coupon_code, name, coupon_type,coupon_time_start,coupon_time_end, max_duration,min_duration, duration, min_price, sub_price, source_type, platform_type, start_date, end_date, use_date, use_status, is_delete, create_by, create_time, update_by, update_time, delete_by, delete_time, remark,room_type,store_type from s_consumer_coupon
</sql> </sql>
<select id="selectSConsumerCouponList" parameterType="SConsumerCoupon" resultMap="SConsumerCouponResult"> <select id="selectSConsumerCouponList" parameterType="SConsumerCoupon" resultMap="SConsumerCouponResult">
...@@ -46,6 +48,8 @@ ...@@ -46,6 +48,8 @@
<if test="couponCode != null and couponCode != ''"> and coupon_code = #{couponCode}</if> <if test="couponCode != null and couponCode != ''"> and coupon_code = #{couponCode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="couponType != null and couponType != ''"> and coupon_type = #{couponType}</if> <if test="couponType != null and couponType != ''"> and coupon_type = #{couponType}</if>
<if test="couponTimeStart != null "> and coupon_time_start = #{couponTimeStart}</if>
<if test="couponTimeEnd != null "> and coupon_time_end = #{couponTimeEnd}</if>
<if test="maxDuration != null and maxDuration != ''"> and max_duration = #{maxDuration}</if> <if test="maxDuration != null and maxDuration != ''"> and max_duration = #{maxDuration}</if>
<if test="minDuration != null and minDuration != ''"> and min_duration = #{minDuration}</if> <if test="minDuration != null and minDuration != ''"> and min_duration = #{minDuration}</if>
<if test="duration != null and duration != ''"> and duration = #{duration}</if> <if test="duration != null and duration != ''"> and duration = #{duration}</if>
...@@ -79,6 +83,8 @@ ...@@ -79,6 +83,8 @@
<if test="couponCode != null and couponCode != ''">coupon_code,</if> <if test="couponCode != null and couponCode != ''">coupon_code,</if>
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="couponType != null">coupon_type,</if> <if test="couponType != null">coupon_type,</if>
<if test="couponTimeStart != null">coupon_time_start,</if>
<if test="couponTimeEnd != null">coupon_time_end,</if>
<if test="maxDuration != null">max_duration,</if> <if test="maxDuration != null">max_duration,</if>
<if test="minDuration != null">min_duration,</if> <if test="minDuration != null">min_duration,</if>
<if test="duration != null and duration != ''">duration,</if> <if test="duration != null and duration != ''">duration,</if>
...@@ -107,6 +113,8 @@ ...@@ -107,6 +113,8 @@
<if test="couponCode != null and couponCode != ''">#{couponCode},</if> <if test="couponCode != null and couponCode != ''">#{couponCode},</if>
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="couponType != null">#{couponType},</if> <if test="couponType != null">#{couponType},</if>
<if test="couponTimeStart != null">#{couponTimeStart},</if>
<if test="couponTimeEnd != null">#{couponTimeEnd},</if>
<if test="maxDuration != null">#{maxDuration},</if> <if test="maxDuration != null">#{maxDuration},</if>
<if test="minDuration != null">#{minDuration},</if> <if test="minDuration != null">#{minDuration},</if>
<if test="duration != null and duration != ''">#{duration},</if> <if test="duration != null and duration != ''">#{duration},</if>
...@@ -139,6 +147,8 @@ ...@@ -139,6 +147,8 @@
<if test="couponCode != null and couponCode != ''">coupon_code = #{couponCode},</if> <if test="couponCode != null and couponCode != ''">coupon_code = #{couponCode},</if>
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="couponType != null">coupon_type = #{couponType},</if> <if test="couponType != null">coupon_type = #{couponType},</if>
<if test="couponTimeStart != null">coupon_time_start = #{couponTimeStart},</if>
<if test="couponTimeEnd != null">coupon_time_end = #{couponTimeEnd},</if>
<if test="maxDuration != null">max_duration = #{maxDuration},</if> <if test="maxDuration != null">max_duration = #{maxDuration},</if>
<if test="minDuration != null">min_duration = #{minDuration},</if> <if test="minDuration != null">min_duration = #{minDuration},</if>
<if test="duration != null and duration != ''">duration = #{duration},</if> <if test="duration != null and duration != ''">duration = #{duration},</if>
......
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