New file |
| | |
| | | package com.supersavedriving.user.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/8/12 13:58 |
| | | */ |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "qyt") |
| | | public class QYTConfig { |
| | | /** |
| | | * 出行网关接口地址 |
| | | */ |
| | | private String chuxingUrl; |
| | | /** |
| | | * 长连接地址 |
| | | */ |
| | | private String socketUri; |
| | | /** |
| | | * 管理后台url |
| | | */ |
| | | private String adminUrl; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil travelOrder(Integer uid, TravelOrder travelOrder) throws Exception { |
| | | RLock lock1 = redissonClient.getLock("travelOrder:" + uid); |
| | | boolean lock2 = lock1.tryLock(5, 10, TimeUnit.SECONDS); |
| | | if(!lock2){ |
| | | return ResultUtil.error("系统繁忙,请稍后重试"); |
| | | } |
| | | try { |
| | | List<Integer> state = Arrays.asList(101, 102, 103, 104, 105, 106, 107, 201, 401); |
| | | Order order = this.selectOne(new EntityWrapper<Order>().eq("userId", uid).eq("status", 1).in("state", state)); |
| | |
| | | return ResultUtil.success(order.getId()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | lock1.unlock(); |
| | | } |
| | | return ResultUtil.error("系统异常"); |
| | | } |