Commit 3d152d6d by 吕明尚

优惠券配置增加过期天数

parent b639d475
...@@ -134,6 +134,12 @@ public class SCoupon extends BaseEntity ...@@ -134,6 +134,12 @@ public class SCoupon extends BaseEntity
private String weeks; private String weeks;
/** /**
* 过期天数
*/
@Excel(name = "过期天数")
private Integer expirationNumber;
/**
* 第三方平台类型(1:自营,2:美团) * 第三方平台类型(1:自营,2:美团)
*/ */
@Excel(name = "第三方平台类型(1:自营,2:美团,3: 抖音)") @Excel(name = "第三方平台类型(1:自营,2:美团,3: 抖音)")
......
...@@ -473,7 +473,15 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -473,7 +473,15 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon.setSourceType(SourceTypeEnum.GIVE.getCode()); newSConsumerCoupon.setSourceType(SourceTypeEnum.GIVE.getCode());
newSConsumerCoupon.setPlatformType(sCoupon.getPlatformType()); newSConsumerCoupon.setPlatformType(sCoupon.getPlatformType());
newSConsumerCoupon.setStartDate(sCoupon.getStartDate()); newSConsumerCoupon.setStartDate(sCoupon.getStartDate());
newSConsumerCoupon.setEndDate(sCoupon.getEndDate()); if (ObjectUtils.isEmpty(sCoupon.getExpirationNumber())) {
newSConsumerCoupon.setEndDate(sCoupon.getEndDate());
} else {
if (DateUtils.addDays(new Date(), sCoupon.getExpirationNumber()).getTime() < sCoupon.getEndDate().getTime()) {
newSConsumerCoupon.setEndDate(DateUtils.addDays(new Date(), sCoupon.getExpirationNumber()));
} else {
newSConsumerCoupon.setEndDate(sCoupon.getEndDate());
}
}
newSConsumerCoupon.setRemark(sCoupon.getRemark()); newSConsumerCoupon.setRemark(sCoupon.getRemark());
newSConsumerCoupon.setCreateTime(new Date()); newSConsumerCoupon.setCreateTime(new Date());
int insert = baseMapper.insert(newSConsumerCoupon); int insert = baseMapper.insert(newSConsumerCoupon);
......
...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="weeks" column="weeks"/> <result property="weeks" column="weeks"/>
<result property="platformType" column="platform_type" /> <result property="platformType" column="platform_type" />
<result property="number" column="number" /> <result property="number" column="number" />
<result property="expirationNumber" column="expiration_number"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
min_price, min_price,
original_price, original_price,
is_overlay, is_overlay,
expiration_number,
platform_type,number,create_by, platform_type,number,create_by,
create_time,update_by,update_time, create_time,update_by,update_time,
remark from s_coupon remark from s_coupon
...@@ -87,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -87,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="platformType != null"> and platform_type = #{platformType}</if> <if test="platformType != null"> and platform_type = #{platformType}</if>
<if test="weeks != null">and weeks = #{weeks}</if> <if test="weeks != null">and weeks = #{weeks}</if>
<if test="number != null"> and number = #{number}</if> <if test="number != null"> and number = #{number}</if>
<if test="expirationNumber != null">and expiration_number = #{expirationNumber}</if>
<if test="createBy != null"> and create_by = #{createBy}</if> <if test="createBy != null"> and create_by = #{createBy}</if>
<if test="createTime != null"> and create_time = #{createTime}</if> <if test="createTime != null"> and create_time = #{createTime}</if>
<if test="updateBy != null"> and update_by = #{updateBy}</if> <if test="updateBy != null"> and update_by = #{updateBy}</if>
...@@ -158,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -158,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="storeIds != null">store_ids,</if> <if test="storeIds != null">store_ids,</if>
<if test="couponPayPrice != null">coupon_pay_price,</if> <if test="couponPayPrice != null">coupon_pay_price,</if>
<if test="salePrice != null">sale_price,</if> <if test="salePrice != null">sale_price,</if>
<if test="expirationNumber != null">expiration_number,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
...@@ -187,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -187,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="storeIds != null">#{storeIds},</if> <if test="storeIds != null">#{storeIds},</if>
<if test="couponPayPrice != null">#{couponPayPrice},</if> <if test="couponPayPrice != null">#{couponPayPrice},</if>
<if test="salePrice != null">#{salePrice},</if> <if test="salePrice != null">#{salePrice},</if>
<if test="expirationNumber != null">#{expirationNumber},</if>
</trim> </trim>
</insert> </insert>
...@@ -222,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -222,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="couponPayPrice != null">coupon_pay_price = #{couponPayPrice},</if> <if test="couponPayPrice != null">coupon_pay_price = #{couponPayPrice},</if>
<if test="salePrice != null">sale_price = #{salePrice},</if> <if test="salePrice != null">sale_price = #{salePrice},</if>
<if test="expirationNumber != null">expiration_number = #{expirationNumber},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
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