cartDel(@Validated @RequestBody CartIdsParm parm){
+ Long uid = LocalUser.getUser().getUid();
+ storeCartService.removeUserCart(uid, parm.getIds());
+ return ApiResult.ok();
+ }
+
+
+
+
+
+}
+
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueQueryParam.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueQueryParam.java
new file mode 100644
index 00000000..849205be
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueQueryParam.java
@@ -0,0 +1,21 @@
+package co.yixiang.app.modules.coupon.param;
+
+import co.yixiang.common.web.param.QueryParam;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ *
+ * 优惠券前台领取表 查询参数对象
+ *
+ *
+ * @author hupeng
+ * @date 2019-10-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="YxStoreCouponIssueQueryParam对象", description="优惠券前台领取表查询参数")
+public class YxStoreCouponIssueQueryParam extends QueryParam {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueUserQueryParam.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueUserQueryParam.java
new file mode 100644
index 00000000..f6320fb9
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponIssueUserQueryParam.java
@@ -0,0 +1,21 @@
+package co.yixiang.app.modules.coupon.param;
+
+import co.yixiang.common.web.param.QueryParam;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ *
+ * 优惠券前台用户领取记录表 查询参数对象
+ *
+ *
+ * @author hupeng
+ * @date 2019-10-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="YxStoreCouponIssueUserQueryParam对象", description="优惠券前台用户领取记录表查询参数")
+public class YxStoreCouponIssueUserQueryParam extends QueryParam {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponQueryParam.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponQueryParam.java
new file mode 100644
index 00000000..0c20190e
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponQueryParam.java
@@ -0,0 +1,28 @@
+package co.yixiang.app.modules.coupon.param;
+
+import co.yixiang.common.web.param.QueryParam;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ *
+ * 优惠券表 查询参数对象
+ *
+ *
+ * @author hupeng
+ * @date 2019-10-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="YxStoreCouponQueryParam对象", description="优惠券表查询参数")
+public class YxStoreCouponQueryParam extends QueryParam {
+ private static final long serialVersionUID = 1L;
+
+ @NotBlank(message = "参数有误")
+ @ApiModelProperty(value = "优惠券ID")
+ private String couponId;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponUserQueryParam.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponUserQueryParam.java
new file mode 100644
index 00000000..09bedc59
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/param/YxStoreCouponUserQueryParam.java
@@ -0,0 +1,21 @@
+package co.yixiang.app.modules.coupon.param;
+
+import co.yixiang.common.web.param.QueryParam;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ *
+ * 优惠券发放记录表 查询参数对象
+ *
+ *
+ * @author hupeng
+ * @date 2019-10-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value="YxStoreCouponUserQueryParam对象", description="优惠券发放记录表查询参数")
+public class YxStoreCouponUserQueryParam extends QueryParam {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
new file mode 100644
index 00000000..1aeac632
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
@@ -0,0 +1,143 @@
+/**
+ * Copyright (C) 2018-2022
+ * All rights reserved, Designed By www.yixiang.co
+ * 注意:
+ * 本软件为www.yixiang.co开发研制,未经购买不得使用
+ * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
+ * 一经发现盗用、分享等行为,将追究法律责任,后果自负
+ */
+package co.yixiang.app.modules.coupon.rest;
+
+import cn.hutool.core.util.NumberUtil;
+import co.yixiang.api.ApiResult;
+import co.yixiang.api.YshopException;
+import co.yixiang.logging.aop.log.AppLog;
+import co.yixiang.app.common.aop.NoRepeatSubmit;
+import co.yixiang.app.common.bean.LocalUser;
+import co.yixiang.app.common.interceptor.AuthCheck;
+import co.yixiang.modules.activity.service.YxStoreCouponIssueService;
+import co.yixiang.modules.activity.service.YxStoreCouponUserService;
+import co.yixiang.modules.activity.vo.StoreCouponUserVo;
+import co.yixiang.modules.activity.vo.YxStoreCouponIssueQueryVo;
+import co.yixiang.modules.activity.vo.YxStoreCouponUserQueryVo;
+import co.yixiang.app.modules.coupon.param.YxStoreCouponQueryParam;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * 优惠券 todo
+ *
+ *
+ * @author hupeng
+ * @since 2019-10-02
+ */
+@Slf4j
+@RestController
+@Api(value = "优惠券", tags = "营销:优惠券")
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class CouponController {
+
+ private final YxStoreCouponIssueService couponIssueService;
+ private final YxStoreCouponUserService storeCouponUserService;
+
+ /**
+ * 可领取优惠券列表
+ */
+ @AuthCheck
+ @GetMapping("/coupons")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "page", value = "页码,默认为1", paramType = "query", dataType = "int"),
+ @ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int"),
+ @ApiImplicitParam(name = "productId", value = "产品ID", paramType = "query", dataType = "int"),
+ @ApiImplicitParam(name = "type", value = "优惠券类型 0通用券 1商品券 2内部券", paramType = "query", dataType = "int")
+ })
+ @ApiOperation(value = "可领取优惠券列表",notes = "可领取优惠券列表")
+ public ApiResult> getList(@RequestParam(value = "page",defaultValue = "1") int page,
+ @RequestParam(value = "limit",defaultValue = "10") int limit,
+ @RequestParam(value = "productId",required = false) Long productId,
+ @RequestParam(value = "type",required = false) Integer type){
+ Long uid = LocalUser.getUser().getUid();
+ return ApiResult.ok(couponIssueService.getCouponList(page, limit,uid,productId,type));
+ }
+
+ /**
+ * 领取优惠券
+ */
+ @AppLog(value = "领取优惠券", type = 1)
+ @NoRepeatSubmit
+ @AuthCheck
+ @PostMapping("/coupon/receive")
+ @ApiOperation(value = "领取优惠券",notes = "领取优惠券")
+ public ApiResult receive(@Validated @RequestBody YxStoreCouponQueryParam param){
+ Long uid = LocalUser.getUser().getUid();
+ if(!NumberUtil.isNumber(param.getCouponId())){
+ throw new YshopException("参数非法");
+ }
+ Integer couponId = Integer.valueOf(param.getCouponId());
+ couponIssueService.issueUserCoupon(couponId,uid);
+ return ApiResult.ok();
+ }
+
+ /**
+ * 用户已领取优惠券
+ */
+ @AppLog(value = "查看已领取优惠券", type = 1)
+ @AuthCheck
+ @GetMapping("/coupons/user/{type}")
+ @ApiOperation(value = "用户已领取优惠券",notes = "用户已领取优惠券")
+ public ApiResult> getUserList(){
+ Long uid = LocalUser.getUser().getUid();
+ List list = storeCouponUserService.getUserCoupon(uid);
+ return ApiResult.ok(list);
+ }
+
+ /**
+ * 用户已领取优惠券pc
+ */
+ @AppLog(value = "用户已领取优惠券pc", type = 1)
+ @AuthCheck
+ @GetMapping("/coupons/user/pc/{type}")
+ @ApiOperation(value = "用户已领取优惠券pc",notes = "用户已领取优惠券pc")
+ public ApiResult