Kaynağa Gözat

update 上传文件去掉权限

周箭河 5 yıl önce
ebeveyn
işleme
f8aa9dbca2

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/NotifyCallback.java

@@ -41,6 +41,9 @@ public class NotifyCallback implements MQTTCallbackHandler {
         }
         String orderNo = dataObj.getString("order_no");
         ExamRegistrationPayment order = notifyCallback.examRegistrationPaymentService.getByOrderNo(orderNo);
+        if (order == null || !order.getTransStatus().equals("ING")) {
+            return;
+        }
         order.setPayChannel(dataObj.getString("pay_channel"));
         order.setTransStatus("SUCCESS");
         order.setUpdateTime(new Date());
@@ -63,6 +66,9 @@ public class NotifyCallback implements MQTTCallbackHandler {
         }
         String orderNo = dataObj.getString("order_no");
         ExamRegistrationPayment order = notifyCallback.examRegistrationPaymentService.getByOrderNo(orderNo);
+        if (order == null || !order.getTransStatus().equals("ING")) {
+            return;
+        }
         order.setPayChannel(dataObj.getString("pay_channel"));
         order.setTransStatus("FAILED");
         order.setUpdateTime(new Date());
@@ -85,6 +91,9 @@ public class NotifyCallback implements MQTTCallbackHandler {
         }
         String orderNo = dataObj.getString("order_no");
         ExamRegistrationPayment order = notifyCallback.examRegistrationPaymentService.getByOrderNo(orderNo);
+        if (order == null || !order.getTransStatus().equals("ING")) {
+            return;
+        }
         order.setPayChannel(dataObj.getString("pay_channel"));
         order.setTransStatus("FAILED");
         order.setUpdateTime(new Date());

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml

@@ -128,6 +128,6 @@
     <select id="getByOrderNo" resultMap="ExamRegistrationPayment">
         SELECT *
         FROM exam_registration_payment
-        WHERE order_no_ = #{orderNo}
+        WHERE order_no_ = #{orderNo} FOR UPDATE
     </select>
 </mapper>