Bladeren bron

update:添加商城优惠券类型

liujunchi 2 jaren geleden
bovenliggende
commit
83bd66d1d3

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysCoupon.java

@@ -91,6 +91,17 @@ public class SysCoupon extends BaseEntity implements Serializable{
 	@ApiModelProperty("领取优惠券条件JSON: {organId:分部id(逗号隔开)}")
 	private String useCondition;
 
+	@ApiModelProperty("使用系统 MALL:商城  MEC:管乐迷")
+	private String useSystem;
+
+	public String getUseSystem() {
+		return useSystem;
+	}
+
+	public void setUseSystem(String useSystem) {
+		this.useSystem = useSystem;
+	}
+
 	public String getUseCondition() {
 		return useCondition;
 	}

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CouponDetailTypeEnum.java

@@ -37,7 +37,9 @@ public enum CouponDetailTypeEnum {
     //会员开通,团练宝   CLOUD_TEACHER  CLOUD_TEACHER_PLUS
     MEMBER("MEMBER", "云教练"),
     //全类都可以使用
-    FULLCOUPON("FULLCOUPON", "全类券");
+    FULLCOUPON("FULLCOUPON", "全类券"),
+    // 商城券
+    MALLCOUPON("MALLCOUPON", "商城券");
 
     private String code;
 

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysCouponCodeQueryInfo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.page;
 
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author Joburgess
@@ -23,6 +24,29 @@ public class SysCouponCodeQueryInfo extends QueryInfo {
      */
     private Integer issueType;
 
+    // 使用系统 MALL:商城  MEC:管乐迷
+    private String useSystem;
+
+    // 优惠券类型 详情-CouponDetailTypeEnum-枚举类 多个逗号隔开
+    @ApiModelProperty("优惠券类型:OTHER:其他,MUSICAL:乐器 MAINTENANCE 乐保 ACCESSORIES 辅件 TEACHING 教材 PRACTICE 网管课 SINGLE 声部课 MIX 合奏课 VIP:VIP MEMBER:会员开通 FULLCOUPON:全类 MALLCOUPON:商城券")
+    private String typeDetail;
+
+    public String getTypeDetail() {
+        return typeDetail;
+    }
+
+    public void setTypeDetail(String typeDetail) {
+        this.typeDetail = typeDetail;
+    }
+
+    public String getUseSystem() {
+        return useSystem;
+    }
+
+    public void setUseSystem(String useSystem) {
+        this.useSystem = useSystem;
+    }
+
     public Integer getOrganId() {
         return organId;
     }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysCouponServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -141,6 +142,9 @@ public class SysCouponServiceImpl extends BaseServiceImpl<Integer, SysCoupon> im
         if (Objects.isNull(sysCoupon.getType())) {
             throw new BizException("请指定优惠券类型");
         }
+        if (StringUtils.isEmpty(sysCoupon.getUseSystem())) {
+            throw new BizException("请置顶使用系统");
+        }
 
         switch (sysCoupon.getType()) {
             case DISCOUNT:

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/SysCouponCodeMapper.xml

@@ -185,6 +185,12 @@
 			<if test="issueType !=null">
                 AND scc.type_ = #{issueType}
             </if>
+			<if test="useSystem != null and useSystem != ''">
+				and sc.use_system_ = #{useSystem}
+			</if>
+			<if test="typeDetail != null and typeDetail != ''">
+				and  find_in_set(sc.type_detail_ , #{typeDetail})
+			</if>
 		</where>
 	</sql>