Ver código fonte

约场门票增加核验时间

Memory_LG 4 meses atrás
pai
commit
340b5f2f96

+ 9 - 7
qmjszx-admin/src/main/java/beilv/web/controller/bootacourse/bootACourseController.java

@@ -142,20 +142,17 @@ public class bootACourseController extends BaseController {
         //生成订单编号
         String orderId = IdUtils.fastSimpleUUID();
         //生成订单信息
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         BootACourse bootACourse = new BootACourse(
                 course.getUserId(), //用户id
                 course.getContactPeople(), //联系人
                 course.getContactNumber(), //联系电话
-                simpleDateFormat.format(new Date()), //下单时间
+                new Date(), //下单时间
                 "payment_status_to_be_paid", //支付状态
                 orderId, //订单比那好
                 course.getTicketId(), //场次id
                 course.getTicketType(), //场地类型
                 course.getClubCardId(), //会员卡号
                 refund); //最晚退单时间
-
-
         //验证场次是否可用
         if (courseService.isOk(course)) {
             //调用会员卡接口减少次数
@@ -168,7 +165,7 @@ public class bootACourseController extends BaseController {
             cardService.addStream(memberStream);
 
             //扣除成功后, 修改订单状态为已付款.
-            bootACourse.setPaymentTime(simpleDateFormat.format(new Date()));
+            bootACourse.setPaymentTime(new Date());
             bootACourse.setPaymentStatus("payment_status_have_paid");
 
             //将门票信息修改为2: 线上预约的时段;
@@ -189,7 +186,12 @@ public class bootACourseController extends BaseController {
     @PostMapping("/getCourseList")
     public AjaxResult getCourseList(@RequestBody BootACourseBO courseBO) {
         courseBO.setUserId(courseBO.getUserId());
-        return AjaxResult.success(courseService.getCourseList(courseBO));
+        List<BootACourse> courseList = courseService.getCourseList(courseBO);
+        Map<String, String> paymentStatus = DictUtils.getDictCacheToMap("payment_status");
+        courseList.forEach(course->{
+            course.setPaymentStatusLabel(paymentStatus.get(course.getPaymentStatus()));
+        });
+        return AjaxResult.success(courseList);
     }
 
 
@@ -225,7 +227,7 @@ public class bootACourseController extends BaseController {
 
             //修改订单信息状态为退款,
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            course.setRefundTime(simpleDateFormat.format(new Date()));
+            course.setRefundTime(new Date());
             course.setRefundInstructions(courseBo.getRefundInstructions());
             course.setPaymentStatus("payment_status_refunded");
             return toAjax(courseService.updateCourse(course));

+ 15 - 5
qmjszx-business/src/main/java/beilv/bootacourse/domain/BootACourse.java

@@ -30,23 +30,28 @@ public class BootACourse {
     /**
      * 下单时间
      */
-    private String registrationTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date registrationTime;
     /**
      * 支付时间
      */
-    private String paymentTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date paymentTime;
     /**
      * 取消时间
      */
-    private String cancellationTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date cancellationTime;
     /**
      * 退款时间
      */
-    private String refundTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date refundTime;
     /**
      * 支付状态
      */
     private String paymentStatus;
+    private String paymentStatusLabel;
     /**
      * 订单编号
      */
@@ -72,10 +77,15 @@ public class BootACourse {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     private Date refund;
+    /**
+     * 核验时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date verificationTime;
 
 
 
-    public BootACourse(String userId, String contactPeople, String contactNumber, String registrationTime, String paymentStatus, String orderId, String ticketId, String orderType, String clubCardId, Date refund) {
+    public BootACourse(String userId, String contactPeople, String contactNumber, Date registrationTime, String paymentStatus, String orderId, String ticketId, String orderType, String clubCardId, Date refund) {
         this.userId = userId;
         this.contactPeople = contactPeople;
         this.contactNumber = contactNumber;

+ 3 - 1
qmjszx-business/src/main/java/beilv/bootacourse/mapper/BootACourseMapper.java

@@ -2,7 +2,9 @@ package beilv.bootacourse.mapper;
 
 import beilv.bootacourse.domain.BootACourse;
 import beilv.bootacourse.domain.BootACourseBO;
+import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface BootACourseMapper {
@@ -16,5 +18,5 @@ public interface BootACourseMapper {
 
     List<BootACourse> selectPaidOrders();
 
-    void updateOrderStatusToVerification(List<String> orderIdsToUpdate);
+    void updateOrderStatusToVerification(@Param("orderIds") List<String> orderIdsToUpdate, @Param("verificationTime") String verificationTime);
 }

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

@@ -1,5 +1,6 @@
 package beilv.stadium.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.*;
 
 import java.util.Date;
@@ -29,19 +30,23 @@ public class Stadium {
     /**
      * 下单时间
      */
-    private String registrationTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date registrationTime;
     /**
      * 支付时间
      */
-    private String paymentTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date paymentTime;
     /**
      * 取消时间
      */
-    private String cancellationTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date cancellationTime;
     /**
      * 退款时间
      */
-    private String refundTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date refundTime;
     /**
      * 支付状态
      */
@@ -66,6 +71,7 @@ public class Stadium {
     /**
      * 核验时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date verificationTime;
     /**
      * 实付金额

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

@@ -37,7 +37,7 @@ public class StadiumServiceImpl implements IStadiumService {
             //设置订单状态为 待支付
             stadium.setPaymentStatus(DAI_ZHI_FU);
             //设置下单时间为当前时间
-            stadium.setRegistrationTime(simpleDateFormat.format(new Date()));
+            stadium.setRegistrationTime(new Date());
             //生成订单编号
             stadium.setOrderId(orderId);
             stadiumMapper.toBeStadium(stadium);
@@ -53,7 +53,7 @@ public class StadiumServiceImpl implements IStadiumService {
         //设置订单状态为取消
         stadium.setPaymentStatus(YI_QU_XIAO);
         //设置取消时间为当前时间
-        stadium.setCancellationTime(simpleDateFormat.format(new Date()));
+        stadium.setCancellationTime(new Date());
         return stadiumMapper.cancellStadium(stadium);
     }
 
@@ -67,7 +67,7 @@ public class StadiumServiceImpl implements IStadiumService {
         //设置订单状态为已支付
         stadium.setPaymentStatus(YI_ZHI_FU);
         //设置支付时间
-        stadium.setPaymentTime(simpleDateFormat.format(new Date()));
+        stadium.setPaymentTime(new Date());
 
         //增加赛事退单时间验证,如果赛事报名已结束, 则直接设置支付状态为已核销
         Competition competition = competitionMapper.getCompetitionInfo(stadium.getOrderId());
@@ -85,7 +85,7 @@ public class StadiumServiceImpl implements IStadiumService {
         //设置订单状态为取消
         stadium.setPaymentStatus(YI_TUI_KUAN);
         //设置取消时间为当前时间
-        stadium.setRefundTime(simpleDateFormat.format(new Date()));
+        stadium.setRefundTime(new Date());
         //修改订单状态为退款
         return stadiumMapper.cancellStadium(stadium);
     }
@@ -117,7 +117,7 @@ public class StadiumServiceImpl implements IStadiumService {
         //设置订单状态
         stadium.setPaymentStatus("payment_status_refunded");
         //设置退款时间
-        stadium.setRefundTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
+        stadium.setRefundTime(new Date());
         return stadiumMapper.cancellStadium(stadium);
     }
 }

+ 5 - 3
qmjszx-business/src/main/resources/mapper/bootacourse/BootACourseMapper.xml

@@ -20,6 +20,7 @@
         <result property="refundInstructions" column="refund_instructions"/>
         <result property="clubCardId" column="club_card_id"/>
         <result property="refund" column="refund"/>
+        <result property="verificationTime" column="verification_time"/>
     </resultMap>
 
 
@@ -81,7 +82,7 @@
     <select id="getCourseList" parameterType="bootACourseBO" resultMap="BootACourseResult">
         select
             user_id, contact_people, contact_number, registration_time, payment_time, cancellation_time, refund_time,
-            payment_status, order_id, ticket_id, order_type, refund_instructions, club_card_id, refund
+            payment_status, order_id, ticket_id, order_type, refund_instructions, club_card_id, refund, verification_time
         from beilv_book_a_course
         <where>
             <if test="userId != null and userId != ''">
@@ -118,9 +119,10 @@
 
     <update id="updateOrderStatusToVerification" parameterType="bootACourse">
         UPDATE beilv_book_a_course
-        SET payment_status = 'payment_status_verification'
+        SET payment_status = 'payment_status_verification',
+        verification_time = #{verificationTime}
         WHERE order_id IN
-        <foreach collection="list" item="orderId" open="(" separator="," close=")">
+        <foreach collection="orderIds" item="orderId" open="(" separator="," close=")">
             #{orderId}
         </foreach>
     </update>

+ 1 - 1
qmjszx-quartz/src/main/java/beilv/quartz/task/SiteTask.java

@@ -154,7 +154,7 @@ public class SiteTask {
 
         // 批量更新订单状态为已核销
         if (!orderIdsToUpdate.isEmpty()) {
-            courseMapper.updateOrderStatusToVerification(orderIdsToUpdate);
+            courseMapper.updateOrderStatusToVerification(orderIdsToUpdate, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now));
         }
         // 批量更新门票状态为已核销
         if (!orderIdsToUpdate.isEmpty()) {