Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

lchao 5 mēneši atpakaļ
vecāks
revīzija
ea37c77976

+ 8 - 1
qmjszx-admin/src/main/resources/templates/card/add.html

@@ -109,7 +109,14 @@
 
     function submitHandler() {
         if ($.validate.form()) {
-            $.operate.save(prefix + "/add", $('#form-card-add').serialize());
+            const totalNumber = parseInt(totalNumberInput.value)
+            const remainingNumber = parseInt(document.getElementsByName("remainingNumber")[0].value);
+            if (remainingNumber>totalNumber){
+                alert("剩余次数不能大于总次数")
+            }else {
+                const request =  $('#form-card-add').serialize() + '&totalNumber=' + totalNumber
+                $.operate.save(prefix + "/add", request);
+            }
         }
     }
 </script>

+ 3 - 1
qmjszx-admin/src/main/resources/templates/competition/details.html

@@ -97,7 +97,9 @@
         $.ajax({
             url: prefix + "/close",
             type: "GET",
-            data: {id:id},
+            data: {
+                id: id,
+            },
             success: function(res){
                 if(res.code === 0){
                     $.modal.msgSuccess("操作成功");

+ 0 - 1
qmjszx-admin/src/main/resources/templates/record/add.html

@@ -122,7 +122,6 @@
             if ($.validate.form()) {
                 const cardName = cardSelect.options[cardSelect.selectedIndex].text
                 const request =  $('#form-record-add').serialize() + '&cardName='+cardName + '&price=' + priceInput.value
-                console.log(request)
                 $.operate.save(prefix + "/add", request);
             }
         }

+ 4 - 0
qmjszx-business/src/main/java/beilv/stadium/domain/Stadium.java

@@ -56,5 +56,9 @@ public class Stadium {
      * 订单类型(1: 参赛门票 / 2: 观看门票)
      */
     private String orderType;
+    /**
+     * 退款说明
+     */
+    private String refundInstructions;
 
 }

+ 1 - 1
qmjszx-business/src/main/java/beilv/stadium/mapper/StadiumMapper.java

@@ -20,5 +20,5 @@ public interface StadiumMapper {
 
     List<Stadium> getTakePartList(Stadium stadium);
 
-    int closeStadiumById(Stadium stadium);
+//    int closeStadiumById(Stadium stadium);
 }

+ 3 - 4
qmjszx-business/src/main/java/beilv/stadium/service/impl/StadiumServiceImpl.java

@@ -79,9 +79,7 @@ public class StadiumServiceImpl implements IStadiumService {
      */
     @Override
     public Boolean paymentVerification(Stadium stadium) {
-        boolean flag = stadiumMapper.paymentVerification(stadium);
-        System.out.println("flag = " + flag);
-        return flag;
+        return stadiumMapper.paymentVerification(stadium);
     }
 
     @Override
@@ -96,10 +94,11 @@ public class StadiumServiceImpl implements IStadiumService {
         //修改购票状态
         Stadium stadium = new Stadium();
         stadium.setId(Long.parseLong(id));
+        stadium.setRefundInstructions("商家发起退款");
         //设置订单状态
         stadium.setPaymentStatus("payment_status_refunded");
         //设置退款时间
         stadium.setRefundTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
-        return stadiumMapper.closeStadiumById(stadium);
+        return stadiumMapper.cancellStadium(stadium);
     }
 }

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/CarInformationMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notes != null  and notes != ''"> and notes = #{notes}</if>
             <if test="state != null  and state != ''"> and state = #{state}</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectCarInformationById" parameterType="Long" resultMap="CarInformationResult">

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/CardPurchaseRecordMapper.xml

@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="realName != null  and realName != ''"> and b.real_name like concat('%', #{realName}, '%')</if>
             <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
         </where>
+        order by a.create_time desc
     </select>
 
     <select id="selectCardPurchaseRecordById" parameterType="Long" resultMap="CardPurchaseRecordResult">

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/UserMembershipCardMapper.xml

@@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
             <if test="cardName != null  and cardName != ''"> and c.name like concat('%', #{cardName}, '%')</if>
         </where>
+        order by a.create_time desc
     </select>
 
     <select id="selectUserMembershipCardById" parameterType="Long" resultMap="UserMembershipCardResult">

+ 17 - 12
qmjszx-business/src/main/resources/mapper/stadium/StadiumMapper.xml

@@ -17,6 +17,7 @@
         <result property="orderId" column="order_id"/>
         <result property="competitionId" column="competition_id"/>
         <result property="orderType" column="order_type"/>
+        <result property="refundInstructions" column="refund_instructions"/>
     </resultMap>
 
 
@@ -34,6 +35,7 @@
             <if test="orderId != null">order_id,</if>
             <if test="competitionId != null">competition_id,</if>
             <if test="orderType != null">order_type,</if>
+            <if test="refundInstructions != null">refund_instructions,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -47,24 +49,33 @@
             <if test="orderId != null">#{orderId},</if>
             <if test="competitionId != null">#{competitionId},</if>
             <if test="orderType != null">#{orderType},</if>
+            <if test="refundInstructions != null">#{refundInstructions},</if>
         </trim>
     </insert>
 
     <update id="cancellStadium" parameterType="stadium">
         update beilv_book_a_race
         <trim prefix="SET" suffixOverrides=",">
-            <if test="paymentTime != null">#{paymentTime},</if>
-            <if test="cancellationTime != null">#{cancellationTime},</if>
-            <if test="refundTime != null">#{refundTime},</if>
-            <if test="paymentStatus != null">#{paymentStatus},</if>
+            <if test="paymentTime != null">payment_time = #{paymentTime},</if>
+            <if test="cancellationTime != null">cancellation_time = #{cancellationTime},</if>
+            <if test="refundTime != null">refund_time = #{refundTime},</if>
+            <if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
+            <if test="refundInstructions != null">refund_instructions = #{refundInstructions},</if>
         </trim>
-        where order_id = #{orderId}
+        <where>
+            <if test="orderId != null and orderId != ''">
+                and order_id = #{orderId}
+            </if>
+            <if test="id != null and id != ''">
+                and id = #{id}
+            </if>
+        </where>
     </update>
 
     <select id="getStadimList" parameterType="stadiumBO" resultMap="StadiumResult">
         select
             user_id, contact_perple, contact_number, registration_time, payment_time,
-            cancellation_time, refund_time, payment_status, order_id, competition_id, order_type
+            cancellation_time, refund_time, payment_status, order_id, competition_id, order_type, refund_instructions
         from beilv_book_a_race
         <where>
             <if test="userId != null and userId != ''">
@@ -102,10 +113,4 @@
         </where>
         order by registration_time desc
     </select>
-
-    <update id="closeStadiumById" parameterType="Stadium">
-        update beilv_book_a_race set payment_status = #{paymentStatus}, refund_time = #{refundTime}
-        where id = #{id}
-    </update>
-
 </mapper>