|
@@ -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);
|