From 0ababc615d5b381f856ca84fb8dc715cdb2c4b5b Mon Sep 17 00:00:00 2001
From: peter <14100000001@qq.com>
Date: Thu, 15 Jan 2026 14:22:53 +0800
Subject: [PATCH] 2-10演示站搭建

---
 src/main/java/com/nq/service/impl/UserPositionServiceImpl.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
index 9327b4e..2ff418f 100644
--- a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -295,6 +295,9 @@
             return ServerResponse.createByErrorMsg("平仓失败,订单不存在");
         }
         User user = this.userMapper.selectById(userPosition.getUserId());
+        if (user.getIsLock() == 1) {
+            return ServerResponse.createByErrorMsg("账户已被限制交易");
+        }
         if (user == null) {
             return ServerResponse.createByErrorMsg("平仓失败,用户不存在");
         }
@@ -372,6 +375,9 @@
             return ServerResponse.createByErrorMsg("平仓失败,订单不存在", request);
         }
         User user = this.userMapper.selectById(userPosition.getUserId());
+        if (user.getIsLock() == 1) {
+            return ServerResponse.createByErrorMsg("账户已被限制交易", request);
+        }
         if (user == null) {
             return ServerResponse.createByErrorMsg("平仓失败,用户不存在", request);
         }
@@ -1324,7 +1330,7 @@
 //        StringBuffer gid = new StringBuffer();
 //        gid.append(stockSubscribe.getStockType()!=null?stockSubscribe.getStockType():"");
 //        gid.append(userStockSubscribe.getNewCode()!=null?userStockSubscribe.getNewCode():"stock code invaild");
-        userPosition.setStockGid(stock.getStockType());
+        userPosition.setStockGid("IN");
         userPosition.setBuyOrderId(GeneratePosition.getPositionId());
         userPosition.setBuyOrderTime(new Date());
         userPosition.setBuyOrderPrice(userStockSubscribe.getBuyPrice());

--
Gitblit v1.9.3