Commit 4f49e546 by 吕明尚

团购优惠卷管理

parent 3ccddc38
...@@ -18,6 +18,7 @@ import share.common.annotation.Log; ...@@ -18,6 +18,7 @@ import share.common.annotation.Log;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.enums.CouponTypeEnum;
import share.common.enums.RoomType; import share.common.enums.RoomType;
import share.common.enums.StoreType; import share.common.enums.StoreType;
import share.system.domain.SCoupon; import share.system.domain.SCoupon;
...@@ -51,6 +52,31 @@ public class SCouponController extends BaseController ...@@ -51,6 +52,31 @@ public class SCouponController extends BaseController
} }
/** /**
* 查询时长劵列表
*/
@PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping("/list/duration")
public TableDataInfo listDuration(SCoupon sCoupon) {
startPage();
sCoupon.setCouponType(CouponTypeEnum.DURATION.getCode());
List<SCoupon> list = sCouponService.selectSCouponList(sCoupon);
return getDataTable(list);
}
/**
* 查询团购劵类别
*/
@PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping("/list/group")
public TableDataInfo listGroup(SCoupon sCoupon) {
startPage();
sCoupon.setCouponType(CouponTypeEnum.CASH.getCode());
List<SCoupon> list = sCouponService.selectSCouponList(sCoupon);
return getDataTable(list);
}
/**
* 导出优惠券列表 * 导出优惠券列表
*/ */
@PreAuthorize("@ss.hasPermi('system:coupon:export')") @PreAuthorize("@ss.hasPermi('system:coupon:export')")
......
...@@ -8,8 +8,10 @@ public enum CouponTypeEnum { ...@@ -8,8 +8,10 @@ public enum CouponTypeEnum {
//1:折扣券,2,团购券,3:满减券,4:套餐劵 //1:折扣券,2,团购券,3:满减券,4:套餐劵
DISCOUNT(1,"1","折扣券"), DISCOUNT(1,"1","折扣券"),
CASH(2, "2", "团购券"), CASH(2, "2", "团购券"),
DURATION(3, "3", "时长券"), //满减券
PACKAGE(4, "4", "套餐劵"), MINUS(3, "3", "满减券"),
DURATION(4, "4", "时长券"),
PACKAGE(5, "5", "套餐劵"),
; ;
private Integer code; private Integer code;
......
...@@ -205,9 +205,14 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe ...@@ -205,9 +205,14 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon.setCouponTimeStart(sCoupon.getValidStartTime()); newSConsumerCoupon.setCouponTimeStart(sCoupon.getValidStartTime());
newSConsumerCoupon.setCouponTimeEnd(sCoupon.getValidEndTime()); newSConsumerCoupon.setCouponTimeEnd(sCoupon.getValidEndTime());
newSConsumerCoupon.setCouponType(sCoupon.getCouponType()); newSConsumerCoupon.setCouponType(sCoupon.getCouponType());
newSConsumerCoupon.setMinDuration(sCoupon.getMinDuration()); if (sCoupon.getCouponType().equals(CouponTypeEnum.CASH.getCode())) {
newSConsumerCoupon.setMaxDuration(sCoupon.getMaxDuration()); newSConsumerCoupon.setMinPrice(new BigDecimal(0.00));
newSConsumerCoupon.setDuration(sCoupon.getDuration()); newSConsumerCoupon.setSubPrice(sCoupon.getSubPrice());
} else if (sCoupon.getCouponType().equals(CouponTypeEnum.DURATION.getCode())) {
newSConsumerCoupon.setMinDuration(sCoupon.getMinDuration());
newSConsumerCoupon.setMaxDuration(sCoupon.getMaxDuration());
newSConsumerCoupon.setDuration(sCoupon.getDuration());
}
newSConsumerCoupon.setSourceType(SourceTypeEnum.GIVE.getCode()); newSConsumerCoupon.setSourceType(SourceTypeEnum.GIVE.getCode());
newSConsumerCoupon.setPlatformType(String.valueOf(sCoupon.getPlatformType())); newSConsumerCoupon.setPlatformType(String.valueOf(sCoupon.getPlatformType()));
newSConsumerCoupon.setStartDate(sCoupon.getStartDate()); newSConsumerCoupon.setStartDate(sCoupon.getStartDate());
......
...@@ -77,7 +77,9 @@ public class SCouponServiceImpl implements ISCouponService ...@@ -77,7 +77,9 @@ public class SCouponServiceImpl implements ISCouponService
sCoupon.setValidEndTime(DEFAULT_END_TIME); sCoupon.setValidEndTime(DEFAULT_END_TIME);
sCoupon.setMinDuration(DEFAULT_DURATION); sCoupon.setMinDuration(DEFAULT_DURATION);
sCoupon.setMaxDuration(DEFAULT_MAX_DURATION); sCoupon.setMaxDuration(DEFAULT_MAX_DURATION);
sCoupon.setMinPrice(new BigDecimal(0));
sCoupon.setCreateTime(DateUtils.getNowDate()); sCoupon.setCreateTime(DateUtils.getNowDate());
return sCouponMapper.insertSCoupon(sCoupon); return sCouponMapper.insertSCoupon(sCoupon);
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="arrivalTime" column="arrival_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
</resultMap> </resultMap>
...@@ -75,6 +76,7 @@ ...@@ -75,6 +76,7 @@
create_time, create_time,
update_by, update_by,
update_time, update_time,
arrival_time,
remark remark
from s_order from s_order
</sql> </sql>
...@@ -124,6 +126,7 @@ ...@@ -124,6 +126,7 @@
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if> <if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if> <if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if> <if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and arrival_time = #{arrivalTime}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if> <if test="remark != null and remark != ''">and remark = #{remark}</if>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
...@@ -170,6 +173,7 @@ ...@@ -170,6 +173,7 @@
<if test="isDelete != null and isDelete != ''">is_delete,</if> <if test="isDelete != null and isDelete != ''">is_delete,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null and createTime != ''">create_time,</if> <if test="createTime != null and createTime != ''">create_time,</if>
<if test="arrivalTime != null and arrivalTime != ''">arrival_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if> <if test="orderNo != null">#{orderNo},</if>
...@@ -202,6 +206,7 @@ ...@@ -202,6 +206,7 @@
<if test="isDelete != null">0,</if> <if test="isDelete != null">0,</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="arrivalTime != null">#{arrivalTime},</if>
</trim> </trim>
</insert> </insert>
...@@ -238,6 +243,7 @@ ...@@ -238,6 +243,7 @@
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = NOW(),</if> <if test="updateTime != null">update_time = NOW(),</if>
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</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