From 677c87ad5b0057a09381cfe023e857229aa770dd Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 04 Sep 2024 16:48:40 +0800
Subject: [PATCH] 1

---
 src/main/java/com/nq/controller/protol/UserController.java |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/nq/controller/protol/UserController.java b/src/main/java/com/nq/controller/protol/UserController.java
index 6c4315c..760ce33 100644
--- a/src/main/java/com/nq/controller/protol/UserController.java
+++ b/src/main/java/com/nq/controller/protol/UserController.java
@@ -23,6 +23,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -60,10 +61,11 @@
     @Autowired
     IUserRechargeService iUserRechargeService;
 
-
-
     @Autowired
     IApplyLeverServices iApplyLeverServices;
+
+    @Autowired
+    private ISiteVipRobService iSiteVipRobService;
 
     private static final ThreadLocal<Boolean> orderCreated = ThreadLocal.withInitial(() -> false);
     private final Lock lock = new ReentrantLock();
@@ -120,13 +122,23 @@
                 return ServerResponse.createByErrorMsg("当前下单人数过多,请稍后重试", request);
             }
             buyOrderCreated.set(true);
-            return this.iUserPositionService.buy(stockId, buyNum, buyType, lever,profitTarget,stopLoss, request);
+            return this.iUserPositionService.buy(stockId, buyNum, buyType, lever,profitTarget,stopLoss,request,null);
         } catch (Exception e) {
             return ServerResponse.createByErrorMsg("订单异常,请稍后重试", request);
         }  finally{
             buyLock.unlock();
             buyOrderCreated.set(false);
         }
+    }
+    @GetMapping("checkStockVip.do")
+    @ResponseBody
+    public ServerResponse checkStockVip(@RequestParam("stockId") Integer stockId,
+                                        @RequestParam("buyNum") Integer buyNum,
+                                        @RequestParam("buyType") Integer buyType,
+                                        @RequestParam("lever") Integer lever,
+                                        @RequestParam(value = "profitTarget",required = false) BigDecimal profitTarget,
+                                        @RequestParam(value = "stopLoss",required = false) BigDecimal stopLoss, HttpServletRequest request){
+        return ServerResponse.createBySuccess(iUserPositionService.checkStockVip(stockId,buyNum,buyType,lever,profitTarget,stopLoss,request));
     }
     //修改涨跌板
     @RequestMapping({"updateProfitTarget.do"})
@@ -143,8 +155,8 @@
     //用户平仓操作
     @RequestMapping({"sell.do"})
     @ResponseBody
-    public ServerResponse sell(HttpServletRequest request, @RequestParam("positionSn") String positionSn) {
-            return this.iUserPositionService.sell(positionSn, 1,request);
+    public ServerResponse sell(HttpServletRequest request, @RequestParam("positionSn") String positionSn, @RequestParam("closeNumber") Integer closeNumber) {
+            return this.iUserPositionService.sell(positionSn,closeNumber, 1,request);
     }
 
 

--
Gitblit v1.9.3