bihs 3 هفته پیش
والد
کامیت
44691a7058

+ 11 - 0
qmjszx-admin/src/main/resources/templates/voucher/add.html

@@ -32,6 +32,14 @@
                     </div>
                 </div>
             </div>
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label is-required">满多少元立减:</label>
+                    <div class="col-sm-8">
+                        <input name="instantDiscount" class="form-control" type="text" required>
+                    </div>
+                </div>
+            </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />
@@ -49,6 +57,9 @@
                 voucherType:{
                     required:true
                 },
+                instantDiscount:{
+                    double:true
+                },
             },
         });
 

+ 11 - 0
qmjszx-admin/src/main/resources/templates/voucher/edit.html

@@ -33,6 +33,14 @@
                     </div>
                 </div>
             </div>
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label is-required">满多少元立减:</label>
+                    <div class="col-sm-8">
+                        <input name="instantDiscount" th:field="*{instantDiscount}" class="form-control" type="text" required>
+                    </div>
+                </div>
+            </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />
@@ -50,6 +58,9 @@
                 voucherType:{
                     required:true
                 },
+                instantDiscount:{
+                    double:true
+                },
             },
         });
 

+ 4 - 0
qmjszx-admin/src/main/resources/templates/voucher/voucher.html

@@ -77,6 +77,10 @@
                     }
                 },
                 {
+                    field: 'instantDiscount',
+                    title: '满多少元立减'
+                },
+                {
                     title: '操作',
                     align: 'center',
                     formatter: function (value, row, index) {

+ 6 - 0
qmjszx-business/src/main/java/beilv/voucher/domain/BeilvVoucher.java

@@ -42,6 +42,12 @@ public class BeilvVoucher extends BaseEntity {
     private String voucherType;
 
     /**
+     * 满多少立减
+     */
+    @Excel(name = "满多少立减")
+    private BigDecimal instantDiscount;
+
+    /**
      * 用户id
      */
     private Long userId;

+ 6 - 0
qmjszx-business/src/main/java/beilv/voucher/domain/BeilvVoucherMember.java

@@ -83,6 +83,12 @@ public class BeilvVoucherMember extends BaseEntity {
     @Excel(name = "代金券类型")
     private String voucherTypeText;
 
+    /**
+     * 付款金额
+     */
+    @Excel(name = "付款金额")
+    private BigDecimal payPrice;
+
     public BeilvVoucherMember() {
 
     }

+ 5 - 1
qmjszx-business/src/main/resources/mapper/voucher/BeilvVoucherMapper.xml

@@ -9,10 +9,11 @@
         <result property="voucherName" column="voucher_name"/>
         <result property="voucherPrice" column="voucher_price"/>
         <result property="voucherType" column="voucher_type"/>
+        <result property="instantDiscount" column="instant_discount"/>
     </resultMap>
 
     <sql id="selectBeilvVoucherVo">
-        select id, voucher_name, voucher_price, voucher_type
+        select id, voucher_name, voucher_price, voucher_type,instant_discount
         from beilv_voucher
     </sql>
 
@@ -38,11 +39,13 @@
             <if test="voucherName != null">voucher_name,</if>
             <if test="voucherPrice != null">voucher_price,</if>
             <if test="voucherType != null">voucher_type,</if>
+            <if test="instantDiscount != null">instant_discount,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="voucherName != null">#{voucherName},</if>
             <if test="voucherPrice != null">#{voucherPrice},</if>
             <if test="voucherType != null">#{voucherType},</if>
+            <if test="instantDiscount != null">#{instantDiscount},</if>
         </trim>
     </insert>
 
@@ -52,6 +55,7 @@
             <if test="voucherName != null">voucher_name = #{voucherName},</if>
             <if test="voucherPrice != null">voucher_price = #{voucherPrice},</if>
             <if test="voucherType != null">voucher_type = #{voucherType},</if>
+            <if test="instantDiscount != null">instant_discount = #{instantDiscount},</if>
         </trim>
         where id = #{id}
     </update>

+ 3 - 1
qmjszx-business/src/main/resources/mapper/voucher/BeilvVoucherMemberMapper.xml

@@ -18,7 +18,7 @@
     </resultMap>
 
     <sql id="selectBeilvVoucherMemberVo">
-        select id, voucher_id, member_id, validity_time,is_validity
+        select id, voucher_id, member_id, validity_time, is_validity
         from beilv_voucher_member
     </sql>
 
@@ -92,6 +92,8 @@
         left join beilv_voucher_member vm on v.id = vm.voucher_id
         left join sys_member m on vm.member_id = m.id
         where m.id = #{memberId}
+        <if test="voucherType != null and voucherType != ''">and voucher_type = #{voucherType}</if>
+        <if test="payPrice != null and payPrice != ''">and v.instant_discount &gt;= #{payPrice}</if>
         <if test="isValidity != null and isValidity != ''">and vm.is_validity = #{isValidity}</if>
     </select>
 </mapper>