Prechádzať zdrojové kódy

feat : 米大师调试

bilingfeng 1 rok pred
rodič
commit
fc37436147

+ 6 - 0
game-module/game-sdk/src/main/java/com/zanxiang/sdk/domain/params/ProductPayParam.java

@@ -89,6 +89,12 @@ public class ProductPayParam {
     @ApiModelProperty(notes = "CP订单id")
     private String orderId;
 
+    /**
+     * 趣程订单id
+     */
+    @ApiModelProperty(notes = "趣程订单id")
+    private String qcOrderId;
+
     /**
      * 扩展字段,充值回调时,原样返回
      */

+ 7 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/impl/OrderServiceImpl.java

@@ -18,6 +18,7 @@ import com.zanxiang.sdk.service.*;
 import com.zanxiang.sdk.util.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -59,6 +60,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Override
     @Transactional(rollbackFor = {Exception.class, RuntimeException.class})
     public Boolean createOrder(ProductPayParam payParam, UserData userData) {
+        if (Strings.isNotBlank(payParam.getQcOrderId())) {
+            //设置订单号
+            payParam.setOrderId(payParam.getQcOrderId());
+            return Boolean.TRUE;
+        }
         //用户id
         Long userId = userData.getUserId();
         //游戏id
@@ -132,7 +138,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     private void orderExpire(String orderId) {
         //过期时间
-        double expire = (double) DateUtil.localDateTimeToMilli(LocalDateTime.now().plusMinutes(5));
+        double expire = (double) DateUtil.localDateTimeToMilli(LocalDateTime.now().plusMinutes(15));
         //设置缓存
         redisUtil.addZSet(RedisKeyConstant.ORDER_EXPIRE, orderId, expire);
         log.error("订单添加过期缓存, orderId : {}, expire : {}", orderId, expire);