dcs 2 月之前
父節點
當前提交
868583cad1

+ 2 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/dao/ProductCouponDao.java

@@ -24,4 +24,6 @@ public interface ProductCouponDao {
     List<ProductCoupon> getLimit(@Param("p") ProductCoupon p, @Param("currIndex") int currIndex, @Param("pageSize") int pageSize);
 
     List<ProductCoupon> getProductCouponModelId(long userId);
+
+    ProductCoupon getUserId(long productCouponId, long userId);
 }

+ 13 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/model/ProductCoupon.java

@@ -106,6 +106,11 @@ public class ProductCoupon {
      */
     private String description;
 
+    /**
+     * 是否可以叠加使用
+     */
+    private Integer overlayUse;
+
     public Long getId() {
         return id;
     }
@@ -257,4 +262,12 @@ public class ProductCoupon {
     public void setDescription(String description) {
         this.description = description;
     }
+
+    public Integer getOverlayUse() {
+        return overlayUse;
+    }
+
+    public void setOverlayUse(Integer overlayUse) {
+        this.overlayUse = overlayUse;
+    }
 }

+ 13 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/model/ProductCouponModel.java

@@ -73,6 +73,11 @@ public class ProductCouponModel {
      */
     private String description;
 
+    /**
+     * 是否可以叠加使用
+     */
+    private Integer overlayUse;
+
     public Long getId() {
         return id;
     }
@@ -176,4 +181,12 @@ public class ProductCouponModel {
     public void setDescription(String description) {
         this.description = description;
     }
+
+    public Integer getOverlayUse() {
+        return overlayUse;
+    }
+
+    public void setOverlayUse(Integer overlayUse) {
+        this.overlayUse = overlayUse;
+    }
 }

+ 3 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/service/ProductCouponService.java

@@ -70,4 +70,7 @@ public class ProductCouponService {
         productCouponDao.update(productCoupon);
     }
 
+    public ProductCoupon getUserId(long productCouponId, long userId) {
+        return productCouponDao.getUserId(productCouponId, userId);
+    }
 }

+ 8 - 2
virgo.api/src/main/resources/mapper/ProductCouponMapper.xml

@@ -24,12 +24,17 @@
         <result column="threshold" property="threshold"/>
         <result column="mostConstraint" property="mostConstraint"/>
         <result column="description" property="description"/>
+        <result column="overlayUse" property="overlayUse"/>
     </resultMap>
 
     <select id="get" resultMap="result">
         select * from workark_product_coupon where id = #{id}
     </select>
 
+    <select id="getUserId" resultMap="result">
+        select * from workark_product_coupon where id = #{id} and userId = #{userId}
+    </select>
+
     <select id="getProductCouponModelId" resultMap="result">
         select id, productCouponModelId from workark_product_coupon where userId = #{userId} and productCouponModelId != 0
     </select>
@@ -117,8 +122,8 @@
     </select>
 
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO workark_product_coupon (productCouponModelId, type, otherType, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
-        VALUES (#{productCouponModelId}, #{type}, #{otherType}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
+        INSERT INTO workark_product_coupon (productCouponModelId, type, otherType, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description, overlayUse)
+        VALUES (#{productCouponModelId}, #{type}, #{otherType}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description}, #{overlayUse})
     </insert>
 
     <update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
@@ -141,6 +146,7 @@
             <if test="threshold!=null">threshold=#{threshold},</if>
             <if test="mostConstraint!=null">mostConstraint=#{mostConstraint},</if>
             <if test="description!=null">description=#{description},</if>
+            <if test="overlayUse!=null">overlayUse=#{overlayUse},</if>
         </trim>
         WHERE id=#{id}
     </update>

+ 4 - 2
virgo.api/src/main/resources/mapper/ProductCouponModelMapper.xml

@@ -18,6 +18,7 @@
         <result column="threshold" property="threshold"/>
         <result column="mostConstraint" property="mostConstraint"/>
         <result column="description" property="description"/>
+        <result column="overlayUse" property="overlayUse"/>
     </resultMap>
 
     <select id="get" resultMap="result">
@@ -92,8 +93,8 @@
     </select>
 
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO workark_product_coupon_model (organizationId, type, otherType, discount, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
-        VALUES (#{organizationId}, #{type}, #{otherType}, #{discount}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
+        INSERT INTO workark_product_coupon_model (organizationId, type, otherType, discount, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description, overlayUse)
+        VALUES (#{organizationId}, #{type}, #{otherType}, #{discount}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description}, #{overlayUse})
     </insert>
 
     <update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCouponModel">
@@ -110,6 +111,7 @@
             <if test="threshold!=null">threshold=#{threshold},</if>
             <if test="mostConstraint!=null">mostConstraint=#{mostConstraint},</if>
             <if test="description!=null">description=#{description},</if>
+            <if test="overlayUse!=null">overlayUse=#{overlayUse},</if>
         </trim>
         WHERE id=#{id}
     </update>