From 993755aece09ef32798c04cfdaf4921cd5572743 Mon Sep 17 00:00:00 2001
From: zyy3 <zyy3@zy.com>
Date: Sat, 08 Nov 2025 00:33:58 +0800
Subject: [PATCH] 1
---
src/main/java/com/nq/controller/protol/UserController.java | 68 ++++++++++++++++++++++++++++------
1 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/nq/controller/protol/UserController.java b/src/main/java/com/nq/controller/protol/UserController.java
index e34647d..c8826be 100644
--- a/src/main/java/com/nq/controller/protol/UserController.java
+++ b/src/main/java/com/nq/controller/protol/UserController.java
@@ -108,6 +108,12 @@
return this.iUserService.getMoney(request);
}
+ @RequestMapping("getWeeklyProfit.do")
+ @ResponseBody
+ public ServerResponse getWeeklyProfit( HttpServletRequest request) {
+ return this.iUserService.getWeeklyProfit(request);
+ }
+
//查询用户自选股
@RequestMapping({"queryMyOption.do"})
@ResponseBody
@@ -123,14 +129,15 @@
@RequestParam("buyType") Integer buyType,
@RequestParam("lever") Integer lever,
@RequestParam(value = "profitTarget",required = false)
- BigDecimal profitTarget,@RequestParam(value = "stopLoss",required = false) BigDecimal stopLoss, HttpServletRequest request) {
+ BigDecimal profitTarget,@RequestParam(value = "stopLoss",required = false) BigDecimal stopLoss,
+ @RequestParam(value = "preMarketPrice",required = false) BigDecimal preMarketPrice,HttpServletRequest request) {
buyLock.lock();
try {
if (buyOrderCreated.get()) {
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,preMarketPrice, request);
} catch (Exception e) {
e.printStackTrace();
return ServerResponse.createByErrorMsg("订单异常,请稍后重试", request);
@@ -155,16 +162,18 @@
@RequestMapping({"sell.do"})
@ResponseBody
public ServerResponse sell(HttpServletRequest request, @RequestParam("positionSn") String positionSn,@RequestParam("number") Integer number) {
- return this.iUserPositionService.sell(positionSn,1,number,request);
+ synchronized (positionSn) {
+ return this.iUserPositionService.sell(positionSn, 1, number, request);
+ }
}
//一键用户平仓操作
@RequestMapping({"allsell.do"})
@ResponseBody
- public ServerResponse allsell(@RequestParam("stockType") String positionSn,HttpServletRequest request) {
+ public ServerResponse allsell(HttpServletRequest request) {
try {
- return this.iUserPositionService.allSell(request,positionSn);
+ return this.iUserPositionService.allSell(request);
} catch (Exception e) {
return ServerResponse.createByErrorMsg("Sell Fail",request);
}
@@ -206,6 +215,23 @@
}
return serverResponse;
}
+
+ //挂单操作-撤销
+ @RequestMapping({"revocationOrder.do"})
+ @ResponseBody
+ public ServerResponse revocationOrder(HttpServletRequest request,@RequestParam("id") Integer id) {
+ ServerResponse serverResponse = null;
+ try {
+ serverResponse = this.userPendingorderService.cancelPendingOrder(request,id);
+ } catch (Exception e) {
+ log.error("挂单操作-撤销 = {}", e);
+ }
+ return serverResponse;
+ }
+
+
+
+
//挂单操作-删除
@RequestMapping({"delOrder.do"})
@ResponseBody
@@ -416,7 +442,7 @@
*/
@RequestMapping({"thirdPartyRecharge.do"})
@ResponseBody
- public ServerResponse thirdPartyRecharge(@RequestParam("tradeAmoun") String tradeAmoun,HttpServletRequest request) {
+ public ServerResponse thirdPartyRecharge(@RequestParam("tradeAmoun") String tradeAmoun,@RequestParam("type") Integer type,HttpServletRequest request) {
payLock.lock();
try {
if (payCreated.get()) {
@@ -425,11 +451,15 @@
if (!isIntegerGreaterThan100(tradeAmoun)) {
return ServerResponse.createByErrorMsg("请输入整数!",request);
}
+ if(null == type){
+ return ServerResponse.createByErrorMsg("请选择支付通道!",request);
+ }
if(new BigDecimal(tradeAmoun).compareTo(new BigDecimal("1000")) < 0){
return ServerResponse.createByErrorMsg("请重新输入,最低充值金额:1000", request);
}
+
payCreated.set(true);
- return payService.thirdPartyRecharge(request,tradeAmoun);
+ return payService.thirdPartyRecharge(request,tradeAmoun,type);
} catch (Exception e) {
e.printStackTrace();
return ServerResponse.createByErrorMsg("获取充值链接异常,请稍后重试", request);
@@ -449,7 +479,7 @@
}
/**
- * 充值异步接收地址
+ * 充值1异步接收地址
*/
@PostMapping({"rechargeCallback.do"})
public void rechargeCallback(PaymentResponse vo, HttpServletResponse response) throws IOException {
@@ -457,10 +487,24 @@
}
/**
- * 代付回调通知
+ * 充值2异步接收地址
*/
- @PostMapping({"noticePayment.do"})
- public void noticePayment(TradeResultVO vo,HttpServletResponse response) throws IOException {
- iUserWithdrawService.noticePayment(vo,response);
+ @PostMapping({"rechargeCallbackTwo.do"})
+ public void rechargeCallbackTwo(@RequestParam("status") String status,
+ @RequestParam("merchantid") String merchantid,
+ @RequestParam("out_trade_no") String outTradeNo,
+ @RequestParam("total_fee") String totalFee,
+ @RequestParam("poundage") String poundage,
+ @RequestParam("account_fee") String accountFee,
+ @RequestParam("sign") String sign, HttpServletResponse response) throws IOException {
+ TransactionStatusVo vo = new TransactionStatusVo();
+ vo.setStatus(status);
+ vo.setMerchantid(merchantid);
+ vo.setOut_trade_no(outTradeNo);
+ vo.setTotal_fee(totalFee);
+ vo.setPoundage(poundage);
+ vo.setAccount_fee(accountFee);
+ vo.setSign(sign);
+ payService.rechargeCallbackTwo(vo,response);
}
}
--
Gitblit v1.9.3