Commit 4f49e546 by 吕明尚

团购优惠卷管理

parent 3ccddc38
......@@ -18,6 +18,7 @@ import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.common.enums.CouponTypeEnum;
import share.common.enums.RoomType;
import share.common.enums.StoreType;
import share.system.domain.SCoupon;
......@@ -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')")
......
......@@ -8,8 +8,10 @@ public enum CouponTypeEnum {
//1:折扣券,2,团购券,3:满减券,4:套餐劵
DISCOUNT(1,"1","折扣券"),
CASH(2, "2", "团购券"),
DURATION(3, "3", "时长券"),
PACKAGE(4, "4", "套餐劵"),
//满减券
MINUS(3, "3", "满减券"),
DURATION(4, "4", "时长券"),
PACKAGE(5, "5", "套餐劵"),
;
private Integer code;
......
......@@ -205,9 +205,14 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon.setCouponTimeStart(sCoupon.getValidStartTime());
newSConsumerCoupon.setCouponTimeEnd(sCoupon.getValidEndTime());
newSConsumerCoupon.setCouponType(sCoupon.getCouponType());
if (sCoupon.getCouponType().equals(CouponTypeEnum.CASH.getCode())) {
newSConsumerCoupon.setMinPrice(new BigDecimal(0.00));
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.setPlatformType(String.valueOf(sCoupon.getPlatformType()));
newSConsumerCoupon.setStartDate(sCoupon.getStartDate());
......
......@@ -77,7 +77,9 @@ public class SCouponServiceImpl implements ISCouponService
sCoupon.setValidEndTime(DEFAULT_END_TIME);
sCoupon.setMinDuration(DEFAULT_DURATION);
sCoupon.setMaxDuration(DEFAULT_MAX_DURATION);
sCoupon.setMinPrice(new BigDecimal(0));
sCoupon.setCreateTime(DateUtils.getNowDate());
return sCouponMapper.insertSCoupon(sCoupon);
}
......
......@@ -38,6 +38,7 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="arrivalTime" column="arrival_time"/>
<result property="remark" column="remark"/>
</resultMap>
......@@ -75,6 +76,7 @@
create_time,
update_by,
update_time,
arrival_time,
remark
from s_order
</sql>
......@@ -124,6 +126,7 @@
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</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="arrivalTime != null and arrivalTime != ''">and arrival_time = #{arrivalTime}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
ORDER BY create_time DESC
</select>
......@@ -170,6 +173,7 @@
<if test="isDelete != null and isDelete != ''">is_delete,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null and createTime != ''">create_time,</if>
<if test="arrivalTime != null and arrivalTime != ''">arrival_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if>
......@@ -202,6 +206,7 @@
<if test="isDelete != null">0,</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="arrivalTime != null">#{arrivalTime},</if>
</trim>
</insert>
......@@ -238,6 +243,7 @@
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = NOW(),</if>
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</if>
</trim>
where id = #{id}
</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