From 9b857ed9a9c6e07cc656622b0664109e61638041 Mon Sep 17 00:00:00 2001
From: jack <zengjieli93@163.com>
Date: Wed, 27 Mar 2024 19:34:10 +0800
Subject: [PATCH] 分支1
---
src/main/java/com/nq/utils/ip/JuheIpApi.java | 2
src/main/java/com/nq/controller/SiteApiController.java | 2
src/main/java/com/nq/service/IMandatoryLiquidationService.java | 14
src/main/java/com/nq/service/IPayService.java | 2
src/main/java/com/nq/utils/stock/qq/QqStockApi.java | 2
src/main/java/com/nq/utils/http/HttpRequest.java | 2
src/main/java/com/nq/dao/SitePayMapper.java | 10
src/main/java/com/nq/pojo/User.java | 505 ---
src/main/java/com/nq/ws/USWebsocketRunClient.java | 10
src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java | 9
src/main/java/com/nq/service/impl/UserServiceImpl.java | 920 +-----
src/main/java/com/nq/service/impl/SiteArticleServiceImpl.java | 4
src/main/resources/application.properties | 109
src/main/java/com/nq/pojo/reponse/RUserAssets.java | 55
src/main/java/com/nq/service/impl/FileUploadServiceImpl.java | 2
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst | 17
src/main/java/com/nq/enums/EUserAssets.java | 47
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java | 100
src/main/java/com/nq/utils/stock/GeneratePosition.java | 2
src/main/java/com/nq/service/impl/UserIndexPositionServiceImpl.java | 465 ---
src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java | 5
src/main/java/com/nq/service/impl/PayServiceImpl.java | 81
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst | 860 +++---
src/main/java/com/nq/service/impl/FundsApplyServiceImpl.java | 126
src/main/java/com/nq/service/impl/StockFuturesServiceImpl.java | 2
src/main/java/com/nq/utils/ApplicationContextRegisterUtil.java | 22
src/main/java/com/nq/service/impl/StockServiceImpl.java | 100
src/main/resources/mapper/UserPositionMapper.xml | 2
src/main/java/com/nq/pojo/SiteProduct.java | 10
src/main/java/com/nq/utils/redis/RedisKeyUtil.java | 4
src/main/java/com/nq/controller/protol/UserController.java | 57
src/main/java/com/nq/utils/ftp/FTPUtil.java | 3
src/main/java/com/nq/Text.java | 6
src/main/java/com/nq/controller/SiteNewsController.java | 3
src/main/java/com/nq/dao/UserAssetsMapper.java | 7
src/main/java/com/nq/service/impl/MandatoryLiquidationService.java | 48
src/main/java/com/nq/service/impl/FundsAppendServiceImpl.java | 2
src/main/java/com/nq/ws/WebSocketClientBeanConfig.java | 42
src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java | 13
src/main/java/com/nq/service/impl/StockDzServiceImpl.java | 2
src/main/java/com/nq/service/impl/UserFuturesPositionServiceImpl.java | 317 --
src/main/java/com/nq/controller/protol/UserPayController.java | 5
src/main/java/com/nq/service/impl/SitePayServiceImpl.java | 4
src/main/java/com/nq/service/impl/StockMarketsDayServiceImpl.java | 5
src/main/java/com/nq/service/impl/StockIndexServiceImpl.java | 2
src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java | 47
src/main/java/com/nq/controller/ArticleApiController.java | 1
src/main/java/com/nq/ws/WebsocketRunClient.java | 15
target/classes/application.properties | 111
target/classes/mapper/SitePayMapper.xml | 39
src/main/resources/mapper/UserWithdrawMapper.xml | 30
src/main/java/com/nq/service/impl/AgentAgencyFeeServiceImpl.java | 2
src/main/java/com/nq/service/impl/DkServices.java | 4
src/main/java/com/nq/utils/task/stock/StockTask.java | 70
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java | 370 --
src/main/java/com/nq/utils/stock/GetStayDays.java | 2
target/classes/mapper/UserWithdrawMapper.xml | 30
src/main/java/com/nq/service/IUserPositionService.java | 4
src/main/resources/mapper/SitePayMapper.xml | 39
pom.xml | 5
src/main/java/com/nq/utils/redis/RedisKeyConstant.java | 7
src/main/resources/mapper/UserMapper.xml | 450 ---
src/main/java/com/nq/service/impl/UserRechargeServiceImpl.java | 87
src/main/java/com/nq/service/impl/SmsServiceImpl.java | 2
src/main/java/com/nq/pojo/UserAssets.java | 50
src/main/java/com/nq/vo/user/UserInfoVO.java | 466 ---
src/main/java/com/nq/service/IUserAssetsServices.java | 49
src/main/java/com/nq/dao/UserPositionMapper.java | 1
src/main/java/com/nq/service/IUserWithdrawService.java | 2
src/main/java/com/nq/utils/timeutil/DateTimeUtil.java | 2
target/stock-0.0.1-SNAPSHOT.jar.original | 0
src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java | 9
src/main/java/com/nq/pojo/SitePay.java | 223 -
src/main/resources/mapper/UserRechargeMapper.xml | 50
src/main/java/com/nq/enums/EStockType.java | 26
src/main/java/com/nq/service/impl/UserAssetsServices.java | 78
src/main/java/com/nq/utils/stock/sina/StockApi.java | 69
src/main/java/com/nq/utils/http/HttpClientRequest.java | 5
target/classes/mapper/UserMapper.xml | 450 ---
target/classes/mapper/UserPositionMapper.xml | 2
src/main/java/com/nq/controller/protol/UserWithdrawController.java | 6
src/main/java/com/nq/utils/http/HttpClientUtil.java | 2
src/main/java/com/nq/pojo/UserPosition.java | 1
src/main/java/com/nq/dao/UserMapper.java | 3
src/main/java/com/nq/controller/SmsApiController.java | 2
src/main/java/com/nq/service/IUserService.java | 5
/dev/null | 206 -
src/main/java/com/nq/pojo/HBData.java | 150 +
target/classes/application.yml | 26
src/main/java/com/nq/config/WebMvcConfig.java | 6
src/main/java/com/nq/vo/stock/StockVO.java | 495 ---
target/classes/mapper/UserRechargeMapper.xml | 50
src/main/java/com/nq/dao/UserRechargeMapper.java | 9
src/main/java/com/nq/pojo/UserRecharge.java | 140
src/main/resources/application.yml | 26
src/main/java/com/nq/service/impl/UserFundsPositionServiceImpl.java | 281 --
96 files changed, 1,871 insertions(+), 6,341 deletions(-)
diff --git a/pom.xml b/pom.xml
index 52ec0d0..84a2b55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,6 +27,11 @@
</dependency>
+ <dependency>
+ <groupId>org.flywaydb</groupId>
+ <artifactId>flyway-core</artifactId>
+ </dependency>
+
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
diff --git a/src/main/java/com/nq/Text.java b/src/main/java/com/nq/Text.java
index 11f4962..77be89f 100644
--- a/src/main/java/com/nq/Text.java
+++ b/src/main/java/com/nq/Text.java
@@ -2,15 +2,15 @@
import com.nq.common.ServerResponse;
import com.nq.pay.PayUtil;
-import com.nq.utils.DateTimeUtil;
-import com.nq.utils.HttpClientUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
+import com.nq.utils.http.HttpClientUtil;
import com.nq.utils.SignAPI;
import com.nq.utils.SignUtil;
import org.apache.commons.collections.map.HashedMap;
import java.util.Map;
-import static com.nq.utils.DateTimeUtil.STANDARD_FORMAT;
+import static com.nq.utils.timeutil.DateTimeUtil.STANDARD_FORMAT;
public class Text {
public static void main(String[] args) {
diff --git a/src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java b/src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java
index 38d883d..a1bc556 100644
--- a/src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java
+++ b/src/main/java/com/nq/common/interceptor/ApiUserAuthorityInterceptor.java
@@ -4,6 +4,7 @@
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
+import com.google.gson.Gson;
import com.nq.annotation.SameUrlData;
import com.nq.common.ServerResponse;
import com.nq.pojo.User;
@@ -73,21 +74,15 @@
}
User currentUser = getCurrentUser(httpServletRequest);
if (null == currentUser) {
-// httpServletResponse.reset();
httpServletResponse.setCharacterEncoding("UTF-8");
httpServletResponse.setContentType("application/json;charset=UTF-8");
PrintWriter writer = httpServletResponse.getWriter();
- Map map = Maps.newHashMap();
- map.put("success", Boolean.valueOf(false));
- map.put("msg", "Please Login");
- writer.print(JsonUtil.obj2String(map));
+ writer.print( new Gson().toJson(ServerResponse.createByErrorCodeMsg(401,"请登录")));
writer.flush();
writer.close();
return false;
}
String uri = httpServletRequest.getRequestURI();
-
-
//验证重复点击与接口权限等
Boolean checkFlag = checkUri(httpServletResponse, handler, uri,currentUser);
if (!checkFlag) {
diff --git a/src/main/java/com/nq/config/WebMvcConfig.java b/src/main/java/com/nq/config/WebMvcConfig.java
index cacc5f3..9602a26 100644
--- a/src/main/java/com/nq/config/WebMvcConfig.java
+++ b/src/main/java/com/nq/config/WebMvcConfig.java
@@ -34,13 +34,13 @@
//SpringMVC下,攔截器的註冊需要排除對靜態資源的攔截(*.css,*.js)
//SpringBoot已經做好了靜態資源的映射,因此我們無需任何操作
registry.addInterceptor(new ApiAgentAuthorityInterceptor()).addPathPatterns("/agent/**")
- .excludePathPatterns("/index.html", "/", "/user/login")
+ .excludePathPatterns("/index.html", "/", "/user/login","/user/upload.do")
;
registry.addInterceptor(new ApiUserAuthorityInterceptor(redisTemplate)).addPathPatterns("/user/**")
- .excludePathPatterns("/index.html", "/", "/user/login")
+ .excludePathPatterns("/index.html", "/", "/user/login","/user/upload.do")
;
registry.addInterceptor(new ApiAdminAuthorityInterceptor()).addPathPatterns("/admin/**")
- .excludePathPatterns("/index.html", "/", "/user/login")
+ .excludePathPatterns("/index.html", "/", "/user/login","/user/upload.do")
;
}
}
diff --git a/src/main/java/com/nq/constant/StockConstant.java b/src/main/java/com/nq/constant/StockConstant.java
deleted file mode 100644
index 0e250e7..0000000
--- a/src/main/java/com/nq/constant/StockConstant.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.nq.constant;
-
-/**
- * 股票长量配置
- * */
-public class StockConstant {
-
- public static String HTTP_API = "http://api-in.js-stock.top/";
-
-
- public static String HTTP_F_API = "http://api-v1-f.js-stock.top/";
-
-
- public static String WS_URL = "ws://api-in-ws.js-stock.top";
-
- public static String KEY = "r3ZAgtcYzuBizmqge2hK";
-
-
- public static String US_WS_URL = "ws://ws-us.js-stock.top";
-
- public static String US_API_URL = "http://api-us.js-stock.top/";
-
- public static String US_KEY = "F03fXyNJKeFiTGsaoXHg";
-
-
-
-}
diff --git a/src/main/java/com/nq/controller/ArticleApiController.java b/src/main/java/com/nq/controller/ArticleApiController.java
index fe0afd6..6b0c818 100644
--- a/src/main/java/com/nq/controller/ArticleApiController.java
+++ b/src/main/java/com/nq/controller/ArticleApiController.java
@@ -2,7 +2,6 @@
import com.nq.common.ServerResponse;
import com.nq.service.ISiteArticleService;
-import com.nq.utils.HttpRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/nq/controller/SiteApiController.java b/src/main/java/com/nq/controller/SiteApiController.java
index 012b65f..32ffe12 100644
--- a/src/main/java/com/nq/controller/SiteApiController.java
+++ b/src/main/java/com/nq/controller/SiteApiController.java
@@ -5,7 +5,7 @@
import com.nq.service.ISiteBannerService;
import com.nq.service.ISiteInfoService;
import com.nq.service.ISitePayService;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.ip.Mandate;
import io.lettuce.core.dynamic.annotation.Param;
diff --git a/src/main/java/com/nq/controller/SiteNewsController.java b/src/main/java/com/nq/controller/SiteNewsController.java
index 1607695..f68e33e 100644
--- a/src/main/java/com/nq/controller/SiteNewsController.java
+++ b/src/main/java/com/nq/controller/SiteNewsController.java
@@ -4,8 +4,7 @@
import com.nq.common.ServerResponse;
import com.nq.service.ISiteNewsService;
import com.nq.service.IUserPositionService;
-import com.nq.utils.HttpClientRequest;
-import com.nq.utils.PropertiesUtil;
+import com.nq.utils.http.HttpClientRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/nq/controller/SmsApiController.java b/src/main/java/com/nq/controller/SmsApiController.java
index 79ae5e4..0327f28 100644
--- a/src/main/java/com/nq/controller/SmsApiController.java
+++ b/src/main/java/com/nq/controller/SmsApiController.java
@@ -7,7 +7,7 @@
import com.nq.service.ISiteSmsLogService;
import com.nq.service.ISmsService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.smsUtil.smsUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
diff --git a/src/main/java/com/nq/controller/protol/UserController.java b/src/main/java/com/nq/controller/protol/UserController.java
index d3eae51..dfe63cc 100644
--- a/src/main/java/com/nq/controller/protol/UserController.java
+++ b/src/main/java/com/nq/controller/protol/UserController.java
@@ -71,6 +71,12 @@
return this.iUserService.isOption(code, request);
}
+ @RequestMapping("getMoney.do")
+ @ResponseBody
+ public ServerResponse getMoney( HttpServletRequest request) {
+ return this.iUserService.getMoney(request);
+ }
+
//查询用户自选股
@RequestMapping({"queryMyOption.do"})
@ResponseBody
@@ -113,18 +119,40 @@
@RequestMapping({"sell.do"})
@ResponseBody
public ServerResponse sell(HttpServletRequest request, @RequestParam("positionSn") String positionSn) {
- ServerResponse serverResponse = null;
try {
- serverResponse = this.iUserPositionService.sell(positionSn, 1);
+ return this.iUserPositionService.sell(positionSn, 1);
} catch (Exception e) {
- log.error("用户平仓操作 = {}", e);
+ return ServerResponse.createByErrorMsg("Sell Fail");
}
- return serverResponse;
}
+
+
+ //用户平仓操作
+ @RequestMapping({"allsell.do"})
+ @ResponseBody
+ public ServerResponse allsell(@RequestParam("stockType") String positionSn,HttpServletRequest request) {
+ try {
+ return this.iUserPositionService.allSell(request,positionSn);
+ } catch (Exception e) {
+ return ServerResponse.createByErrorMsg("Sell Fail");
+ }
+ }
+
+
+
+
+
//挂单操作-添加
@RequestMapping({"addOrder.do"})
@ResponseBody
- public ServerResponse addOrder(HttpServletRequest request, @RequestParam("stockId") String stockId, @RequestParam("buyNum") Integer buyNum, @RequestParam("buyType") Integer buyType, @RequestParam("lever") Integer lever,@RequestParam(value = "profitTarget",required = false) BigDecimal profitTarget,@RequestParam(value = "stopTarget",required = false) BigDecimal stopTarget,@RequestParam(value = "targetPrice",required = false) BigDecimal targetPrice) {
+ public ServerResponse addOrder(HttpServletRequest request,
+ @RequestParam("stockId") String stockId,
+ @RequestParam("buyNum") Integer buyNum,
+ @RequestParam("buyType") Integer buyType,
+ @RequestParam("lever") Integer lever,
+ @RequestParam(value = "profitTarget",required = false) BigDecimal profitTarget,
+ @RequestParam(value = "stopTarget",required = false) BigDecimal stopTarget,
+ @RequestParam(value = "targetPrice",required = false) BigDecimal targetPrice) {
ServerResponse serverResponse = null;
try {
serverResponse = this.userPendingorderService.addOrder(stockId, buyNum, buyType, lever,profitTarget,stopTarget,targetPrice, request);
@@ -325,6 +353,25 @@
return this.iUserStockSubscribeService.userSubmit(id,request);
}
+
+ /**
+ * vip抢筹 (涨停板买入)
+ *
+ */
+ @RequestMapping({"transfer.do"})
+ @ResponseBody
+ public ServerResponse transfer(@RequestParam("fromType") String fromType, @RequestParam("toType") String toType,
+ @RequestParam("amt") String amt, HttpServletRequest request) {
+ ServerResponse serverResponse = null;
+ try {
+ serverResponse = this.iUserService.transfer(fromType, toType, amt,request);
+ } catch (Exception e) {
+ log.error("vip抢筹下单操作出错 = {}", e);
+ }
+ return serverResponse;
+ }
+
+
/**
* vip抢筹 (涨停板买入)
*
diff --git a/src/main/java/com/nq/controller/protol/UserPayController.java b/src/main/java/com/nq/controller/protol/UserPayController.java
index 115c291..c3b5986 100644
--- a/src/main/java/com/nq/controller/protol/UserPayController.java
+++ b/src/main/java/com/nq/controller/protol/UserPayController.java
@@ -50,9 +50,10 @@
@RequestMapping({"flyPay.do"})
@ResponseBody
- public ServerResponse flyPay(@RequestParam("payType") String payType,
+ public ServerResponse flyPay(@RequestParam("payTypeId") Integer payType,
@RequestParam("payAmt") String payAmt,
- @RequestParam("currency") String currency, HttpServletRequest request) {
+ @RequestParam("img") String currency,
+ HttpServletRequest request) {
log.info("发起 fly 线上支付 payType = {} payAmt = {} currency = {}", new Object[]{payType, payAmt, currency});
return this.iPayService.flyPay(payType, payAmt, currency, request);
}
diff --git a/src/main/java/com/nq/controller/protol/UserWithdrawController.java b/src/main/java/com/nq/controller/protol/UserWithdrawController.java
index d979ebc..c2ad41a 100644
--- a/src/main/java/com/nq/controller/protol/UserWithdrawController.java
+++ b/src/main/java/com/nq/controller/protol/UserWithdrawController.java
@@ -37,11 +37,13 @@
//用户提现
@RequestMapping({"outMoney.do"})
@ResponseBody
- public ServerResponse outMoney(String amt, HttpServletRequest request) {
+ public ServerResponse outMoney(@RequestParam(value = "amt") String amt,
+ @RequestParam(value = " ") String accsetType,
+ HttpServletRequest request) {
ServerResponse serverResponse = null;
User user = this.iUserService.getCurrentRefreshUser(request);
try {
- serverResponse = this.iUserWithdrawService.outMoney(amt, user.getWithPwd(), request);
+ serverResponse = this.iUserWithdrawService.outMoney(amt, user.getWithPwd(), accsetType,request);
} catch (Exception e) {
log.error("出金异常 e = {}", e);
serverResponse = ServerResponse.createByErrorMsg("Withdrawal exception, please try again later");
diff --git a/src/main/java/com/nq/dao/SitePayMapper.java b/src/main/java/com/nq/dao/SitePayMapper.java
index e3c313d..25c128d 100644
--- a/src/main/java/com/nq/dao/SitePayMapper.java
+++ b/src/main/java/com/nq/dao/SitePayMapper.java
@@ -1,10 +1,16 @@
package com.nq.dao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.nq.pojo.PayChnnel;
import com.nq.pojo.SitePay;
import java.util.List;
-import org.apache.ibatis.annotations.Param;
-public interface SitePayMapper {
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.reflection.wrapper.BaseWrapper;
+import org.springframework.stereotype.Repository;
+
+public interface SitePayMapper extends BaseMapper<SitePay> {
int deleteByPrimaryKey(Integer paramInteger);
int insert(SitePay paramSitePay);
diff --git a/src/main/java/com/nq/dao/UserAssetsMapper.java b/src/main/java/com/nq/dao/UserAssetsMapper.java
new file mode 100644
index 0000000..f86120a
--- /dev/null
+++ b/src/main/java/com/nq/dao/UserAssetsMapper.java
@@ -0,0 +1,7 @@
+package com.nq.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.nq.pojo.UserAssets;
+
+public interface UserAssetsMapper extends BaseMapper<UserAssets> {
+}
diff --git a/src/main/java/com/nq/dao/UserMapper.java b/src/main/java/com/nq/dao/UserMapper.java
index 26e3c75..60f7634 100644
--- a/src/main/java/com/nq/dao/UserMapper.java
+++ b/src/main/java/com/nq/dao/UserMapper.java
@@ -13,15 +13,12 @@
public interface UserMapper extends BaseMapper<User> {
- int deleteByPrimaryKey(Integer paramInteger);
int insert(User paramUser);
int insertSelective(User paramUser);
- User selectByPrimaryKey(Integer paramInteger);
- int updateByPrimaryKeySelective(User paramUser);
int updateByPrimaryKey(User paramUser);
diff --git a/src/main/java/com/nq/dao/UserPositionMapper.java b/src/main/java/com/nq/dao/UserPositionMapper.java
index 0f7fd4c..b2e8c73 100644
--- a/src/main/java/com/nq/dao/UserPositionMapper.java
+++ b/src/main/java/com/nq/dao/UserPositionMapper.java
@@ -54,4 +54,5 @@
UserPosition findUserPositionByCode(@Param("userId") Integer paramInteger,@Param("stockCode") String stockCode);
+
}
diff --git a/src/main/java/com/nq/dao/UserRechargeMapper.java b/src/main/java/com/nq/dao/UserRechargeMapper.java
index 7958203..b341a5f 100644
--- a/src/main/java/com/nq/dao/UserRechargeMapper.java
+++ b/src/main/java/com/nq/dao/UserRechargeMapper.java
@@ -1,20 +1,19 @@
package com.nq.dao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nq.pojo.UserRecharge;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
-public interface UserRechargeMapper {
- int deleteByPrimaryKey(Integer paramInteger);
-
+public interface UserRechargeMapper extends BaseMapper<UserRecharge> {
+
int insert(UserRecharge paramUserRecharge);
int insertSelective(UserRecharge paramUserRecharge);
- UserRecharge selectByPrimaryKey(Integer paramInteger);
-
+
int updateByPrimaryKeySelective(UserRecharge paramUserRecharge);
int updateByPrimaryKey(UserRecharge paramUserRecharge);
diff --git a/src/main/java/com/nq/enums/EStockType.java b/src/main/java/com/nq/enums/EStockType.java
index d567b68..2b965f2 100644
--- a/src/main/java/com/nq/enums/EStockType.java
+++ b/src/main/java/com/nq/enums/EStockType.java
@@ -1,8 +1,7 @@
package com.nq.enums;
-import com.nq.constant.StockConstant;
-import lombok.Data;
+import com.nq.utils.PropertiesUtil;
/**
* 股票类型
@@ -11,8 +10,17 @@
public enum EStockType {
- IN("IN","印度股票","14", StockConstant.HTTP_API,StockConstant.KEY),
- US("US","美国股票","5",StockConstant.US_API_URL,StockConstant.US_KEY);
+ IN("IN","印度股票","14", PropertiesUtil.getProperty("IN_HTTP_API"),PropertiesUtil.getProperty("IN_KEY")),
+ US("US","美国股票","5",PropertiesUtil.getProperty("US_HTTP_API"),PropertiesUtil.getProperty("US_KEY")),
+ HK("HK","香港股票","39",PropertiesUtil.getProperty("HK_HTTP_API"),PropertiesUtil.getProperty("HK_KEY")),
+ MAS("MAS","马来西亚股票","42",PropertiesUtil.getProperty("MAS_HTTP_API"),PropertiesUtil.getProperty("MAS_KEY")),
+ TH("TH","泰国股票","41",PropertiesUtil.getProperty("TH_HTTP_API"),PropertiesUtil.getProperty("TH_KEY")),
+
+
+
+ HG("HG","韩国股票","11",PropertiesUtil.getProperty("HG_HTTP_API"),PropertiesUtil.getProperty("TG_KEY")),
+
+ SZHB("SZHB","数字货币","41",PropertiesUtil.getProperty("SZHB_HTTP_API"),PropertiesUtil.getProperty("SZHB_KEY"));
private String code;
private String typeDesc;
public String contryId;
@@ -32,8 +40,16 @@
public static EStockType getEStockTypeByCode(String code){
if(EStockType.US.getCode().equals(code)){
return US;
- }else{
+ }else if(EStockType.IN.getCode().equals(code)){
return IN;
+ }else if(EStockType.HK.getCode().equals(code)){
+ return HK;
+ }else if(EStockType.MAS.getCode().equals(code)){
+ return MAS;
+ }else if(EStockType.SZHB.getCode().equals(code)){
+ return SZHB;
+ }else {
+ return TH;
}
}
diff --git a/src/main/java/com/nq/enums/EUserAssets.java b/src/main/java/com/nq/enums/EUserAssets.java
new file mode 100644
index 0000000..7384a33
--- /dev/null
+++ b/src/main/java/com/nq/enums/EUserAssets.java
@@ -0,0 +1,47 @@
+package com.nq.enums;
+
+import com.nq.utils.PropertiesUtil;
+import lombok.Data;
+
+public enum EUserAssets {
+
+
+
+ HANDLING_CHARGE("HANDLING_CHARGE","手续费"),
+ CALCULATE_PROFIT_AND_LOSS("CALCULATE_PROFIT_AND_LOSS","计算盈亏"),
+
+ CLOSE_POSITION_RETURN_SECURITY_DEPOSIT("CLOSE_POSITION_RETURN_SECURITY","平仓返回保证金"),
+ CLOSE_POSITION("CLOSE_POSITION","平仓"),
+ BUY("BUY","购买"),
+ WITHDRAW("WITHDRAW","提现"),
+
+ TRANSFER("TRANSFER","转换"),
+ TOP_UP("TOP_UP","充值");
+
+
+ private String code;
+
+ private String desc;
+
+
+ EUserAssets(String code, String desc) {
+ this.code = code;
+ this.desc = desc;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+}
diff --git a/src/main/java/com/nq/pojo/HBData.java b/src/main/java/com/nq/pojo/HBData.java
new file mode 100644
index 0000000..d80f4c3
--- /dev/null
+++ b/src/main/java/com/nq/pojo/HBData.java
@@ -0,0 +1,150 @@
+package com.nq.pojo;
+
+import java.util.List;
+
+public class HBData {
+
+
+ /**
+ * ch : market.btcusdt.detail.merged
+ * status : ok
+ * ts : 1711452466761
+ * tick : {"id":339321896246,"version":339321896246,"open":66860.62,"close":70754.98,"low":66750.01,"high":71540.34,"amount":4448.863696904556,"vol":3.091908139344081E8,"count":178297,"bid":[70754.97,0.298382],"ask":[70754.98,0.637937]}
+ */
+
+ private String ch;
+ private String status;
+ private long ts;
+ private TickBean tick;
+
+ public String getCh() {
+ return ch;
+ }
+
+ public void setCh(String ch) {
+ this.ch = ch;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public long getTs() {
+ return ts;
+ }
+
+ public void setTs(long ts) {
+ this.ts = ts;
+ }
+
+ public TickBean getTick() {
+ return tick;
+ }
+
+ public void setTick(TickBean tick) {
+ this.tick = tick;
+ }
+
+ public static class TickBean {
+ /**
+ * id : 339321896246
+ * version : 339321896246
+ * open : 66860.62
+ * close : 70754.98
+ * low : 66750.01
+ * high : 71540.34
+ * amount : 4448.863696904556
+ * vol : 3.091908139344081E8
+ * count : 178297
+ * bid : [70754.97,0.298382]
+ * ask : [70754.98,0.637937]
+ */
+
+ private long id;
+ private long version;
+ private double open;
+ private double close;
+ private double low;
+ private double high;
+ private double amount;
+ private double vol;
+ private int count;
+
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public long getVersion() {
+ return version;
+ }
+
+ public void setVersion(long version) {
+ this.version = version;
+ }
+
+ public double getOpen() {
+ return open;
+ }
+
+ public void setOpen(double open) {
+ this.open = open;
+ }
+
+ public double getClose() {
+ return close;
+ }
+
+ public void setClose(double close) {
+ this.close = close;
+ }
+
+ public double getLow() {
+ return low;
+ }
+
+ public void setLow(double low) {
+ this.low = low;
+ }
+
+ public double getHigh() {
+ return high;
+ }
+
+ public void setHigh(double high) {
+ this.high = high;
+ }
+
+ public double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(double amount) {
+ this.amount = amount;
+ }
+
+ public double getVol() {
+ return vol;
+ }
+
+ public void setVol(double vol) {
+ this.vol = vol;
+ }
+
+ public int getCount() {
+ return count;
+ }
+
+ public void setCount(int count) {
+ this.count = count;
+ }
+ }
+}
diff --git a/src/main/java/com/nq/pojo/SitePay.java b/src/main/java/com/nq/pojo/SitePay.java
index cdd4e34..9108930 100644
--- a/src/main/java/com/nq/pojo/SitePay.java
+++ b/src/main/java/com/nq/pojo/SitePay.java
@@ -1,8 +1,11 @@
package com.nq.pojo;
+import lombok.Data;
+
import java.beans.ConstructorProperties;
import java.math.BigDecimal;
+@Data
public class SitePay {
private Integer id;
private Integer cType;
@@ -11,12 +14,10 @@
private String channelType;
private String channelName;
- public void setId(Integer id) {
- this.id = id;
- }
-
+ // 银行名字
private String channelDesc;
private String channelAccount;
+ // 收款人名称
private String channelImg;
private Integer channelMinLimit;
private Integer channelMaxLimit;
@@ -25,220 +26,8 @@
/*累计充值金额*/
private BigDecimal totalPrice;
- public void setCType(Integer cType) {
- this.cType = cType;
- }
-
- public void setFormUrl(String formUrl) {
- this.formUrl = formUrl;
- }
-
- public void setFormCode(String formCode) {
- this.formCode = formCode;
- }
-
- public void setChannelType(String channelType) {
- this.channelType = channelType;
- }
-
- public void setChannelName(String channelName) {
- this.channelName = channelName;
- }
-
- public void setChannelDesc(String channelDesc) {
- this.channelDesc = channelDesc;
- }
-
- public void setChannelAccount(String channelAccount) {
- this.channelAccount = channelAccount;
- }
-
- public void setChannelImg(String channelImg) {
- this.channelImg = channelImg;
- }
-
- public void setChannelMinLimit(Integer channelMinLimit) {
- this.channelMinLimit = channelMinLimit;
- }
-
- public void setChannelMaxLimit(Integer channelMaxLimit) {
- this.channelMaxLimit = channelMaxLimit;
- }
-
- public void setIsShow(Integer isShow) {
- this.isShow = isShow;
- }
-
- public void setIsLock(Integer isLock) {
- this.isLock = isLock;
- }
-
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof SitePay)) return false;
- SitePay other = (SitePay) o;
- if (!other.canEqual(this)) return false;
- Object this$id = getId(), other$id = other.getId();
- if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id)) return false;
- Object this$cType = getCType(), other$cType = other.getCType();
- if ((this$cType == null) ? (other$cType != null) : !this$cType.equals(other$cType)) return false;
- Object this$formUrl = getFormUrl(), other$formUrl = other.getFormUrl();
- if ((this$formUrl == null) ? (other$formUrl != null) : !this$formUrl.equals(other$formUrl)) return false;
- Object this$formCode = getFormCode(), other$formCode = other.getFormCode();
- if ((this$formCode == null) ? (other$formCode != null) : !this$formCode.equals(other$formCode)) return false;
- Object this$channelType = getChannelType(), other$channelType = other.getChannelType();
- if ((this$channelType == null) ? (other$channelType != null) : !this$channelType.equals(other$channelType))
- return false;
- Object this$channelName = getChannelName(), other$channelName = other.getChannelName();
- if ((this$channelName == null) ? (other$channelName != null) : !this$channelName.equals(other$channelName))
- return false;
- Object this$channelDesc = getChannelDesc(), other$channelDesc = other.getChannelDesc();
- if ((this$channelDesc == null) ? (other$channelDesc != null) : !this$channelDesc.equals(other$channelDesc))
- return false;
- Object this$channelAccount = getChannelAccount(), other$channelAccount = other.getChannelAccount();
- if ((this$channelAccount == null) ? (other$channelAccount != null) : !this$channelAccount.equals(other$channelAccount))
- return false;
- Object this$channelImg = getChannelImg(), other$channelImg = other.getChannelImg();
- if ((this$channelImg == null) ? (other$channelImg != null) : !this$channelImg.equals(other$channelImg))
- return false;
- Object this$channelMinLimit = getChannelMinLimit(), other$channelMinLimit = other.getChannelMinLimit();
- if ((this$channelMinLimit == null) ? (other$channelMinLimit != null) : !this$channelMinLimit.equals(other$channelMinLimit))
- return false;
- Object this$channelMaxLimit = getChannelMaxLimit(), other$channelMaxLimit = other.getChannelMaxLimit();
- if ((this$channelMaxLimit == null) ? (other$channelMaxLimit != null) : !this$channelMaxLimit.equals(other$channelMaxLimit))
- return false;
- Object this$isShow = getIsShow(), other$isShow = other.getIsShow();
- if ((this$isShow == null) ? (other$isShow != null) : !this$isShow.equals(other$isShow)) return false;
- Object this$isLock = getIsLock(), other$isLock = other.getIsLock();
- return !((this$isLock == null) ? (other$isLock != null) : !this$isLock.equals(other$isLock));
- }
-
- protected boolean canEqual(Object other) {
- return other instanceof SitePay;
- }
-
- public int hashCode() {
- int PRIME = 59;
- int result = 1;
- Object $id = getId();
- result = result * 59 + (($id == null) ? 43 : $id.hashCode());
- Object $cType = getCType();
- result = result * 59 + (($cType == null) ? 43 : $cType.hashCode());
- Object $formUrl = getFormUrl();
- result = result * 59 + (($formUrl == null) ? 43 : $formUrl.hashCode());
- Object $formCode = getFormCode();
- result = result * 59 + (($formCode == null) ? 43 : $formCode.hashCode());
- Object $channelType = getChannelType();
- result = result * 59 + (($channelType == null) ? 43 : $channelType.hashCode());
- Object $channelName = getChannelName();
- result = result * 59 + (($channelName == null) ? 43 : $channelName.hashCode());
- Object $channelDesc = getChannelDesc();
- result = result * 59 + (($channelDesc == null) ? 43 : $channelDesc.hashCode());
- Object $channelAccount = getChannelAccount();
- result = result * 59 + (($channelAccount == null) ? 43 : $channelAccount.hashCode());
- Object $channelImg = getChannelImg();
- result = result * 59 + (($channelImg == null) ? 43 : $channelImg.hashCode());
- Object $channelMinLimit = getChannelMinLimit();
- result = result * 59 + (($channelMinLimit == null) ? 43 : $channelMinLimit.hashCode());
- Object $channelMaxLimit = getChannelMaxLimit();
- result = result * 59 + (($channelMaxLimit == null) ? 43 : $channelMaxLimit.hashCode());
- Object $isShow = getIsShow();
- result = result * 59 + (($isShow == null) ? 43 : $isShow.hashCode());
- Object $isLock = getIsLock();
- return result * 59 + (($isLock == null) ? 43 : $isLock.hashCode());
- }
-
- public String toString() {
- return "SitePay(id=" + getId() + ", cType=" + getCType() + ", formUrl=" + getFormUrl() + ", formCode=" + getFormCode() + ", channelType=" + getChannelType() + ", channelName=" + getChannelName() + ", channelDesc=" + getChannelDesc() + ", channelAccount=" + getChannelAccount() + ", channelImg=" + getChannelImg() + ", channelMinLimit=" + getChannelMinLimit() + ", channelMaxLimit=" + getChannelMaxLimit() + ", isShow=" + getIsShow() + ", isLock=" + getIsLock()+ ", totalPrice=" + getTotalPrice() + ")";
- }
-
- public SitePay() {
- }
-
- @ConstructorProperties({"id", "cType", "formUrl", "formCode", "channelType", "channelName", "channelDesc", "channelAccount", "channelImg", "channelMinLimit", "channelMaxLimit", "isShow", "isLock","totalPrice"})
- public SitePay(Integer id, Integer cType, String formUrl, String formCode, String channelType, String channelName, String channelDesc, String channelAccount, String channelImg, Integer channelMinLimit, Integer channelMaxLimit, Integer isShow, Integer isLock, BigDecimal totalPrice) {
- this.id = id;
- this.cType = cType;
- this.formUrl = formUrl;
- this.formCode = formCode;
- this.channelType = channelType;
- this.channelName = channelName;
- this.channelDesc = channelDesc;
- this.channelAccount = channelAccount;
- this.channelImg = channelImg;
- this.channelMinLimit = channelMinLimit;
- this.channelMaxLimit = channelMaxLimit;
- this.isShow = isShow;
- this.isLock = isLock;
- this.totalPrice = totalPrice;
- }
+ private String assetsType;
- public Integer getId() {
- return this.id;
- }
-
- public Integer getCType() {
- return this.cType;
- }
-
-
- public String getFormUrl() {
- return this.formUrl;
- }
-
-
- public String getFormCode() {
- return this.formCode;
- }
-
-
- public String getChannelType() {
- return this.channelType;
- }
-
-
- public String getChannelName() {
- return this.channelName;
- }
-
-
- public String getChannelDesc() {
- return this.channelDesc;
- }
-
-
- public String getChannelAccount() {
- return this.channelAccount;
- }
-
-
- public String getChannelImg() {
- return this.channelImg;
- }
-
- public Integer getChannelMinLimit() {
- return this.channelMinLimit;
- }
-
- public Integer getChannelMaxLimit() {
- return this.channelMaxLimit;
- }
-
- public Integer getIsShow() {
- return this.isShow;
- }
-
- public Integer getIsLock() {
- return this.isLock;
- }
-
- public BigDecimal getTotalPrice() {
- return totalPrice;
- }
-
- public void setTotalPrice(BigDecimal totalPrice) {
- this.totalPrice = totalPrice;
- }
}
diff --git a/src/main/java/com/nq/pojo/SiteProduct.java b/src/main/java/com/nq/pojo/SiteProduct.java
index 2661c03..70803c4 100644
--- a/src/main/java/com/nq/pojo/SiteProduct.java
+++ b/src/main/java/com/nq/pojo/SiteProduct.java
@@ -34,16 +34,11 @@
*/
private Boolean endDisplay;
- /**
- * 股票追加保证金开关
- */
- private Boolean stockMarginDisplay;
/**
* 节假日开关:1、开启,0、关闭
*/
private Boolean holidayDisplay;
-
public SiteProduct(Integer id, Boolean stockDisplay, Boolean kcStockDisplay, Boolean indexDisplay, Boolean futuresDisplay, Boolean realNameDisplay, Boolean fundsDisplay, Boolean delayDisplay, Boolean expandDisplay, Boolean marginDisplay, Boolean endDisplay, Boolean stockMarginDisplay, Boolean holidayDisplay) {
this.id = id;
this.stockDisplay = stockDisplay;
@@ -61,6 +56,11 @@
}
+ /**
+ * 股票追加保证金开关
+ */
+ private Boolean stockMarginDisplay;
+
public SiteProduct() {}
diff --git a/src/main/java/com/nq/pojo/User.java b/src/main/java/com/nq/pojo/User.java
index b57f648..17b797f 100644
--- a/src/main/java/com/nq/pojo/User.java
+++ b/src/main/java/com/nq/pojo/User.java
@@ -8,7 +8,6 @@
import java.beans.ConstructorProperties;
import java.math.BigDecimal;
import java.util.Date;
-@TableName("user")
@Data
public class User {
@TableId(type = IdType.AUTO,value = "id")
@@ -21,28 +20,9 @@
private String nickName;
private String realName;
private String idCard;
-
-
private Integer accountType;
- /**
- * 卢比总资产
- * */
- private BigDecimal userAmt;
- /**
- * 卢比可用资金
- * */
- private BigDecimal enableAmt;
-
- private BigDecimal sumChargeAmt;
-
- private BigDecimal sumBuyAmt;
-
-
- public void setId(Integer id) {
- this.id = id;
- }
private String recomPhone;
private Integer isLock;
@@ -55,492 +35,7 @@
private String img3Key;
private Integer isActive;
private String authMsg;
- /**
- * 美股
- * */
- private BigDecimal userIndexAmt;
- /**
- * 美股可用资金
- * */
- private BigDecimal enableIndexAmt;
- private BigDecimal userFutAmt;
- private BigDecimal enableFutAmt;
private String withdrawalPwd;
- /*总操盘金额*/
- private BigDecimal tradingAmount;
-
- private BigDecimal djzj;
-
private String vaildNumber;
-
-
-
- public String getWithdrawalPwd() {
- return withdrawalPwd;
- }
-
- public void setWithdrawalPwd(String withdrawalPwd) {
- this.withdrawalPwd = withdrawalPwd;
- }
-
- public void setAgentId(Integer agentId) {
- this.agentId = agentId;
- }
-
- public void setAgentName(String agentName) {
- this.agentName = agentName;
- }
-
- public void setPhone(String phone) {
- this.phone = phone;
- }
-
- public void setUserPwd(String userPwd) {
- this.userPwd = userPwd;
- }
-
- public void setWithPwd(String withPwd) {
- this.withPwd = withPwd;
- }
-
- public void setNickName(String nickName) {
- this.nickName = nickName;
- }
-
- public void setRealName(String realName) {
- this.realName = realName;
- }
-
- public void setIdCard(String idCard) {
- this.idCard = idCard;
- }
-
- public void setAccountType(Integer accountType) {
- this.accountType = accountType;
- }
-
- public void setUserAmt(BigDecimal userAmt) {
- this.userAmt = userAmt;
- }
-
- public void setEnableAmt(BigDecimal enableAmt) {
- this.enableAmt = enableAmt;
- }
-
- public void setSumChargeAmt(BigDecimal sumChargeAmt) {
- this.sumChargeAmt = sumChargeAmt;
- }
-
- public void setSumBuyAmt(BigDecimal sumBuyAmt) {
- this.sumBuyAmt = sumBuyAmt;
- }
-
- public void setRecomPhone(String recomPhone) {
- this.recomPhone = recomPhone;
- }
-
- public void setIsLock(Integer isLock) {
- this.isLock = isLock;
- }
-
- public void setIsLogin(Integer isLogin) {
- this.isLogin = isLogin;
- }
-
- public void setRegTime(Date regTime) {
- this.regTime = regTime;
- }
-
- public void setRegIp(String regIp) {
- this.regIp = regIp;
- }
-
- public void setRegAddress(String regAddress) {
- this.regAddress = regAddress;
- }
-
- public void setImg1Key(String img1Key) {
- this.img1Key = img1Key;
- }
-
- public void setImg2Key(String img2Key) {
- this.img2Key = img2Key;
- }
-
- public void setImg3Key(String img3Key) {
- this.img3Key = img3Key;
- }
-
- public void setIsActive(Integer isActive) {
- this.isActive = isActive;
- }
-
- public void setAuthMsg(String authMsg) {
- this.authMsg = authMsg;
- }
-
- public void setUserIndexAmt(BigDecimal userIndexAmt) {
- this.userIndexAmt = userIndexAmt;
- }
-
- public void setEnableIndexAmt(BigDecimal enableIndexAmt) {
- this.enableIndexAmt = enableIndexAmt;
- }
-
- public void setUserFutAmt(BigDecimal userFutAmt) {
- this.userFutAmt = userFutAmt;
- }
-
- public void setEnableFutAmt(BigDecimal enableFutAmt) {
- this.enableFutAmt = enableFutAmt;
- }
-
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof User)) return false;
- User other = (User) o;
- if (!other.canEqual(this)) return false;
- Object this$id = getId(), other$id = other.getId();
- if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id)) return false;
- Object this$agentId = getAgentId(), other$agentId = other.getAgentId();
- if ((this$agentId == null) ? (other$agentId != null) : !this$agentId.equals(other$agentId)) return false;
- Object this$agentName = getAgentName(), other$agentName = other.getAgentName();
- if ((this$agentName == null) ? (other$agentName != null) : !this$agentName.equals(other$agentName))
- return false;
- Object this$phone = getPhone(), other$phone = other.getPhone();
- if ((this$phone == null) ? (other$phone != null) : !this$phone.equals(other$phone)) return false;
- Object this$userPwd = getUserPwd(), other$userPwd = other.getUserPwd();
- if ((this$userPwd == null) ? (other$userPwd != null) : !this$userPwd.equals(other$userPwd)) return false;
- Object this$withPwd = getWithPwd(), other$withPwd = other.getWithPwd();
- if ((this$withPwd == null) ? (other$withPwd != null) : !this$withPwd.equals(other$withPwd)) return false;
- Object this$nickName = getNickName(), other$nickName = other.getNickName();
- if ((this$nickName == null) ? (other$nickName != null) : !this$nickName.equals(other$nickName)) return false;
- Object this$realName = getRealName(), other$realName = other.getRealName();
- if ((this$realName == null) ? (other$realName != null) : !this$realName.equals(other$realName)) return false;
- Object this$idCard = getIdCard(), other$idCard = other.getIdCard();
- if ((this$idCard == null) ? (other$idCard != null) : !this$idCard.equals(other$idCard)) return false;
- Object this$accountType = getAccountType(), other$accountType = other.getAccountType();
- if ((this$accountType == null) ? (other$accountType != null) : !this$accountType.equals(other$accountType))
- return false;
- Object this$userAmt = getUserAmt(), other$userAmt = other.getUserAmt();
- if ((this$userAmt == null) ? (other$userAmt != null) : !this$userAmt.equals(other$userAmt)) return false;
- Object this$enableAmt = getEnableAmt(), other$enableAmt = other.getEnableAmt();
- if ((this$enableAmt == null) ? (other$enableAmt != null) : !this$enableAmt.equals(other$enableAmt))
- return false;
- Object this$sumChargeAmt = getSumChargeAmt(), other$sumChargeAmt = other.getSumChargeAmt();
- if ((this$sumChargeAmt == null) ? (other$sumChargeAmt != null) : !this$sumChargeAmt.equals(other$sumChargeAmt))
- return false;
- Object this$sumBuyAmt = getSumBuyAmt(), other$sumBuyAmt = other.getSumBuyAmt();
- if ((this$sumBuyAmt == null) ? (other$sumBuyAmt != null) : !this$sumBuyAmt.equals(other$sumBuyAmt))
- return false;
- Object this$recomPhone = getRecomPhone(), other$recomPhone = other.getRecomPhone();
- if ((this$recomPhone == null) ? (other$recomPhone != null) : !this$recomPhone.equals(other$recomPhone))
- return false;
- Object this$isLock = getIsLock(), other$isLock = other.getIsLock();
- if ((this$isLock == null) ? (other$isLock != null) : !this$isLock.equals(other$isLock)) return false;
- Object this$isLogin = getIsLogin(), other$isLogin = other.getIsLogin();
- if ((this$isLogin == null) ? (other$isLogin != null) : !this$isLogin.equals(other$isLogin)) return false;
- Object this$regTime = getRegTime(), other$regTime = other.getRegTime();
- if ((this$regTime == null) ? (other$regTime != null) : !this$regTime.equals(other$regTime)) return false;
- Object this$regIp = getRegIp(), other$regIp = other.getRegIp();
- if ((this$regIp == null) ? (other$regIp != null) : !this$regIp.equals(other$regIp)) return false;
- Object this$regAddress = getRegAddress(), other$regAddress = other.getRegAddress();
- if ((this$regAddress == null) ? (other$regAddress != null) : !this$regAddress.equals(other$regAddress))
- return false;
- Object this$img1Key = getImg1Key(), other$img1Key = other.getImg1Key();
- if ((this$img1Key == null) ? (other$img1Key != null) : !this$img1Key.equals(other$img1Key)) return false;
- Object this$img2Key = getImg2Key(), other$img2Key = other.getImg2Key();
- if ((this$img2Key == null) ? (other$img2Key != null) : !this$img2Key.equals(other$img2Key)) return false;
- Object this$img3Key = getImg3Key(), other$img3Key = other.getImg3Key();
- if ((this$img3Key == null) ? (other$img3Key != null) : !this$img3Key.equals(other$img3Key)) return false;
- Object this$isActive = getIsActive(), other$isActive = other.getIsActive();
- if ((this$isActive == null) ? (other$isActive != null) : !this$isActive.equals(other$isActive)) return false;
- Object this$authMsg = getAuthMsg(), other$authMsg = other.getAuthMsg();
- if ((this$authMsg == null) ? (other$authMsg != null) : !this$authMsg.equals(other$authMsg)) return false;
- Object this$userIndexAmt = getUserIndexAmt(), other$userIndexAmt = other.getUserIndexAmt();
- if ((this$userIndexAmt == null) ? (other$userIndexAmt != null) : !this$userIndexAmt.equals(other$userIndexAmt))
- return false;
- Object this$enableIndexAmt = getEnableIndexAmt(), other$enableIndexAmt = other.getEnableIndexAmt();
- if ((this$enableIndexAmt == null) ? (other$enableIndexAmt != null) : !this$enableIndexAmt.equals(other$enableIndexAmt))
- return false;
- Object this$userFutAmt = getUserFutAmt(), other$userFutAmt = other.getUserFutAmt();
- if ((this$userFutAmt == null) ? (other$userFutAmt != null) : !this$userFutAmt.equals(other$userFutAmt))
- return false;
-
- Object this$enableFutAmt = getEnableFutAmt(), other$enableFutAmt = other.getEnableFutAmt();
- if ((this$enableFutAmt == null) ? (other$enableFutAmt != null) : !this$enableFutAmt.equals(other$enableFutAmt))
- return false;
-
- Object this$withdrawalPwd = getWithdrawalPwd(), other$withdrawalPwd = other.getWithdrawalPwd();
- return !((this$withdrawalPwd == null) ? (other$withdrawalPwd != null) : !this$withdrawalPwd.equals(other$withdrawalPwd));
-
- }
-
- protected boolean canEqual(Object other) {
- return other instanceof User;
- }
-
- public int hashCode() {
- int PRIME = 59;
- int result = 1;
- Object $id = getId();
- result = result * 59 + (($id == null) ? 43 : $id.hashCode());
- Object $agentId = getAgentId();
- result = result * 59 + (($agentId == null) ? 43 : $agentId.hashCode());
- Object $agentName = getAgentName();
- result = result * 59 + (($agentName == null) ? 43 : $agentName.hashCode());
- Object $phone = getPhone();
- result = result * 59 + (($phone == null) ? 43 : $phone.hashCode());
- Object $userPwd = getUserPwd();
- result = result * 59 + (($userPwd == null) ? 43 : $userPwd.hashCode());
- Object $withPwd = getWithPwd();
- result = result * 59 + (($withPwd == null) ? 43 : $withPwd.hashCode());
- Object $nickName = getNickName();
- result = result * 59 + (($nickName == null) ? 43 : $nickName.hashCode());
- Object $realName = getRealName();
- result = result * 59 + (($realName == null) ? 43 : $realName.hashCode());
- Object $idCard = getIdCard();
- result = result * 59 + (($idCard == null) ? 43 : $idCard.hashCode());
- Object $accountType = getAccountType();
- result = result * 59 + (($accountType == null) ? 43 : $accountType.hashCode());
- Object $userAmt = getUserAmt();
- result = result * 59 + (($userAmt == null) ? 43 : $userAmt.hashCode());
- Object $enableAmt = getEnableAmt();
- result = result * 59 + (($enableAmt == null) ? 43 : $enableAmt.hashCode());
- Object $sumChargeAmt = getSumChargeAmt();
- result = result * 59 + (($sumChargeAmt == null) ? 43 : $sumChargeAmt.hashCode());
- Object $sumBuyAmt = getSumBuyAmt();
- result = result * 59 + (($sumBuyAmt == null) ? 43 : $sumBuyAmt.hashCode());
- Object $recomPhone = getRecomPhone();
- result = result * 59 + (($recomPhone == null) ? 43 : $recomPhone.hashCode());
- Object $isLock = getIsLock();
- result = result * 59 + (($isLock == null) ? 43 : $isLock.hashCode());
- Object $isLogin = getIsLogin();
- result = result * 59 + (($isLogin == null) ? 43 : $isLogin.hashCode());
- Object $regTime = getRegTime();
- result = result * 59 + (($regTime == null) ? 43 : $regTime.hashCode());
- Object $regIp = getRegIp();
- result = result * 59 + (($regIp == null) ? 43 : $regIp.hashCode());
- Object $regAddress = getRegAddress();
- result = result * 59 + (($regAddress == null) ? 43 : $regAddress.hashCode());
- Object $img1Key = getImg1Key();
- result = result * 59 + (($img1Key == null) ? 43 : $img1Key.hashCode());
- Object $img2Key = getImg2Key();
- result = result * 59 + (($img2Key == null) ? 43 : $img2Key.hashCode());
- Object $img3Key = getImg3Key();
- result = result * 59 + (($img3Key == null) ? 43 : $img3Key.hashCode());
- Object $isActive = getIsActive();
- result = result * 59 + (($isActive == null) ? 43 : $isActive.hashCode());
- Object $authMsg = getAuthMsg();
- result = result * 59 + (($authMsg == null) ? 43 : $authMsg.hashCode());
- Object $userIndexAmt = getUserIndexAmt();
- result = result * 59 + (($userIndexAmt == null) ? 43 : $userIndexAmt.hashCode());
- Object $enableIndexAmt = getEnableIndexAmt();
- result = result * 59 + (($enableIndexAmt == null) ? 43 : $enableIndexAmt.hashCode());
- Object $userFutAmt = getUserFutAmt();
- result = result * 59 + (($userFutAmt == null) ? 43 : $userFutAmt.hashCode());
- Object $enableFutAmt = getEnableFutAmt();
- result= result * 59 + (($enableFutAmt == null) ? 43 : $enableFutAmt.hashCode());
-
- Object $withdrawalPwd = getWithdrawalPwd();
- return result * 59 + (($withdrawalPwd == null) ? 43 : $withdrawalPwd.hashCode());
- }
-
- public String toString() {
- return "User(id=" + getId() + ", agentId=" + getAgentId() + ", agentName=" + getAgentName() + ", phone=" + getPhone() + ", userPwd=" + getUserPwd() + ", withPwd=" + getWithPwd() + ", nickName=" + getNickName() + ", realName=" + getRealName() + ", idCard=" + getIdCard() + ", accountType=" + getAccountType() + ", userAmt=" + getUserAmt() + ", enableAmt=" + getEnableAmt() + ", sumChargeAmt=" + getSumChargeAmt() + ", sumBuyAmt=" + getSumBuyAmt() + ", recomPhone=" + getRecomPhone() + ", isLock=" + getIsLock() + ", isLogin=" + getIsLogin() + ", regTime=" + getRegTime() + ", regIp=" + getRegIp() + ", regAddress=" + getRegAddress() + ", img1Key=" + getImg1Key() + ", img2Key=" + getImg2Key() + ", img3Key=" + getImg3Key() + ", isActive=" + getIsActive() + ", authMsg=" + getAuthMsg() + ", userIndexAmt=" + getUserIndexAmt() + ", enableIndexAmt=" + getEnableIndexAmt() + ", userFutAmt=" + getUserFutAmt() + ", enableFutAmt=" + getEnableFutAmt() +", withdrawalPwd=" + getWithdrawalPwd() +", tradingAmount=" + getTradingAmount() +",djzj=" + getDjzj()+")";
- }
-
- public User() {
- }
-
- @ConstructorProperties({"id", "agentId", "agentName", "phone", "userPwd", "withPwd", "nickName", "realName", "idCard", "accountType", "userAmt", "enableAmt", "sumChargeAmt", "sumBuyAmt", "recomPhone", "isLock", "isLogin", "regTime", "regIp", "regAddress", "img1Key", "img2Key", "img3Key", "isActive", "authMsg", "userIndexAmt", "enableIndexAmt", "userFutAmt", "enableFutAmt", "withdrawalPwd","tradingAmount","djzj","vaildNumber"})
- public User(Integer id, Integer agentId, String agentName, String phone, String userPwd, String withPwd, String nickName, String realName, String idCard, Integer accountType, BigDecimal userAmt, BigDecimal enableAmt, BigDecimal sumChargeAmt, BigDecimal sumBuyAmt, String recomPhone, Integer isLock, Integer isLogin, Date regTime, String regIp, String regAddress, String img1Key, String img2Key, String img3Key, Integer isActive, String authMsg, BigDecimal userIndexAmt, BigDecimal enableIndexAmt, BigDecimal userFutAmt, BigDecimal enableFutAmt, String withdrawalPwd, BigDecimal tradingAmount, BigDecimal djzj,String vaildNumber) {
- this.id = id;
- this.agentId = agentId;
- this.agentName = agentName;
- this.phone = phone;
- this.userPwd = userPwd;
- this.withPwd = withPwd;
- this.nickName = nickName;
- this.realName = realName;
- this.idCard = idCard;
- this.accountType = accountType;
- this.userAmt = userAmt;
- this.enableAmt = enableAmt;
- this.sumChargeAmt = sumChargeAmt;
- this.sumBuyAmt = sumBuyAmt;
- this.recomPhone = recomPhone;
- this.isLock = isLock;
- this.isLogin = isLogin;
- this.regTime = regTime;
- this.regIp = regIp;
- this.regAddress = regAddress;
- this.img1Key = img1Key;
- this.img2Key = img2Key;
- this.img3Key = img3Key;
- this.isActive = isActive;
- this.authMsg = authMsg;
- this.userIndexAmt = userIndexAmt;
- this.enableIndexAmt = enableIndexAmt;
- this.userFutAmt = userFutAmt;
- this.enableFutAmt = enableFutAmt;
- this.withdrawalPwd= withdrawalPwd;
- this.tradingAmount = tradingAmount;
- this.djzj = djzj;
- this.vaildNumber = vaildNumber;
- }
-
-
- public Integer getId() {
- return this.id;
- }
-
-
- public Integer getAgentId() {
- return this.agentId;
- }
-
-
- public String getAgentName() {
- return this.agentName;
- }
-
-
- public String getPhone() {
- return this.phone;
- }
-
-
- public String getUserPwd() {
- return this.userPwd;
- }
-
-
- public String getWithPwd() {
- return this.withPwd;
- }
-
-
- public String getNickName() {
- return this.nickName;
- }
-
-
- public String getRealName() {
- return this.realName;
- }
-
-
- public String getIdCard() {
- return this.idCard;
- }
-
-
- public Integer getAccountType() {
- return this.accountType;
- }
-
-
- public BigDecimal getUserAmt() {
- return this.userAmt;
- }
-
-
- public BigDecimal getEnableAmt() {
- return this.enableAmt;
- }
-
-
- public BigDecimal getSumChargeAmt() {
- return this.sumChargeAmt;
- }
-
-
- public BigDecimal getSumBuyAmt() {
- return this.sumBuyAmt;
- }
-
-
- public String getRecomPhone() {
- return this.recomPhone;
- }
-
-
- public Integer getIsLock() {
- return this.isLock;
- }
-
-
- public Integer getIsLogin() {
- return this.isLogin;
- }
-
-
- public Date getRegTime() {
- return this.regTime;
- }
-
-
- public String getRegIp() {
- return this.regIp;
- }
-
-
- public String getRegAddress() {
- return this.regAddress;
- }
-
-
- public String getImg1Key() {
- return this.img1Key;
- }
-
-
- public String getImg2Key() {
- return this.img2Key;
- }
-
-
- public String getImg3Key() {
- return this.img3Key;
- }
-
-
- public Integer getIsActive() {
- return this.isActive;
- }
-
-
- public String getAuthMsg() {
- return this.authMsg;
- }
-
-
- public BigDecimal getUserIndexAmt() {
- return this.userIndexAmt;
- }
-
-
- public BigDecimal getEnableIndexAmt() {
- return this.enableIndexAmt;
- }
-
-
- public BigDecimal getUserFutAmt() {
- return this.userFutAmt;
- }
-
-
- public BigDecimal getEnableFutAmt() {
- return this.enableFutAmt;
- }
-
- public BigDecimal getTradingAmount() {
- return tradingAmount;
- }
-
- public void setTradingAmount(BigDecimal tradingAmount) {
- this.tradingAmount = tradingAmount;
- }
}
diff --git a/src/main/java/com/nq/pojo/UserAssets.java b/src/main/java/com/nq/pojo/UserAssets.java
new file mode 100644
index 0000000..2196a20
--- /dev/null
+++ b/src/main/java/com/nq/pojo/UserAssets.java
@@ -0,0 +1,50 @@
+package com.nq.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 总资产
+ * */
+@Data
+@TableName("user_assets")
+public class UserAssets {
+
+ @TableId(type = IdType.AUTO,value = "id")
+ private Integer id;
+
+ //可用余额
+ private BigDecimal availableBalance;
+
+
+
+ //待补金额
+ private BigDecimal amountToBeCovered;
+
+ // 手续费
+ private BigDecimal handlingCharge;
+
+ // 累计盈亏
+ private BigDecimal cumulativeProfitAndLoss;
+
+ //盈亏
+ private BigDecimal profitAndLoss;
+
+ // 账号类型
+ private String accectType;
+
+ //总资产
+ private BigDecimal totleAssets;
+
+ // 美元转换比例
+ private BigDecimal usdtRatio;
+
+ private Integer userId;
+
+ // 冻结金额
+ private BigDecimal freezeMoney;
+}
diff --git a/src/main/java/com/nq/pojo/UserPosition.java b/src/main/java/com/nq/pojo/UserPosition.java
index 2d14067..eabc035 100644
--- a/src/main/java/com/nq/pojo/UserPosition.java
+++ b/src/main/java/com/nq/pojo/UserPosition.java
@@ -32,6 +32,7 @@
}
private BigDecimal sellOrderPrice;
+ //
private BigDecimal profitTargetPrice;
private BigDecimal stopTargetPrice;
private String orderDirection;
diff --git a/src/main/java/com/nq/pojo/UserRecharge.java b/src/main/java/com/nq/pojo/UserRecharge.java
index cc58a1c..368bfe5 100644
--- a/src/main/java/com/nq/pojo/UserRecharge.java
+++ b/src/main/java/com/nq/pojo/UserRecharge.java
@@ -3,12 +3,15 @@
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.data.annotation.Transient;
import java.math.BigDecimal;
import java.util.Date;
+@Data
public class UserRecharge {
private Integer id;
@@ -25,7 +28,6 @@
@Excel(name = "充值渠道" ,replace = { "支付宝_0", "对公打款_1" })
private String payChannel;
- private String payChannelType;
@Excel(name = "充值金额")
private BigDecimal payAmt;
@Excel(name = "状态" ,replace = { "审核中_0", "成功_1", "失败_2" })
@@ -47,147 +49,19 @@
/**
* 手机号码
* */
+ @Transient
private String userPhone;
+ private String img;
- public UserRecharge(Integer id, Integer userId, String nickName, Integer agentId, String orderSn, String paySn, String payChannel, BigDecimal payAmt, Integer orderStatus, String orderDesc, Date addTime, Date payTime, Integer payId) {
- this.id = id;
- this.userId = userId;
- this.nickName = nickName;
- this.agentId = agentId;
- this.orderSn = orderSn;
- this.paySn = paySn;
- this.payChannel = payChannel;
- this.payAmt = payAmt;
- this.orderStatus = orderStatus;
- this.orderDesc = orderDesc;
- this.addTime = addTime;
- this.payTime = payTime;
- this.payId = payId;
- }
+ private String channelName;
- public UserRecharge() {
- }
+ private String assetsType;
- public Integer getId() {
- return id;
- }
- public void setId(Integer id) {
- this.id = id;
- }
- public Integer getUserId() {
- return userId;
- }
- public void setUserId(Integer userId) {
- this.userId = userId;
- }
- public String getNickName() {
- return nickName;
- }
-
- public void setNickName(String nickName) {
- this.nickName = nickName;
- }
-
- public Integer getAgentId() {
- return agentId;
- }
-
- public void setAgentId(Integer agentId) {
- this.agentId = agentId;
- }
-
- public String getOrderSn() {
- return orderSn;
- }
-
- public void setOrderSn(String orderSn) {
- this.orderSn = orderSn;
- }
-
- public String getPaySn() {
- return paySn;
- }
-
- public void setPaySn(String paySn) {
- this.paySn = paySn;
- }
-
- public String getPayChannel() {
- return payChannel;
- }
-
- public void setPayChannel(String payChannel) {
- this.payChannel = payChannel;
- }
-
- public BigDecimal getPayAmt() {
- return payAmt;
- }
-
- public void setPayAmt(BigDecimal payAmt) {
- this.payAmt = payAmt;
- }
-
- public Integer getOrderStatus() {
- return orderStatus;
- }
-
- public void setOrderStatus(Integer orderStatus) {
- this.orderStatus = orderStatus;
- }
-
- public String getOrderDesc() {
- return orderDesc;
- }
-
- public void setOrderDesc(String orderDesc) {
- this.orderDesc = orderDesc;
- }
-
- public Date getAddTime() {
- return addTime;
- }
-
- public void setAddTime(Date addTime) {
- this.addTime = addTime;
- }
-
- public Date getPayTime() {
- return payTime;
- }
-
- public void setPayTime(Date payTime) {
- this.payTime = payTime;
- }
-
- public Integer getPayId() {
- return payId;
- }
-
- public void setPayId(Integer payId) {
- this.payId = payId;
- }
-
- public String getPayChannelType() {
- return payChannelType;
- }
-
- public void setPayChannelType(String payChannelType) {
- this.payChannelType = payChannelType;
- }
-
- public String getUserPhone() {
- return userPhone;
- }
-
- public void setUserPhone(String userPhone) {
- this.userPhone = userPhone;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/nq/pojo/reponse/RUserAssets.java b/src/main/java/com/nq/pojo/reponse/RUserAssets.java
new file mode 100644
index 0000000..777241c
--- /dev/null
+++ b/src/main/java/com/nq/pojo/reponse/RUserAssets.java
@@ -0,0 +1,55 @@
+package com.nq.pojo.reponse;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 返回实体磊
+ * */
+@Data
+public class RUserAssets {
+ private Integer id;
+
+ //可用余额
+ private String availableBalance;
+
+ private String availableBalanceUSD;
+
+ //待补金额
+ private String amountToBeCovered;
+
+ // 手续费
+ private String handlingCharge;
+ private String handlingChargeUSD;
+
+ // 累计盈亏
+ private String cumulativeProfitAndLoss;
+ private String cumulativeProfitAndLossUSD;
+
+ //盈亏
+ private String profitAndLoss;
+ //盈亏
+ private String profitAndLossUSD;
+
+ // 账号类型
+ private String accectType;
+
+
+ // 美元转换比例
+ private String usdtRatio;
+
+ private Integer userId;
+ // 冻结金额
+ private String freezeMoney;
+ private String freezeMoneyUSD;
+ // 总资产
+ private String totalMoney;
+ // 总资产
+ private String totalMoneyUSD;
+ //货币符号
+ private String symbol;
+
+ private String symbolCode;
+}
diff --git a/src/main/java/com/nq/service/IMandatoryLiquidationService.java b/src/main/java/com/nq/service/IMandatoryLiquidationService.java
new file mode 100644
index 0000000..9535018
--- /dev/null
+++ b/src/main/java/com/nq/service/IMandatoryLiquidationService.java
@@ -0,0 +1,14 @@
+package com.nq.service;
+
+import com.nq.enums.EStockType;
+import com.nq.pojo.StockRealTimeBean;
+
+public interface IMandatoryLiquidationService {
+
+
+
+
+ void RealTimeDataProcess(EStockType eStockType, StockRealTimeBean timeBean);
+
+
+}
diff --git a/src/main/java/com/nq/service/IPayService.java b/src/main/java/com/nq/service/IPayService.java
index fdf38a2..9e42029 100644
--- a/src/main/java/com/nq/service/IPayService.java
+++ b/src/main/java/com/nq/service/IPayService.java
@@ -18,7 +18,7 @@
ServerResponse juhenewpayNotify(HttpServletRequest paramHttpServletRequest) throws UnsupportedEncodingException;
- ServerResponse flyPay(String paramString1, String paramString2, String paramString3, HttpServletRequest paramHttpServletRequest);
+ ServerResponse flyPay(Integer paramString1, String paramString2, String paramString3, HttpServletRequest paramHttpServletRequest);
ServerResponse flyNotify(HttpServletRequest paramHttpServletRequest) throws IOException;
diff --git a/src/main/java/com/nq/service/IUserAssetsServices.java b/src/main/java/com/nq/service/IUserAssetsServices.java
new file mode 100644
index 0000000..c2e5b24
--- /dev/null
+++ b/src/main/java/com/nq/service/IUserAssetsServices.java
@@ -0,0 +1,49 @@
+package com.nq.service;
+
+import com.nq.enums.EUserAssets;
+import com.nq.pojo.Bank;
+import com.nq.pojo.UserAssets;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public interface IUserAssetsServices {
+
+
+
+ /**
+ * 根据id获取 和 类型 获取 资产
+ * @param accetType 资产类型
+ * @param userId 用户id
+ * */
+ UserAssets assetsByTypeAndUserId(String accetType,Integer userId);
+
+
+
+
+
+ List<UserAssets> assetsByUserId(Integer userId);
+
+
+ /**
+ * 根据id获取 和 类型 获取 资产
+ * @param accetType 资产类型
+ * @param userId 用户id
+ * */
+ BigDecimal getAvailableBalance(String accetType,Integer userId);
+
+
+
+
+ /**
+ * @param accetType 资产类型
+ * @param userId 用户id
+ * @param eUserAssets EUserAssets
+ * @param amount 金额
+ * @param desc 描述
+ * @param descType 购买类型 充值 持仓 平仓 提现
+ * */
+ Boolean availablebalanceChange(String accetType, Integer userId, EUserAssets eUserAssets, BigDecimal amount, String desc, String descType);
+
+
+}
diff --git a/src/main/java/com/nq/service/IUserPositionService.java b/src/main/java/com/nq/service/IUserPositionService.java
index 6ef89f5..ef121f0 100644
--- a/src/main/java/com/nq/service/IUserPositionService.java
+++ b/src/main/java/com/nq/service/IUserPositionService.java
@@ -13,7 +13,9 @@
public interface IUserPositionService {
ServerResponse buy(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3, Integer paramInteger4,BigDecimal paramInteger5,BigDecimal paramInteger6, HttpServletRequest paramHttpServletRequest) throws Exception;
- ServerResponse sell(String paramString, int paramInt) throws Exception;
+ ServerResponse sell(String paramString, int paramInt) throws Exception ;
+
+ ServerResponse allSell(HttpServletRequest request,String stockType)throws Exception;
ServerResponse lock(Integer paramInteger1, Integer paramInteger2, String paramString);
diff --git a/src/main/java/com/nq/service/IUserService.java b/src/main/java/com/nq/service/IUserService.java
index 2d0444c..2c0439c 100644
--- a/src/main/java/com/nq/service/IUserService.java
+++ b/src/main/java/com/nq/service/IUserService.java
@@ -36,6 +36,11 @@
ServerResponse transAmt(Integer paramInteger1, Integer paramInteger2, HttpServletRequest paramHttpServletRequest);
+ ServerResponse getMoney(HttpServletRequest request);
+
+
+ ServerResponse transfer(String fromType,String toType,String amt,HttpServletRequest paramHttpServletRequest);
+
void ForceSellTask();
void ForceSellOneStockTask();
void ForceSellOneStockTaskV2();
diff --git a/src/main/java/com/nq/service/IUserWithdrawService.java b/src/main/java/com/nq/service/IUserWithdrawService.java
index 81b75ab..025cab8 100644
--- a/src/main/java/com/nq/service/IUserWithdrawService.java
+++ b/src/main/java/com/nq/service/IUserWithdrawService.java
@@ -10,7 +10,7 @@
import javax.servlet.http.HttpServletRequest;
public interface IUserWithdrawService {
- ServerResponse outMoney(String paramString,String with_Pwd, HttpServletRequest paramHttpServletRequest) throws Exception;
+ ServerResponse outMoney(String paramString,String with_Pwd, String assetsType,HttpServletRequest paramHttpServletRequest) throws Exception;
ServerResponse<PageInfo> findUserWithList(String paramString, HttpServletRequest paramHttpServletRequest, int paramInt1, int paramInt2);
diff --git a/src/main/java/com/nq/service/impl/AgentAgencyFeeServiceImpl.java b/src/main/java/com/nq/service/impl/AgentAgencyFeeServiceImpl.java
index be051d9..a1e29cb 100644
--- a/src/main/java/com/nq/service/impl/AgentAgencyFeeServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/AgentAgencyFeeServiceImpl.java
@@ -127,7 +127,7 @@
return -1;
}
//模拟用户下单不计算分红
- User user = userMapper.selectByPrimaryKey(userPosition.getUserId());
+ User user = userMapper.selectById(userPosition.getUserId());
if(user.getAccountType() != 0 || user.getIsLock() != 0 || user.getIsActive() != 2){
return -2;
}
diff --git a/src/main/java/com/nq/service/impl/DkServices.java b/src/main/java/com/nq/service/impl/DkServices.java
index 409a09b..3e1f2cf 100644
--- a/src/main/java/com/nq/service/impl/DkServices.java
+++ b/src/main/java/com/nq/service/impl/DkServices.java
@@ -1,6 +1,5 @@
package com.nq.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nq.dao.DkJGMapper;
import com.nq.dao.DkMapper;
import com.nq.pojo.DkJgBean;
@@ -8,13 +7,12 @@
import com.nq.pojo.User;
import com.nq.service.IDkServices;
import com.nq.service.IUserService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.vo.dk.DkModelVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
import java.util.Date;
import java.util.List;
diff --git a/src/main/java/com/nq/service/impl/FileUploadServiceImpl.java b/src/main/java/com/nq/service/impl/FileUploadServiceImpl.java
index 860b372..34b5b4c 100644
--- a/src/main/java/com/nq/service/impl/FileUploadServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/FileUploadServiceImpl.java
@@ -3,7 +3,7 @@
import com.google.common.collect.Lists;
import com.nq.common.ServerResponse;
import com.nq.service.IFileUploadService;
-import com.nq.utils.FTPUtil;
+import com.nq.utils.ftp.FTPUtil;
import java.io.File;
import java.util.UUID;
diff --git a/src/main/java/com/nq/service/impl/FundsAppendServiceImpl.java b/src/main/java/com/nq/service/impl/FundsAppendServiceImpl.java
index 08cafbd..3e5123e 100644
--- a/src/main/java/com/nq/service/impl/FundsAppendServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/FundsAppendServiceImpl.java
@@ -13,7 +13,7 @@
import com.nq.pojo.User;
import com.nq.service.IFundsAppendService;
import com.nq.service.IUserService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
diff --git a/src/main/java/com/nq/service/impl/FundsApplyServiceImpl.java b/src/main/java/com/nq/service/impl/FundsApplyServiceImpl.java
index c790d7a..42333ad 100644
--- a/src/main/java/com/nq/service/impl/FundsApplyServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/FundsApplyServiceImpl.java
@@ -8,7 +8,7 @@
import com.nq.service.IFundsApplyService;
import com.nq.service.IFundsSettingService;
import com.nq.service.IUserService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,9 +34,9 @@
@Resource
private FundsApplyMapper fundsApplyMapper;
- @Autowired
+ @Resource
UserMapper userMapper;
- @Autowired
+ @Resource
UserCashDetailMapper userCashDetailMapper;
@Autowired
FundsTradingAccountMapper fundsTradingAccountMapper;
@@ -57,14 +57,8 @@
if(user == null){
return ServerResponse.createBySuccessMsg("请登录后操作");
}
- BigDecimal user_enable_amt = user.getEnableAmt();
//支付金额=保证金+管理费
BigDecimal pay_amount = model.getMargin().add(model.getManageFee());
- int compareUserAmtInt = user_enable_amt.compareTo(pay_amount);
- log.info("用户可用金额 = {} 实际购买金额 = {} 比较结果 = {} ", user_enable_amt, pay_amount, compareUserAmtInt);
- if (compareUserAmtInt == -1) {
- return ServerResponse.createByErrorMsg("申请失败,可用金额小于" + pay_amount + "元");
- }
//自动生成订单编号
model.setOrderNumber(KeyUtils.getUniqueKey());
@@ -72,9 +66,7 @@
ret = fundsApplyMapper.insert(model);
if(ret>0){
//修改用户可用余额= 当前余额-支付金额
- BigDecimal reckon_enable = user_enable_amt.subtract(pay_amount);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
log.info("【用户交易下单】修改用户金额成功");
UserCashDetail ucd = new UserCashDetail();
@@ -129,112 +121,10 @@
/**
* 配资申请-审核
*/
- /* */ @Transactional
- /* */ public ServerResponse audit(FundsApply model, HttpServletRequest request) throws Exception {
- /* 135 */ FundsApply fundsApply = this.fundsApplyMapper.load(model.getId().intValue());
- /* 136 */ int ret = 0;
- /* 137 */ if (model != null && model.getId().intValue() > 0) {
- /* 138 */ User user = this.userMapper.selectByPrimaryKey(fundsApply.getUserId());
- /* */
- /* 140 */ if (model.getStatus().intValue() == 1) {
- /* 141 */ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- /* 142 */ String begtime = df.format(new Date()).split(" ")[0] + " 0:00:00";
- /* 143 */ Date date = DateTimeUtil.strToDate(begtime);
- /* 144 */ Date begDate = DateTimeUtil.addDay(date, 1);
- /* 145 */ model.setBeginTime(begDate);
- /* 146 */ String endtime = df.format(new Date()).split(" ")[0] + " 23:59:59";
- /* 147 */ Date endDate = DateTimeUtil.strToDate(endtime);
- /* 148 */ endDate = DateTimeUtil.addDay(endDate, model.getTradersCycle().intValue() + 1);
- /* 149 */ model.setEndTime(endDate);
- /* 150 */ model.setEnabledTradingAmount(fundsApply.getTotalTradingAmount());
- /* 151 */ FundsSetting fundsSetting = this.iFundsSettingService.getFundsSetting();
- /* */
- /* 153 */ BigDecimal lineUnwind = fundsApply.getMargin().multiply(fundsSetting.getDaysUnwind()).add(fundsApply.getFundsAmount()).setScale(2, 4);
- /* 154 */ model.setLineUnwind(lineUnwind);
- /* */
- /* 156 */ BigDecimal lineWarning = fundsApply.getMargin().multiply(fundsSetting.getDaysWarning()).add(fundsApply.getFundsAmount()).setScale(2, 4);
- /* 157 */ model.setLineWarning(lineWarning);
- /* */ }
- /* 159 */ model.setAuditTime(DateTimeUtil.getCurrentDate());
- /* 160 */ ret = this.fundsApplyMapper.update(model);
- /* 161 */ if (ret > 0) {
- /* 162 */ BigDecimal user_enable_amt = user.getEnableAmt();
- /* */
- /* 164 */ if (model.getStatus().intValue() == 1) {
- /* 165 */ BigDecimal user_all_amt = user.getUserAmt();
- /* */
- /* 167 */ BigDecimal reckon_all = user_all_amt.subtract(fundsApply.getManageFee());
- /* */
- /* 169 */ BigDecimal tradingAmount = user.getTradingAmount().add(fundsApply.getTotalTradingAmount());
- /* 170 */ log.info("【配资审核通过】用户平总资金 = {} , 可用资金 = {} , 总操盘资金 = {}", new Object[] { reckon_all, user_enable_amt, tradingAmount });
- /* 171 */ user.setUserAmt(reckon_all);
- /* 172 */ user.setTradingAmount(tradingAmount);
- /* 173 */ int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- /* 174 */ if (updateUserCount > 0) {
- /* 175 */ log.info("【配资审核通过】修改用户金额成功");
- /* */
- /* 177 */ FundsTradingAccount fundsTradingAccount = this.fundsTradingAccountMapper.getAccountByNumber(model.getSubaccountNumber());
- /* 178 */ if (fundsTradingAccount != null) {
- /* 179 */ fundsTradingAccount.setStatus(Integer.valueOf(1));
- /* 180 */ this.fundsTradingAccountMapper.update(fundsTradingAccount);
- /* */ }
- /* */
- /* 183 */ UserCashDetail ucd = new UserCashDetail();
- /* 184 */ ucd.setPositionId(fundsApply.getId());
- /* 185 */ ucd.setAgentId(user.getAgentId());
- /* 186 */ ucd.setAgentName(user.getAgentName());
- /* 187 */ ucd.setUserId(user.getId());
- /* 188 */ ucd.setUserName(user.getRealName());
- /* 189 */ ucd.setDeType("配资审核通过");
- /* 190 */ ucd.setDeAmt(fundsApply.getPayAmount());
- /* 191 */ ucd.setDeSummary("申请按天配资:" + fundsApply.getOrderNumber() + ",配资审核通过,解冻保证金到配资账户:" + fundsApply.getPayAmount());
- /* 192 */ ucd.setAddTime(new Date());
- /* 193 */ ucd.setIsRead(Integer.valueOf(0));
- /* 194 */ int insertSxfCount = this.userCashDetailMapper.insert(ucd);
- /* 195 */ if (insertSxfCount > 0) {
- /* 196 */ log.info("【配资审核通过】申请成功");
- /* */ }
- /* */ } else {
- /* 199 */ log.error("【配资审核通过】修改用户金额出错");
- /* 200 */ throw new Exception("【配资审核通过】修改用户金额出错");
- /* */ }
- /* */
- /* */ } else {
- /* */
- /* 205 */ BigDecimal reckon_enable = user_enable_amt.add(fundsApply.getPayAmount());
- /* 206 */ user.setEnableAmt(reckon_enable);
- /* 207 */ int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- /* 208 */ if (updateUserCount > 0) {
- /* 209 */ log.info("【配资审核未通过】修改用户金额成功");
- /* 210 */ UserCashDetail ucd = new UserCashDetail();
- /* 211 */ ucd.setPositionId(fundsApply.getId());
- /* 212 */ ucd.setAgentId(user.getAgentId());
- /* 213 */ ucd.setAgentName(user.getAgentName());
- /* 214 */ ucd.setUserId(user.getId());
- /* 215 */ ucd.setUserName(user.getRealName());
- /* 216 */ ucd.setDeType("配资审核未通过");
- /* 217 */ ucd.setDeAmt(fundsApply.getPayAmount());
- /* 218 */ ucd.setDeSummary("申请按天配资:" + fundsApply.getOrderNumber() + ",配资审核未通过,解冻保证金到余额:" + fundsApply.getPayAmount() + ",原因:" + model.getAuditOpinion());
- /* 219 */ ucd.setAddTime(new Date());
- /* 220 */ ucd.setIsRead(Integer.valueOf(0));
- /* 221 */ int insertSxfCount = this.userCashDetailMapper.insert(ucd);
- /* 222 */ if (insertSxfCount > 0) {
- /* 223 */ log.info("【按天配资】申请成功");
- /* */ }
- /* */ } else {
- /* 226 */ log.error("【按天配资】修改用户金额出错");
- /* 227 */ throw new Exception("【按天配资】修改用户金额出错");
- /* */ }
- /* */ }
- /* */
- /* 231 */ log.info("配资申请-审核 = {} 实际购买金额 = {} 比较结果 = {} ", Integer.valueOf(0));
- /* */ }
- /* */ }
- /* 234 */ if (ret > 0) {
- /* 235 */ return ServerResponse.createBySuccessMsg("操作成功");
- /* */ }
- /* 237 */ return ServerResponse.createByErrorMsg("操作失败");
- /* */ }
+ @Transactional
+ public ServerResponse audit(FundsApply model, HttpServletRequest request) throws Exception {
+ return ServerResponse.createByErrorMsg("操作失败");
+ }
/*配资申请-查询列表*/
diff --git a/src/main/java/com/nq/service/impl/MandatoryLiquidationService.java b/src/main/java/com/nq/service/impl/MandatoryLiquidationService.java
new file mode 100644
index 0000000..c2b0ae0
--- /dev/null
+++ b/src/main/java/com/nq/service/impl/MandatoryLiquidationService.java
@@ -0,0 +1,48 @@
+package com.nq.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.nq.dao.UserPositionMapper;
+import com.nq.enums.EStockType;
+import com.nq.pojo.StockRealTimeBean;
+import com.nq.pojo.UserPosition;
+import com.nq.service.IMandatoryLiquidationService;
+import com.nq.utils.redis.RedisKeyUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.List;
+
+@Service
+public class MandatoryLiquidationService implements IMandatoryLiquidationService {
+
+
+ @Resource
+ UserPositionMapper userPositionMapper;
+
+ @Transactional
+ @Override
+ public void RealTimeDataProcess(EStockType eStockType, StockRealTimeBean timeBean) {
+ QueryWrapper<UserPosition> upQuery = new QueryWrapper<>();
+ upQuery.eq("stock_code",timeBean.getPid());
+ upQuery.isNotNull("sell_order_id");
+ // 查询未平仓的价格
+ List<UserPosition> userPositionList = userPositionMapper.selectList(upQuery);
+ for (int i = 0; i <userPositionList.size() ; i++) {
+ UserPosition userPosition = userPositionList.get(i);
+ BigDecimal bigDecimal = new BigDecimal(timeBean.getLast()).subtract(userPosition.getBuyOrderPrice())
+ .multiply(new BigDecimal(userPosition.getOrderNum()));
+ if(!userPosition.getOrderDirection().equals("买涨")){
+ bigDecimal = bigDecimal.negate();
+ }
+ userPosition.setProfitAndLose(bigDecimal);
+ userPosition.setAllProfitAndLose(bigDecimal);
+ userPositionMapper.updateById(userPosition);
+ }
+
+
+ RedisKeyUtil.setCacheRealTimeStock(eStockType,timeBean);
+
+ }
+}
diff --git a/src/main/java/com/nq/service/impl/PayServiceImpl.java b/src/main/java/com/nq/service/impl/PayServiceImpl.java
index 3016e5c..1cad8bd 100644
--- a/src/main/java/com/nq/service/impl/PayServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/PayServiceImpl.java
@@ -1,5 +1,6 @@
package com.nq.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.Gson;
import com.nq.common.CmcPayConfig;
import com.nq.common.ServerResponse;
@@ -7,10 +8,14 @@
import com.nq.pay.PayUtil;
import com.nq.pojo.*;
import com.nq.service.IPayService;
+import com.nq.service.ISitePayService;
+import com.nq.service.IUserAssetsServices;
import com.nq.service.IUserService;
import com.nq.utils.*;
+import com.nq.utils.http.HttpClientUtil;
import com.nq.utils.pay.CmcPayOuterRequestUtil;
import com.nq.utils.pay.CmcPayTool;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.vo.pay.GuoPayVO;
import java.io.IOException;
@@ -32,8 +37,9 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
-import static com.nq.utils.DateTimeUtil.STANDARD_FORMAT;
+import static com.nq.utils.timeutil.DateTimeUtil.STANDARD_FORMAT;
@Service("iPayService")
@@ -50,6 +56,16 @@
UserMapper userMapper;
@Resource
+ SitePayMapper sitePayMapper;
+
+
+ @Resource
+ IUserService userService;
+
+ @Resource
+ IUserAssetsServices iUserAssetsServices;
+
+ @Resource
UserWithdrawMapper userWithdrawMapper;
@Resource
@@ -59,8 +75,7 @@
PayChnnelMapper payChnnelMapper;
- @Resource
- AgentUserMapper agentUserMapper;
+
@@ -216,54 +231,24 @@
}
- public ServerResponse flyPay(String payType, String payAmt, String currency, HttpServletRequest request) {
- if( Integer.parseInt(payAmt)>=50000 || Integer.parseInt(payAmt)<100){
- return ServerResponse.createByErrorMsg("The maximum top-up amount is 100 and 50000");
- }
- User user = this.iUserService.getCurrentRefreshUser(request);
- if (user == null){
- return ServerResponse.createBySuccessMsg("Please Login");
- }
- if(user.getRealName() == null || user.getRealName().isEmpty()){
- return ServerResponse.createByErrorMsg("Please authenticate with your real name");
- }
-
-
+ @Transactional
+ public ServerResponse flyPay(Integer payType, String payAmt, String currency, HttpServletRequest request) {
+ User user = iUserService.getCurrentUser(request);
+ SitePay sitePay = sitePayMapper.selectById(payType);
UserRecharge userRecharge = new UserRecharge();
userRecharge.setUserId(user.getId());
userRecharge.setNickName(user.getRealName());
userRecharge.setAgentId(user.getAgentId());
String ordersn = KeyUtils.getRechargeOrderSn();
userRecharge.setOrderSn(ordersn);
- userRecharge.setPayChannel(payType);
+ userRecharge.setPayChannel(sitePay.getChannelName());
userRecharge.setPayAmt(new BigDecimal(payAmt));
userRecharge.setOrderStatus(Integer.valueOf(0));
userRecharge.setAddTime(new Date());
- int insertCount = this.userRechargeMapper.insert(userRecharge);
- if (insertCount > 0) {
- log.info("fly支付,创建支付订单成功!");
- } else {
- log.info("fly支付,创建支付订单失败!");
- }
-
-
-
- PayChnnel payChnnel = payChnnelMapper.selectById(payType);
- if(payChnnel.getChannelName().equals("USDT")){
- AgentUser agentUser = agentUserMapper.findAgentByAgentId(user.getAgentId());
- return ServerResponse.createBySuccess(agentUser.getOnLineServices());
- }else{
- if(payChnnel.getChannelDesc().equals("wowpay")){
- return rechargMethodWow(ordersn,payAmt);
- }else if(payChnnel.getChannelDesc().equals("dzxum")){
- return rechargMethodDz(ordersn,payAmt);
- }else if(payChnnel.getChannelDesc().equals("qeaepay")){
- return rechargMethodGe(ordersn,payAmt);
- } else{
- return rechargMethodTop4(ordersn,payAmt);
- }
- }
-
+ userRecharge.setPayId(payType);
+ userRecharge.setImg(currency);
+ userRechargeMapper.insert(userRecharge);
+ return ServerResponse.createBySuccess("");
}
@@ -278,7 +263,7 @@
map.put("mch_order_no",ordersn);
map.put("pay_type","122");
map.put("trade_amount",payAmt);
- map.put("order_date",DateTimeUtil.getCurrentDate(STANDARD_FORMAT));
+ map.put("order_date", DateTimeUtil.getCurrentDate(STANDARD_FORMAT));
map.put("goods_name","充值");
String signStr = SignUtil.sortData(map);
map.put("sign_type","MD5");
@@ -559,7 +544,7 @@
return ServerResponse.createByErrorMsg("后台通知,查不到订单");
}
- User user = this.userMapper.selectByPrimaryKey(userRecharge.getUserId());
+ User user = this.userMapper.selectById(userRecharge.getUserId());
if (user == null) {
return ServerResponse.createByErrorMsg("后台通知,查不到用户");
}
@@ -577,13 +562,7 @@
int updateCount = this.userRechargeMapper.updateByPrimaryKeySelective(userRecharge);
if (updateCount > 0) {
log.info("后台通知,修改订单状态成功");
-
- BigDecimal total_amt = user.getUserAmt().add(userRecharge.getPayAmt());
- total_amt = total_amt.divide(new BigDecimal(100));
- user.setUserAmt(total_amt);
- BigDecimal total_enable = user.getEnableAmt().add(userRecharge.getPayAmt());
- user.setEnableAmt(total_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
return ServerResponse.createBySuccessMsg("后台通知 处理成功");
}
diff --git a/src/main/java/com/nq/service/impl/SiteArticleServiceImpl.java b/src/main/java/com/nq/service/impl/SiteArticleServiceImpl.java
index c49878a..0e18cb2 100644
--- a/src/main/java/com/nq/service/impl/SiteArticleServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SiteArticleServiceImpl.java
@@ -11,8 +11,8 @@
import java.util.Date;
import java.util.List;
-import com.nq.utils.DateTimeUtil;
-import com.nq.utils.HttpRequest;
+import com.nq.utils.timeutil.DateTimeUtil;
+import com.nq.utils.http.HttpRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.translate.GoogleTranslateUtil;
import net.sf.json.JSONObject;
diff --git a/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java b/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
index 2feb1a6..5929c13 100644
--- a/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SiteInfoServiceImpl.java
@@ -102,7 +102,10 @@
AgentUser agentUser = agentUserMapper.findAgentByAgentId(user.getAgentId());
if(agentUser != null){
siteInfo.setAgentCode(agentUser.getAgentCode());
- siteInfo.setOnlineService(agentUser.getOnLineServices());
+ if(!agentUser.getOnLineServices().isEmpty()){
+ siteInfo.setOnlineService(agentUser.getOnLineServices());
+ }
+
}
}
return ServerResponse.createBySuccess(siteInfo);
diff --git a/src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java b/src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java
index cad7d0e..1afc433 100644
--- a/src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SiteNewsServiceImpl.java
@@ -3,11 +3,12 @@
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nq.common.ServerResponse;
-import com.nq.constant.StockConstant;
import com.nq.dao.SiteNewsMapper;
+import com.nq.enums.EStockType;
import com.nq.pojo.SiteNews;
import com.nq.service.ISiteNewsService;
import com.nq.utils.*;
+import com.nq.utils.http.HttpRequest;
import com.nq.utils.translate.GoogleTranslateUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -139,10 +140,10 @@
@Override
public int grabNews() {
int ret = 0;
- //新闻类型:1、财经要闻,2、经济数据,3、全球股市,4、7*24全球,5、商品资讯,6、上市公司,7、全球央行
- addNews(1, StockConstant.HTTP_API +"stock-markets?key="+ StockConstant.KEY +"&type=4");
- addNews(2, StockConstant.HTTP_API+"stock-markets?key="+ StockConstant.KEY +"&type=5");
- addNews(4, StockConstant.HTTP_API+"stock-markets?key="+ StockConstant.KEY +"&type=6");
+ addNews(1, EStockType.HK.getStockUrl() +"stock-markets?key="+ EStockType.HK.getStockKey() +"&type=4");
+ addNews(2, EStockType.US.getStockUrl() +"stock-markets?key="+ EStockType.US.getStockKey() +"&type=4");
+ addNews(3, EStockType.TH.getStockUrl() +"stock-markets?key="+ EStockType.TH.getStockKey() +"&type=4");
+ addNews(4, EStockType.MAS.getStockUrl() +"stock-markets?key="+ EStockType.MAS.getStockKey() +"&type=4");
return ret;
}
@@ -168,7 +169,7 @@
siteNews.setShowTime(new Date(showTime));
if(jsonObject.has("img")){
String imgBase = convertBase64ToImage(jsonObject.getString("img"),"/www/wwwroot/dabao/"+newsId+".jpg");
- siteNews.setImgurl("https://img.jumptalk.net/"+newsId+".jpg");
+ siteNews.setImgurl(PropertiesUtil.getProperty("ftp.server.http.prefix")+newsId+".jpg");
}
siteNews.setDescription(jsonObject.getString("content"));
siteNews.setContent(jsonObject.getString("content"));
diff --git a/src/main/java/com/nq/service/impl/SitePayServiceImpl.java b/src/main/java/com/nq/service/impl/SitePayServiceImpl.java
index ae0e528..f9b63d0 100644
--- a/src/main/java/com/nq/service/impl/SitePayServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SitePayServiceImpl.java
@@ -13,11 +13,13 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+
@Service("iSitePayService")
public class SitePayServiceImpl
implements ISitePayService {
- @Autowired
+ @Resource
SitePayMapper sitePayMapper;
public ServerResponse add(SitePay sitePay) {
diff --git a/src/main/java/com/nq/service/impl/SmsServiceImpl.java b/src/main/java/com/nq/service/impl/SmsServiceImpl.java
index 8bb4dcd..67d03ce 100644
--- a/src/main/java/com/nq/service/impl/SmsServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/SmsServiceImpl.java
@@ -6,7 +6,7 @@
import com.nq.dao.SiteSmsLogMapper;
import com.nq.pojo.SiteSmsLog;
import com.nq.service.ISmsService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.utils.sms.ali.AliyunSms;
import org.apache.commons.lang3.RandomStringUtils;
diff --git a/src/main/java/com/nq/service/impl/StockDzServiceImpl.java b/src/main/java/com/nq/service/impl/StockDzServiceImpl.java
index a351333..22c4879 100644
--- a/src/main/java/com/nq/service/impl/StockDzServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockDzServiceImpl.java
@@ -8,7 +8,7 @@
import com.nq.pojo.Stock;
import com.nq.pojo.StockDz;
import com.nq.service.StockDzService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/com/nq/service/impl/StockFuturesServiceImpl.java b/src/main/java/com/nq/service/impl/StockFuturesServiceImpl.java
index d9efee0..08229ce 100644
--- a/src/main/java/com/nq/service/impl/StockFuturesServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockFuturesServiceImpl.java
@@ -22,7 +22,7 @@
import com.nq.service.IStockOptionService;
import com.nq.service.IUserService;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
diff --git a/src/main/java/com/nq/service/impl/StockIndexServiceImpl.java b/src/main/java/com/nq/service/impl/StockIndexServiceImpl.java
index e58aa15..75b0b29 100644
--- a/src/main/java/com/nq/service/impl/StockIndexServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockIndexServiceImpl.java
@@ -12,7 +12,7 @@
import com.nq.service.IStockIndexService;
import com.nq.service.IStockOptionService;
import com.nq.service.IUserService;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.vo.stock.MarketVO;
diff --git a/src/main/java/com/nq/service/impl/StockMarketsDayServiceImpl.java b/src/main/java/com/nq/service/impl/StockMarketsDayServiceImpl.java
index 5ef71c7..8403816 100644
--- a/src/main/java/com/nq/service/impl/StockMarketsDayServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockMarketsDayServiceImpl.java
@@ -15,7 +15,7 @@
import com.nq.service.IStockService;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.HolidayUtil;
import com.nq.utils.stock.sina.StockApi;
@@ -118,20 +118,17 @@
public void saveHoliday() {
log.info("【同步节假日开关 定时任务】 开始保存 ... ");
-
SiteProduct siteProduct = iSiteProductService.getProductSetting();
// 判断1周末 2节假日不能出金
SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");
String httpArg = f.format(new Date());
String jsonResult = HolidayUtil.request(httpArg);
if ("1".equals(jsonResult) || "2".equals(jsonResult)) {
- //return ServerResponse.createByErrorMsg("周末或节假日不能购买!");
siteProduct.setHolidayDisplay(true);
} else {
siteProduct.setHolidayDisplay(false);
}
siteProductMapper.updateByPrimaryKeySelective(siteProduct);
-
}
diff --git a/src/main/java/com/nq/service/impl/StockServiceImpl.java b/src/main/java/com/nq/service/impl/StockServiceImpl.java
index 58036c5..bd26147 100644
--- a/src/main/java/com/nq/service/impl/StockServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockServiceImpl.java
@@ -8,12 +8,11 @@
import com.google.common.collect.Maps;
import com.nq.common.ServerResponse;
import com.nq.config.StockPoll;
-import com.nq.constant.StockConstant;
import com.nq.dao.*;
import com.nq.enums.EStockType;
import com.nq.pojo.*;
import com.nq.service.*;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.utils.stock.pinyin.GetPyByChinese;
@@ -44,7 +43,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import static com.nq.utils.DateTimeUtil.getWeekDay;
+import static com.nq.utils.timeutil.DateTimeUtil.getWeekDay;
@Service("iStockService")
public class StockServiceImpl implements IStockService {
@@ -242,85 +241,15 @@
public ServerResponse getSingleStock(String code, HttpServletRequest request) {
if (StringUtils.isBlank(code))
return ServerResponse.createByErrorMsg("");
- Stock stock = new Stock();
+ Stock stock = stockMapper.findStockByCode(code);
Integer depositAmt = 0;
String introduction = null;
String result = null;
com.alibaba.fastjson2.JSONObject json = null;
- //期货
- String url = null;
- if (code.contains("hf")) {
- StockFutures futmodel = stockFuturesMapper.selectFuturesByCode(code.replace("hf_", ""));
- stock.setStockGid(futmodel.getFuturesGid());
- stock.setStockCode(futmodel.getFuturesCode());
- stock.setStockName(futmodel.getFuturesName());
- stock.setAddTime(futmodel.getAddTime());
- stock.setId(futmodel.getId());
- stock.setStockSpell("0");
- depositAmt = futmodel.getDepositAmt();
- url = PropertiesUtil.getProperty("sina.single.futures.introduction.url") + futmodel.getFuturesCode() + "&app=source&type=1";
- } else if (code.contains("sh") || code.contains("sz") || code.contains("hk") || code.contains("us")) { //指数
- StockIndex model = stockIndexMapper.selectIndexByCode(code.replace("sh", "").replace("sz", "").replace("hk", "").replace("us", ""));
- stock.setStockGid(model.getIndexGid());
- stock.setStockCode(model.getIndexCode());
- stock.setStockName(model.getIndexName());
- stock.setAddTime(model.getAddTime());
- stock.setId(model.getId());
- stock.setStockSpell("0");
- depositAmt = model.getDepositAmt();
- introduction = model.getIntroduction();
- } else {//股票
- stock = this.stockMapper.findStockByCode(code);
- if (stock == null)
- return ServerResponse.createByErrorMsg("");
- //简介
- if (stock.getStockGid().contains("hk")) {
- url = PropertiesUtil.getProperty("hk.stock.introduction.url") + "%22" + stock.getStockCode() + ".HK%22)";
- result = HttpClientRequest.doGet(url);
- if (result.length() < 20) {
- introduction = "暂无数据";
- } else {
- json = com.alibaba.fastjson2.JSONObject.parseObject(result);
- introduction = json.getJSONObject("result")
- .getJSONArray("data")
- .getJSONObject(0)
- .getString("ORG_PROFILE");
- if (request.getHeader("lang") != null && !request.getHeader("lang").equals("zh-CN") && !request.getHeader("lang").equals("tww") && !request.getHeader("lang").equals("")) {
- GoogleTranslateUtil googleTranslateUtil = new GoogleTranslateUtil();
- try {
- introduction = googleTranslateUtil.translate(introduction, request.getHeader("lang"));
- } catch (Exception e) {
- log.error("翻译失败");
- }
- }
- }
- } else {
- try {
- url = PropertiesUtil.getProperty("sina.single.stock.introduction.url") + stock.getStockGid();
- result = HttpClientRequest.doGet(url);
- json = com.alibaba.fastjson2.JSONObject.parseObject(result);
- //取json里result里的data里的introduction
- introduction = json.getJSONObject("result").getJSONObject("data").getString("introduction");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
String gid = stock.getStockGid();
- //股票数据
- StockVO stockVO = new StockVO();
- if (gid.contains("hk") && "hk".equals(stock.getStockType())) {
- String hkStock = RedisShardedPoolUtils.get(stock.getStockGid(), 1);
- stockVO = StockApi.otherStockVO(hkStock);
-
- } else if (gid.contains("hk") || gid.contains("us")) {
- String index = RedisShardedPoolUtils.get(stock.getStockGid(), 3);
- stockVO = StockApi.otherStockVO(index);
- } else {
- stockVO = StockApi.assembleInStockVO(stock);
- }
+ StockVO stockVO = StockApi.assembleInStockVO(stock);
stockVO.setDepositAmt(depositAmt);
stockVO.setType(stock.getStockType());
stockVO.setId(stock.getId().intValue());
@@ -512,13 +441,24 @@
/*股票日线-K线*/
@Override
public Object getKData(String pid, String interval, String stockType) {
- EStockType eStockType = null;
- if(stockType.equals("US")){
- eStockType = EStockType.US;
+ EStockType eStockType = EStockType.getEStockTypeByCode(stockType);
+ String string;
+ if(eStockType == EStockType.SZHB){
+
+ if(interval.equals("D")){
+ interval = "1day";
+ }else if(interval.equals("W")) {
+ interval = "1week";
+ }else if(interval.equals("M")){
+ interval = "1mon";
+ }else{
+ interval =interval+ "min";
+ }
+ string = HttpUtil.get(eStockType.stockUrl + "market/history/kline?period="+interval+"&size=600&symbol="+pid);
+
}else{
- eStockType = EStockType.IN;
+ string = HttpUtil.get(eStockType.stockUrl + "kline?pid=" + pid + "&interval=" + interval + "&key=" + eStockType.stockKey);
}
- String string = HttpUtil.get(eStockType.stockUrl + "kline?pid=" + pid + "&interval=" + interval + "&key=" + eStockType.stockKey);
return string;
}
diff --git a/src/main/java/com/nq/service/impl/UserAssetsServices.java b/src/main/java/com/nq/service/impl/UserAssetsServices.java
new file mode 100644
index 0000000..7610fd6
--- /dev/null
+++ b/src/main/java/com/nq/service/impl/UserAssetsServices.java
@@ -0,0 +1,78 @@
+package com.nq.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.nq.dao.UserAssetsMapper;
+import com.nq.enums.EUserAssets;
+import com.nq.pojo.UserAssets;
+import com.nq.service.IUserAssetsServices;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Objects;
+
+@Service
+public class UserAssetsServices implements IUserAssetsServices {
+
+ @Resource
+ UserAssetsMapper userAssetsMapper;
+
+
+ @Override
+ public UserAssets assetsByTypeAndUserId(String accetType, Integer userId) {
+ QueryWrapper<UserAssets> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("accect_type",accetType);
+ queryWrapper.eq("user_id",userId);
+ UserAssets userAssets = userAssetsMapper.selectOne(queryWrapper);
+ if(userAssets == null){
+ userAssets = new UserAssets();
+ userAssets.setAccectType(accetType);
+ userAssets.setUserId(userId);
+ userAssetsMapper.insert(userAssets);
+ }
+ userAssets = userAssetsMapper.selectOne(queryWrapper);
+ return userAssets;
+ }
+
+
+
+ @Override
+ public List<UserAssets> assetsByUserId(Integer userId) {
+ QueryWrapper<UserAssets> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("user_id",userId);
+ return userAssetsMapper.selectList(queryWrapper);
+ }
+
+ @Override
+ public BigDecimal getAvailableBalance(String accetType, Integer userId) {
+ return assetsByTypeAndUserId(accetType,userId).getAvailableBalance();
+ }
+
+
+ @Override
+ public Boolean availablebalanceChange(String accetType, Integer userId, EUserAssets eUserAssets, BigDecimal amount, String desc, String descType) {
+
+
+ UserAssets userAssets = assetsByTypeAndUserId(accetType,userId);
+ if(Objects.equals(eUserAssets.getCode(), EUserAssets.BUY.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(amount.negate()));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.CLOSE_POSITION.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ userAssets.setCumulativeProfitAndLoss(userAssets.getCumulativeProfitAndLoss().add(amount));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.CLOSE_POSITION_RETURN_SECURITY_DEPOSIT.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ userAssets.setFreezeMoney(userAssets.getFreezeMoney().subtract(amount));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.CALCULATE_PROFIT_AND_LOSS.getCode())){
+ userAssets.setProfitAndLoss(userAssets.getProfitAndLoss().add(amount));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.TRANSFER.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.TOP_UP.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ }else if(Objects.equals(eUserAssets.getCode(), EUserAssets.WITHDRAW.getCode())){
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(amount));
+ }
+ return userAssetsMapper.updateById(userAssets)>1;
+ }
+}
diff --git a/src/main/java/com/nq/service/impl/UserFundsPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserFundsPositionServiceImpl.java
index 5e6513c..69d98a0 100644
--- a/src/main/java/com/nq/service/impl/UserFundsPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserFundsPositionServiceImpl.java
@@ -11,7 +11,7 @@
import com.nq.dao.UserMapper;
import com.nq.pojo.*;
import com.nq.service.*;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.stock.BuyAndSellUtils;
import com.nq.utils.stock.GeneratePosition;
@@ -44,9 +44,9 @@
@Resource
private UserFundsPositionMapper userFundsPositionMapper;
- @Autowired
+ @Resource
UserMapper userMapper;
- @Autowired
+ @Resource
UserCashDetailMapper userCashDetailMapper;
@Autowired
@@ -123,271 +123,6 @@
*/
@Transactional
public ServerResponse buyFunds(Integer stockId, Integer buyNum, Integer buyType, Integer lever, Integer subaccountNumber, HttpServletRequest request) throws Exception {
- // 判断周末不能买
- Date today = new Date();
- Calendar c = Calendar.getInstance();
- c.setTime(today);
- int weekday = c.get(Calendar.DAY_OF_WEEK);
- /*实名认证开关开启*/
- SiteProduct siteProduct = iSiteProductService.getProductSetting();
- User user = this.iUserService.getCurrentRefreshUser(request);
- if (user == null){
- return ServerResponse.createBySuccessMsg("請先登錄");
- }
- if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
- return ServerResponse.createByErrorMsg("下单失败,请先实名认证");
- }
- if(siteProduct.getHolidayDisplay()){
- return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
- }
- BigDecimal user_enable_amt = user.getEnableAmt();
- log.info("用户 {} 下单,股票id = {} ,数量 = {} , 方向 = {} , 杠杆 = {}", new Object[]{user
- .getId(), stockId, buyNum, buyType, lever});
- if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
- return ServerResponse.createByErrorMsg("下单失败,账户已被锁定");
- }
-
- SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
- if (siteSetting == null) {
- log.error("下单出错,网站设置表不存在");
- return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
- }
-
- String am_begin = siteSetting.getTransAmBegin();
- String am_end = siteSetting.getTransAmEnd();
- String pm_begin = siteSetting.getTransPmBegin();
- String pm_end = siteSetting.getTransPmEnd();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
-
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
-
- Stock stock = null;
- ServerResponse stock_res = this.iStockService.findStockById(stockId);
- if (!stock_res.isSuccess()) {
- return ServerResponse.createByErrorMsg("下单失败,股票代码错误");
- }
- stock = (Stock) stock_res.getData();
-
- if (stock.getIsLock().intValue() != 0) {
- return ServerResponse.createByErrorMsg("下单失败,当前股票不能交易");
- }
-
- /*List dbPosition = findPositionByStockCodeAndTimes(siteSetting.getBuySameTimes().intValue(), stock
- .getStockCode(), user.getId());
- if (dbPosition.size() >= siteSetting.getBuySameNums().intValue()) {
- return ServerResponse.createByErrorMsg("频繁交易," + siteSetting.getBuySameTimes() + "分钟内同一股票持仓不得超过" + siteSetting
- .getBuySameNums() + "条");
- }
-
- Integer transNum = findPositionNumByTimes(siteSetting.getBuyNumTimes().intValue(), user.getId());
- if (transNum.intValue() / 100 >= siteSetting.getBuyNumLots().intValue()) {
- return ServerResponse.createByErrorMsg("频繁交易," + siteSetting
- .getBuyNumTimes() + "分钟内不能超过" + siteSetting.getBuyNumLots() + "手");
- }*/
-
- if (buyNum.intValue() < siteSetting.getBuyMinNum().intValue()) {
- return ServerResponse.createByErrorMsg("下单失败,购买数量小于" + siteSetting
- .getBuyMinNum() + "股");
- }
- if (buyNum.intValue() > siteSetting.getBuyMaxNum().intValue()) {
- return ServerResponse.createByErrorMsg("下单失败,购买数量大于" + siteSetting
- .getBuyMaxNum() + "股");
- }
-
-
- StockListVO stockListVO = StockApi.getStockRealTime(stock);
- BigDecimal now_price = new BigDecimal(stockListVO.getNowPrice());
-
- if (now_price.compareTo(new BigDecimal("0")) == 0) {
- return ServerResponse.createByErrorMsg("报价0,请稍后再试");
- }
-
-
- double stock_crease = stockListVO.getHcrate().doubleValue();
-
-
- BigDecimal maxRisePercent = new BigDecimal("0");
- if (stock.getStockPlate() != null) {
-
- maxRisePercent = new BigDecimal("0.2");
- log.info("【科创股票】");
- } else {
- maxRisePercent = new BigDecimal("0.1");
- log.info("【普通A股】");
- }
- BigDecimal zsPrice = new BigDecimal(stockListVO.getPreclose_px());
-
- BigDecimal ztPrice = zsPrice.multiply(maxRisePercent).add(zsPrice);
- ztPrice = ztPrice.setScale(2, 4);
- BigDecimal chaPrice = ztPrice.subtract(zsPrice);
-
- BigDecimal ztRate = chaPrice.multiply(new BigDecimal("100")).divide(zsPrice, 2, 4);
-
- log.info("当前涨跌幅 = {} % , 涨停幅度 = {} %", Double.valueOf(stock_crease), ztRate);
- if ((new BigDecimal(String.valueOf(stock_crease))).compareTo(ztRate) == 0 && buyType
- .intValue() == 0) {
- return ServerResponse.createByErrorMsg("当前股票已涨停不能买涨");
- }
-
-
- if (stock.getStockPlate() == null) {
-
- int maxcrease = siteSetting.getCreaseMaxPercent().intValue();
- if (stock_crease > 0.0D &&
- stock_crease >= maxcrease) {
- return ServerResponse.createByErrorMsg("下单失败,股票当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
- }
-
-
- if (stock_crease < 0.0D &&
- Math.abs(stock_crease) > maxcrease) {
- return ServerResponse.createByErrorMsg("下单失败,股票当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
-
- }
-
- } else {
-
- int maxcrease = siteSetting.getKcCreaseMaxPercent().intValue();
- if (stock_crease > 0.0D &&
- stock_crease >= maxcrease) {
- return ServerResponse.createByErrorMsg("下单失败,科创股当前涨幅:" + stock_crease + ",大于最大涨幅:" + maxcrease);
- }
-
-
- if (stock_crease < 0.0D &&
- Math.abs(stock_crease) > maxcrease) {
- return ServerResponse.createByErrorMsg("下单失败,科创股当前跌幅:" + stock_crease + ",大于最大跌幅:" + maxcrease);
- }
- }
-
-
- ServerResponse serverResponse = this.iStockService.selectRateByDaysAndStockCode(stock
- .getStockCode(), siteSetting.getStockDays().intValue());
- if (!serverResponse.isSuccess()) {
- return serverResponse;
- }
- BigDecimal daysRate = (BigDecimal) serverResponse.getData();
- log.info("股票 {} , {} 天内 涨幅 {} , 设置的涨幅 = {}", new Object[]{stock.getStockCode(), siteSetting
- .getStockDays(), daysRate, siteSetting.getStockRate()});
-
- if (daysRate != null &&
- siteSetting.getStockRate().compareTo(daysRate) == -1) {
- return serverResponse.createByErrorMsg(siteSetting.getStockDays() + "天内涨幅超过 " + siteSetting
- .getStockRate() + "不能交易");
- }
-
-
- BigDecimal buy_amt = now_price.multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever.intValue())).setScale(2, 4);
-
-
- BigDecimal buy_amt_autual = now_price.multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever.intValue()), 2, 4);
-
-
- int compareInt = buy_amt_autual.compareTo(new BigDecimal(siteSetting.getBuyMinAmt().intValue()));
- if (compareInt == -1) {
- return ServerResponse.createByErrorMsg("下单失败,购买金额小于" + siteSetting
- .getBuyMinAmt() + "元");
- }
-
-
- BigDecimal max_buy_amt = user_enable_amt.multiply(siteSetting.getBuyMaxAmtPercent());
- int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
- if (compareCwInt == 1) {
- return ServerResponse.createByErrorMsg("下单失败,不能超过可用资金的" + siteSetting
- .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
- }
-
-
- int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
- log.info("用户可用金额 = {} 实际购买金额 = {}", user_enable_amt, buy_amt_autual);
- log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
- if (compareUserAmtInt == -1) {
- return ServerResponse.createByErrorMsg("下单失败,融资可用金额小于" + buy_amt_autual + "元");
- }
-
- if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,指数总资金小于0");
- }
- if (user.getUserFutAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,期货总资金小于0");
- }
-
- UserFundsPosition userPosition = new UserFundsPosition();
- userPosition.setPositionType(user.getAccountType());
- userPosition.setPositionSn(KeyUtils.getUniqueKey());
- userPosition.setUserId(user.getId());
- userPosition.setNickName(user.getRealName());
- userPosition.setAgentId(user.getAgentId());
- userPosition.setStockId(stock.getId());
- userPosition.setStockCode(stock.getStockCode());
- userPosition.setStockName(stock.getStockName());
- userPosition.setStockGid(stock.getStockGid());
- userPosition.setStockSpell(stock.getStockSpell());
- userPosition.setBuyOrderId(GeneratePosition.getPositionId());
- userPosition.setBuyOrderTime(new Date());
- userPosition.setBuyOrderPrice(now_price);
- userPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
- userPosition.setOrderNum(buyNum);
- userPosition.setSubaccountNumber(subaccountNumber);
-
- if (stock.getStockPlate() != null) {
- userPosition.setStockPlate(stock.getStockPlate());
- }
- userPosition.setIsLock(Integer.valueOf(0));
- userPosition.setOrderLever(lever);
- userPosition.setOrderTotalPrice(buy_amt);
- BigDecimal buy_fee_amt = buy_amt.multiply(siteSetting.getBuyFee()).setScale(2, 4);
- log.info("用户购买手续费(配资后总资金 * 百分比) = {}", buy_fee_amt);
- userPosition.setOrderFee(buy_fee_amt);
-
-
- BigDecimal buy_yhs_amt = buy_amt.multiply(siteSetting.getDutyFee()).setScale(2, 4);
- log.info("用户购买印花税(配资后总资金 * 百分比) = {}", buy_yhs_amt);
- userPosition.setOrderSpread(buy_yhs_amt);
-
- SiteSpread siteSpread = iSiteSpreadService.findSpreadRateOne(new BigDecimal(stock_crease), buy_amt, stock.getStockCode(), now_price);
- BigDecimal spread_rate_amt = buy_amt.multiply(siteSpread.getSpreadRate()).setScale(2, 4);
- log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", siteSpread.getSpreadRate(), spread_rate_amt);
- userPosition.setSpreadRatePrice(spread_rate_amt);
-
-
- BigDecimal profit_and_lose = new BigDecimal("0");
- userPosition.setProfitAndLose(profit_and_lose);
-
-
- BigDecimal all_profit_and_lose = profit_and_lose.subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
- userPosition.setAllProfitAndLose(all_profit_and_lose);
-
-
- userPosition.setOrderStayDays(Integer.valueOf(0));
- userPosition.setOrderStayFee(new BigDecimal("0"));
-
- int insertPositionCount = 0;
- this.userFundsPositionMapper.insert(userPosition);
- insertPositionCount = userPosition.getId();
- if (insertPositionCount > 0) {
- //修改用户可用余额= 当前余额-下单金额-买入手续费-印花税-点差费
- BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual).subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
- user.setEnableAmt(reckon_enable);
- /*int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易下单】修改用户金额成功");
- } else {
- log.error("用户交易下单】修改用户金额出错");
- throw new Exception("用户交易下单】修改用户金额出错");
- }*/
- //核算代理收入-入仓手续费
- //iAgentAgencyFeeService.AgencyFeeIncome(1,userPosition.getPositionSn());
- log.info("【用户交易下单】保存持仓记录成功");
- } else {
- log.error("用户交易下单】保存持仓记录出错");
- throw new Exception("用户交易下单】保存持仓记录出错");
- }
-
return ServerResponse.createBySuccess("Order successful");
}
@@ -422,7 +157,7 @@
return ServerResponse.createByErrorMsg("平仓失败,订单不存在");
}
- User user = this.userMapper.selectByPrimaryKey(userPosition.getUserId());
+ User user = this.userMapper.selectById(userPosition.getUserId());
/*实名认证开关开启*/
SiteProduct siteProduct = iSiteProductService.getProductSetting();
if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
@@ -485,9 +220,6 @@
}
log.info("买入总金额 = {} , 卖出总金额 = {} , 盈亏 = {}", new Object[]{all_buy_amt, all_sell_amt, profitLoss});
- BigDecimal user_all_amt = user.getUserAmt();
- BigDecimal user_enable_amt = user.getEnableAmt();
- log.info("用户原本总资金 = {} , 可用 = {}", user_all_amt, user_enable_amt);
BigDecimal buy_fee_amt = userPosition.getOrderFee();
log.info("买入手续费 = {}", buy_fee_amt);
@@ -529,12 +261,7 @@
BigDecimal freez_amt = all_buy_amt.divide(new BigDecimal(userPosition.getOrderLever().intValue()), 2, 4);
- BigDecimal reckon_all = user_all_amt.add(all_profit);
- BigDecimal reckon_enable = user_enable_amt.add(all_profit).add(freez_amt);
- log.info("用户平仓后的总资金 = {} , 可用资金 = {}", reckon_all, reckon_enable);
- user.setUserAmt(reckon_all);
- user.setEnableAmt(reckon_enable);
/*int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
if (updateUserCount > 0) {
log.info("【用户平仓】修改用户金额成功");
diff --git a/src/main/java/com/nq/service/impl/UserFuturesPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserFuturesPositionServiceImpl.java
index a6996b0..c284ae1 100644
--- a/src/main/java/com/nq/service/impl/UserFuturesPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserFuturesPositionServiceImpl.java
@@ -8,7 +8,7 @@
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.nq.common.ServerResponse;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.stock.BuyAndSellUtils;
import com.nq.vo.agent.AgentIncomeVO;
@@ -23,6 +23,7 @@
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
+import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
@@ -36,7 +37,7 @@
public class UserFuturesPositionServiceImpl implements IUserFuturesPositionService {
private static final Logger log = LoggerFactory.getLogger(UserFuturesPositionServiceImpl.class);
- @Autowired
+ @Resource
UserFuturesPositionMapper userFuturesPositionMapper;
@Autowired
@@ -48,183 +49,25 @@
@Autowired
IAgentUserService iAgentUserService;
- @Autowired
+ @Resource
AgentUserMapper agentUserMapper;
@Autowired
IStockCoinService iStockCoinService;
- @Autowired
+ @Resource
UserMapper userMapper;
- @Autowired
+ @Resource
UserCashDetailMapper userCashDetailMapper;
@Autowired
ISiteFuturesSettingService iSiteFuturesSettingService;
- @Autowired
+ @Resource
StockFuturesMapper stockFuturesMapper;
@Autowired
ISiteProductService iSiteProductService;
@Transactional
public ServerResponse buyFutures(Integer futuresId, Integer buyNum, Integer buyType, Integer lever, HttpServletRequest request) throws Exception {
- if (futuresId == null || buyNum == null || buyType == null) {
- return ServerResponse.createByErrorMsg("参数不能为空");
- }
- /*实名认证开关开启*/
- SiteProduct siteProduct = iSiteProductService.getProductSetting();
- User user = this.iUserService.getCurrentRefreshUser(request);
- if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
- return ServerResponse.createByErrorMsg("下单失败,请先实名认证");
- }
- if(siteProduct.getHolidayDisplay()){
- return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
- }
-
- if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
- return ServerResponse.createByErrorMsg("下单失败,账户已被锁定");
- }
-
- StockFutures stockFutures = this.iStockFuturesService.selectFuturesById(futuresId);
- if (stockFutures == null) {
- return ServerResponse.createByErrorMsg("产品不存在");
- }
- if (1 != stockFutures.getTransState().intValue()) {
- return ServerResponse.createByErrorMsg("该产品不能交易");
- }
- if (buyNum.intValue() < stockFutures.getMinNum().intValue()) {
- return ServerResponse.createByErrorMsg("最低不能低于" + stockFutures.getMinNum() + "手");
- }
- if (buyNum.intValue() > stockFutures.getMaxNum().intValue()) {
- return ServerResponse.createByErrorMsg("最多不能高于" + stockFutures.getMaxNum() + "手");
- }
- log.info("用户 {} 下单, 期货产品 = {} ,数量 = {} 手 , 方向 = {} , 杠杆倍数 = {}", new Object[]{user
- .getId(), stockFutures.getFuturesName(), buyNum, buyType, lever});
-
-
- String am_begin = stockFutures.getTransAmBegin();
- String am_end = stockFutures.getTransAmEnd();
- String pm_begin = stockFutures.getTransPmBegin();
- String pm_end = stockFutures.getTransPmEnd();
- String pm_begin2 = stockFutures.getTransPmBegin2();
- String pm_end2 = stockFutures.getTransPmEnd2();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- boolean pm_flag2 = BuyAndSellUtils.isTransTime(pm_begin2, pm_end2);
- log.info("futures 是否在上午交易时间 = {} 是否在下午交易时间 = {}是否在下午交易时间2 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag), Boolean.valueOf(pm_flag2));
- if (!am_flag && !pm_flag && !pm_flag2) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
-
-
- SiteFuturesSetting siteFuturesSetting = this.iSiteFuturesSettingService.getSetting();
- if (siteFuturesSetting == null) {
- log.error("下单出错,网站设置表不存在");
- return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
- }
-
- List dbPosition = findPositionByFuturesCodeAndTimes(siteFuturesSetting.getBuySameTimes().intValue(), stockFutures
- .getFuturesCode(), user.getId());
- if (dbPosition.size() >= siteFuturesSetting.getBuySameNums().intValue()) {
- return ServerResponse.createByErrorMsg("频繁交易," + siteFuturesSetting.getBuySameTimes() + "分钟内同一产品持仓不得超过" + siteFuturesSetting
- .getBuySameNums() + "条");
- }
-
- Integer transNum = findPositionNumByTimes(siteFuturesSetting.getBuyNumTimes().intValue(), user.getId());
- if (transNum.intValue() >= siteFuturesSetting.getBuyNumLots().intValue()) {
- return ServerResponse.createByErrorMsg("频繁交易," + siteFuturesSetting.getBuyNumTimes() + "分钟内不能超过" + siteFuturesSetting
- .getBuyNumLots() + "手");
- }
-
-
- // 保证金= 期货保证金*数量/杠杆倍数
- BigDecimal all_deposit_amt = (new BigDecimal(stockFutures.getDepositAmt().intValue())).multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever)).setScale(4,2);
-
-
- BigDecimal all_order_fee = (new BigDecimal(stockFutures.getTransFee().intValue())).multiply(new BigDecimal(buyNum.intValue()));
-
-
- ServerResponse exchangeRateResponse = this.iStockFuturesService.getExchangeRate(stockFutures.getCoinCode());
- if (!exchangeRateResponse.isSuccess()) {
- return ServerResponse.createByErrorMsg(exchangeRateResponse.getMsg());
- }
- BigDecimal exchangeRate = (BigDecimal) exchangeRateResponse.getData();
- log.info("期货产品 {} , 基币 {} , 汇率模版采用 {} ", new Object[]{stockFutures.getFuturesName(), stockFutures
- .getCoinCode(), exchangeRate});
-
- BigDecimal all_usd_amt = all_deposit_amt;
- log.info("需要支付的总资金(保证金) = {} 未计算汇率", all_usd_amt);
-
- all_usd_amt = all_usd_amt.multiply(exchangeRate);
- log.info("计算汇率后 人民币 = {} ", all_usd_amt);
-
-
- if (user.getEnableFutAmt().compareTo(all_usd_amt) == -1) {
- return ServerResponse.createByErrorMsg("账户资金不足");
- }
- if (user.getUserAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,融资总资金小于0");
- }
- if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,指数总资金小于0");
- }
-
-
- BigDecimal max_buy_amt = user.getEnableFutAmt().multiply(siteFuturesSetting.getBuyMaxPercent());
- if (max_buy_amt.compareTo(all_usd_amt) == -1) {
- return ServerResponse.createByErrorMsg("不能超过最大购买比例");
- }
-
-
- FuturesVO futuresVO = this.iStockFuturesService.querySingleMarket(stockFutures.getFuturesGid());
- log.info("期货下单 {} , 价格 = {}", futuresVO.getName(), futuresVO.getNowPrice());
-
-
- BigDecimal reckon_enable = user.getEnableFutAmt().subtract(all_usd_amt);
- user.setEnableFutAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易 期货 下单】修改用户金额成功");
- } else {
- log.error("【用户交易 期货 下单】修改用户金额出错");
- throw new Exception("【用户交易 期货 下单】修改用户金额出错");
- }
-
-
- UserFuturesPosition userFuturesPosition = new UserFuturesPosition();
- userFuturesPosition.setPositionType(user.getAccountType());
- userFuturesPosition.setPositionSn(KeyUtils.getUniqueKey());
- userFuturesPosition.setUserId(user.getId());
- userFuturesPosition.setRealName(user.getRealName());
- userFuturesPosition.setAgentId(user.getAgentId());
- userFuturesPosition.setFuturesName(stockFutures.getFuturesName());
- userFuturesPosition.setFuturesCode(stockFutures.getFuturesCode());
- userFuturesPosition.setFuturesGid(stockFutures.getFuturesGid());
- userFuturesPosition.setBuyOrderTime(new Date());
- userFuturesPosition.setBuyOrderPrice(new BigDecimal(futuresVO.getNowPrice()));
- userFuturesPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
-
- userFuturesPosition.setOrderNum(buyNum);
- userFuturesPosition.setFuturesStandard(stockFutures.getFuturesStandard());
- userFuturesPosition.setFuturesUnit(stockFutures.getFuturesUnit());
-
- userFuturesPosition.setAllDepositAmt(all_usd_amt);
- userFuturesPosition.setOrderFee(all_order_fee);
- userFuturesPosition.setIsLock(Integer.valueOf(0));
- userFuturesPosition.setProfitAndLose(new BigDecimal("0"));
- userFuturesPosition.setAllProfitAndLose(new BigDecimal("0"));
- userFuturesPosition.setBuyRate(exchangeRate);
-
- userFuturesPosition.setCoinCode(stockFutures.getCoinCode());
- userFuturesPosition.setOrderLever(lever);
-
-
- int insertPositionCount = this.userFuturesPositionMapper.insert(userFuturesPosition);
- if (insertPositionCount > 0) {
- log.info("【用户交易 期货 下单】保存持仓记录成功");
- } else {
- log.error("用户交易 期货 下单】保存持仓记录出错");
- throw new Exception("用户交易 期货 下单】保存持仓记录出错");
- }
return ServerResponse.createBySuccess("Order successful");
}
@@ -248,152 +91,6 @@
public ServerResponse sellFutures(String positionSn, int doType) throws Exception {
- log.info("【 用户交易平仓 期货 】 positionSn = {} , dotype = {}", positionSn, Integer.valueOf(doType));
-
-
- UserFuturesPosition userFuturesPosition = this.userFuturesPositionMapper.selectPositionBySn(positionSn);
- if (userFuturesPosition == null) {
- return ServerResponse.createByErrorMsg("操作失败,找不到订单");
- }
-
-
- StockFutures stockFutures = this.iStockFuturesService.selectFuturesByCode(userFuturesPosition.getFuturesCode());
- if (stockFutures == null) {
- return ServerResponse.createByErrorMsg("操作失败,产品不存在或已被删除");
- }
-
-
- if (doType != 0) {
- String am_begin = stockFutures.getTransAmBegin();
- String am_end = stockFutures.getTransAmEnd();
- String pm_begin = stockFutures.getTransPmBegin();
- String pm_end = stockFutures.getTransPmEnd();
- String pm_begin2 = stockFutures.getTransPmBegin2();
- String pm_end2 = stockFutures.getTransPmEnd2();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- boolean pm_flag2 = BuyAndSellUtils.isTransTime(pm_begin2, pm_end2);
- log.info("【 期货 】是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag && !pm_flag2) {
- return ServerResponse.createByErrorMsg("操作失败,不在交易时段内");
- }
- }
-
-
- User user = this.userMapper.selectByPrimaryKey(userFuturesPosition.getUserId());
- /*实名认证开关开启*/
- SiteProduct siteProduct = iSiteProductService.getProductSetting();
- if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
- return ServerResponse.createByErrorMsg("操作失败,用户已被锁定");
- }
- if(siteProduct.getHolidayDisplay()){
- return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
- }
-
- if (userFuturesPosition.getSellOrderPrice() != null) {
- return ServerResponse.createByErrorMsg("操作失败,此订单已平仓");
- }
-
- if (1 == userFuturesPosition.getIsLock().intValue()) {
- return ServerResponse.createByErrorMsg("平仓失败 " + userFuturesPosition.getLockMsg());
- }
-
-
- FuturesVO futuresVO = this.iStockFuturesService.querySingleMarket(stockFutures.getFuturesGid());
- log.info("平仓 期货订单 {} ,平仓价格为 {}", userFuturesPosition.getId(), futuresVO.getNowPrice());
-
-
- userFuturesPosition.setSellOrderPrice(new BigDecimal(futuresVO.getNowPrice()));
- userFuturesPosition.setSellOrderTime(new Date());
-
- BigDecimal point_sub = userFuturesPosition.getSellOrderPrice().setScale(2,4).subtract(userFuturesPosition.getBuyOrderPrice().setScale(2,4));
-
- //每手浮动价格
- BigDecimal eachPoint = new BigDecimal("1");
- if(stockFutures!=null && stockFutures.getEachPoint() != null){
- eachPoint = stockFutures.getEachPoint();
- }
- //BigDecimal profit_and_lose = point_sub.multiply(new BigDecimal(userFuturesPosition.getFuturesStandard().intValue())).multiply(new BigDecimal(userFuturesPosition.getOrderNum().intValue()));
- BigDecimal profit_and_lose = point_sub.multiply(eachPoint).multiply(new BigDecimal(userFuturesPosition.getOrderNum().intValue()));
- if ("买跌".equals(userFuturesPosition.getOrderDirection())) {
- profit_and_lose = profit_and_lose.negate();
- }
- BigDecimal all_profit = profit_and_lose.subtract(userFuturesPosition.getOrderFee());
-
-
- ServerResponse exchangeRateResponse = this.iStockFuturesService.getExchangeRate(stockFutures.getCoinCode());
- if (!exchangeRateResponse.isSuccess()) {
- return ServerResponse.createByErrorMsg(exchangeRateResponse.getMsg());
- }
- BigDecimal exchangeRate = (BigDecimal) exchangeRateResponse.getData();
- exchangeRate = exchangeRate.setScale(2, 4);
- log.info("【平仓】期货产品 {} , 基币 {} , 汇率模版采用 {} ", new Object[]{stockFutures.getFuturesName(), stockFutures
- .getCoinCode(), exchangeRate});
-
- userFuturesPosition.setSellRate(exchangeRate);
-
-
- profit_and_lose = profit_and_lose.multiply(exchangeRate);
- userFuturesPosition.setProfitAndLose(profit_and_lose);
- log.info("【平仓】USD总盈亏 {} ", all_profit);
- all_profit = all_profit.multiply(exchangeRate);
- userFuturesPosition.setAllProfitAndLose(all_profit);
-
-
- int updateFuturesPositionCount = this.userFuturesPositionMapper.updateByPrimaryKeySelective(userFuturesPosition);
- if (updateFuturesPositionCount > 0) {
- log.info("【用户平仓 期货 】修改浮动盈亏记录成功");
- } else {
- log.error("【用户平仓 期货 】修改浮动盈亏记录出错");
- throw new Exception("用户平仓 期货 】修改浮动盈亏记录出错");
- }
-
-
- BigDecimal before_user_amt = user.getUserFutAmt();
- BigDecimal before_enable_amt = user.getEnableFutAmt();
- log.info("用户平仓之前 的 总资金 = {} , 可用资金 = {}", before_user_amt, before_enable_amt);
-
- BigDecimal user_futures_amt = before_user_amt.add(all_profit);
-
- BigDecimal enable_futures_amt = before_enable_amt.add(all_profit).add(userFuturesPosition.getAllDepositAmt());
-
- log.info("用户平仓后的总资金 = {} , 可用资金 = {}", user_futures_amt, enable_futures_amt);
- user.setUserFutAmt(user_futures_amt);
- user.setEnableFutAmt(enable_futures_amt);
-
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户平仓 期货 】修改用户金额成功");
- } else {
- log.error("【用户平仓 期货 】修改用户金额出错");
- throw new Exception("【用户平仓 期货 】修改用户金额出错");
- }
-
-
- UserCashDetail ucd = new UserCashDetail();
- ucd.setPositionId(userFuturesPosition.getId());
- ucd.setAgentId(user.getAgentId());
- ucd.setAgentName(user.getAgentName());
- ucd.setUserId(user.getId());
- ucd.setUserName(user.getRealName());
- ucd.setDeType("期货盈亏");
- ucd.setDeAmt(all_profit);
- String deSummary = "卖出期货," + userFuturesPosition.getFuturesName() + "/" + userFuturesPosition.getFuturesCode() + ",总盈亏:" + all_profit;
- ucd.setDeSummary(deSummary);
- log.info("卖出期货资金明细:{}", deSummary);
-
-
- ucd.setAddTime(new Date());
- ucd.setIsRead(Integer.valueOf(0));
-
- int insertSxfCount = this.userCashDetailMapper.insert(ucd);
- if (insertSxfCount > 0) {
- log.info("【用户平仓 期货 】保存明细记录成功");
- } else {
- log.error("【用户平仓 期货 】保存明细记录出错");
- throw new Exception("【用户平仓 期货 】保存明细记录出错");
- }
-
return ServerResponse.createBySuccessMsg("Closed position successfully!");
}
diff --git a/src/main/java/com/nq/service/impl/UserIndexPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserIndexPositionServiceImpl.java
index 0978f3b..1001fdf 100644
--- a/src/main/java/com/nq/service/impl/UserIndexPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserIndexPositionServiceImpl.java
@@ -9,7 +9,7 @@
import com.google.common.collect.Lists;
import com.nq.common.ServerResponse;
import com.nq.utils.CurrencyUtils;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.stock.BuyAndSellUtils;
@@ -25,6 +25,7 @@
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
+import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
@@ -38,7 +39,7 @@
public class UserIndexPositionServiceImpl implements IUserIndexPositionService {
private static final Logger log = LoggerFactory.getLogger(UserIndexPositionServiceImpl.class);
- @Autowired
+ @Resource
UserIndexPositionMapper userIndexPositionMapper;
@Autowired
@@ -50,199 +51,26 @@
@Autowired
ISiteIndexSettingService iSiteIndexSettingService;
- @Autowired
+ @Resource
UserMapper userMapper;
- @Autowired
+ @Resource
UserCashDetailMapper userCashDetailMapper;
@Autowired
IAgentUserService iAgentUserService;
- @Autowired
+ @Resource
AgentUserMapper agentUserMapper;
@Autowired
ISiteProductService iSiteProductService;
@Autowired
IUserIndexPositionService iUserIndexPositionService;
- @Autowired
+ @Resource
SiteTaskLogMapper siteTaskLogMapper;
@Autowired
CurrencyUtils currencyUtils;
@Transactional
public ServerResponse buyIndex(Integer indexId, Integer buyNum, Integer buyType, Integer lever,BigDecimal profitTarget,BigDecimal stopTarget, HttpServletRequest request) throws Exception {
- if (indexId == null || buyNum == null || buyType == null) {
- return ServerResponse.createByErrorMsg("参数不能为空");
- }
- User user = this.iUserService.getCurrentRefreshUser(request);
- /*实名认证开关开启*/
- SiteProduct siteProduct = iSiteProductService.getProductSetting();
- if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
- return ServerResponse.createByErrorMsg("下单失败,请先实名认证");
- }
-
- if(siteProduct.getHolidayDisplay()){
- return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
- }
-
- log.info("用户 {} 下单, 指数id = {} ,数量 = {} 手 , 方向 = {} , 杠杆 = {}", new Object[]{user
- .getId(), indexId, buyNum, buyType, lever});
-
- if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
- return ServerResponse.createByErrorMsg("下单失败,账户已被锁定");
- }
-
-
- SiteIndexSetting siteIndexSetting = this.iSiteIndexSettingService.getSiteIndexSetting();
- if (siteIndexSetting == null) {
- log.error("下单出错,指数设置表不存在");
- return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
- }
- StockIndex stockIndex = this.iStockIndexService.selectIndexById(indexId);
-
- if (stockIndex.getIndexGid().contains("us")){
- String am_begin = siteIndexSetting.getTransAmBeginUs();
- String am_end = siteIndexSetting.getTransAmEndUs();
- String pm_begin = siteIndexSetting.getTransPmBeginUs();
- String pm_end = siteIndexSetting.getTransPmEndUs();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
-
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
- }else if(stockIndex.getIndexGid().contains("hk")){
- String am_begin = siteIndexSetting.getTransAmBeginhk();
- String am_end = siteIndexSetting.getTransAmEndhk();
- String pm_begin = siteIndexSetting.getTransPmBeginhk();
- String pm_end = siteIndexSetting.getTransPmEndhk();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
-
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
- }else {
- String am_begin = siteIndexSetting.getTransAmBegin();
- String am_end = siteIndexSetting.getTransAmEnd();
- String pm_begin = siteIndexSetting.getTransPmBegin();
- String pm_end = siteIndexSetting.getTransPmEnd();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
- }
-
- if (stockIndex == null) {
- return ServerResponse.createByErrorMsg("指数不存在");
- }
- if (1 != stockIndex.getTransState().intValue()) {
- return ServerResponse.createByErrorMsg("该指数不能交易");
- }
-
- //保证金= 指数保证金*数量/杠杆倍数
- BigDecimal all_deposit_amt = (new BigDecimal(stockIndex.getDepositAmt().intValue())).multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever)).setScale(4,2);
-
- if (user.getEnableIndexAmt().compareTo(all_deposit_amt) == -1) {
- return ServerResponse.createByErrorMsg("指数账户资金不足");
- }
-
- BigDecimal max_buy_amt = user.getEnableIndexAmt().multiply(siteIndexSetting.getBuyMaxPercent());
- if (max_buy_amt.compareTo(all_deposit_amt) == -1) {
- return ServerResponse.createByErrorMsg("不能超过最大购买比例");
- }
- if (user.getUserAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,融资总资金小于0");
- }
- if (user.getUserFutAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("失败,期货总资金小于0");
- }
-
-
- MarketVO marketVO = this.iStockIndexService.querySingleIndex(stockIndex.getIndexGid());
- log.info("当前指数行情 = {}", JsonUtil.obj2StringPretty(marketVO));
-
- BigDecimal increaseRate = new BigDecimal(marketVO.getIncreaseRate());
- if (increaseRate.compareTo(new BigDecimal("0")) == 1) {
-
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) == -1 && buyType
- .intValue() == 0) {
- return ServerResponse.createByErrorMsg("当前指数涨幅:" + increaseRate + ",不能买涨");
- }
- } else {
-
- increaseRate = increaseRate.negate();
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) == -1 && buyType
- .intValue() == 1) {
- return ServerResponse.createByErrorMsg("当前指数跌幅:" + increaseRate + ",不能买跌");
- }
- }
-
-
- BigDecimal reckon_enable = user.getEnableIndexAmt().subtract(all_deposit_amt);
- user.setEnableIndexAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易指数下单】修改用户金额成功");
- } else {
- log.error("用户交易指数下单】修改用户金额出错");
- throw new Exception("用户交易指数下单】修改用户金额出错");
- }
-
-
- UserIndexPosition userIndexPosition = new UserIndexPosition();
- if (profitTarget != null && profitTarget.compareTo(new BigDecimal("0")) > 0) {
- userIndexPosition.setProfitTargetPrice(profitTarget);
- }
- if (stopTarget != null && stopTarget.compareTo(new BigDecimal("0")) > 0) {
- userIndexPosition.setStopTargetPrice(stopTarget);
- }
- BigDecimal buyPrice = new BigDecimal("0");
- if (stockIndex.getIndexGid().contains("hk")){
- buyPrice = currencyUtils.getNowIndexPrice(stockIndex.getIndexGid(),"HKD");
- }else if (stockIndex.getIndexGid().contains("us")){
- buyPrice = currencyUtils.getNowIndexPrice(stockIndex.getIndexGid(),"USD");
- }else {
- buyPrice = new BigDecimal(marketVO.getNowPrice());
- }
- userIndexPosition.setPositionType(user.getAccountType());
- userIndexPosition.setPositionSn(KeyUtils.getUniqueKey());
- userIndexPosition.setUserId(user.getId());
- userIndexPosition.setRealName(user.getRealName());
- userIndexPosition.setAgentId(user.getAgentId());
- userIndexPosition.setIndexName(stockIndex.getIndexName());
- userIndexPosition.setIndexCode(stockIndex.getIndexCode());
- userIndexPosition.setIndexGid(stockIndex.getIndexGid());
- userIndexPosition.setBuyOrderTime(new Date());
- userIndexPosition.setBuyOrderPrice(buyPrice);
- userIndexPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
-
- userIndexPosition.setOrderNum(buyNum);
-
-
- userIndexPosition.setIsLock(Integer.valueOf(0));
-
- userIndexPosition.setAllDepositAmt(all_deposit_amt);
- userIndexPosition.setOrderFee((new BigDecimal(stockIndex.getTransFee().intValue()))
- .multiply(new BigDecimal(buyNum.intValue())));
- userIndexPosition.setOrderStayDays(Integer.valueOf(0));
- userIndexPosition.setEachPoint(new BigDecimal(stockIndex.getEachPoint().intValue()));
- userIndexPosition.setProfitAndLose(new BigDecimal("0"));
- userIndexPosition.setAllProfitAndLose(new BigDecimal("0"));
- userIndexPosition.setOrderLever(lever);
-
- int insertPositionCount = this.userIndexPositionMapper.insert(userIndexPosition);
- if (insertPositionCount > 0) {
- log.info("【用户交易指数下单】保存持仓记录成功");
- } else {
- log.error("用户交易指数下单】保存持仓记录出错");
- throw new Exception("用户交易指数下单】保存持仓记录出错");
- }
return ServerResponse.createBySuccess("Order successful");
}
@@ -263,7 +91,7 @@
return ServerResponse.createByErrorMsg("参数不能为空");
}
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
/*实名认证开关开启*/
SiteProduct siteProduct = iSiteProductService.getProductSetting();
if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
@@ -327,107 +155,6 @@
//保证金= 指数保证金*数量/杠杆倍数
BigDecimal all_deposit_amt = (new BigDecimal(stockIndex.getDepositAmt().intValue())).multiply(new BigDecimal(buyNum.intValue())).divide(new BigDecimal(lever)).setScale(4,2);
- if (user.getEnableIndexAmt().compareTo(all_deposit_amt) == -1) {
- log.error("用户 {} 余额不足", user.getId());
- return ServerResponse.createByErrorMsg("指数账户资金不足");
- }
-
- BigDecimal max_buy_amt = user.getEnableIndexAmt().multiply(siteIndexSetting.getBuyMaxPercent());
- if (max_buy_amt.compareTo(all_deposit_amt) == -1) {
- log.error("不能超过最大购买比例");
- return ServerResponse.createByErrorMsg("不能超过最大购买比例");
- }
- if (user.getUserAmt().compareTo(new BigDecimal("0")) == -1) {
- log.error("用户 {} 余额不足", user.getId());
- return ServerResponse.createByErrorMsg("失败,融资总资金小于0");
- }
-// if (user.getUserFutAmt().compareTo(new BigDecimal("0")) == -1) {
-// return ServerResponse.createByErrorMsg("失败,期货总资金小于0");
-// }
-
-
- MarketVO marketVO = this.iStockIndexService.querySingleIndex(stockIndex.getIndexGid());
- log.info("当前指数行情 = {}", JsonUtil.obj2StringPretty(marketVO));
-
-
- BigDecimal increaseRate = new BigDecimal(marketVO.getIncreaseRate());
- if (increaseRate.compareTo(new BigDecimal("0")) == 1) {
-
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) == -1 && buyType
- .intValue() == 0) {
- return ServerResponse.createByErrorMsg("当前指数涨幅:" + increaseRate + ",不能买涨");
- }
- } else {
-
- increaseRate = increaseRate.negate();
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) == -1 && buyType
- .intValue() == 1) {
- return ServerResponse.createByErrorMsg("当前指数跌幅:" + increaseRate + ",不能买跌");
- }
- }
-
-
- BigDecimal reckon_enable = user.getEnableIndexAmt().subtract(all_deposit_amt);
- user.setEnableIndexAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易指数下单】修改用户金额成功");
- } else {
- log.error("用户交易指数下单】修改用户金额出错");
- throw new Exception("用户交易指数下单】修改用户金额出错");
- }
-
-
- UserIndexPosition userIndexPosition = new UserIndexPosition();
- if (profitTarget != null && profitTarget.compareTo(new BigDecimal("0")) > 0) {
- userIndexPosition.setProfitTargetPrice(profitTarget);
- }
- if (stopTarget != null && stopTarget.compareTo(new BigDecimal("0")) > 0) {
- userIndexPosition.setStopTargetPrice(stopTarget);
- }
- BigDecimal buyPrice = new BigDecimal("0");
- if (stockIndex.getIndexGid().contains("hk")){
- buyPrice = currencyUtils.getNowIndexPrice(stockIndex.getIndexGid(),"HKD");
- }else if (stockIndex.getIndexGid().contains("us")){
- buyPrice = currencyUtils.getNowIndexPrice(stockIndex.getIndexGid(),"USD");
- }else {
- buyPrice = new BigDecimal(marketVO.getNowPrice());
- }
- userIndexPosition.setPositionType(user.getAccountType());
- userIndexPosition.setPositionSn(KeyUtils.getUniqueKey());
- userIndexPosition.setUserId(user.getId());
- userIndexPosition.setRealName(user.getRealName());
- userIndexPosition.setAgentId(user.getAgentId());
- userIndexPosition.setIndexName(stockIndex.getIndexName());
- userIndexPosition.setIndexCode(stockIndex.getIndexCode());
- userIndexPosition.setIndexGid(stockIndex.getIndexGid());
- userIndexPosition.setBuyOrderTime(new Date());
- userIndexPosition.setBuyOrderPrice(buyPrice);
- userIndexPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
-
- userIndexPosition.setOrderNum(buyNum);
-
-
- userIndexPosition.setIsLock(Integer.valueOf(0));
-
- userIndexPosition.setAllDepositAmt(all_deposit_amt);
- userIndexPosition.setOrderFee((new BigDecimal(stockIndex.getTransFee().intValue()))
- .multiply(new BigDecimal(buyNum.intValue())));
- userIndexPosition.setOrderStayDays(Integer.valueOf(0));
- userIndexPosition.setEachPoint(new BigDecimal(stockIndex.getEachPoint().intValue()));
- userIndexPosition.setProfitAndLose(new BigDecimal("0"));
- userIndexPosition.setAllProfitAndLose(new BigDecimal("0"));
- userIndexPosition.setOrderLever(lever);
-
- int insertPositionCount = this.userIndexPositionMapper.insert(userIndexPosition);
- if (insertPositionCount > 0) {
- log.info("【用户交易指数下单】保存持仓记录成功");
- } else {
- log.error("用户交易指数下单】保存持仓记录出错");
- throw new Exception("用户交易指数下单】保存持仓记录出错");
- }
return ServerResponse.createBySuccess("Order successful");
}
@@ -448,14 +175,13 @@
for (int i = 0; i < userIdList.size(); i++) {
log.info("=====================");
Integer userId = (Integer)userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if(user == null){
continue;
}
List<UserIndexPosition> userindexPositions = this.iUserIndexPositionService.findIndexPositionByUserIdAndSellPriceIsNull(userId);
log.info("用户id = {} 姓名 = {} 指数持仓中订单数: {}", new Object[] { userId, user.getRealName(), Integer.valueOf(userindexPositions.size()) });
- BigDecimal enable_user_amt = user.getEnableAmt();
BigDecimal all_freez_amt = new BigDecimal("0");
for (UserIndexPosition userIndexPosition : userindexPositions) {
@@ -470,13 +196,10 @@
try {
this.iUserIndexPositionService.sellIndex(userIndexPosition.getPositionSn(), 0);
- User user1 = this.userMapper.selectByPrimaryKey(userId);
- BigDecimal enable_user_amt1 = user1.getEnableAmt();
+ User user1 = this.userMapper.selectById(userId);
SiteTaskLog siteTaskLog = new SiteTaskLog();
siteTaskLog.setTaskType("指数止盈止损强平任务-指数持仓");
String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平[达到目标盈亏] 用户id = " + user.getId() + ", 扣款可用资金 = " + enable_user_amt + "扣款后可用资金 = " + enable_user_amt1 + ",现价"+nowPrice+ ", 目标止盈价格:" + userIndexPosition.getProfitTargetPrice()+ ", 目标止损价格:" + userIndexPosition.getStopTargetPrice();
- siteTaskLog.setTaskCnt(taskcnt);
String tasktarget = "此次强平订单号为:" + userIndexPosition.getPositionSn();
siteTaskLog.setTaskTarget(tasktarget);
siteTaskLog.setAddTime(new Date());
@@ -524,174 +247,6 @@
@Transactional
public ServerResponse sellIndex(String positionSn, int doType) throws Exception {
log.info("【用户交易平仓指数】 positionSn = {} , dotype = {}", positionSn, Integer.valueOf(doType));
-
-
- SiteIndexSetting siteIndexSetting = this.iSiteIndexSettingService.getSiteIndexSetting();
- if (siteIndexSetting == null) {
- log.error("平仓出错,网站指数设置表不存在");
- return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
- }
- UserIndexPosition userIndexPosition = this.userIndexPositionMapper.selectIndexPositionBySn(positionSn);
-
- if (doType != 0) {
- if (userIndexPosition.getIndexGid().contains("us")){
- String am_begin = siteIndexSetting.getTransAmBeginUs();
- String am_end = siteIndexSetting.getTransAmEndUs();
- String pm_begin = siteIndexSetting.getTransPmBeginUs();
- String pm_end = siteIndexSetting.getTransPmEndUs();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("平仓失败,不在交易时段内");
- }
- }else if(userIndexPosition.getIndexGid().contains("hk")){
- String am_begin = siteIndexSetting.getTransAmBeginhk();
- String am_end = siteIndexSetting.getTransAmEndhk();
- String pm_begin = siteIndexSetting.getTransPmBeginhk();
- String pm_end = siteIndexSetting.getTransPmEndhk();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("下单失败,不在交易时段内");
- }
- }else {
- String am_begin = siteIndexSetting.getTransAmBegin();
- String am_end = siteIndexSetting.getTransAmEnd();
- String pm_begin = siteIndexSetting.getTransPmBegin();
- String pm_end = siteIndexSetting.getTransPmEnd();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("【指数】是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("平仓失败,不在交易时段内");
- }
- }
- }
-
-
-
- if (userIndexPosition == null) {
- return ServerResponse.createByErrorMsg("平仓失败,指数持仓不存在");
- }
-
-
- User user = this.userMapper.selectByPrimaryKey(userIndexPosition.getUserId());
- /*实名认证开关开启*/
- SiteProduct siteProduct = iSiteProductService.getProductSetting();
- if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
- return ServerResponse.createByErrorMsg("平仓失败,用户已被锁定");
- }
- if(siteProduct.getHolidayDisplay()){
- return ServerResponse.createByErrorMsg("周末或节假日不能交易!");
- }
- if (userIndexPosition.getSellOrderPrice() != null) {
- return ServerResponse.createByErrorMsg("平仓失败,此订单已平仓");
- }
-
- if (1 == userIndexPosition.getIsLock().intValue()) {
- return ServerResponse.createByErrorMsg("平仓失败 " + userIndexPosition.getLockMsg());
- }
-
-
- MarketVO marketVO = this.iStockIndexService.querySingleIndex(userIndexPosition.getIndexGid());
- log.info("当前指数行情 = {}", JsonUtil.obj2StringPretty(marketVO));
-
- BigDecimal increaseRate = new BigDecimal(marketVO.getIncreaseRate());
- if (increaseRate.compareTo(new BigDecimal("0")) == 1) {
-
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) != 1 && "买跌"
- .equals(userIndexPosition.getOrderDirection())) {
- return ServerResponse.createByErrorMsg("当前指数涨幅:" + increaseRate + ",不能卖出");
- }
- } else {
-
- increaseRate = increaseRate.negate();
- if (siteIndexSetting.getRiseLimit().multiply(new BigDecimal("100"))
- .compareTo(increaseRate) == -1 && "买涨"
- .equals(userIndexPosition.getOrderDirection())) {
- return ServerResponse.createByErrorMsg("当前指数跌幅:" + increaseRate + ",不能卖出");
- }
- }
- BigDecimal buyPrice = new BigDecimal("0");
- if (userIndexPosition.getIndexGid().contains("hk")){
- buyPrice = currencyUtils.getNowIndexPrice(userIndexPosition.getIndexGid(),"HKD");
- }else if (userIndexPosition.getIndexGid().contains("us")){
- buyPrice = currencyUtils.getNowIndexPrice(userIndexPosition.getIndexGid(),"USD");
- }else {
- buyPrice = new BigDecimal(marketVO.getNowPrice());
- }
-
- userIndexPosition.setSellOrderPrice((buyPrice));
- userIndexPosition.setSellOrderTime(new Date());
-
- BigDecimal point_sub = userIndexPosition.getSellOrderPrice().subtract(userIndexPosition.getBuyOrderPrice());
-
- BigDecimal profit_and_lose = point_sub.multiply(userIndexPosition.getEachPoint()).multiply(new BigDecimal(userIndexPosition.getOrderNum().intValue()));
- if ("买跌".equals(userIndexPosition.getOrderDirection())) {
- profit_and_lose = profit_and_lose.negate();
- }
-
- userIndexPosition.setProfitAndLose(profit_and_lose);
-
- BigDecimal all_profit = profit_and_lose.subtract(userIndexPosition.getOrderFee());
- userIndexPosition.setAllProfitAndLose(all_profit);
-
-
- int updateIndexPositionCount = this.userIndexPositionMapper.updateByPrimaryKeySelective(userIndexPosition);
- if (updateIndexPositionCount > 0) {
- log.info("【用户平仓指数】修改浮动盈亏记录成功");
- } else {
- log.error("【用户平仓指数】修改浮动盈亏记录出错");
- throw new Exception("用户平仓指数】修改浮动盈亏记录出错");
- }
-
-
- BigDecimal before_user_amt = user.getUserIndexAmt();
- BigDecimal before_enable_amt = user.getEnableIndexAmt();
- log.info("用户平仓之前 的 总资金 = {} , 可用资金 = {}", before_user_amt, before_enable_amt);
-
- BigDecimal user_index_amt = before_user_amt.add(all_profit);
-
- BigDecimal enable_index_amt = before_enable_amt.add(all_profit).add(userIndexPosition.getAllDepositAmt());
-
- log.info("用户平仓后的总资金 = {} , 可用资金 = {}", user_index_amt, enable_index_amt);
- user.setUserIndexAmt(user_index_amt);
- user.setEnableIndexAmt(enable_index_amt);
-
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户平仓指数】修改用户金额成功");
- } else {
- log.error("【用户平仓指数】修改用户金额出错");
- throw new Exception("【用户平仓指数】修改用户金额出错");
- }
-
- UserCashDetail ucd = new UserCashDetail();
- ucd.setPositionId(userIndexPosition.getId());
- ucd.setAgentId(user.getAgentId());
- ucd.setAgentName(user.getAgentName());
- ucd.setUserId(user.getId());
- ucd.setUserName(user.getRealName());
- ucd.setDeType("指数盈亏");
- ucd.setDeAmt(all_profit);
- ucd.setDeSummary("卖出指数," + userIndexPosition.getIndexName() + "/" + userIndexPosition
- .getIndexCode() + ",总盈亏:" + all_profit);
-
-
- ucd.setAddTime(new Date());
- ucd.setIsRead(Integer.valueOf(0));
-
- int insertSxfCount = this.userCashDetailMapper.insert(ucd);
- if (insertSxfCount > 0) {
- log.info("【用户平仓指数】保存明细记录成功");
- } else {
- log.error("【用户平仓指数】保存明细记录出错");
- throw new Exception("【用户平仓指数】保存明细记录出错");
- }
-
return ServerResponse.createBySuccessMsg("Closed position successfully!");
}
diff --git a/src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java b/src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java
index e832c11..f5637cb 100644
--- a/src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java
@@ -14,7 +14,7 @@
import com.nq.dao.*;
import com.nq.pojo.*;
import com.nq.service.*;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.redis.RedisShardedPoolUtils;
@@ -163,7 +163,7 @@
log.info("当前有挂单的用户数量 为 {}", Integer.valueOf(userPendingorders.size()));
for (int i = 0; i < userPendingorders.size(); i++) {
Integer userId = (Integer) userPendingorders.get(i).getUserId();
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
continue;
}
@@ -172,7 +172,6 @@
continue;
}
log.info("用户id = {} 姓名 = {} 已挂单数: {}", new Object[]{userId, user.getRealName(), Integer.valueOf(userPendingorders.size())});
- BigDecimal enable_user_amt = user.getEnableAmt();
BigDecimal all_freez_amt = new BigDecimal("0");
String nowPrice = "";
String code = "";
@@ -234,8 +233,6 @@
SiteTaskLog siteTaskLog = new SiteTaskLog();
siteTaskLog.setTaskType("股票挂单转持仓");
String accountType = (user.getAccountType() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "挂单[达到目标价格] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 目标价格 = " + userPendingorder.getTargetPrice() + ",现价" + nowPrice + ", 涨跌:" + (userPendingorder.getBuyType().intValue() == 0 ? "涨" : "跌");
- siteTaskLog.setTaskCnt(taskcnt);
String tasktarget = "此次挂单买入id:" + userPendingorder.getId();
siteTaskLog.setTaskTarget(tasktarget);
siteTaskLog.setAddTime(new Date());
@@ -260,8 +257,6 @@
SiteTaskLog siteTaskLog = new SiteTaskLog();
siteTaskLog.setTaskType("指数挂单转持仓");
String accountType = (user.getAccountType() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "挂单[达到目标价格] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 目标价格 = " + userPendingorder.getTargetPrice() + ",现价" + nowPrice + ", 涨跌:" + (userPendingorder.getBuyType().intValue() == 0 ? "涨" : "跌");
- siteTaskLog.setTaskCnt(taskcnt);
String tasktarget = "此次挂单买入id:" + userPendingorder.getId();
siteTaskLog.setTaskTarget(tasktarget);
siteTaskLog.setAddTime(new Date());
diff --git a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
index d07d1cd..487dbbd 100644
--- a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -4,6 +4,7 @@
import com.google.gson.Gson;
import com.nq.dao.*;
import com.nq.enums.EStockType;
+import com.nq.enums.EUserAssets;
import com.nq.pojo.*;
import com.nq.service.*;
import com.github.pagehelper.PageHelper;
@@ -11,14 +12,13 @@
import com.google.common.collect.Lists;
import com.nq.common.ServerResponse;
import com.nq.utils.*;
-import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.utils.stock.BuyAndSellUtils;
import com.nq.utils.stock.GeneratePosition;
import com.nq.utils.stock.GetStayDays;
import com.nq.utils.stock.pinyin.GetPyByChinese;
import com.nq.utils.stock.sina.StockApi;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.vo.agent.AgentIncomeVO;
-import com.nq.vo.foreigncurrency.ExchangeVO;
import com.nq.vo.position.AdminPositionVO;
import com.nq.vo.position.AgentPositionVO;
import com.nq.vo.position.PositionProfitVO;
@@ -33,6 +33,7 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*;
+import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
@@ -44,11 +45,14 @@
private static final Logger log = LoggerFactory.getLogger(UserPositionServiceImpl.class);
- @Autowired
+ @Resource
UserPositionMapper userPositionMapper;
@Autowired
IUserService iUserService;
+
+ @Autowired
+ IUserAssetsServices userAssetsServices;
@Autowired
ISiteSettingService iSiteSettingService;
@@ -59,16 +63,16 @@
@Autowired
IStockService iStockService;
- @Autowired
+ @Resource
UserMapper userMapper;
- @Autowired
+ @Resource
UserCashDetailMapper userCashDetailMapper;
@Autowired
IAgentUserService iAgentUserService;
- @Autowired
+ @Resource
AgentUserMapper agentUserMapper;
- @Autowired
+ @Resource
SiteTaskLogMapper siteTaskLogMapper;
@Autowired
StockMapper stockMapper;
@@ -83,9 +87,9 @@
FundsApplyMapper fundsApplyMapper;
@Autowired
UserStockSubscribeMapper userStockSubscribeMapper;
- @Autowired
+ @Resource
StockSubscribeMapper stockSubscribeMapper;
- @Autowired
+ @Resource
UserIndexPositionMapper userIndexPositionMapper;
@Autowired
@@ -94,8 +98,11 @@
IStockCoinService iStockCoinService;
@Autowired
CurrencyUtils currencyUtils;
- @Autowired
+ @Resource
StockDzMapper stockDzMapper;
+
+ @Autowired
+ IUserAssetsServices iUserAssetsServices;
@Transactional
public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) throws Exception {
@@ -112,8 +119,7 @@
return ServerResponse.createByErrorMsg("Order failed, please first real name authentication");
}
- log.info("用户 {} 下单,股票id = {} ,数量 = {} , 方向 = {} , 杠杆 = {}", user
- .getId(), stockId, buyNum, buyType, lever);
+
if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
return ServerResponse.createByErrorMsg("Order failed, account has been locked");
}
@@ -124,17 +130,10 @@
}
Stock stock = stockMapper.selectByPrimaryKey(stockId);
- log.info("当前股票信息 {}", new Gson().toJson(stock));
if (stock == null) {
return ServerResponse.createByErrorMsg("Order failed, stock code error");
}
- BigDecimal userEnableAmt;
- if (stock.getStockType().equals(EStockType.US.getCode())) {
- userEnableAmt = user.getEnableIndexAmt();
- } else {
- userEnableAmt = user.getEnableAmt();
- }
if (Objects.equals(stock.getStockType(), EStockType.US.getCode())) {
if (buyNum < siteSetting.getDzMinByCount()) {
return ServerResponse.createByErrorMsg("Minimum purchase for bulk commodities " + siteSetting.getDzMinByCount());
@@ -157,8 +156,6 @@
String pm_end = siteSetting.getTransPmEnd();
boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
-
if (!am_flag && !pm_flag) {
return ServerResponse.createByErrorMsg("Order failed, out of trading hours");
}
@@ -187,17 +184,15 @@
if (buyNum.intValue() < siteSetting.getBuyMinNum().intValue()) {
return ServerResponse.createByErrorMsg("Order failed, purchase quantity is less than" + siteSetting
- .getBuyMinNum() + "股");
+ .getBuyMinNum() );
}
if (buyNum.intValue() > siteSetting.getBuyMaxNum().intValue()) {
return ServerResponse.createByErrorMsg("Order failed, purchase quantity is greater than于" + siteSetting
.getBuyMaxNum() + "stocks");
}
BigDecimal now_price;
- StockListVO stockListVO = new StockListVO();
- StockCoin stockCoin = new StockCoin();
//股票类型 现价 数据源的处理
- stockListVO = StockApi.getStockRealTime(stock);
+ StockListVO stockListVO = StockApi.getStockRealTime(stock);
now_price = new BigDecimal(stockListVO.getNowPrice());
@@ -205,30 +200,15 @@
return ServerResponse.createByErrorMsg("Quote 0, please try again later");
}
+ BigDecimal buy_amt = now_price.multiply(new BigDecimal(buyNum));
- BigDecimal buy_amt = now_price.multiply(new BigDecimal(buyNum.intValue()));
- BigDecimal buy_amt_autual = buy_amt.divide(new BigDecimal(lever.intValue()), 2, 4);
- int compareInt = buy_amt_autual.compareTo(new BigDecimal(siteSetting.getBuyMinAmt().intValue()));
- if (compareInt == -1) {
- return ServerResponse.createByErrorMsg("Order failed, purchase amount is less than" + siteSetting
- .getBuyMinAmt());
- }
- BigDecimal max_buy_amt = userEnableAmt.multiply(siteSetting.getBuyMaxAmtPercent());
- int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
- if (compareCwInt == 1) {
- return ServerResponse.createByErrorMsg("Order failed, cannot exceed available funds." + siteSetting
- .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
- }
- int compareUserAmtInt = userEnableAmt.compareTo(buy_amt_autual);
- log.info("用户可用金额 = {} 实际购买金额 = {}", userEnableAmt, buy_amt_autual);
- log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
- if (compareUserAmtInt == -1) {
- return ServerResponse.createByErrorMsg("下单失败,融资可用金额小于" + buy_amt_autual + "元");
+ UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stock.getStockType(),user.getId());
+ if(userAssets.getAvailableBalance().compareTo(buy_amt)<0){
+ return ServerResponse.createByErrorMsg("Order failed,Insufficient balance");
+
}
- if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
- return ServerResponse.createByErrorMsg("Failure, index total funds less than");
- }
+
UserPosition userPosition = new UserPosition();
if (profitTarget != null && profitTarget.compareTo(new BigDecimal("0")) > 0) {
@@ -259,31 +239,19 @@
userPosition.setIsLock(Integer.valueOf(0));
userPosition.setOrderLever(lever);
userPosition.setOrderTotalPrice(buy_amt);
- //递延费特殊处理
-// BigDecimal stayFee = userPosition.getOrderTotalPrice().multiply(siteSetting.getStayFee());
-// BigDecimal allStayFee = stayFee.multiply(new BigDecimal(1));
BigDecimal allStayFee = BigDecimal.valueOf(0);
userPosition.setOrderStayFee(allStayFee);
userPosition.setOrderStayDays(1);
BigDecimal buy_fee_amt = BigDecimal.valueOf(0);
-// BigDecimal buy_fee_amt = buy_amt.multiply(siteSetting.getBuyFee()).setScale(2, 4);
log.info("用户购买手续费(配资后总资金 * 百分比) = {}", buy_fee_amt);
userPosition.setOrderFee(buy_fee_amt);
BigDecimal buy_yhs_amt = BigDecimal.valueOf(0);
-// BigDecimal buy_yhs_amt = buy_amt.multiply(siteSetting.getDutyFee()).setScale(2, 4);
log.info("用户购买印花税(配资后总资金 * 百分比) = {}", buy_yhs_amt);
userPosition.setOrderSpread(buy_yhs_amt);
-// SiteSpread siteSpread = iSiteSpreadService.findSpreadRateOne(new BigDecimal(stock_crease), buy_amt, stock.getStockCode(), now_price);
BigDecimal spread_rate_amt = new BigDecimal("0");
-// if (siteSpread != null) {
-// spread_rate_amt = buy_amt.multiply(siteSpread.getSpreadRate()).setScale(2, 4);
-// log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", siteSpread.getSpreadRate(), spread_rate_amt);
-// } else {
-// log.info("用户购买点差费(配资后总资金 * 百分比{}) = {}", "设置异常", spread_rate_amt);
-// }
userPosition.setSpreadRatePrice(spread_rate_amt);
BigDecimal profit_and_lose = new BigDecimal("0");
@@ -292,40 +260,8 @@
userPosition.setAllProfitAndLose(all_profit_and_lose);
userPosition.setOrderStayDays(Integer.valueOf(0));
userPosition.setOrderStayFee(new BigDecimal("0"));
- int insertPositionCount = 0;
this.userPositionMapper.insert(userPosition);
- insertPositionCount = userPosition.getId();
- if (insertPositionCount > 0) {
- if (stock.getStockType().equals(EStockType.US.getCode())) {
- BigDecimal reckon_enable = userEnableAmt.subtract(buy_amt_autual);
- user.setUserIndexAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易下单】修改用户金额成功");
- } else {
- log.error("用户交易下单】修改用户金额出错");
- throw new Exception("用户交易下单】修改用户金额出错");
- }
- } else {
- BigDecimal reckon_enable = userEnableAmt.subtract(buy_amt_autual);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户交易下单】修改用户金额成功");
- } else {
- log.error("用户交易下单】修改用户金额出错");
- throw new Exception("用户交易下单】修改用户金额出错");
- }
- }
-
- //核算代理收入-入仓手续费
-// iAgentAgencyFeeService.AgencyFeeIncome(1, userPosition.getPositionSn());
- log.info("【用户交易下单】保存持仓记录成功");
- } else {
- log.error("用户交易下单】保存持仓记录出错");
- throw new Exception("用户交易下单】保存持仓记录出错");
- }
-
+ iUserAssetsServices.availablebalanceChange(stock.getStockType(),user.getId(), EUserAssets.BUY,buy_amt.negate(),"","");
return ServerResponse.createBySuccessMsg("Order successful");
}
@@ -373,9 +309,9 @@
}
- public ServerResponse sell(String positionSn, int doType) throws Exception {
- log.info("【用户交易平仓】 positionSn = {} , dotype = {}", positionSn, Integer.valueOf(doType));
+ @Transactional
+ public ServerResponse sell(String positionSn, int doType) throws Exception {
SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
if (siteSetting == null) {
log.error("平仓出错,网站设置表不存在");
@@ -416,7 +352,7 @@
return ServerResponse.createByErrorMsg("Closing failed, order does not exist");
}
- User user = this.userMapper.selectByPrimaryKey(userPosition.getUserId());
+ User user = this.userMapper.selectById(userPosition.getUserId());
if (user == null) {
return ServerResponse.createByErrorMsg("Closed position failed, user does not exist");
}
@@ -436,20 +372,11 @@
if (1 == userPosition.getIsLock().intValue()) {
return ServerResponse.createByErrorMsg("this order is closed " + userPosition.getLockMsg());
}
-//
-// if (!DateTimeUtil.isCanSell(userPosition.getBuyOrderTime(), siteSetting.getCantSellTimes().intValue())) {
-// return ServerResponse.createByErrorMsg(siteSetting.getCantSellTimes() + "分钟内不能平仓");
-// }
-
-// if (DateTimeUtil.sameDate(DateTimeUtil.getCurrentDate(),userPosition.getBuyOrderTime())) {
-// return ServerResponse.createByErrorMsg("当天入仓的股票需要隔天才能出仓");
-// }
BigDecimal now_price;
- StockListVO stockListVO = new StockListVO();
Stock stock = stockMapper.selectOne(new QueryWrapper<Stock>().eq("stock_code", userPosition.getStockCode()));
//股票卖出的 价格 数据源
- stockListVO = StockApi.getStockRealTime(stock);
+ StockListVO stockListVO = StockApi.getStockRealTime(stock);
now_price = new BigDecimal(stockListVO.getNowPrice());
if (stockListVO.getNowPrice() == null) {
return ServerResponse.createByErrorMsg("Failed to close position, failed to obtain stock information");
@@ -458,138 +385,34 @@
log.error("股票 = {} 收到报价 = {}", userPosition.getStockName(), now_price);
return ServerResponse.createByErrorMsg("Quote 0, closing failed, please try again later");
}
- double stock_crease = stockListVO.getHcrate().doubleValue();
- BigDecimal zsPrice = new BigDecimal(stockListVO.getPreclose_px());
-
- BigDecimal ztPrice = zsPrice.multiply(new BigDecimal("0.1")).add(zsPrice);
- ztPrice = ztPrice.setScale(2, 4);
- BigDecimal chaPrice = ztPrice.subtract(zsPrice);
-
- Integer buy_num = userPosition.getOrderNum();
-
- BigDecimal all_buy_amt = userPosition.getOrderTotalPrice();
- //BigDecimal all_sell_amt = now_price.multiply(new BigDecimal(buy_num.intValue())).divide(new BigDecimal(userPosition.getOrderLever())).setScale(2,4);
- BigDecimal all_sell_amt = now_price.multiply(new BigDecimal(buy_num.intValue()));
-
- BigDecimal profitLoss = new BigDecimal("0");
- if ("买涨".equals(userPosition.getOrderDirection())) {
- log.info("买卖方向:{}", "涨");
-
- profitLoss = all_sell_amt.subtract(all_buy_amt);
- } else {
- log.info("买卖方向:{}", "跌");
- profitLoss = all_buy_amt.subtract(all_sell_amt);
- }
- log.info("买入总金额 = {} , 卖出总金额 = {} , 盈亏 = {}", new Object[]{all_buy_amt, all_sell_amt, profitLoss});
-
-
- BigDecimal userAllAmt;
- BigDecimal userEnableAmt;
- if (EStockType.US.getCode().equals(userPosition.getStockGid())) {
- userAllAmt = user.getUserIndexAmt();
- userEnableAmt = user.getEnableIndexAmt();
- log.info("美股账号原本资金 = {} , 可用 = {}", userAllAmt, userEnableAmt);
- } else {
- userAllAmt = user.getUserAmt();
- userEnableAmt = user.getEnableAmt();
- log.info("印度账户用户原本总资金 = {} , 可用 = {}", userAllAmt, userEnableAmt);
- }
-
-
- BigDecimal buy_fee_amt = BigDecimal.ZERO;
- BigDecimal orderSpread = BigDecimal.ZERO;
- BigDecimal orderStayFee = BigDecimal.ZERO;
- BigDecimal spreadRatePrice = BigDecimal.ZERO;
- BigDecimal sell_fee_amt = BigDecimal.ZERO;
-// BigDecimal buy_fee_amt = userPosition.getOrderFee();
-// log.info("买入手续费 = {}", buy_fee_amt);
-//
-// BigDecimal orderSpread = userPosition.getOrderSpread();
-// log.info("印花税 = {}", orderSpread);
-//
-// BigDecimal orderStayFee = userPosition.getOrderStayFee();
-// log.info("递延费 = {}", orderStayFee);
-//
-// BigDecimal spreadRatePrice = userPosition.getSpreadRatePrice();
-// log.info("点差费 = {}", spreadRatePrice);
-//
-// BigDecimal sell_fee_amt = all_sell_amt.multiply(siteSetting.getSellFee()).setScale(2, 4);
-// log.info("卖出手续费 = {}", sell_fee_amt);
-
- //总手续费= 买入手续费+卖出手续费+印花税+递延费+点差费
- BigDecimal all_fee_amt = buy_fee_amt.add(sell_fee_amt).add(orderSpread).add(orderStayFee).add(spreadRatePrice);
- log.info("总的手续费费用 = {}", all_fee_amt);
userPosition.setSellOrderId(GeneratePosition.getPositionId());
userPosition.setSellOrderPrice(now_price);
userPosition.setSellOrderTime(new Date());
+ userPositionMapper.updateById(userPosition);
+ userAssetsServices.availablebalanceChange(stock.getStockType(),userPosition.getUserId(),EUserAssets.CLOSE_POSITION_RETURN_SECURITY_DEPOSIT,
+ userPosition.getOrderTotalPrice(),"","");
+ userAssetsServices.availablebalanceChange(stock.getStockType(),userPosition.getUserId(),EUserAssets.CLOSE_POSITION,
+ userPosition.getProfitAndLose() ,"","");
+ return ServerResponse.createBySuccessMsg("Closed position successfully!");
+ }
- BigDecimal order_fee_all = buy_fee_amt.add(sell_fee_amt);
- userPosition.setOrderFee(order_fee_all);
-
- userPosition.setProfitAndLose(profitLoss);
-
- BigDecimal all_profit = profitLoss.subtract(all_fee_amt);
- userPosition.setAllProfitAndLose(all_profit);
-
- int updatePositionCount = this.userPositionMapper.updateByPrimaryKeySelective(userPosition);
- if (updatePositionCount > 0) {
- log.info("【用户平仓】修改浮动盈亏记录成功");
- } else {
- log.error("用户平仓】修改浮动盈亏记录出错");
- throw new Exception("用户平仓】修改浮动盈亏记录出错");
+ @Transactional
+ @Override
+ public ServerResponse allSell(HttpServletRequest request,String stockType) throws Exception{
+ User user = iUserService.getCurrentUser(request);
+ if(user == null){
+ return ServerResponse.createByErrorMsg("Please login");
}
+ QueryWrapper<UserPosition> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("user_id",user.getId());
+ queryWrapper.eq("stock_gid",stockType);
+ queryWrapper.isNull("sell_order_id");
- BigDecimal freez_amt = all_buy_amt.divide(new BigDecimal(userPosition.getOrderLever().intValue()), 2, 4);
- //BigDecimal freez_amt = all_buy_amt;
-
- BigDecimal reckon_all = userAllAmt.add(all_profit);
- //修改用户可用余额=当前可用余额+总盈亏+买入总金额+追加保证金
- BigDecimal reckon_enable = userEnableAmt.add(all_profit).add(freez_amt).add(userPosition.getMarginAdd());
-
-
- if (EStockType.US.getCode().equals(userPosition.getStockGid())) {
- user.setUserIndexAmt(reckon_all);
- user.setEnableIndexAmt(reckon_enable);
- log.info("美股用户平仓后的总资金 = {} , 可用资金 = {}", reckon_all, reckon_enable);
- } else {
- user.setUserAmt(reckon_all);
- user.setEnableAmt(reckon_enable);
- log.info("印度股用户平仓后的总资金 = {} , 可用资金 = {}", reckon_all, reckon_enable);
+ List<UserPosition> userPositionList = userPositionMapper.selectList(queryWrapper);
+ for (int i = 0; i < userPositionList.size(); i++) {
+ sell(userPositionList.get(i).getPositionSn(),0);
}
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateUserCount > 0) {
- log.info("【用户平仓】修改用户金额成功");
- } else {
- log.error("用户平仓】修改用户金额出错");
- throw new Exception("用户平仓】修改用户金额出错");
- }
-
- UserCashDetail ucd = new UserCashDetail();
- ucd.setPositionId(userPosition.getId());
- ucd.setAgentId(user.getAgentId());
- ucd.setAgentName(user.getAgentName());
- ucd.setUserId(user.getId());
- ucd.setUserName(user.getRealName());
- ucd.setDeType("总盈亏");
- ucd.setDeAmt(all_profit);
- ucd.setDeSummary("卖出股票," + userPosition.getStockCode() + "/" + userPosition.getStockName() + ",占用本金:" + freez_amt + ",总手续费:" + all_fee_amt + ",递延费:" + orderStayFee + ",印花税:" + orderSpread + ",盈亏:" + profitLoss + ",总盈亏:" + all_profit);
-
- ucd.setAddTime(new Date());
- ucd.setIsRead(Integer.valueOf(0));
-
- int insertSxfCount = this.userCashDetailMapper.insert(ucd);
- if (insertSxfCount > 0) {
- //核算代理收入-平仓手续费
- iAgentAgencyFeeService.AgencyFeeIncome(2, userPosition.getPositionSn());
- //核算代理收入-分红
- iAgentAgencyFeeService.AgencyFeeIncome(4, userPosition.getPositionSn());
- log.info("【用户平仓】保存明细记录成功");
- } else {
- log.error("用户平仓】保存明细记录出错");
- throw new Exception("用户平仓】保存明细记录出错");
- }
-
return ServerResponse.createBySuccessMsg("Closed position successfully!");
}
@@ -604,16 +427,6 @@
}
if (doType != 0) {
- /*String am_begin = siteSetting.getTransAmBegin();
- String am_end = siteSetting.getTransAmEnd();
- String pm_begin = siteSetting.getTransPmBegin();
- String pm_end = siteSetting.getTransPmEnd();
- boolean am_flag = BuyAndSellUtils.isTransTime(am_begin, am_end);
- boolean pm_flag = BuyAndSellUtils.isTransTime(pm_begin, pm_end);
- log.info("是否在上午交易时间 = {} 是否在下午交易时间 = {}", Boolean.valueOf(am_flag), Boolean.valueOf(pm_flag));
- if (!am_flag && !pm_flag) {
- return ServerResponse.createByErrorMsg("追加失败,不在交易时段内");
- }*/
}
UserPosition userPosition = this.userPositionMapper.findPositionBySn(positionSn);
@@ -621,7 +434,7 @@
return ServerResponse.createByErrorMsg("追加失败,订单不存在");
}
- User user = this.userMapper.selectByPrimaryKey(userPosition.getUserId());
+ User user = this.userMapper.selectById(userPosition.getUserId());
/*实名认证开关开启*/
SiteProduct siteProduct = iSiteProductService.getProductSetting();
if (!siteProduct.getStockMarginDisplay()) {
@@ -640,8 +453,8 @@
return ServerResponse.createByErrorMsg("追加失败 " + userPosition.getLockMsg());
}
- BigDecimal user_all_amt = user.getUserAmt();
- BigDecimal user_enable_amt = user.getEnableAmt();
+ BigDecimal user_all_amt = BigDecimal.ZERO;
+ BigDecimal user_enable_amt = BigDecimal.ZERO;
int compareUserAmtInt = user_enable_amt.compareTo(marginAdd);
log.info("用户可用金额 = {} 追加金额 = {}", user_enable_amt, marginAdd);
log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
@@ -664,8 +477,7 @@
BigDecimal reckon_enable = user_enable_amt.subtract(marginAdd);
log.info("用户追加保证金后的总资金 = {} , 可用资金 = {}", user_all_amt, reckon_enable);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
log.info("【用户平仓】修改用户金额成功");
} else {
@@ -1000,7 +812,7 @@
}
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
log.info("用户不存在");
return ServerResponse.createByErrorMsg("用户不存在");
@@ -1030,26 +842,9 @@
}
- BigDecimal user_enable_amt = user.getEnableAmt();
BigDecimal buy_amt = (new BigDecimal(buyPrice)).multiply(new BigDecimal(buyNum.intValue()));
BigDecimal buy_amt_autual = buy_amt.divide(new BigDecimal(lever.intValue()), 2, 4);
-
-
- int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
- log.info("用户可用金额 = {} 实际购买金额 = {}", user_enable_amt, buy_amt_autual);
- log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
- if (compareUserAmtInt == -1) {
- log.info("下单失败,用户可用金额小于" + buy_amt_autual + "元");
- return ServerResponse.createByErrorMsg("下单失败,用户可用金额小于" + buy_amt_autual + "元");
-
- }
-
- if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
- log.info("失败,指数总资金小于0");
- return ServerResponse.createByErrorMsg("失败,指数总资金小于0");
-
- }
UserPosition userPosition = new UserPosition();
@@ -1147,9 +942,7 @@
} else {
log.error("【创建持仓】保存记录出错");
}
- BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
log.info("【用户交易下单】修改用户金额成功");
} else {
@@ -1588,8 +1381,7 @@
userStockSubscribe.setStatus(5);
userStockSubscribeMapper.update1(userStockSubscribe);
if (userStockSubscribe.getType() == 1 || userStockSubscribe.getType() == 2) {
- User user = userMapper.selectByPrimaryKey(userStockSubscribe.getUserId());
- user.setDjzj(user.getDjzj().subtract(userStockSubscribe.getBond()));
+ User user = userMapper.selectById(userStockSubscribe.getUserId());
ret = userMapper.updateByPrimaryKey(user);
}
if (ret > 0) {
@@ -1625,7 +1417,6 @@
if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
return ServerResponse.createByErrorMsg("下单失败,请先实名认证");
}
- BigDecimal user_enable_amt = user.getEnableAmt();
log.info("用户 {} 下单,股票id = {} ,数量 = {} , 方向 = {} , 杠杆 = {}", new Object[]{user
.getId(), stockCode, buyNum, buyType, lever});
@@ -1639,15 +1430,11 @@
log.error("下单出错,网站设置表不存在");
return ServerResponse.createByErrorMsg("下单失败,系统设置错误");
}
-// if (siteSetting.getVipQcMaxAmt().compareTo(user_enable_amt) > 0) {
-// return ServerResponse.createByErrorMsg("下单失败,可用余额小于"+siteSetting.getVipQcMaxAmt());
-// }
- Stock stock = null;
ServerResponse stock_res = this.iStockService.findStockByCode(stockCode);
if (!stock_res.isSuccess()) {
return ServerResponse.createByErrorMsg("下单失败,股票代码错误");
}
- stock = (Stock) stock_res.getData();
+ Stock stock = (Stock) stock_res.getData();
String am_begin = siteSetting.getTransAmBegin();
String am_end = siteSetting.getTransAmEnd();
@@ -1808,21 +1595,6 @@
}
- BigDecimal max_buy_amt = user_enable_amt.multiply(siteSetting.getBuyMaxAmtPercent());
- int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
- if (compareCwInt == 1) {
- return ServerResponse.createByErrorMsg("下单失败,不能超过可用资金的" + siteSetting
- .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
- }
-
-
- int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
- log.info("用户可用金额 = {} 实际购买金额 = {}", user_enable_amt, buy_amt_autual);
- log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
- if (compareUserAmtInt == -1) {
- return ServerResponse.createByErrorMsg("下单失败,可用金额小于" + buy_amt_autual + "元");
- }
-
// if (user.getUserIndexAmt().compareTo(new BigDecimal("0")) == -1) {
// return ServerResponse.createByErrorMsg("失败,指数总资金小于0");
// }
@@ -1913,9 +1685,7 @@
//修改用户可用余额= 当前余额-下单金额-买入手续费-印花税-点差费
//BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual).subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
//修改用户可用余额= 当前余额-下单总金额
- BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
log.info("【用户交易下单】修改用户金额成功");
} else {
@@ -1951,7 +1721,6 @@
if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) {
return ServerResponse.createByErrorMsg("Order failed, please first real name authentication");
}
- BigDecimal user_enable_amt = user.getEnableAmt();
log.info("用户 {} 下单,股票code = {} ,数量 = {}", new Object[]{user
.getId(), stockCode, num});
if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
@@ -2062,21 +1831,6 @@
}
- BigDecimal max_buy_amt = user_enable_amt.multiply(siteSetting.getBuyMaxAmtPercent());
- int compareCwInt = buy_amt_autual.compareTo(max_buy_amt);
- if (compareCwInt == 1) {
- return ServerResponse.createByErrorMsg("Order failed, purchase amount is less than" + siteSetting
- .getBuyMaxAmtPercent().multiply(new BigDecimal("100")) + "%");
- }
-
-
- int compareUserAmtInt = user_enable_amt.compareTo(buy_amt_autual);
- log.info("用户可用金额 = {} 实际购买金额 = {}", user_enable_amt, buy_amt_autual);
- log.info("比较 用户金额 和 实际 购买金额 = {}", Integer.valueOf(compareUserAmtInt));
- if (compareUserAmtInt == -1) {
- return ServerResponse.createByErrorMsg("Order failed, the amount of financing available is less than" + buy_amt_autual);
- }
-
UserPosition userPosition = new UserPosition();
userPosition.setPositionType(3);
userPosition.setPositionSn(KeyUtils.getUniqueKey());
@@ -2145,9 +1899,7 @@
//修改用户可用余额= 当前余额-下单金额-买入手续费-印花税-点差费
//BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual).subtract(buy_fee_amt).subtract(buy_yhs_amt).subtract(spread_rate_amt);
//修改用户可用余额= 当前余额-下单总金额
- BigDecimal reckon_enable = user_enable_amt.subtract(buy_amt_autual);
- user.setEnableAmt(reckon_enable);
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
log.info("【用户交易下单】修改用户金额成功");
} else {
diff --git a/src/main/java/com/nq/service/impl/UserRechargeServiceImpl.java b/src/main/java/com/nq/service/impl/UserRechargeServiceImpl.java
index daf22a0..850dc93 100644
--- a/src/main/java/com/nq/service/impl/UserRechargeServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserRechargeServiceImpl.java
@@ -2,12 +2,13 @@
import com.nq.dao.*;
+import com.nq.enums.EUserAssets;
import com.nq.pojo.*;
import com.nq.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nq.common.ServerResponse;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.redis.RedisShardedPoolUtils;
@@ -48,7 +49,10 @@
UserCashDetailMapper userCashDetailMapper;
@Resource
- PayChnnelMapper payChnnelMapper;
+ SitePayMapper sitePayMapper;
+
+ @Autowired
+ IUserAssetsServices userAssetsServices;
@Autowired
@@ -152,15 +156,11 @@
}
- User user = this.userMapper.selectByPrimaryKey(userRecharge.getUserId());
+ User user = this.userMapper.selectById(userRecharge.getUserId());
if (user == null) {
return ServerResponse.createByErrorMsg("用户不存在");
}
- BigDecimal userAmt_before = user.getUserAmt();
- BigDecimal enableAmt_before = user.getEnableAmt();
- user.setUserAmt(userAmt_before.add(userRecharge.getPayAmt()));
- user.setEnableAmt(enableAmt_before.add(userRecharge.getPayAmt()));
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
log.info("1.修改用户资金成功");
} else {
@@ -178,22 +178,6 @@
}
- UserCashDetail ucd = new UserCashDetail();
- ucd.setAgentId(user.getAgentId());
- ucd.setAgentName(user.getAgentName());
- ucd.setUserId(user.getId());
- ucd.setUserName(user.getRealName());
- ucd.setDeType("用户充值");
- ucd.setDeAmt(userRecharge.getPayAmt());
- ucd.setDeSummary("用户充值成功,充值前总金额:" + userAmt_before + ",充值后总金额:" + user.getUserAmt() + ",充值前可用:" + enableAmt_before + ",充值后可用:" + user
- .getEnableAmt());
-
- ucd.setAddTime(new Date());
- ucd.setIsRead(Integer.valueOf(0));
- int insertCount = this.userCashDetailMapper.insert(ucd);
- if (insertCount > 0) {
- return ServerResponse.createBySuccessMsg("充值成功!");
- }
return ServerResponse.createByErrorMsg("充值失败");
}
@@ -230,12 +214,8 @@
PageHelper.startPage(pageNum, pageSize);
User user = this.iUserService.getCurrentUser(request);
-
-
List<UserRecharge> userRecharges = this.userRechargeMapper.findUserChargeList(user.getId(), payChannel, orderStatus);
-
log.info("充值列表,增加用户 {} ,payChannel = {} , orderStatus = {}, 数量 = {}", new Object[]{user.getId(), payChannel, orderStatus, userRecharges.size()});
-
PageInfo pageInfo = new PageInfo(userRecharges);
return ServerResponse.createBySuccess(pageInfo);
@@ -286,17 +266,6 @@
List<UserRecharge> userRecharges = this.userRechargeMapper.listByAdmin(agentId, userId, realName, state, begin_time, end_time);
-
- for (int i = 0; i < userRecharges.size(); i++) {
- UserRecharge userRecharge = userRecharges.get(i);
- PayChnnel payChnnel = payChnnelMapper.selectById(userRecharge.getPayChannel());
- userRecharge.setPayChannelType(payChnnel.getChannelDesc());
- User user = userMapper.selectById(userRecharge.getUserId());
- if (user != null) {
- userRecharge.setUserPhone(user.getPhone());
- }
- }
-
PageInfo pageInfo = new PageInfo(userRecharges);
return ServerResponse.createBySuccess(pageInfo);
@@ -305,7 +274,7 @@
@Transactional
public ServerResponse updateState(Integer chargeId, Integer state) throws Exception {
- UserRecharge userRecharge = this.userRechargeMapper.selectByPrimaryKey(chargeId);
+ UserRecharge userRecharge = this.userRechargeMapper.selectById(chargeId);
if (userRecharge == null) {
return ServerResponse.createByErrorMsg("充值订单不存在");
@@ -316,38 +285,14 @@
if (state.intValue() == 1) {
-
- User user = this.userMapper.selectByPrimaryKey(userRecharge.getUserId());
+ User user = this.userMapper.selectById(userRecharge.getUserId());
if (user == null) {
return ServerResponse.createByErrorMsg("用户不存在");
}
-
- PayChnnel payChnnel = payChnnelMapper.selectById(userRecharge.getPayChannel());
-
- if (!payChnnel.getChannelName().equals("USDT")) {
- BigDecimal user_amt = user.getUserAmt().add(userRecharge.getPayAmt());
- user.setUserAmt(user_amt);
- BigDecimal user_enable_amt = user.getEnableAmt().add(userRecharge.getPayAmt());
- user.setEnableAmt(user_enable_amt);
- } else {
- BigDecimal user_amt = user.getUserIndexAmt().add(userRecharge.getPayAmt());
- user.setUserIndexAmt(user_amt);
- BigDecimal user_enable_amt = user.getEnableIndexAmt().add(userRecharge.getPayAmt());
- user.setEnableIndexAmt(user_enable_amt);
- }
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
- if (updateCount > 0) {
- log.info("修改用户资金成功!");
- } else {
- log.error("修改用户资金出错,抛出异常");
- throw new Exception("修改用户资金出错,抛出异常");
- }
+ SitePay payChnnel = sitePayMapper.selectById(userRecharge.getPayId());
+ userAssetsServices.availablebalanceChange(payChnnel.getAssetsType(),user.getId(), EUserAssets.TOP_UP,userRecharge.getPayAmt(),"","");
}
-
-
userRecharge.setOrderStatus(Integer.valueOf((state.intValue() == 1) ? 1 : 2));
-
-
userRecharge.setPayTime(new Date());
int updateCount = this.userRechargeMapper.updateByPrimaryKeySelective(userRecharge);
if (updateCount > 0) {
@@ -362,7 +307,7 @@
return ServerResponse.createByErrorMsg("参数不能为空");
}
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
return ServerResponse.createByErrorMsg("找不到用户");
}
@@ -387,9 +332,7 @@
userRecharge.setPayChannel("2");
userRecharge.setOrderStatus(Integer.valueOf(1));
- user.setUserAmt(user.getUserAmt().add(new BigDecimal(amt.intValue())));
- user.setEnableAmt(user.getEnableAmt().add(new BigDecimal(amt.intValue())));
- this.userMapper.updateByPrimaryKeySelective(user);
+ this.userMapper.updateById(user);
} else if (state.intValue() == 2) {
userRecharge.setOrderStatus(Integer.valueOf(2));
} else {
@@ -408,7 +351,7 @@
if (cId == null) {
return ServerResponse.createByErrorMsg("id不能为空");
}
- int updateCount = this.userRechargeMapper.deleteByPrimaryKey(cId);
+ int updateCount = this.userRechargeMapper.deleteById(cId);
if (updateCount > 0) {
return ServerResponse.createBySuccessMsg("删除成功");
}
diff --git a/src/main/java/com/nq/service/impl/UserServiceImpl.java b/src/main/java/com/nq/service/impl/UserServiceImpl.java
index 1d420ca..9dfc106 100644
--- a/src/main/java/com/nq/service/impl/UserServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -8,9 +8,11 @@
import com.nq.config.StockPoll;
import com.nq.dao.*;
import com.nq.enums.EStockType;
+import com.nq.enums.EUserAssets;
import com.nq.pojo.*;
+import com.nq.pojo.reponse.RUserAssets;
import com.nq.service.*;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.SymmetricCryptoUtil;
import com.nq.utils.ip.IpUtils;
@@ -29,6 +31,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -46,7 +49,7 @@
public class UserServiceImpl implements IUserService {
private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
- @Autowired
+ @Resource
UserMapper userMapper;
@Autowired
@@ -55,8 +58,15 @@
@Autowired
ISiteLoginLogService iSiteLoginLogService;
- @Autowired
+ @Resource
StockOptionMapper stockOptionMapper;
+
+
+ @Autowired
+ IUserService userService;
+
+ @Autowired
+ IUserAssetsServices userAssetsServices;
@Autowired
StockMapper stockMapper;
@@ -64,9 +74,9 @@
IUserPositionService iUserPositionService;
@Autowired
IUserBankService iUserBankService;
- @Autowired
+ @Resource
AgentUserMapper agentUserMapper;
- @Autowired
+ @Resource
SiteTaskLogMapper siteTaskLogMapper;
@Autowired
IStockOptionService iStockOptionService;
@@ -84,6 +94,10 @@
ISiteIndexSettingService iSiteIndexSettingService;
@Autowired
StockPoll stockPoll;
+
+
+ @Resource
+ UserPositionMapper userPositionMapper;
@Resource
SiteAmtTransLogMapper siteAmtTransLogMapper;
@Autowired
@@ -92,12 +106,11 @@
ISiteFuturesSettingService iSiteFuturesSettingService;
@Autowired
IStockFuturesService iStockFuturesService;
- @Resource
- StockFuturesMapper stockFuturesMapper;
- @Resource
- StockIndexMapper stockIndexMapper;
+
@Autowired
ISiteMessageService iSiteMessageService;
+
+
public ServerResponse reg(String yzmCode, String agentCode, String phone, String userPwd, HttpServletRequest request) {
if (StringUtils.isBlank(agentCode) || StringUtils.isBlank(phone) ||
@@ -149,19 +162,6 @@
user.setIsLogin(Integer.valueOf(0));
- user.setUserAmt(new BigDecimal("0"));
- user.setEnableAmt(new BigDecimal("0"));
-
- user.setUserIndexAmt(new BigDecimal("0"));
- user.setEnableIndexAmt(new BigDecimal("0"));
-
- user.setUserFutAmt(new BigDecimal("0"));
- user.setEnableFutAmt(new BigDecimal("0"));
-
- user.setSumBuyAmt(new BigDecimal("0"));
- user.setSumChargeAmt(new BigDecimal("0"));
- user.setDjzj(new BigDecimal("0"));
-
int insertCount = this.userMapper.insert(user);
if (insertCount > 0) {
@@ -185,6 +185,7 @@
log.info("用户{}登陆成功, 登陆状态{} ,交易状态{}", new Object[]{user.getId(), user.getIsLogin(), user.getIsLock()});
+ userAssetsServices.assetsByTypeAndUserId(EStockType.HG.getCode(),user.getId());
this.iSiteLoginLogService.saveLog(user, request);
return ServerResponse.createBySuccess(user);
}
@@ -217,7 +218,7 @@
if (user == null) {
return null;
} else {
- return this.userMapper.selectByPrimaryKey(user.getId());
+ return this.userMapper.selectById(user.getId());
}
}
@@ -297,7 +298,7 @@
String loginToken = request.getHeader(cookie_name);
String userJson = RedisShardedPoolUtils.get(loginToken);
User user = (User) JsonUtil.string2Obj(userJson, User.class);
- User dbuser = this.userMapper.selectByPrimaryKey(user.getId());
+ User dbuser = this.userMapper.selectById(user.getId());
SiteSetting siteSetting = iSiteSettingService.getSiteSetting();
UserInfoVO userInfoVO = assembleUserInfoVO(dbuser, siteSetting);
return ServerResponse.createBySuccess(userInfoVO);
@@ -319,7 +320,7 @@
}
user.setUserPwd(SymmetricCryptoUtil.encryptPassword(newPwd));
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccessMsg("Modified successfully");
}
@@ -358,7 +359,7 @@
}
user.setUserPwd(SymmetricCryptoUtil.encryptPassword(newPwd));
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccess("Password changed successfully!");
}
@@ -367,10 +368,6 @@
public ServerResponse update(User user) {
- log.info("#####修改用户信息####,用户总资金 = {} 可用资金 = {}", user
- .getUserAmt(), user.getEnableAmt());
- log.info("#####修改用户信息####,用户index总资金 = {} index可用资金 = {}", user
- .getUserIndexAmt(), user.getEnableIndexAmt());
if (user.getAgentId() != null) {
AgentUser agentUser = this.agentUserMapper.selectByPrimaryKey(user.getAgentId());
if (agentUser != null) {
@@ -380,7 +377,7 @@
if (user.getUserPwd() != null && !user.getUserPwd().equals("")) {
user.setUserPwd(SymmetricCryptoUtil.encryptPassword(user.getUserPwd()));
}
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccessMsg("Modified successfully");
}
@@ -411,10 +408,8 @@
user.setIsActive(Integer.valueOf(1));
- log.info("##### 用户认证 ####,用户总资金 = {} 可用资金 = {}", user
- .getUserAmt(), user.getEnableAmt());
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccessMsg("Real name authentication");
}
@@ -440,37 +435,142 @@
BigDecimal exranRate = iSiteSettingService.getSiteSetting().getExchangeRate();
if (type == 1) {
- if (user.getUserIndexAmt().compareTo(new BigDecimal(amt)) == -1) {
- return ServerResponse.createByErrorMsg("US available in the financing account");
- }
- userIndexAmt = user.getUserAmt().subtract(new BigDecimal(amt));
- enableIndexAmt = user.getEnableAmt().subtract(new BigDecimal(amt));
BigDecimal usdt = new BigDecimal(amt).multiply(exranRate).setScale(2, RoundingMode.UP);
- userAmt = user.getUserIndexAmt().add(usdt);
- enableAmt = user.getEnableIndexAmt().add(usdt);
} else if (2 == type) {
- if (user.getEnableAmt().compareTo(new BigDecimal(amt)) == -1) {
- return ServerResponse.createByErrorMsg("US available in the financing account");
- }
- userAmt = user.getUserAmt().subtract(new BigDecimal(amt));
- enableAmt = user.getEnableAmt().subtract(new BigDecimal(amt));
BigDecimal usdt = new BigDecimal(amt).divide(exranRate).setScale(2, RoundingMode.UP);
- userIndexAmt = user.getUserIndexAmt().add(usdt);
- enableIndexAmt = user.getEnableIndexAmt().add(usdt);
}
- user.setUserAmt(userAmt);
- user.setEnableAmt(enableAmt);
- user.setUserIndexAmt(userIndexAmt);
- user.setEnableIndexAmt(enableIndexAmt);
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
saveAmtTransLog(user, type, amt);
return ServerResponse.createBySuccessMsg("Transfer successful");
}
return ServerResponse.createByErrorMsg("Transfer failure");
+ }
+
+ @Override
+ public ServerResponse getMoney(HttpServletRequest request) {
+
+ BigDecimal exchangeRate = iSiteSettingService.getSiteSetting().getExchangeRate();
+ List<UserAssets> userAssetsList = userAssetsServices.assetsByUserId(getCurrentUser(request).getId());
+ List<RUserAssets> rUserAssetsList = new ArrayList<>();
+
+ /**
+ * 浮动盈亏
+ * */
+ BigDecimal AllProfitAndLose = BigDecimal.ZERO;
+ /**
+ * 总资产
+ * */
+ BigDecimal allTotalAssets = BigDecimal.ZERO;
+ /**
+ * 总可用余额
+ * */
+ BigDecimal allAmt = BigDecimal.ZERO;
+ /**
+ * 累计盈亏
+ * */
+ BigDecimal AllHProfitAndLose = BigDecimal.ZERO;
+ /**
+ * 总冻结资产
+ * */
+ BigDecimal allFreeMoney = BigDecimal.ZERO;
+ /**
+ * 总手续费
+ * */
+ BigDecimal allHMoney = BigDecimal.ZERO;
+
+ for (int i = 0; i <userAssetsList.size() ; i++) {
+ RUserAssets rUserAssets = new RUserAssets();
+ UserAssets userAssets = userAssetsList.get(i);
+ // 浮动盈亏
+ BigDecimal profitAndLose = userAssets.getProfitAndLoss();
+ BigDecimal amt = userAssets.getAvailableBalance();
+ BigDecimal totalAssets = userAssets.getAvailableBalance().add(userAssets.getFreezeMoney());
+ BigDecimal freeMoney = userAssets.getFreezeMoney();
+ BigDecimal hMoney = userAssets.getHandlingCharge();
+ BigDecimal hProfitAndLose = userAssets.getCumulativeProfitAndLoss();
+
+ rUserAssets.setTotalMoney((totalAssets.setScale(2).toString()));
+ rUserAssets.setAccectType(userAssets.getAccectType());
+ rUserAssets.setAvailableBalance(amt.setScale(2).toString());
+ rUserAssets.setFreezeMoney(freeMoney.setScale(2).toString());
+ rUserAssets.setCumulativeProfitAndLoss(hProfitAndLose.setScale(2).toString());
+ rUserAssets.setHandlingCharge(hMoney.setScale(2).toString());
+ rUserAssets.setProfitAndLoss(profitAndLose.setScale(2).toString());
+ if(userAssets.getAccectType().equals("US")){
+ rUserAssets.setSymbol("$");
+ rUserAssets.setSymbolCode("USD");
+ AllProfitAndLose = AllProfitAndLose.add(profitAndLose);
+ allTotalAssets = allTotalAssets.add(totalAssets);
+ allAmt = allAmt.add(amt);
+ AllHProfitAndLose = AllHProfitAndLose.add(hProfitAndLose);
+ allFreeMoney = allFreeMoney.add(freeMoney);
+ allHMoney = allHMoney.add(hMoney);
+ rUserAssets.setAvailableBalanceUSD(rUserAssets.getAvailableBalance());
+ rUserAssets.setFreezeMoneyUSD(rUserAssets.getFreezeMoney());
+ rUserAssets.setTotalMoneyUSD(rUserAssets.getTotalMoney());
+ rUserAssets.setCumulativeProfitAndLossUSD(hProfitAndLose.setScale(2).toString());
+ rUserAssets.setHandlingChargeUSD(hMoney.setScale(2).toString());
+ rUserAssets.setProfitAndLossUSD(hProfitAndLose.setScale(2).toString());
+
+ }else{
+ rUserAssets.setAvailableBalanceUSD(userAssets.getAvailableBalance().divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+ rUserAssets.setFreezeMoneyUSD(userAssets.getFreezeMoney().divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+ rUserAssets.setTotalMoneyUSD(userAssets.getTotleAssets().divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+ rUserAssets.setSymbol("RM");
+ rUserAssets.setSymbolCode("MYR");
+ rUserAssets.setCumulativeProfitAndLossUSD(hProfitAndLose.divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+ rUserAssets.setHandlingChargeUSD(hMoney.divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+ rUserAssets.setProfitAndLossUSD(hProfitAndLose.divide(exchangeRate,BigDecimal.ROUND_CEILING).toString());
+
+ AllProfitAndLose = AllProfitAndLose.add(profitAndLose.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ allTotalAssets = allTotalAssets.add(totalAssets.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ allAmt = allAmt.add(amt.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ AllHProfitAndLose = AllHProfitAndLose.add(hProfitAndLose.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ allFreeMoney = allFreeMoney.add(freeMoney.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ allHMoney = allHMoney.add(hMoney.divide(exchangeRate,BigDecimal.ROUND_CEILING));
+ }
+ rUserAssetsList.add(rUserAssets);
+ }
+
+
+
+ RUserAssets rUserAssets = new RUserAssets();
+ rUserAssets.setAccectType("ALL");
+ rUserAssets.setProfitAndLoss(AllProfitAndLose.setScale(2).toString());
+ rUserAssets.setProfitAndLossUSD(AllProfitAndLose.setScale(2).toString());
+ rUserAssets.setHandlingCharge(allHMoney.setScale(2).toString());
+ rUserAssets.setHandlingChargeUSD(allHMoney.setScale(2).toString());
+ rUserAssets.setCumulativeProfitAndLoss(AllHProfitAndLose.setScale(2).toString());
+ rUserAssets.setCumulativeProfitAndLossUSD(AllHProfitAndLose.setScale(2).toString());
+ rUserAssets.setTotalMoney(allTotalAssets.setScale(2).toString());
+ rUserAssets.setTotalMoneyUSD(allTotalAssets.setScale(2).toString());
+ rUserAssets.setAvailableBalance(allAmt.setScale(2).toString());
+ rUserAssets.setAvailableBalanceUSD(allAmt.setScale(2).toString());
+ rUserAssets.setFreezeMoney(allFreeMoney.setScale(2).toString());
+ rUserAssets.setFreezeMoneyUSD(allFreeMoney.setScale(2).toString());
+ rUserAssets.setSymbol("$");
+ rUserAssets.setSymbolCode("USD");
+ rUserAssetsList.add(rUserAssets);
+
+ return ServerResponse.createBySuccess(rUserAssetsList);
+ }
+
+ @Override
+ public ServerResponse transfer(String fromType, String toType, String amt,HttpServletRequest paramHttpServletRequest) {
+
+ User user = userService.getCurrentUser(paramHttpServletRequest);
+ UserAssets formAssets = userAssetsServices.assetsByTypeAndUserId(fromType,user.getId());
+ BigDecimal amtBig = new BigDecimal(amt);
+ if(formAssets.getAvailableBalance().compareTo(amtBig)<0){
+ return ServerResponse.createByErrorMsg("Insufficient amount");
+ }
+ userAssetsServices.availablebalanceChange(fromType,user.getId(), EUserAssets.TRANSFER,amtBig.negate(),"","");
+ userAssetsServices.availablebalanceChange(toType,user.getId(),EUserAssets.TRANSFER,amtBig,"","");
+ return ServerResponse.createBySuccess();
}
@@ -504,614 +604,44 @@
public void ForceSellTask() {
- List<Integer> userIdList = this.iUserPositionService.findDistinctUserIdList();
- log.info("当前有持仓单的用户数量 为 {}", Integer.valueOf(userIdList.size()));
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
-
- List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(userId);
-
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user.getRealName(), Integer.valueOf(userPositions.size())});
-
-
- BigDecimal enable_user_amt = user.getEnableAmt();
-
-
- BigDecimal all_freez_amt = new BigDecimal("0");
- for (UserPosition position : userPositions) {
-
- BigDecimal actual_amt = position.getOrderTotalPrice().divide(new BigDecimal(position
- .getOrderLever().intValue()), 2, 4);
-
-
- all_freez_amt = all_freez_amt.add(actual_amt);
- }
-
-
- BigDecimal all_profit_and_lose = new BigDecimal("0");
- PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(userId);
- all_profit_and_lose = positionVO.getAllProfitAndLose();
- SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
- BigDecimal force_stop_percent = siteSetting.getForceStopPercent();
- BigDecimal force_stop_amt = enable_user_amt.add(all_freez_amt);
-
- //(沪深)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.8
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
-
- boolean isProfit = false;
-
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
- if (isProfit) {
- log.info("强制平仓该用户所有的持仓单");
-
- int[] arrs = new int[userPositions.size()];
- for (int k = 0; k < userPositions.size(); k++) {
- UserPosition position = (UserPosition) userPositions.get(k);
- arrs[k] = position.getId().intValue();
- try {
- if (!DateTimeUtil.sameDate(DateTimeUtil.getCurrentDate(), position.getBuyOrderTime())) {
- this.iUserPositionService.sell(position.getPositionSn(), 0);
- }
-
- } catch (Exception e) {
- log.error("[盈亏达到最大亏损]强制平仓失败...");
- }
- }
-
-
- SiteTaskLog siteTaskLog = new SiteTaskLog();
- siteTaskLog.setTaskType("强平任务-股票持仓");
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平[两融盈亏达到最大亏损] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏" + all_profit_and_lose + ", 强平线:" + user_force_amt;
-
-
- siteTaskLog.setTaskCnt(taskcnt);
- String tasktarget = "此次强平" + userPositions.size() + "条股票持仓订单, 订单号为" + Arrays.toString(arrs);
- siteTaskLog.setTaskTarget(tasktarget);
- siteTaskLog.setAddTime(new Date());
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
- siteTaskLog.setErrorMsg("");
- int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
- if (insertTaskCount > 0) {
- log.info("[盈亏达到最大亏损]保存强制平仓task任务成功");
- } else {
- log.info("[盈亏达到最大亏损]保存强制平仓task任务失败");
- }
- } else {
- log.info("用户未达到强制平仓线,不做强平处理...");
- }
-
- log.info("=====================");
- }
}
- /*用户持仓单-单支股票盈亏-强平定时*/
+ @Override
public void ForceSellOneStockTask() {
- List<Integer> userIdList = this.iUserPositionService.findDistinctUserIdList();
- log.info("当前有持仓单的用户数量 为 {}", Integer.valueOf(userIdList.size()));
- SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
- BigDecimal force_stop_percent = siteSetting.getForceStopPercent();
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
- List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(userId);
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user.getRealName(), Integer.valueOf(userPositions.size())});
- BigDecimal enable_user_amt = user.getEnableAmt();
- BigDecimal all_freez_amt = new BigDecimal("0");
- for (UserPosition position : userPositions) {
- PositionProfitVO positionProfitVO = iUserPositionService.getPositionProfitVO(position);
-
- //(沪深)单支股票强制平仓线 = (下单总金额 / 杠杆 + 追加保证金) * 0.8
- BigDecimal user_force_amt = position.getOrderTotalPrice().divide(new BigDecimal(position.getOrderLever())).add(position.getMarginAdd()).multiply(force_stop_percent);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
- /*if("1601344387923698".equals( position.getPositionSn())){
- log.info("test = {}", position.getPositionSn());
- }*/
- boolean isProfit = false;
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (positionProfitVO.getAllProfitAndLose().compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(positionProfitVO.getAllProfitAndLose()) > -1);
- if (isProfit && !DateTimeUtil.sameDate(DateTimeUtil.getCurrentDate(), position.getBuyOrderTime())) {
- try {
- this.iUserPositionService.sell(position.getPositionSn(), 0);
- SiteTaskLog siteTaskLog = new SiteTaskLog();
- siteTaskLog.setTaskType("单股强平任务-股票持仓");
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平[两融盈亏达到最大亏损] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏" + positionProfitVO.getAllProfitAndLose() + ", 强平线:" + user_force_amt;
- siteTaskLog.setTaskCnt(taskcnt);
- String tasktarget = "此次强平订单号为:" + position.getPositionSn();
- siteTaskLog.setTaskTarget(tasktarget);
- siteTaskLog.setAddTime(new Date());
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
- siteTaskLog.setErrorMsg("");
- int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
- if (insertTaskCount > 0) {
- log.info("[盈亏达到最大亏损]保存强制平仓task任务成功");
- } else {
- log.info("[盈亏达到最大亏损]保存强制平仓task任务失败");
- }
- } catch (Exception e) {
- log.error("[盈亏达到最大亏损]强制平仓失败...");
- }
- }
-
- }
- log.info("=====================");
- }
}
- /*用户持仓单-单支股票/止损止盈-强平定时*/
+ @Override
public void ForceSellOneStockTaskV2() {
- List<Integer> userIdList = this.iUserPositionService.findDistinctUserIdList();
- log.info("当前有持仓单的用户数量 为 {}", Integer.valueOf(userIdList.size()));
- SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
- BigDecimal force_stop_percent = siteSetting.getForceStopPercent();
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
- List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(userId);
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user.getRealName(), Integer.valueOf(userPositions.size())});
- BigDecimal enable_user_amt = user.getEnableAmt();
- BigDecimal all_freez_amt = new BigDecimal("0");
- for (UserPosition position : userPositions) {
- StockListVO stockListVO = new StockListVO();
- if (position.getStockGid().contains("hk")) {
- String hk = RedisShardedPoolUtils.get(position.getStockGid(), 1);
- stockListVO = StockApi.otherStockListVO(hk);
- } else if (position.getStockGid().contains("us")) {
- String us = RedisShardedPoolUtils.get(position.getStockGid(), 2);
- stockListVO = StockApi.otherStockListVO(us);
- } else {
- Stock stock = stockMapper.selectOne(new QueryWrapper<Stock>().eq("stock_code", position.getStockCode()));
- stockListVO = StockApi.getStockRealTime(stock);
- }
- if (stockListVO == null) {
- continue;
- }
- if (position.getProfitTargetPrice() != null && position.getProfitTargetPrice().compareTo(new BigDecimal(stockListVO.getNowPrice())) <= 0 || position.getStopTargetPrice() != null && position.getStopTargetPrice().compareTo(new BigDecimal(stockListVO.getNowPrice())) >= 0) {
- try {
- this.iUserPositionService.sell(position.getPositionSn(), 0);
- SiteTaskLog siteTaskLog = new SiteTaskLog();
- siteTaskLog.setTaskType("单股止盈止损强平任务-股票持仓");
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平[达到目标盈亏] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ",现价" + stockListVO.getNowPrice() + ", 目标止盈价格:" + position.getProfitTargetPrice() + ", 目标止损价格:" + position.getStopTargetPrice();
- siteTaskLog.setTaskCnt(taskcnt);
- String tasktarget = "此次强平订单号为:" + position.getPositionSn();
- siteTaskLog.setTaskTarget(tasktarget);
- siteTaskLog.setAddTime(new Date());
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
- siteTaskLog.setErrorMsg("");
- int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
- if (insertTaskCount > 0) {
- log.info("[盈利达到目标盈利]保存强制平仓task任务成功");
- } else {
- log.info("[盈利达到目标盈利]保存强制平仓task任务失败");
- }
- } catch (Exception e) {
- log.error("[盈利达到目标盈利]强制平仓失败...");
- }
-
- }
-
- }
- log.info("=========止盈止损定时任务============");
- }
}
- /*用户股票持仓单-强平提醒推送消息定时*/
+ @Override
public void ForceSellMessageTask() {
- List<Integer> userIdList = this.iUserPositionService.findDistinctUserIdList();
- log.info("当前有持仓单的用户数量 为 {}", Integer.valueOf(userIdList.size()));
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
-
- List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(userId);
-
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user.getRealName(), Integer.valueOf(userPositions.size())});
-
-
- BigDecimal enable_user_amt = user.getEnableAmt();
-
-
- BigDecimal all_freez_amt = new BigDecimal("0");
- for (UserPosition position : userPositions) {
-
- BigDecimal actual_amt = position.getOrderTotalPrice().divide(new BigDecimal(position
- .getOrderLever().intValue()), 2, 4);
-
-
- all_freez_amt = all_freez_amt.add(actual_amt);
- }
-
-
- BigDecimal all_profit_and_lose = new BigDecimal("0");
- PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(userId);
- all_profit_and_lose = positionVO.getAllProfitAndLose();
- SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
- BigDecimal force_stop_percent = siteSetting.getForceStopRemindRatio();
- /*BigDecimal force_stop_amt = force_stop_percent.multiply(all_freez_amt);
- BigDecimal user_force_amt = enable_user_amt.add(force_stop_amt);
- boolean isProfit = false;
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) == -1 && user_force_amt.compareTo(all_profit_and_lose.negate()) != 1);
- */
- BigDecimal force_stop_amt = enable_user_amt.add(all_freez_amt);
-
- //(沪深)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.8
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
-
- boolean isProfit = false;
-
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
- if (isProfit) {
- log.info("强制平仓该用户所有的持仓单");
- int count = iSiteMessageService.getIsDayCount(userId, "股票预警");
- if (count == 0) {
- //给达到消息强平提醒用户推送消息
- SiteMessage siteMessage = new SiteMessage();
- siteMessage.setUserId(userId);
- siteMessage.setUserName(user.getRealName());
- siteMessage.setTypeName("股票预警");
- siteMessage.setStatus(1);
- siteMessage.setContent("【股票预警】提醒您,用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏" + all_profit_and_lose + ", 提醒线:" + user_force_amt + ",请及时关注哦。");
- siteMessage.setAddTime(DateTimeUtil.getCurrentDate());
- iSiteMessageService.insert(siteMessage);
- }
-
- } else {
- log.info("用户未达到强制平仓线,不做强平处理...");
- }
-
- log.info("=====================");
- }
}
-
+ @Override
public void ForceSellIndexTask() {
- List<Integer> userIdList = this.iUserIndexPositionService.findDistinctUserIdList();
- log.info("当前有 指数持仓 的用户数量 为 {}", Integer.valueOf(userIdList.size()));
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
-
- List<UserIndexPosition> userIndexPositions = this.iUserIndexPositionService.findIndexPositionByUserIdAndSellPriceIsNull(userId);
-
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user
- .getRealName(), Integer.valueOf(userIndexPositions.size())});
-
-
- IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(userId);
-
-
- BigDecimal enable_index_amt = user.getEnableIndexAmt();
-
-
- BigDecimal all_freez_amt = indexPositionVO.getAllIndexFreezAmt();
-
- BigDecimal all_profit_and_lose = indexPositionVO.getAllIndexProfitAndLose();
-
- log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", new Object[]{userId, enable_index_amt, all_freez_amt, all_profit_and_lose});
-
-
- SiteIndexSetting siteIndexSetting = this.iSiteIndexSettingService.getSiteIndexSetting();
- BigDecimal force_stop_percent = siteIndexSetting.getForceSellPercent();
- BigDecimal force_stop_amt = enable_index_amt.add(all_freez_amt);
-
- //(指数)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.8
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
- boolean isProfit = false;
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
-
- if (isProfit) {
- log.info("强制平仓该用户所有的指数持仓单");
-
- int[] arrs = new int[userIndexPositions.size()];
- for (int k = 0; k < userIndexPositions.size(); k++) {
- UserIndexPosition userIndexPosition = (UserIndexPosition) userIndexPositions.get(k);
- arrs[k] = userIndexPosition.getId().intValue();
- try {
- this.iUserIndexPositionService.sellIndex(userIndexPosition.getPositionSn(), 0);
- } catch (Exception e) {
- log.error("[盈亏达到最大亏损]强制平仓指数失败...");
- }
- }
-
-
- SiteTaskLog siteTaskLog = new SiteTaskLog();
- siteTaskLog.setTaskType("强平任务-指数持仓");
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平 [指数盈亏达到最大亏损] 用户 id = " + user.getId() + ", 可用资金 = " + enable_index_amt + ", 冻结资金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏 = " + all_profit_and_lose + ", 强平线 = " + user_force_amt;
-
-
- siteTaskLog.setTaskCnt(taskcnt);
-
- String tasktarget = "此次强平" + userIndexPositions.size() + "条指数持仓订单, 订单号为" + Arrays.toString(arrs);
- siteTaskLog.setTaskTarget(tasktarget);
- siteTaskLog.setAddTime(new Date());
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
- siteTaskLog.setErrorMsg("");
- int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
- if (insertTaskCount > 0) {
- log.info("[盈亏达到最大亏损] 保存强制平仓 指数 task任务成功");
- } else {
- log.info("[盈亏达到最大亏损] 保存强制平仓 指数 task任务失败");
- }
- } else {
- log.info("用户指数持仓未达到强制平仓线, 不做强平处理...");
- }
-
- log.info("=====================");
- }
}
- /*指数强平提醒推送消息,每分钟检测一次*/
+ @Override
public void ForceSellIndexsMessageTask() {
- List<Integer> userIdList = this.iUserIndexPositionService.findDistinctUserIdList();
- log.info("当前有 指数持仓 的用户数量 为 {}", Integer.valueOf(userIdList.size()));
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("=====================");
- Integer userId = (Integer) userIdList.get(i);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
-
- List<UserIndexPosition> userIndexPositions = this.iUserIndexPositionService.findIndexPositionByUserIdAndSellPriceIsNull(userId);
-
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[]{userId, user
- .getRealName(), Integer.valueOf(userIndexPositions.size())});
-
-
- IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(userId);
-
-
- BigDecimal enable_index_amt = user.getEnableIndexAmt();
-
-
- BigDecimal all_freez_amt = indexPositionVO.getAllIndexFreezAmt();
-
- BigDecimal all_profit_and_lose = indexPositionVO.getAllIndexProfitAndLose();
-
- log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", new Object[]{userId, enable_index_amt, all_freez_amt, all_profit_and_lose});
-
-
- SiteIndexSetting siteIndexSetting = this.iSiteIndexSettingService.getSiteIndexSetting();
- BigDecimal force_stop_percent = siteIndexSetting.getForceStopRemindRatio();
- BigDecimal force_stop_amt = enable_index_amt.add(all_freez_amt);
-
- //(指数)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.8
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
- boolean isProfit = false;
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
-
- if (isProfit) {
- log.info("强制平仓该用户所有的指数持仓单");
-
- int count = iSiteMessageService.getIsDayCount(userId, "指数预警");
- if (count == 0) {
- //给达到消息强平提醒用户推送消息
- SiteMessage siteMessage = new SiteMessage();
- siteMessage.setUserId(userId);
- siteMessage.setUserName(user.getRealName());
- siteMessage.setTypeName("指数预警");
- siteMessage.setStatus(1);
- siteMessage.setContent("【指数预警】提醒您,用户id = " + user.getId() + ", 可用资金 = " + enable_index_amt + ", 冻结资金 = " + all_freez_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏 = " + all_profit_and_lose + ", 提醒线 = " + user_force_amt + ",请及时关注哦。");
- siteMessage.setAddTime(DateTimeUtil.getCurrentDate());
- iSiteMessageService.insert(siteMessage);
- }
-
- } else {
- log.info("用户指数持仓未达到强制平仓线, 不做强平处理...");
- }
-
- log.info("=====================");
- }
}
-// public void qh1() {
-// this.stockPoll.qh1();
-// }
-//
-// public void zs1() {
-// this.stockPoll.zs1();
-// }
-
+ @Override
public void ForceSellFuturesTask() {
- List<Integer> userIdList = this.iUserFuturesPositionService.findDistinctUserIdList();
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("===================== \n");
- Integer userId = (Integer) userIdList.get(i);
- System.out.println("userId" + userId);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
- List<UserFuturesPosition> userFuturesPositions = this.iUserFuturesPositionService.findFuturesPositionByUserIdAndSellPriceIsNull(userId);
- System.out.println("userFuturesPositions" + userFuturesPositions);
- System.out.println("继续");
- log.info("用户id = {} 姓名 = {} 期货持仓中订单数 {}", new Object[]{userId, user
- .getRealName(), Integer.valueOf(userFuturesPositions.size())});
-
- FuturesPositionVO futuresPositionVO = this.iUserFuturesPositionService.findUserFuturesPositionAllProfitAndLose(userId);
-
- BigDecimal enable_Futures_amt = user.getEnableFutAmt();
-
- BigDecimal all_deposit_amt = futuresPositionVO.getAllFuturesDepositAmt();
-
- BigDecimal all_profit_and_lose = futuresPositionVO.getAllFuturesProfitAndLose();
-
- log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", new Object[]{userId, enable_Futures_amt, all_deposit_amt, all_profit_and_lose});
-
-
- SiteFuturesSetting siteFuturesSetting = this.iSiteFuturesSettingService.getSetting();
- BigDecimal force_stop_percent = siteFuturesSetting.getForceSellPercent();
- BigDecimal force_stop_amt = enable_Futures_amt.add(all_deposit_amt);
-
- //(期货)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.8
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户强制平仓线金额 = {}", user_force_amt);
-
- boolean isProfit = false;
-
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
-
- if (isProfit) {
- log.info("强制平仓用户 {} 所有的 期货 持仓单", user.getId());
-
- int[] arrs = new int[userFuturesPositions.size()];
- for (int k = 0; k < userFuturesPositions.size(); k++) {
- UserFuturesPosition userFuturesPosition = (UserFuturesPosition) userFuturesPositions.get(k);
- arrs[k] = userFuturesPosition.getId().intValue();
- try {
- this.iUserFuturesPositionService.sellFutures(userFuturesPosition.getPositionSn(), 0);
- } catch (Exception e) {
- log.error("[盈亏达到最大亏损] 强制平仓 期货 失败...");
- }
- }
-
- SiteTaskLog siteTaskLog = new SiteTaskLog();
- siteTaskLog.setTaskType("强平任务-期货持仓");
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
- String taskcnt = accountType + "-" + user.getRealName() + "被强平[期货盈亏达到最大亏损]用户id = " + user.getId() + ", 可用资金 = " + enable_Futures_amt + ", 冻结保证金 = " + all_deposit_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏" + all_profit_and_lose + ", 强平线:" + user_force_amt;
-
-
- siteTaskLog.setTaskCnt(taskcnt);
-
- String tasktarget = "此次强平" + userFuturesPositions.size() + "条期货持仓订单, 订单号为" + Arrays.toString(arrs);
- siteTaskLog.setTaskTarget(tasktarget);
- siteTaskLog.setAddTime(new Date());
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
- siteTaskLog.setErrorMsg("");
- int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
- if (insertTaskCount > 0) {
- log.info("[盈亏达到最大亏损]保存强制平仓 期货 task任务成功");
- } else {
- log.info("[盈亏达到最大亏损]保存强制平仓 期货 task任务失败");
- }
- } else {
- log.info("用户期货;持仓未达到强制平仓线,不做强平处理...");
- }
- log.info("===================== \n");
- }
}
+ @Override
public void ForceSellFuturesMessageTask() {
- List<Integer> userIdList = this.iUserFuturesPositionService.findDistinctUserIdList();
-
- for (int i = 0; i < userIdList.size(); i++) {
- log.info("===================== \n");
- Integer userId = (Integer) userIdList.get(i);
- System.out.println("userId" + userId);
- User user = this.userMapper.selectByPrimaryKey(userId);
- if (user == null) {
- continue;
- }
-
- List<UserFuturesPosition> userFuturesPositions = this.iUserFuturesPositionService.findFuturesPositionByUserIdAndSellPriceIsNull(userId);
- System.out.println("userFuturesPositions" + userFuturesPositions);
- System.out.println("继续");
- log.info("用户id = {} 姓名 = {} 期货持仓中订单数 {}", new Object[]{userId, user
- .getRealName(), Integer.valueOf(userFuturesPositions.size())});
-
- FuturesPositionVO futuresPositionVO = this.iUserFuturesPositionService.findUserFuturesPositionAllProfitAndLose(userId);
-
- BigDecimal enable_Futures_amt = user.getEnableFutAmt();
-
- BigDecimal all_deposit_amt = futuresPositionVO.getAllFuturesDepositAmt();
-
- BigDecimal all_profit_and_lose = futuresPositionVO.getAllFuturesProfitAndLose();
-
- log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", new Object[]{userId, enable_Futures_amt, all_deposit_amt, all_profit_and_lose});
-
- SiteFuturesSetting siteFuturesSetting = this.iSiteFuturesSettingService.getSetting();
- BigDecimal force_stop_percent = siteFuturesSetting.getForceStopRemindRatio();
- BigDecimal force_stop_amt = enable_Futures_amt.add(all_deposit_amt);
-
- //(期货)强制平仓线 = (账户可用资金 + 冻结保证金) * 0.4
- BigDecimal user_force_amt = force_stop_percent.multiply(force_stop_amt);
- BigDecimal fu_user_force_amt = user_force_amt.negate(); //负平仓线
- log.info("用户消息强制平仓线金额 = {}", user_force_amt);
-
- boolean isProfit = false;
-
- //总盈亏<=0 并且 强制负平仓线>=总盈亏
- isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) < 1 && fu_user_force_amt.compareTo(all_profit_and_lose) > -1);
-
- if (isProfit) {
- log.info("强制平仓用户 {} 所有的 期货 持仓单", user.getId());
- int count = iSiteMessageService.getIsDayCount(userId, "期货预警");
- if (count == 0) {
- //给达到消息强平提醒用户推送消息
- SiteMessage siteMessage = new SiteMessage();
- siteMessage.setUserId(userId);
- siteMessage.setUserName(user.getRealName());
- siteMessage.setTypeName("期货预警");
- siteMessage.setStatus(1);
- siteMessage.setContent("【期货预警】提醒您,用户id = " + user.getId() + ", 可用资金 = " + enable_Futures_amt + ", 冻结保证金 = " + all_deposit_amt + ", 强平比例 = " + force_stop_percent + ", 总盈亏" + all_profit_and_lose + ", 提醒线:" + user_force_amt + ",请及时关注哦。");
- siteMessage.setAddTime(DateTimeUtil.getCurrentDate());
- iSiteMessageService.insert(siteMessage);
- }
-
-
- } else {
- log.info("用户期货;持仓未达到强制平仓线,不做强平处理...");
- }
- log.info("===================== \n");
- }
}
+
@Override
public void qh1() {
@@ -1183,11 +713,6 @@
User user = new User();
user.setAccountType(accountType);
user.setPhone(phone);
- user.setUserPwd(SymmetricCryptoUtil.encryptPassword(pwd));
- user.setUserAmt(new BigDecimal(amt));
- user.setEnableAmt(new BigDecimal(amt));
- user.setSumChargeAmt(new BigDecimal("0"));
- user.setSumBuyAmt(new BigDecimal("0"));
user.setIsLock(Integer.valueOf(0));
user.setIsLogin(Integer.valueOf(0));
user.setIsActive(Integer.valueOf(0));
@@ -1197,10 +722,6 @@
user.setNickName("模拟用户");
}
- user.setUserIndexAmt(new BigDecimal("0"));
- user.setEnableIndexAmt(new BigDecimal("0"));
- user.setUserFutAmt(new BigDecimal("0"));
- user.setEnableFutAmt(new BigDecimal("0"));
if (agentId != null) {
AgentUser agentUser = this.agentUserMapper.selectByPrimaryKey(agentId);
@@ -1228,12 +749,12 @@
public ServerResponse findByUserId(Integer userId) {
- return ServerResponse.createBySuccess(this.userMapper.selectByPrimaryKey(userId));
+ return ServerResponse.createBySuccess(this.userMapper.selectById(userId));
}
public ServerResponse updateLock(Integer userId) {
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
return ServerResponse.createByErrorMsg("User does not exist");
}
@@ -1244,7 +765,7 @@
user.setIsLock(Integer.valueOf(1));
}
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccess("Modified successfully");
}
@@ -1258,38 +779,11 @@
return ServerResponse.createByErrorMsg("The parameter cannot be null");
}
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
return ServerResponse.createByErrorMsg("User does not exist");
}
-
- BigDecimal user_amt = user.getUserAmt();
- BigDecimal user_enable = user.getEnableAmt();
-
- BigDecimal user_amt_back = new BigDecimal("0");
- BigDecimal user_enable_back = new BigDecimal("0");
- if (direction.intValue() == 0) {
- user_amt_back = user_amt.add(new BigDecimal(amt));
- user_enable_back = user_enable.add(new BigDecimal(amt));
- } else if (direction.intValue() == 1) {
-
- if (user_amt.compareTo(new BigDecimal(amt)) == -1) {
- return ServerResponse.createByErrorMsg("The deduction failed and the total funds were insufficient");
- }
- if (user_enable.compareTo(new BigDecimal(amt)) == -1) {
- return ServerResponse.createByErrorMsg("Deduction failed, insufficient available funds");
- }
-
- user_amt_back = user_amt.subtract(new BigDecimal(amt));
- user_enable_back = user_enable.subtract(new BigDecimal(amt));
- } else {
- return ServerResponse.createByErrorMsg("This operation does not exist");
- }
-
-
- user.setUserAmt(user_amt_back);
- user.setEnableAmt(user_enable_back);
- this.userMapper.updateByPrimaryKeySelective(user);
+ this.userMapper.updateById(user);
SiteTaskLog siteTaskLog = new SiteTaskLog();
@@ -1301,9 +795,6 @@
siteTaskLog.setTaskCnt(cnt.toString());
StringBuffer target = new StringBuffer();
- target.append("用户id : ").append(user.getId())
- .append("修改前 总资金 = ").append(user_amt).append(" 可用 = ").append(user_enable)
- .append("修改后 总资金 = ").append(user_amt_back).append(" 可用 = ").append(user_enable_back);
siteTaskLog.setTaskTarget(target.toString());
siteTaskLog.setIsSuccess(Integer.valueOf(0));
@@ -1366,7 +857,7 @@
}
- int delUserCount = this.userMapper.deleteByPrimaryKey(userId);
+ int delUserCount = this.userMapper.deleteById(userId);
if (delUserCount > 0) {
return ServerResponse.createBySuccessMsg("Successful operation");
}
@@ -1394,7 +885,7 @@
return ServerResponse.createByErrorMsg("id and state cannot be empty");
}
- User user = this.userMapper.selectByPrimaryKey(userId);
+ User user = this.userMapper.selectById(userId);
if (user == null) {
return ServerResponse.createByErrorMsg("This user cannot be found");
}
@@ -1408,7 +899,7 @@
user.setIsActive(state);
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
return ServerResponse.createBySuccessMsg("Successful audit");
}
@@ -1464,14 +955,7 @@
agentUserListVO.setIsActive(user.getIsActive());
- agentUserListVO.setUserAmt(user.getUserAmt());
- agentUserListVO.setEnableAmt(user.getEnableAmt());
- agentUserListVO.setUserIndexAmt(user.getUserIndexAmt());
- agentUserListVO.setEnableIndexAmt(user.getEnableIndexAmt());
-
- agentUserListVO.setUserFuturesAmt(user.getUserFutAmt());
- agentUserListVO.setEnableFuturesAmt(user.getEnableFutAmt());
PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId());
@@ -1481,7 +965,6 @@
agentUserListVO.setAllFreezAmt(allFreezAmt);
BigDecimal forceLine = forcePercent.multiply(allFreezAmt);
- forceLine = forceLine.add(user.getEnableAmt());
agentUserListVO.setForceLine(forceLine);
@@ -1490,7 +973,7 @@
agentUserListVO.setAllIndexFreezAmt(indexPositionVO.getAllIndexFreezAmt());
BigDecimal indexForceLine = indexForcePercent.multiply(indexPositionVO.getAllIndexFreezAmt());
- indexForceLine = indexForceLine.add(user.getEnableIndexAmt());
+
agentUserListVO.setIndexForceLine(indexForceLine);
@@ -1499,7 +982,7 @@
agentUserListVO.setAllFuturesProfitAndLose(futuresPositionVO.getAllFuturesProfitAndLose());
BigDecimal futuresForceLine = futuresForcePercent.multiply(futuresPositionVO.getAllFuturesDepositAmt());
- futuresForceLine = futuresForceLine.add(user.getEnableFutAmt());
+
agentUserListVO.setFuturesForceLine(futuresForceLine);
@@ -1535,61 +1018,16 @@
userInfoVO.setIsActive(user.getIsActive());
userInfoVO.setAuthMsg(user.getAuthMsg());
userInfoVO.setVaildNumber(user.getVaildNumber());
+ BigDecimal exchangRate = iSiteSettingService.getSiteSetting().getExchangeRate();
+ BigDecimal totalUsMoney = userAssetsServices.getAvailableBalance(EStockType.US.getCode(),user.getId());
+ BigDecimal totalMasMoney = userAssetsServices.getAvailableBalance(EStockType.IN.getCode(), user.getId())
+ .divide(exchangRate,BigDecimal.ROUND_CEILING).setScale(2,
+ RoundingMode.UP);
- userInfoVO.setTradingAmount(user.getTradingAmount());
-
- userInfoVO.setEnableAmt(user.getEnableAmt());
- userInfoVO.setEnableAmtToUsdt(user.getEnableAmt().
- divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN).toString());
-
- PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId(), EStockType.IN.getCode());
- userInfoVO.setAllFreezAmt(positionVO.getAllFreezAmt());
- userInfoVO.setAllFreezAmtToUsdt(positionVO.getAllFreezAmt()
- .divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN).toString());
- BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose();
-
- // 卢比股票的盈利
- userInfoVO.setAllProfitAndLose(allProfitAndLose);
- userInfoVO.setAllProfitAndLoseToUsdt(allProfitAndLose.
- divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN).toString());
-
-
-
- BigDecimal userAllAmt = user.getUserAmt();
- userAllAmt = userAllAmt.add(allProfitAndLose);
- userInfoVO.setUserAmt(userAllAmt);
- userInfoVO.setUserAmtToUsdt(user.getUserAmt().
- divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN).toString());
-
-
- PositionVO usPositionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId(), EStockType.US.getCode());
- userInfoVO.setUsAllFreezAmt(usPositionVO.getAllFreezAmt());
- BigDecimal usAllProfitAndLose = positionVO.getAllProfitAndLose();
- userInfoVO.setUsAllProfitAndLose(usAllProfitAndLose);
- userInfoVO.setAllProfitAndLoseToUsdt(usAllProfitAndLose.
- divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN).toString());
-
- BigDecimal userAllIndexAmt = user.getUserIndexAmt();
- userAllIndexAmt = userAllIndexAmt.add(usAllProfitAndLose);
- userInfoVO.setUserIndexAmt(userAllIndexAmt);
- userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt());
-
- BigDecimal totleAssets = user.getUserAmt().
- divide(siteSetting.getExchangeRate()).
- setScale(2, BigDecimal.ROUND_DOWN)
- .add(user.getUserIndexAmt());
- userInfoVO.setTotalAssets(totleAssets.setScale(2).toString());
-
-
-
-
-
+ userInfoVO.setMasTotalAssets(totalMasMoney.setScale(2).toString());
+ userInfoVO.setUsTotalAssets(totalUsMoney.setScale(2).toString());
+ userInfoVO.setTotalAssets((totalUsMoney.add(totalMasMoney)).setScale(2).toString());
return userInfoVO;
}
diff --git a/src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java b/src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
index 796615c..ee7a71f 100644
--- a/src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserStockSubscribeServiceImpl.java
@@ -10,7 +10,7 @@
import com.nq.dao.UserStockSubscribeMapper;
import com.nq.pojo.*;
import com.nq.service.*;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import com.nq.utils.KeyUtils;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.JsonUtil;
@@ -71,7 +71,6 @@
String property = PropertiesUtil.getProperty("user.cookie.name");
String header = request.getHeader(property);
if (header != null) {
- String userJson = RedisShardedPoolUtils.get(header);
User user = this.iUserService.getCurrentRefreshUser(request);
if (user == null){
return ServerResponse.createBySuccessMsg("請先登錄");
@@ -88,10 +87,10 @@
return ServerResponse.createByErrorMsg("No trading on weekends or holidays!");
}
//重复申购限制
-// UserStockSubscribe userStockSubscribe = userStockSubscribeMapper.selectOne(new QueryWrapper<UserStockSubscribe>().eq("new_code", model.getNewCode()).eq("user_id", user.getId()));
-// if (userStockSubscribe != null) {
-// return ServerResponse.createByErrorMsg("请勿重复申购");
-// }
+ UserStockSubscribe userStockSubscribe = userStockSubscribeMapper.selectOne(new QueryWrapper<UserStockSubscribe>().eq("new_code", model.getNewCode()).eq("user_id", user.getId()));
+ if (userStockSubscribe != null) {
+ return ServerResponse.createByErrorMsg("请勿重复申购");
+ }
if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
return ServerResponse.createByErrorMsg("Order failed, account has been locked");
}
@@ -123,17 +122,6 @@
return ServerResponse.createByErrorMsg("The minimum purchase quantity is 500, the maximum is large" + stockSubscribe.getOrderNumber());
}
if (stockSubscribe.getType() == 2) {
-
- if (user.getEnableAmt().compareTo(new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice())) < 0) {
- return ServerResponse.createByErrorMsg("The user's available balance is insufficient, and the application conditions are not met足");
- }
- user.setEnableAmt(user.getEnableAmt().subtract(new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice())));
- if (user.getDjzj()!=null) {
- user.setDjzj(user.getDjzj().add(new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice())));
- }else
- {
- user.setDjzj(new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice()));
- }
int u = userMapper.updateById(user);
if (u <= 0) {
return ServerResponse.createByErrorMsg("Application failed due to unknown reasons");
@@ -145,7 +133,6 @@
model.setAgentName(user.getAgentName());
model.setPhone(user.getPhone());
model.setBuyPrice(stockSubscribe.getPrice());
-
model.setBond(new BigDecimal(model.getApplyNums()).multiply(stockSubscribe.getPrice()));
model.setRealName(Objects.equals(user.getRealName(), "")||user.getRealName()==null ?"模拟用户无实名":user.getRealName());
model.setAddTime(new Date());
@@ -214,14 +201,12 @@
if (stockSubscribe.getType() == 2){
- User user = userMapper.selectByPrimaryKey(userStockSubscribe.getUserId());
+ User user = userMapper.selectById(userStockSubscribe.getUserId());
UserStockSubscribe userStockSubscribe1 = userStockSubscribeMapper.load(model.getId());
int refundenum = userStockSubscribe1.getApplyNums() - model.getApplyNumber();
// log.info("refundenum"+refundenum);
Integer refund =refundenum * stockSubscribe.getPrice().intValue();
// log.info("退还金额"+refund);
- user.setEnableAmt(user.getEnableAmt().add(BigDecimal.valueOf(refund)));
- user.setDjzj(user.getDjzj().subtract(BigDecimal.valueOf(refund)));
int ret1 = userMapper.updateByPrimaryKey(user);
if (ret1 <= 0) {
return ServerResponse.createByErrorMsg("Application failed due to unknown reasons");
@@ -245,9 +230,7 @@
siteMessage.setAddTime(DateTimeUtil.getCurrentDate());
iSiteMessageService.insert(siteMessage);
}else {
- User user = userMapper.selectByPrimaryKey(userStockSubscribe.getUserId());
- user.setEnableAmt(user.getEnableAmt().add(userStockSubscribe.getBond()));
- user.setDjzj(user.getDjzj().subtract(userStockSubscribe.getBond()));
+ User user = userMapper.selectById(userStockSubscribe.getUserId());
userMapper.updateByPrimaryKey(user);
SiteMessage siteMessage = new SiteMessage();
siteMessage.setUserId(userStockSubscribe.getUserId());
@@ -326,7 +309,7 @@
}
} else {
//指定用户发站内信
- User user = userMapper.selectByPrimaryKey(model.getUserId());
+ User user = userMapper.selectById(model.getUserId());
SiteMessage siteMessage = new SiteMessage();
siteMessage.setUserId(user.getId());
siteMessage.setUserName(user.getRealName());
@@ -435,22 +418,12 @@
userStockSubscribe.setSubmitTime(DateTimeUtil.getCurrentDate());
userStockSubscribe.setStatus(4);
- User user1 = userMapper.selectByPrimaryKey(userStockSubscribe.getUserId());
+ User user1 = userMapper.selectById(userStockSubscribe.getUserId());
// log.info("user" + user1);
- if (user1.getEnableAmt().compareTo(userStockSubscribe.getBond()) < 0) {
- return ServerResponse.createByErrorMsg("Insufficient balance");
- }
// log.info("原可用资金"+user1.getEnableAmt());
- BigDecimal enableAmt = user1.getEnableAmt().subtract(userStockSubscribe.getBond());
// log.info("enableAmt" + enableAmt);
- user1.setEnableAmt(enableAmt);
// log.info("可用资金" + user1.getEnableAmt()+"保证金"+userStockSubscribe.getBond()+"原djzj"+user1.getDjzj());
- if (user1.getDjzj() != null) {
- user1.setDjzj(user1.getDjzj().add(userStockSubscribe.getBond()));
- }else {
- user1.setDjzj(userStockSubscribe.getBond());
- }
- ret = userMapper.updateByPrimaryKeySelective(user1);
+ ret = userMapper.updateById(user1);
}
else {
return ServerResponse.createByErrorMsg("There is no fee for unsuccessful applicants");
diff --git a/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java b/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
index 2475960..4ea7f7d 100644
--- a/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
@@ -1,9 +1,9 @@
package com.nq.service.impl;
-import cn.hutool.log.Log;
import com.google.gson.Gson;
import com.nq.dao.*;
+import com.nq.enums.EUserAssets;
import com.nq.pay.PayUtil;
import com.nq.pojo.*;
import com.nq.service.*;
@@ -14,6 +14,7 @@
import com.nq.common.ServerResponse;
import com.nq.utils.*;
+import com.nq.utils.http.HttpClientUtil;
import com.nq.utils.stock.WithDrawUtils;
import java.math.BigDecimal;
@@ -23,6 +24,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import com.nq.utils.timeutil.DateTimeUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@@ -34,7 +36,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
-import static com.nq.utils.DateTimeUtil.STANDARD_FORMAT;
+import static com.nq.utils.timeutil.DateTimeUtil.STANDARD_FORMAT;
@Service("iUserWithdrawService")
@@ -51,8 +53,11 @@
IUserService iUserService;
- @Autowired
+ @Resource
UserMapper userMapper;
+
+ @Resource
+ IUserAssetsServices iUserAssetsServices;
@Autowired
@@ -81,7 +86,7 @@
@Transactional
- public ServerResponse outMoney(String amt, String with_Pwd, HttpServletRequest request) throws Exception {
+ public ServerResponse outMoney(String amt, String with_Pwd,String accsetType,HttpServletRequest request) throws Exception {
if (StringUtils.isBlank(amt)) {
return ServerResponse.createByErrorMsg("The parameter cannot be null");
}
@@ -148,69 +153,15 @@
}
if (!WithDrawUtils.checkIsWithTime(with_time_begin, with_time_end)) {
-
return ServerResponse.createByErrorMsg("Withdrawal failed. Withdrawal time is at" + with_time_begin + "point - " + with_time_end + "point among");
-
}
-
- BigDecimal index_user_amt = user.getUserIndexAmt();
-
- if (index_user_amt.compareTo(new BigDecimal("0")) == -1) {
-
- return ServerResponse.createByErrorMsg("Index funds cannot be less than 0");
-
+ BigDecimal useAmt = iUserAssetsServices.getAvailableBalance(accsetType,user.getId());
+ BigDecimal tAmt = new BigDecimal(amt);
+ if(useAmt.compareTo(tAmt)<0){
+ return ServerResponse.createByErrorMsg("Insufficient balance");
}
-
-
- BigDecimal futures_user_amt = user.getUserFutAmt();
-
- if (futures_user_amt.compareTo(new BigDecimal("0")) == -1) {
-
- return ServerResponse.createByErrorMsg("Futures capital cannot be less than 0");
-
- }
-
-
- BigDecimal enable_amt = user.getEnableAmt();
-
- int compareAmt = enable_amt.compareTo(new BigDecimal(amt));
-
- if (compareAmt == -1) {
-
- return ServerResponse.createByErrorMsg("Withdrawal failed, the user's available funds are insufficient");
-
- }
-
-
- BigDecimal user_all_amt = user.getUserAmt();
-
- BigDecimal reckon_all_amt = user_all_amt.subtract(new BigDecimal(amt));
-
- BigDecimal reckon_enable_amt = enable_amt.subtract(new BigDecimal(amt));
-
- user.setUserAmt(reckon_all_amt);
-
- user.setEnableAmt(reckon_enable_amt);
-
- log.info("用户提现{},金额 = {},总资金 = {},可用资金 = {}", new Object[]{user.getId(), amt, user_all_amt, enable_amt});
-
-
- log.info("提现后,总金额={},可用资金={}", reckon_all_amt, reckon_enable_amt);
-
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
-
- if (updateUserCount > 0) {
-
- log.info("修改用户资金成功");
-
- } else {
-
- log.error("修改用户资金失败");
-
- throw new Exception("用户提现,修改用户资金失败");
-
- }
+ iUserAssetsServices.availablebalanceChange(accsetType,user.getId(), EUserAssets.WITHDRAW,tAmt.negate(),"","");
UserWithdraw userWithdraw = new UserWithdraw();
userWithdraw.setUserId(user.getId());
userWithdraw.setNickName(user.getRealName());
@@ -296,17 +247,13 @@
log.info("修改用户提现订单 {} 状态成功", withId);
- User user = this.userMapper.selectByPrimaryKey(userWithdraw.getUserId());
+ User user = this.userMapper.selectById(userWithdraw.getUserId());
- user.setUserAmt(user.getUserAmt().add(userWithdraw.getWithAmt()));
- user.setEnableAmt(user.getEnableAmt().add(userWithdraw.getWithAmt()));
-
- int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateUserCount = this.userMapper.updateById(user);
if (updateUserCount > 0) {
- log.info("反还用户资金,总 {} 可用 {}", user.getUserAmt(), user.getEnableAmt());
return ServerResponse.createBySuccessMsg("Cancel Success");
@@ -407,22 +354,11 @@
}
if (state == 3) {
- User user = this.userMapper.selectByPrimaryKey(userWithdraw.getUserId());
+ User user = this.userMapper.selectById(userWithdraw.getUserId());
if (user == null) {
return ServerResponse.createByErrorMsg("用户不存在");
}
- BigDecimal user_amt = user.getUserAmt().add(userWithdraw.getWithAmt());
-
- log.info("管理员确认提现订单失败,返还用户 {} 总资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getUserAmt(), user_amt});
-
- user.setUserAmt(user_amt);
-
- BigDecimal user_enable_amt = user.getEnableAmt().add(userWithdraw.getWithAmt());
-
- log.info("管理员确认提现订单失败,返还用户 {} 可用资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getEnableAmt(), user_enable_amt});
-
- user.setEnableAmt(user_enable_amt);
- int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
+ int updateCount = this.userMapper.updateById(user);
if (updateCount > 0) {
log.info("提现失败,返还用户资金成功!");
} else {
diff --git a/src/main/java/com/nq/utils/ApplicationContextRegisterUtil.java b/src/main/java/com/nq/utils/ApplicationContextRegisterUtil.java
new file mode 100644
index 0000000..0fa7493
--- /dev/null
+++ b/src/main/java/com/nq/utils/ApplicationContextRegisterUtil.java
@@ -0,0 +1,22 @@
+package com.nq.utils;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+@Component
+@Lazy(false)
+public class ApplicationContextRegisterUtil implements ApplicationContextAware {
+
+ private static ApplicationContext APPLICATION_CONTEXT;
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ APPLICATION_CONTEXT = applicationContext;
+ }
+ public static ApplicationContext getApplicationContext() {
+ return APPLICATION_CONTEXT;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/nq/utils/FTPUtil.java b/src/main/java/com/nq/utils/ftp/FTPUtil.java
similarity index 97%
rename from src/main/java/com/nq/utils/FTPUtil.java
rename to src/main/java/com/nq/utils/ftp/FTPUtil.java
index a1a5d80..2ad0851 100644
--- a/src/main/java/com/nq/utils/FTPUtil.java
+++ b/src/main/java/com/nq/utils/ftp/FTPUtil.java
@@ -1,6 +1,7 @@
-package com.nq.utils;
+package com.nq.utils.ftp;
+import com.nq.utils.PropertiesUtil;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/src/main/java/com/nq/utils/HttpClientRequest.java b/src/main/java/com/nq/utils/http/HttpClientRequest.java
similarity index 97%
rename from src/main/java/com/nq/utils/HttpClientRequest.java
rename to src/main/java/com/nq/utils/http/HttpClientRequest.java
index d905aeb..b82a37b 100644
--- a/src/main/java/com/nq/utils/HttpClientRequest.java
+++ b/src/main/java/com/nq/utils/http/HttpClientRequest.java
@@ -1,7 +1,8 @@
-package com.nq.utils;
+package com.nq.utils.http;
import com.google.gson.Gson;
+import com.nq.utils.PropertiesUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
@@ -37,7 +38,7 @@
httpGet.setHeader("Authorization", "Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0");
httpGet.setHeader("Referer","https://quotes.sina.cn/hs/company/quotes/view/sz399001?vt=4&cid=76524&node_id=76524&autocallup=no&isfromsina=yes");
//cookie
- httpGet.setHeader("Cookie",PropertiesUtil.getProperty("cookle"));
+ httpGet.setHeader("Cookie", PropertiesUtil.getProperty("cookle"));
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
diff --git a/src/main/java/com/nq/utils/HttpClientUtil.java b/src/main/java/com/nq/utils/http/HttpClientUtil.java
similarity index 98%
rename from src/main/java/com/nq/utils/HttpClientUtil.java
rename to src/main/java/com/nq/utils/http/HttpClientUtil.java
index 288225e..e89f6a6 100644
--- a/src/main/java/com/nq/utils/HttpClientUtil.java
+++ b/src/main/java/com/nq/utils/http/HttpClientUtil.java
@@ -1,4 +1,4 @@
-package com.nq.utils;
+package com.nq.utils.http;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
diff --git a/src/main/java/com/nq/utils/HttpRequest.java b/src/main/java/com/nq/utils/http/HttpRequest.java
similarity index 99%
rename from src/main/java/com/nq/utils/HttpRequest.java
rename to src/main/java/com/nq/utils/http/HttpRequest.java
index 6236a4b..bbaa265 100644
--- a/src/main/java/com/nq/utils/HttpRequest.java
+++ b/src/main/java/com/nq/utils/http/HttpRequest.java
@@ -1,4 +1,4 @@
-package com.nq.utils;
+package com.nq.utils.http;
import org.apache.http.HttpEntity;
diff --git a/src/main/java/com/nq/utils/ip/JuheIpApi.java b/src/main/java/com/nq/utils/ip/JuheIpApi.java
index e2e8450..1fa7fbe 100644
--- a/src/main/java/com/nq/utils/ip/JuheIpApi.java
+++ b/src/main/java/com/nq/utils/ip/JuheIpApi.java
@@ -1,7 +1,7 @@
package com.nq.utils.ip;
-import com.nq.utils.HttpRequest;
+import com.nq.utils.http.HttpRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.ip.juhe.AddressResultsVo;
import com.nq.utils.redis.JsonUtil;
diff --git a/src/main/java/com/nq/utils/redis/RedisKeyConstant.java b/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
index 9824fbe..4fe11e6 100644
--- a/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
+++ b/src/main/java/com/nq/utils/redis/RedisKeyConstant.java
@@ -19,4 +19,11 @@
* */
public static final String RK_REAL_TIME_STOCK = "rk_real_time_stock";
+
+ /**
+ * 股票实时数据key
+ * */
+ public static final String RK_COMPANY_INFO = "rk_company_info";
+
+
}
diff --git a/src/main/java/com/nq/utils/redis/RedisKeyUtil.java b/src/main/java/com/nq/utils/redis/RedisKeyUtil.java
index b59513b..5920848 100644
--- a/src/main/java/com/nq/utils/redis/RedisKeyUtil.java
+++ b/src/main/java/com/nq/utils/redis/RedisKeyUtil.java
@@ -67,13 +67,13 @@
public static void setCacheCompanies(Stock stock,String companiesInfo){
- RedisShardedPoolUtils.set(RedisKeyConstant.RK_REAL_TIME_STOCK+":"+stock.getStockType()+":"+stock.getStockCode(),
+ RedisShardedPoolUtils.set(RedisKeyConstant.RK_COMPANY_INFO+":"+stock.getStockType()+":"+stock.getStockCode(),
new Gson().toJson(companiesInfo));
}
public static JSONObject getCacheCompanies(Stock stock){
- String companiesInfo = RedisShardedPoolUtils.get(RedisKeyConstant.RK_REAL_TIME_STOCK+":"+stock.getStockType()+":"+stock.getStockCode());
+ String companiesInfo = RedisShardedPoolUtils.get(RedisKeyConstant.RK_COMPANY_INFO+":"+stock.getStockType()+":"+stock.getStockCode());
if(companiesInfo.isEmpty()){
return null;
}
diff --git a/src/main/java/com/nq/utils/stock/GeneratePosition.java b/src/main/java/com/nq/utils/stock/GeneratePosition.java
index f0b83d9..0cd713c 100644
--- a/src/main/java/com/nq/utils/stock/GeneratePosition.java
+++ b/src/main/java/com/nq/utils/stock/GeneratePosition.java
@@ -1,7 +1,7 @@
package com.nq.utils.stock;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import java.util.Date;
import java.util.Random;
diff --git a/src/main/java/com/nq/utils/stock/GetStayDays.java b/src/main/java/com/nq/utils/stock/GetStayDays.java
index 7605023..e5e81f2 100644
--- a/src/main/java/com/nq/utils/stock/GetStayDays.java
+++ b/src/main/java/com/nq/utils/stock/GetStayDays.java
@@ -1,6 +1,6 @@
package com.nq.utils.stock;
-import com.nq.utils.DateTimeUtil;
+import com.nq.utils.timeutil.DateTimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/src/main/java/com/nq/utils/stock/qq/QqStockApi.java b/src/main/java/com/nq/utils/stock/qq/QqStockApi.java
index 467b385..d92dcd8 100644
--- a/src/main/java/com/nq/utils/stock/qq/QqStockApi.java
+++ b/src/main/java/com/nq/utils/stock/qq/QqStockApi.java
@@ -4,7 +4,7 @@
import com.nq.pojo.Stock;
import com.nq.pojo.StockFutures;
import com.nq.pojo.StockIndex;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.stock.sina.StockApi;
diff --git a/src/main/java/com/nq/utils/stock/sina/StockApi.java b/src/main/java/com/nq/utils/stock/sina/StockApi.java
index f71417a..184aa75 100644
--- a/src/main/java/com/nq/utils/stock/sina/StockApi.java
+++ b/src/main/java/com/nq/utils/stock/sina/StockApi.java
@@ -2,15 +2,12 @@
import com.alibaba.fastjson2.JSONObject;
-import com.google.gson.Gson;
import com.nq.common.ServerResponse;
-import com.nq.constant.StockConstant;
import com.nq.pojo.*;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.redis.RedisKeyUtil;
-import com.nq.utils.redis.RedisShardedPoolUtils;
import com.nq.utils.stock.sina.vo.SinaStockMinData;
import com.nq.vo.stock.StockListVO;
import com.nq.vo.stock.StockUsVO;
@@ -19,7 +16,6 @@
import com.nq.vo.stock.k.echarts.EchartsDataVO;
import java.math.BigDecimal;
-import java.math.RoundingMode;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
@@ -117,7 +113,17 @@
}
try {
StockRealTimeBean qhBean = RedisKeyUtil.getCacheRealTimeStock(stock);
- stockListVO.setHcrate(new BigDecimal(qhBean.getPcp().replace("%", "")));
+ if(!qhBean.getPcp().endsWith("%")){
+ stockListVO.setHcrate(qhBean.getPcp()+"%");
+ }else{
+ stockListVO.setHcrate(qhBean.getPcp());
+ }
+
+ if(qhBean.getPcp().startsWith("-")){
+ stockListVO.setColor("rgb(208, 75, 100)");
+ }else{
+ stockListVO.setColor("rgb(3, 173, 143)");
+ }
stockListVO.setNowPrice(qhBean.getLast());
stockListVO.setToday_max(qhBean.getHigh());
stockListVO.setToday_min(qhBean.getLow());
@@ -157,57 +163,6 @@
return stockListVO;
}
-
- //hk 数据转换
- public static StockVO otherStockVO(String Result) {
- StockVO stockVO = new StockVO();
- //判断是否是
- JSONObject jsonObject = JSONObject.parseObject(Result);
- stockVO.setName(jsonObject.getString("f14"));
-
- stockVO.setNowPrice(!Objects.equals(jsonObject.getString("f2"), "-") ? jsonObject.getString("f2") : "0");
-
- stockVO.setHcrate(new BigDecimal(!Objects.equals(jsonObject.getString("f3"), "-") ? jsonObject.getString("f3") : "0"));
-
- stockVO.setToday_max(!Objects.equals(jsonObject.getString("f15"), "-") ? jsonObject.getString("f15") : "0");
-
- stockVO.setToday_min(!Objects.equals(jsonObject.getString("f16"), "-") ? jsonObject.getString("f16") : "0");
-
- stockVO.setBusiness_amount(!Objects.equals(jsonObject.getString("f6"), "-") ? jsonObject.getString("f6") : "0");
-
- stockVO.setBusiness_balance(!Objects.equals(jsonObject.getString("f5"), "-") ? jsonObject.getString("f5") : "0");
-
- stockVO.setPreclose_px(!Objects.equals(jsonObject.getString("f18"), "-") ? jsonObject.getString("f18") : "0");
-
- stockVO.setOpen_px(!Objects.equals(jsonObject.getString("f17"), "-") ? jsonObject.getString("f17") : "0");
- stockVO.setType(jsonObject.getString("f13"));
- String buy = "0";
- stockVO.setBuy1(buy);
- stockVO.setBuy2(buy);
- stockVO.setBuy3(buy);
- stockVO.setBuy4(buy);
- stockVO.setBuy5(buy);
-
- stockVO.setSell1(buy);
- stockVO.setSell2(buy);
- stockVO.setSell3(buy);
- stockVO.setSell4(buy);
- stockVO.setSell5(buy);
-
- stockVO.setBuy1_num(buy);
- stockVO.setBuy2_num(buy);
- stockVO.setBuy3_num(buy);
- stockVO.setBuy4_num(buy);
- stockVO.setBuy5_num(buy);
-
- stockVO.setSell1_num(buy);
- stockVO.setSell2_num(buy);
- stockVO.setSell3_num(buy);
- stockVO.setSell4_num(buy);
- stockVO.setSell5_num(buy);
-
- return stockVO;
- }
//us 数据转换
public static StockUsVO otherUsStockVO(String Result) {
diff --git a/src/main/java/com/nq/utils/task/stock/ClosingStayTask.java b/src/main/java/com/nq/utils/task/stock/ClosingStayTask.java
deleted file mode 100644
index 64c8624..0000000
--- a/src/main/java/com/nq/utils/task/stock/ClosingStayTask.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.nq.utils.task.stock;//package com.nq.utils.task.stock;
-
-
-import com.nq.service.IUserPositionService;
-
-import com.nq.utils.DateTimeUtil;
-
-import java.util.Date;
-
-import org.slf4j.Logger;
-
-import org.slf4j.LoggerFactory;
-
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.scheduling.annotation.Scheduled;
-
-import org.springframework.stereotype.Component;
-
-
-@Component
-public class ClosingStayTask {
-
- private static final Logger log = LoggerFactory.getLogger(ClosingStayTask.class);
-
-
- @Autowired
- IUserPositionService iUserPositionService;
-
- /*遞延費周一到周五,每天七點定時計算*/
-// @Scheduled(cron = "0 15 9 ? * MON-FRI")
- public void closingStayV1() {
-
- log.info("=======================收盤收取留倉費任務開始 ===========================");
-
- log.info("收盤收取留倉費任務 開始時間 = {}", DateTimeUtil.dateToStr(new Date()));
-
- log.info("");
-
- dotask();
-
- log.info("");
-
- log.info("收盤收取留倉費任務 結束時間 = {}", DateTimeUtil.dateToStr(new Date()));
-
- log.info("=======================收盤收取留倉費任務結束 ===========================");
-
- }
-
-
- public void dotask() {
- this.iUserPositionService.doClosingStayTask();
- }
-
- /*留倉到期強制平倉,每天15點執行*/
- @Scheduled(cron = "0 0 15 ? * MON-FRI")
- public void expireStayUnwind() {
- log.info("=======================留倉到期強制平倉任務開始 ===========================");
- this.iUserPositionService.expireStayUnwindTask();
- log.info("=======================留倉到期強制平倉任務結束 ===========================");
- }
-
-}
diff --git a/src/main/java/com/nq/utils/task/stock/ForceSellTask.java b/src/main/java/com/nq/utils/task/stock/ForceSellTask.java
deleted file mode 100644
index 4abc699..0000000
--- a/src/main/java/com/nq/utils/task/stock/ForceSellTask.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package com.nq.utils.task.stock;
-
-
-import com.nq.service.IUserIndexPositionService;
-import com.nq.service.IUserService;
-import com.nq.service.UserPendingorderService;
-import com.nq.utils.DateTimeUtil;
-import com.nq.utils.stock.BuyAndSellUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-
-
-@Component
-public class ForceSellTask {
-
- private static final Logger log = LoggerFactory.getLogger(ForceSellTask.class);
-
-
- @Autowired
- IUserService iUserService;
- @Autowired
- UserPendingorderService userPendingorderService;
- @Autowired
- IUserIndexPositionService iUserIndexPositionService;
-
-
- private static final String am_begin = "9:30";
-
-
- private static final String am_end = "11:30";
-
-
- private static final String pm_begin = "13:00";
-
-
- private static final String pm_end = "15:00";
-
-
- /*用戶持倉單-用戶總金額-強平定時*/
- @Scheduled(cron = "0 0/3 9-15 ? * MON-FRI")
- public void banlanceUserPositionTaskV1() {
- boolean am = false;
- boolean pm = false;
- try {
- am = BuyAndSellUtils.isTransTime("9:30", "11:30");
- pm = BuyAndSellUtils.isTransTime("13:00", "15:00");
- } catch (Exception e) {
- log.error("執行定時任務出錯,e = {}", e);
-
- }
- log.info("當前 am = {} pm = {}", Boolean.valueOf(am), Boolean.valueOf(pm));
- if (am || pm) {
- log.info("=====掃描用戶持倉執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
- dotask();
-
- log.info("=====掃描用戶持倉結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
- } else {
-
- log.info("當前時間不為周一至周五,或者不在交易時間內,不執行(強平)定時任務");
-
- }
-
- }
-
-
- public void dotask() {
- this.iUserService.ForceSellTask();
- }
- /*用戶持倉單-單支股票盈虧-強平定時*/
-// @Scheduled(cron = "0 0/1 * * * *")
- @Scheduled(cron = "0 0/1 9-15 ? * MON-FRI")
- public void stockProfitLossOneTask() {
- boolean am = false;
- boolean pm = false;
- //todo 測試完成需要關閉註釋
- try {
- am = BuyAndSellUtils.isTransTime("9:30", "11:30");
- pm = BuyAndSellUtils.isTransTime("13:00", "15:00");
- } catch (Exception e) {
- log.error("執行定時任務出錯,e = {}", e);
- }
-
- log.info("當前 am = {} pm = {}", Boolean.valueOf(am), Boolean.valueOf(pm));
- if (am || pm) {
- log.info("=====掃描單支股票盈虧執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- this.iUserService.ForceSellOneStockTask();
- log.info("=====掃描單支股票盈虧結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
- } else {
- log.info("當前時間不為周一至周五,或者不在交易時間內,不執行(強平)單支股票盈虧定時任務");
- }
-
- }
-
- /**
- * 用户持仓单-单支股票止损止盈线-强平定时
- */
- @Scheduled(cron = "0 0/1 * ? * MON-FRI")
- public void stockProfitLossOneTaskV2() {
-// boolean am = false;
-// boolean pm = false;
-// //todo 測試完成需要關閉註釋
-// try {
-// am = BuyAndSellUtils.isTransTime("9:30", "11:30");
-// pm = BuyAndSellUtils.isTransTime("13:00", "15:00");
-// } catch (Exception e) {
-// log.error("執行定時任務出錯,e = {}", e);
-// }
-//
-// log.info("當前 am = {} pm = {}", Boolean.valueOf(am), Boolean.valueOf(pm));
-// if (am || pm) {
- log.info("=====掃描單支股票盈虧執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- this.iUserService.ForceSellOneStockTaskV2();
- log.info("=====掃描單支股票盈虧結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
-// } else {
-// log.info("當前時間不為周一至周五,或者不在交易時間內,不執行(強平)單支股票盈虧定時任務");
- }
-
-
- /**
- * 用户指数持仓单-指数止损止盈线-强平定时
- */
- @Scheduled(cron = "0 0/1 * ? * MON-FRI")
- public void indexPosition() {
- log.info("=====掃描單支指数盈虧執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- this.iUserIndexPositionService.indexPositiontask();
- log.info("=====掃描單支指数盈虧結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- }
- /**
- * 挂单定时任务
- *
- */
- @Scheduled(cron = "0 0/1 * ? * MON-FRI")
- public void orderTask() {
- boolean am = false;
- boolean pm = false;
- boolean ln = false;
- //todo 測試完成需要關閉註釋
- try {
- am = BuyAndSellUtils.isTransTime("9:30", "16:00");
- pm = BuyAndSellUtils.isTransTime("21:30", "23:59");
- ln= BuyAndSellUtils.isTransTime("0:00", "5:00");
- } catch (Exception e) {
- log.error("執行定時任務出錯,e = {}", e);
- }
-
- log.info("挂单当前 am = {} pm = {} ln = {}", Boolean.valueOf(am), Boolean.valueOf(pm),Boolean.valueOf(ln));
- if (am || pm||ln) {
- log.info("=====掃描挂單執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- this.userPendingorderService.orderTask();
- log.info("=====掃描挂單結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
- } else {
- log.info("當前時間不為周一至周五,或者不在交易時間內,不執行<< 挂单 >>定時任務");
- }
-
- }
-
- /*用戶股票持倉單-強平提醒推送消息定時*/
- @Scheduled(cron = "0 0/1 * * * *")
- public void banlanceUserPositionMessage() {
-
- boolean am = false;
-
- boolean pm = false;
-
- try {
-
- am = BuyAndSellUtils.isTransTime("9:30", "11:30");
-
- pm = BuyAndSellUtils.isTransTime("13:00", "15:00");
-
- } catch (Exception e) {
-
- log.error("執行定時任務出錯,e = {}", e);
-
- }
-
-
- log.info("當前 am = {} pm = {}", Boolean.valueOf(am), Boolean.valueOf(pm));
-
- if (am || pm) {
-
- log.info("=====掃描用戶持倉執行,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
- this.iUserService.ForceSellMessageTask();
-
- log.info("=====掃描用戶持倉結束,當前時間 {} =====", DateTimeUtil.dateToStr(new Date()));
-
- } else {
-
- log.info("當前時間不為周一至周五,或者不在交易時間內,不執行(強平)提醒推送消息任務");
-
- }
-
- }
-
-
-}
diff --git a/src/main/java/com/nq/utils/task/stock/StockTask.java b/src/main/java/com/nq/utils/task/stock/StockTask.java
index c8c2945..e7beb3d 100644
--- a/src/main/java/com/nq/utils/task/stock/StockTask.java
+++ b/src/main/java/com/nq/utils/task/stock/StockTask.java
@@ -1,12 +1,14 @@
package com.nq.utils.task.stock;
import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.Gson;
import com.nq.dao.*;
import com.nq.enums.EStockType;
import com.nq.pojo.*;
+import com.nq.service.IMandatoryLiquidationService;
import com.nq.service.IStockService;
-import com.nq.utils.HttpClientRequest;
+import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.redis.RedisKeyUtil;
import com.nq.utils.stock.BuyAndSellUtils;
import org.slf4j.Logger;
@@ -29,6 +31,9 @@
StockMapper stockMapper;
+ @Autowired
+ IMandatoryLiquidationService mandatoryLiquidationService;
+
private static final Logger log = LoggerFactory.getLogger(StockTask.class);
@@ -46,29 +51,26 @@
}
- //每隔一个小时请求一次 同步印度股票
- @Scheduled(cron = "0 0 0/1 * * ?")
+ /**
+ * 同步系统所需要的股票
+ * */
+ @Scheduled(cron = "0 0/3 * * * ?")
public void syncINStockData() {
- loadAllStock(EStockType.IN);
+// loadAllStock(EStockType.US);
+ loadAllStock(EStockType.HG);
}
+
+
/**
* 同步美国股票
* */
- @Scheduled(cron = "0 0 0/1 * * ?")
- public void synsUSStockData(){
- loadAllStock(EStockType.US);
- }
-
-
- /**
- * 同步美国股票
- * */
- @Scheduled(cron = "0 0/5 * * * ?")
+ @Scheduled(cron = "0 0/30 * * * ?")
public void loadStockCompanies(){
loadAllCompanies();
}
+
@@ -80,8 +82,7 @@
for (int i = 0; i <list.size() ; i++) {
Stock stock = list.get(i);
EStockType eStockType = EStockType.getEStockTypeByCode(stock.getStockType());
- String result = HttpClientRequest.doGet(eStockType.stockUrl+"companies?pid=+"+stock.getStockCode()+"+country_id="+eStockType.getContryId()+"&size=1000&page=1&key="+eStockType.stockKey);
- log.info(" 公司信息返回{}",result);
+ String result = HttpClientRequest.doGet(eStockType.stockUrl+"companies?pid=+"+stock.getStockCode()+"+country_id="+eStockType.getContryId()+"&size=1&page=1&key="+eStockType.stockKey);
try {
JSONObject jsonObject = JSONObject.parseObject(result);
JSONObject companiesInfo = jsonObject.getJSONArray("data").getJSONObject(0);
@@ -93,9 +94,6 @@
}
}
-
-
-
/**
* 加载所有股票数据
@@ -136,7 +134,6 @@
}else{
stock.setStockSpell(o.getTicker());
}
-
stock.setIsLock(0);
stock.setIsShow(0);
stock.setDataBase(0);
@@ -159,20 +156,31 @@
* 每3分钟同步一次数据源到数据库
*
*/
- @Scheduled(cron = "0 0/1 * * * ?")
+ @Scheduled(cron = "0/3 * * * * ?")
public void sysnInstockData(){
- List<Stock> list = stockMapper.findStockList();
- if(list.size()>0){
- for (int i = 0; i < list.size(); i++) {
- try {
- Stock stock = list.get(i);
- StockRealTimeBean stockDetailBean = RedisKeyUtil.getCacheRealTimeStock(stock);
- stock.setIncreaseRatio(new BigDecimal(stockDetailBean.getPcp().replace("%","")));
- stockMapper.updateById(stock);
- }catch (Exception e){
+ QueryWrapper<Stock> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("stock_type",EStockType.SZHB.getCode());
+ List<Stock> stockList = stockMapper.selectList(queryWrapper);
+ for (int i = 0; i < stockList.size(); i++) {
+ try {
+ String hdataString = HttpClientRequest.doGet(EStockType.SZHB.stockUrl+"market/detail?symbol="+stockList.get(i).getStockCode());
+ HBData hbData = new Gson().fromJson(hdataString,HBData.class);
+ StockRealTimeBean stockRealTimeBean = new StockRealTimeBean();
+ stockRealTimeBean.setLast(hbData.getTick().getClose()+"");
+ stockRealTimeBean.setHigh(hbData.getTick().getHigh()+"");
+ stockRealTimeBean.setPid(stockList.get(i).getStockCode());
+ stockRealTimeBean.setLow(hbData.getTick().getLow()+"");
+ stockRealTimeBean.setBid(hbData.getTick().getOpen()+"");
+ stockRealTimeBean.setLast_close("0.00");
+ BigDecimal sss = (new BigDecimal(hbData.getTick().getClose()).subtract(new BigDecimal(hbData.getTick().getOpen())));
+ sss = sss.divide(new BigDecimal(hbData.getTick().getOpen()),BigDecimal.ROUND_CEILING);
+ stockRealTimeBean.setPcp(sss.setScale(2,BigDecimal.ROUND_UP).toString());
+ mandatoryLiquidationService.RealTimeDataProcess(EStockType.SZHB,stockRealTimeBean);
+ }catch (Exception e){
- }
}
+
}
+
}
}
diff --git a/src/main/java/com/nq/utils/DateTimeUtil.java b/src/main/java/com/nq/utils/timeutil/DateTimeUtil.java
similarity index 99%
rename from src/main/java/com/nq/utils/DateTimeUtil.java
rename to src/main/java/com/nq/utils/timeutil/DateTimeUtil.java
index c0b646f..7f9f337 100644
--- a/src/main/java/com/nq/utils/DateTimeUtil.java
+++ b/src/main/java/com/nq/utils/timeutil/DateTimeUtil.java
@@ -1,4 +1,4 @@
-package com.nq.utils;
+package com.nq.utils.timeutil;
import org.joda.time.DateTime;
diff --git a/src/main/java/com/nq/vo/stock/StockVO.java b/src/main/java/com/nq/vo/stock/StockVO.java
index 6628f64..d92ea0b 100644
--- a/src/main/java/com/nq/vo/stock/StockVO.java
+++ b/src/main/java/com/nq/vo/stock/StockVO.java
@@ -12,9 +12,10 @@
private String spell;
private String gid;
private String nowPrice;
- private BigDecimal hcrate;
+ private String hcrate;
private String today_max;
private String today_min;
+ private String color;
private String business_balance;
@@ -35,9 +36,6 @@
private String buy5;
- public void setId(int id) {
- this.id = id;
- }
private String sell1;
private String sell2;
@@ -61,495 +59,6 @@
private Integer depositAmt;
- public void setName(String name) {
- this.name = name;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public void setSpell(String spell) {
- this.spell = spell;
- }
-
- public void setGid(String gid) {
- this.gid = gid;
- }
-
- public void setNowPrice(String nowPrice) {
- this.nowPrice = nowPrice;
- }
-
- public void setHcrate(BigDecimal hcrate) {
- this.hcrate = hcrate;
- }
-
- public void setToday_max(String today_max) {
- this.today_max = today_max;
- }
-
- public void setToday_min(String today_min) {
- this.today_min = today_min;
- }
-
- public void setBusiness_balance(String business_balance) {
- this.business_balance = business_balance;
- }
-
- public void setBusiness_amount(String business_amount) {
- this.business_amount = business_amount;
- }
-
- public void setPreclose_px(String preclose_px) {
- this.preclose_px = preclose_px;
- }
-
- public void setOpen_px(String open_px) {
- this.open_px = open_px;
- }
-
- public void setBuy1(String buy1) {
- this.buy1 = buy1;
- }
-
- public void setBuy2(String buy2) {
- this.buy2 = buy2;
- }
-
- public void setBuy3(String buy3) {
- this.buy3 = buy3;
- }
-
- public void setBuy4(String buy4) {
- this.buy4 = buy4;
- }
-
- public void setBuy5(String buy5) {
- this.buy5 = buy5;
- }
-
- public void setSell1(String sell1) {
- this.sell1 = sell1;
- }
-
- public void setSell2(String sell2) {
- this.sell2 = sell2;
- }
-
- public void setSell3(String sell3) {
- this.sell3 = sell3;
- }
-
- public void setSell4(String sell4) {
- this.sell4 = sell4;
- }
-
- public void setSell5(String sell5) {
- this.sell5 = sell5;
- }
-
- public void setBuy1_num(String buy1_num) {
- this.buy1_num = buy1_num;
- }
-
- public void setBuy2_num(String buy2_num) {
- this.buy2_num = buy2_num;
- }
-
- public void setBuy3_num(String buy3_num) {
- this.buy3_num = buy3_num;
- }
-
- public void setBuy4_num(String buy4_num) {
- this.buy4_num = buy4_num;
- }
-
- public void setBuy5_num(String buy5_num) {
- this.buy5_num = buy5_num;
- }
-
- public void setSell1_num(String sell1_num) {
- this.sell1_num = sell1_num;
- }
-
- public void setSell2_num(String sell2_num) {
- this.sell2_num = sell2_num;
- }
-
- public void setSell3_num(String sell3_num) {
- this.sell3_num = sell3_num;
- }
-
- public void setSell4_num(String sell4_num) {
- this.sell4_num = sell4_num;
- }
-
- public void setSell5_num(String sell5_num) {
- this.sell5_num = sell5_num;
- }
-
- public void setMinImg(String minImg) {
- this.minImg = minImg;
- }
-
- public void setDayImg(String dayImg) {
- this.dayImg = dayImg;
- }
-
- public void setWeekImg(String weekImg) {
- this.weekImg = weekImg;
- }
-
- public void setMonthImg(String monthImg) {
- this.monthImg = monthImg;
- }
-
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof StockVO)) return false;
- StockVO other = (StockVO) o;
- if (!other.canEqual(this)) return false;
- if (getId() != other.getId()) return false;
- Object this$name = getName(), other$name = other.getName();
- if ((this$name == null) ? (other$name != null) : !this$name.equals(other$name)) return false;
- Object this$code = getCode(), other$code = other.getCode();
- if ((this$code == null) ? (other$code != null) : !this$code.equals(other$code)) return false;
- Object this$spell = getSpell(), other$spell = other.getSpell();
- if ((this$spell == null) ? (other$spell != null) : !this$spell.equals(other$spell)) return false;
- Object this$gid = getGid(), other$gid = other.getGid();
- if ((this$gid == null) ? (other$gid != null) : !this$gid.equals(other$gid)) return false;
- Object this$nowPrice = getNowPrice(), other$nowPrice = other.getNowPrice();
- if ((this$nowPrice == null) ? (other$nowPrice != null) : !this$nowPrice.equals(other$nowPrice)) return false;
- Object this$hcrate = getHcrate(), other$hcrate = other.getHcrate();
- if ((this$hcrate == null) ? (other$hcrate != null) : !this$hcrate.equals(other$hcrate)) return false;
- Object this$today_max = getToday_max(), other$today_max = other.getToday_max();
- if ((this$today_max == null) ? (other$today_max != null) : !this$today_max.equals(other$today_max))
- return false;
- Object this$today_min = getToday_min(), other$today_min = other.getToday_min();
- if ((this$today_min == null) ? (other$today_min != null) : !this$today_min.equals(other$today_min))
- return false;
- Object this$business_balance = getBusiness_balance(), other$business_balance = other.getBusiness_balance();
- if ((this$business_balance == null) ? (other$business_balance != null) : !this$business_balance.equals(other$business_balance))
- return false;
- Object this$business_amount = getBusiness_amount(), other$business_amount = other.getBusiness_amount();
- if ((this$business_amount == null) ? (other$business_amount != null) : !this$business_amount.equals(other$business_amount))
- return false;
- Object this$preclose_px = getPreclose_px(), other$preclose_px = other.getPreclose_px();
- if ((this$preclose_px == null) ? (other$preclose_px != null) : !this$preclose_px.equals(other$preclose_px))
- return false;
- Object this$open_px = getOpen_px(), other$open_px = other.getOpen_px();
- if ((this$open_px == null) ? (other$open_px != null) : !this$open_px.equals(other$open_px)) return false;
- Object this$buy1 = getBuy1(), other$buy1 = other.getBuy1();
- if ((this$buy1 == null) ? (other$buy1 != null) : !this$buy1.equals(other$buy1)) return false;
- Object this$buy2 = getBuy2(), other$buy2 = other.getBuy2();
- if ((this$buy2 == null) ? (other$buy2 != null) : !this$buy2.equals(other$buy2)) return false;
- Object this$buy3 = getBuy3(), other$buy3 = other.getBuy3();
- if ((this$buy3 == null) ? (other$buy3 != null) : !this$buy3.equals(other$buy3)) return false;
- Object this$buy4 = getBuy4(), other$buy4 = other.getBuy4();
- if ((this$buy4 == null) ? (other$buy4 != null) : !this$buy4.equals(other$buy4)) return false;
- Object this$buy5 = getBuy5(), other$buy5 = other.getBuy5();
- if ((this$buy5 == null) ? (other$buy5 != null) : !this$buy5.equals(other$buy5)) return false;
- Object this$sell1 = getSell1(), other$sell1 = other.getSell1();
- if ((this$sell1 == null) ? (other$sell1 != null) : !this$sell1.equals(other$sell1)) return false;
- Object this$sell2 = getSell2(), other$sell2 = other.getSell2();
- if ((this$sell2 == null) ? (other$sell2 != null) : !this$sell2.equals(other$sell2)) return false;
- Object this$sell3 = getSell3(), other$sell3 = other.getSell3();
- if ((this$sell3 == null) ? (other$sell3 != null) : !this$sell3.equals(other$sell3)) return false;
- Object this$sell4 = getSell4(), other$sell4 = other.getSell4();
- if ((this$sell4 == null) ? (other$sell4 != null) : !this$sell4.equals(other$sell4)) return false;
- Object this$sell5 = getSell5(), other$sell5 = other.getSell5();
- if ((this$sell5 == null) ? (other$sell5 != null) : !this$sell5.equals(other$sell5)) return false;
- Object this$buy1_num = getBuy1_num(), other$buy1_num = other.getBuy1_num();
- if ((this$buy1_num == null) ? (other$buy1_num != null) : !this$buy1_num.equals(other$buy1_num)) return false;
- Object this$buy2_num = getBuy2_num(), other$buy2_num = other.getBuy2_num();
- if ((this$buy2_num == null) ? (other$buy2_num != null) : !this$buy2_num.equals(other$buy2_num)) return false;
- Object this$buy3_num = getBuy3_num(), other$buy3_num = other.getBuy3_num();
- if ((this$buy3_num == null) ? (other$buy3_num != null) : !this$buy3_num.equals(other$buy3_num)) return false;
- Object this$buy4_num = getBuy4_num(), other$buy4_num = other.getBuy4_num();
- if ((this$buy4_num == null) ? (other$buy4_num != null) : !this$buy4_num.equals(other$buy4_num)) return false;
- Object this$buy5_num = getBuy5_num(), other$buy5_num = other.getBuy5_num();
- if ((this$buy5_num == null) ? (other$buy5_num != null) : !this$buy5_num.equals(other$buy5_num)) return false;
- Object this$sell1_num = getSell1_num(), other$sell1_num = other.getSell1_num();
- if ((this$sell1_num == null) ? (other$sell1_num != null) : !this$sell1_num.equals(other$sell1_num))
- return false;
- Object this$sell2_num = getSell2_num(), other$sell2_num = other.getSell2_num();
- if ((this$sell2_num == null) ? (other$sell2_num != null) : !this$sell2_num.equals(other$sell2_num))
- return false;
- Object this$sell3_num = getSell3_num(), other$sell3_num = other.getSell3_num();
- if ((this$sell3_num == null) ? (other$sell3_num != null) : !this$sell3_num.equals(other$sell3_num))
- return false;
- Object this$sell4_num = getSell4_num(), other$sell4_num = other.getSell4_num();
- if ((this$sell4_num == null) ? (other$sell4_num != null) : !this$sell4_num.equals(other$sell4_num))
- return false;
- Object this$sell5_num = getSell5_num(), other$sell5_num = other.getSell5_num();
- if ((this$sell5_num == null) ? (other$sell5_num != null) : !this$sell5_num.equals(other$sell5_num))
- return false;
- Object this$minImg = getMinImg(), other$minImg = other.getMinImg();
- if ((this$minImg == null) ? (other$minImg != null) : !this$minImg.equals(other$minImg)) return false;
- Object this$dayImg = getDayImg(), other$dayImg = other.getDayImg();
- if ((this$dayImg == null) ? (other$dayImg != null) : !this$dayImg.equals(other$dayImg)) return false;
- Object this$weekImg = getWeekImg(), other$weekImg = other.getWeekImg();
- if ((this$weekImg == null) ? (other$weekImg != null) : !this$weekImg.equals(other$weekImg)) return false;
- Object this$monthImg = getMonthImg(), other$monthImg = other.getMonthImg();
- return !((this$monthImg == null) ? (other$monthImg != null) : !this$monthImg.equals(other$monthImg));
- }
-
- protected boolean canEqual(Object other) {
- return other instanceof StockVO;
- }
-
- public int hashCode() {
- int PRIME = 59;
- int result = 1;
- result = result * 59 + getId();
- Object $name = getName();
- result = result * 59 + (($name == null) ? 43 : $name.hashCode());
- Object $code = getCode();
- result = result * 59 + (($code == null) ? 43 : $code.hashCode());
- Object $spell = getSpell();
- result = result * 59 + (($spell == null) ? 43 : $spell.hashCode());
- Object $gid = getGid();
- result = result * 59 + (($gid == null) ? 43 : $gid.hashCode());
- Object $nowPrice = getNowPrice();
- result = result * 59 + (($nowPrice == null) ? 43 : $nowPrice.hashCode());
- Object $hcrate = getHcrate();
- result = result * 59 + (($hcrate == null) ? 43 : $hcrate.hashCode());
- Object $today_max = getToday_max();
- result = result * 59 + (($today_max == null) ? 43 : $today_max.hashCode());
- Object $today_min = getToday_min();
- result = result * 59 + (($today_min == null) ? 43 : $today_min.hashCode());
- Object $business_balance = getBusiness_balance();
- result = result * 59 + (($business_balance == null) ? 43 : $business_balance.hashCode());
- Object $business_amount = getBusiness_amount();
- result = result * 59 + (($business_amount == null) ? 43 : $business_amount.hashCode());
- Object $preclose_px = getPreclose_px();
- result = result * 59 + (($preclose_px == null) ? 43 : $preclose_px.hashCode());
- Object $open_px = getOpen_px();
- result = result * 59 + (($open_px == null) ? 43 : $open_px.hashCode());
- Object $buy1 = getBuy1();
- result = result * 59 + (($buy1 == null) ? 43 : $buy1.hashCode());
- Object $buy2 = getBuy2();
- result = result * 59 + (($buy2 == null) ? 43 : $buy2.hashCode());
- Object $buy3 = getBuy3();
- result = result * 59 + (($buy3 == null) ? 43 : $buy3.hashCode());
- Object $buy4 = getBuy4();
- result = result * 59 + (($buy4 == null) ? 43 : $buy4.hashCode());
- Object $buy5 = getBuy5();
- result = result * 59 + (($buy5 == null) ? 43 : $buy5.hashCode());
- Object $sell1 = getSell1();
- result = result * 59 + (($sell1 == null) ? 43 : $sell1.hashCode());
- Object $sell2 = getSell2();
- result = result * 59 + (($sell2 == null) ? 43 : $sell2.hashCode());
- Object $sell3 = getSell3();
- result = result * 59 + (($sell3 == null) ? 43 : $sell3.hashCode());
- Object $sell4 = getSell4();
- result = result * 59 + (($sell4 == null) ? 43 : $sell4.hashCode());
- Object $sell5 = getSell5();
- result = result * 59 + (($sell5 == null) ? 43 : $sell5.hashCode());
- Object $buy1_num = getBuy1_num();
- result = result * 59 + (($buy1_num == null) ? 43 : $buy1_num.hashCode());
- Object $buy2_num = getBuy2_num();
- result = result * 59 + (($buy2_num == null) ? 43 : $buy2_num.hashCode());
- Object $buy3_num = getBuy3_num();
- result = result * 59 + (($buy3_num == null) ? 43 : $buy3_num.hashCode());
- Object $buy4_num = getBuy4_num();
- result = result * 59 + (($buy4_num == null) ? 43 : $buy4_num.hashCode());
- Object $buy5_num = getBuy5_num();
- result = result * 59 + (($buy5_num == null) ? 43 : $buy5_num.hashCode());
- Object $sell1_num = getSell1_num();
- result = result * 59 + (($sell1_num == null) ? 43 : $sell1_num.hashCode());
- Object $sell2_num = getSell2_num();
- result = result * 59 + (($sell2_num == null) ? 43 : $sell2_num.hashCode());
- Object $sell3_num = getSell3_num();
- result = result * 59 + (($sell3_num == null) ? 43 : $sell3_num.hashCode());
- Object $sell4_num = getSell4_num();
- result = result * 59 + (($sell4_num == null) ? 43 : $sell4_num.hashCode());
- Object $sell5_num = getSell5_num();
- result = result * 59 + (($sell5_num == null) ? 43 : $sell5_num.hashCode());
- Object $minImg = getMinImg();
- result = result * 59 + (($minImg == null) ? 43 : $minImg.hashCode());
- Object $dayImg = getDayImg();
- result = result * 59 + (($dayImg == null) ? 43 : $dayImg.hashCode());
- Object $weekImg = getWeekImg();
- result = result * 59 + (($weekImg == null) ? 43 : $weekImg.hashCode());
- Object $monthImg = getMonthImg();
- return result * 59 + (($monthImg == null) ? 43 : $monthImg.hashCode());
- }
-
- public String toString() {
- return "StockVO(id=" + getId() + ", name=" + getName() + ", code=" + getCode() + ", spell=" + getSpell() + ", gid=" + getGid() + ", nowPrice=" + getNowPrice() + ", hcrate=" + getHcrate() + ", today_max=" + getToday_max() + ", today_min=" + getToday_min() + ", business_balance=" + getBusiness_balance() + ", business_amount=" + getBusiness_amount() + ", preclose_px=" + getPreclose_px() + ", open_px=" + getOpen_px() + ", buy1=" + getBuy1() + ", buy2=" + getBuy2() + ", buy3=" + getBuy3() + ", buy4=" + getBuy4() + ", buy5=" + getBuy5() + ", sell1=" + getSell1() + ", sell2=" + getSell2() + ", sell3=" + getSell3() + ", sell4=" + getSell4() + ", sell5=" + getSell5() + ", buy1_num=" + getBuy1_num() + ", buy2_num=" + getBuy2_num() + ", buy3_num=" + getBuy3_num() + ", buy4_num=" + getBuy4_num() + ", buy5_num=" + getBuy5_num() + ", sell1_num=" + getSell1_num() + ", sell2_num=" + getSell2_num() + ", sell3_num=" + getSell3_num() + ", sell4_num=" + getSell4_num() + ", sell5_num=" + getSell5_num() + ", minImg=" + getMinImg() + ", dayImg=" + getDayImg() + ", weekImg=" + getWeekImg() + ", monthImg=" + getMonthImg()+ ", depositAmt=" + getDepositAmt() + ")";
- }
-
-
- public int getId() {
- return this.id;
- }
-
-
- public String getName() {
- return this.name;
- }
-
- public String getCode() {
- return this.code;
- }
-
- public String getSpell() {
- return this.spell;
- }
-
- public String getGid() {
- return this.gid;
- }
-
-
- public String getNowPrice() {
- return this.nowPrice;
- }
-
-
- public BigDecimal getHcrate() {
- return this.hcrate;
- }
-
-
- public String getToday_max() {
- return this.today_max;
- }
-
-
- public String getToday_min() {
- return this.today_min;
- }
-
-
- public String getBusiness_balance() {
- return this.business_balance;
- }
-
-
- public String getBusiness_amount() {
- return this.business_amount;
- }
-
-
- public String getPreclose_px() {
- return this.preclose_px;
- }
-
-
- public String getOpen_px() {
- return this.open_px;
- }
-
-
- public String getBuy1() {
- return this.buy1;
- }
-
- public String getBuy2() {
- return this.buy2;
- }
-
- public String getBuy3() {
- return this.buy3;
- }
-
- public String getBuy4() {
- return this.buy4;
- }
-
- public String getBuy5() {
- return this.buy5;
- }
-
-
- public String getSell1() {
- return this.sell1;
- }
-
- public String getSell2() {
- return this.sell2;
- }
-
- public String getSell3() {
- return this.sell3;
- }
-
- public String getSell4() {
- return this.sell4;
- }
-
- public String getSell5() {
- return this.sell5;
- }
-
-
- public String getBuy1_num() {
- return this.buy1_num;
- }
-
- public String getBuy2_num() {
- return this.buy2_num;
- }
-
- public String getBuy3_num() {
- return this.buy3_num;
- }
-
- public String getBuy4_num() {
- return this.buy4_num;
- }
-
- public String getBuy5_num() {
- return this.buy5_num;
- }
-
-
- public String getSell1_num() {
- return this.sell1_num;
- }
-
- public String getSell2_num() {
- return this.sell2_num;
- }
-
- public String getSell3_num() {
- return this.sell3_num;
- }
-
- public String getSell4_num() {
- return this.sell4_num;
- }
-
- public String getSell5_num() {
- return this.sell5_num;
- }
-
-
- public String getMinImg() {
- return this.minImg;
- }
-
- public String getDayImg() {
- return this.dayImg;
- }
-
- public String getWeekImg() {
- return this.weekImg;
- }
-
- public String getMonthImg() {
- return this.monthImg;
- }
-
- public Integer getDepositAmt() {
- return depositAmt;
- }
- public void setDepositAmt(Integer depositAmt) {
- this.depositAmt = depositAmt;
- }
}
diff --git a/src/main/java/com/nq/vo/user/UserInfoVO.java b/src/main/java/com/nq/vo/user/UserInfoVO.java
index f18e257..c03493f 100644
--- a/src/main/java/com/nq/vo/user/UserInfoVO.java
+++ b/src/main/java/com/nq/vo/user/UserInfoVO.java
@@ -38,42 +38,9 @@
private String img3Key;
private Integer isActive;
private String authMsg;
- // 卢比的总资产
- private BigDecimal userAmt;
-
- private String userAmtToUsdt;
-
- // 卢比的可以资金
- private BigDecimal enableAmt;
- // 卢比的可以资金
- private String enableAmtToUsdt;
-
- // 卢比的盈利
- private BigDecimal allProfitAndLose;
-
- // 卢比的盈利
- private String allProfitAndLoseToUsdt;
-
- private BigDecimal userIndexAmt;
- private BigDecimal enableIndexAmt;
- // 卢比的盈利
- private BigDecimal usAllProfitAndLose;
- private BigDecimal userFuturesAmt;
- private BigDecimal enableFuturesAmt;
-
- private BigDecimal allFreezAmt;
-
- private String allFreezAmtToUsdt;
-
- private BigDecimal usAllFreezAmt;
-
- private BigDecimal allIndexProfitAndLose;
- private BigDecimal allIndexFreezAmt;
- private BigDecimal allFuturesProfitAndLose;
- private BigDecimal allFuturesFreezAmt;
/**
* 杠杆倍数,多个用/分割
*/
@@ -98,440 +65,11 @@
private String vaildNumber;
- public void setAgentId(Integer agentId) {
- this.agentId = agentId;
- }
+ private String masTotalAssets;
- public void setAgentName(String agentName) {
- this.agentName = agentName;
- }
-
- public void setPhone(String phone) {
- this.phone = phone;
- }
-
- public void setNickName(String nickName) {
- this.nickName = nickName;
- }
-
- public void setRealName(String realName) {
- this.realName = realName;
- }
-
- public void setIdCard(String idCard) {
- this.idCard = idCard;
- }
-
- public void setAccountType(Integer accountType) {
- this.accountType = accountType;
- }
-
- public void setRecomPhone(String recomPhone) {
- this.recomPhone = recomPhone;
- }
-
- public void setIsLock(Integer isLock) {
- this.isLock = isLock;
- }
-
- public void setRegTime(Date regTime) {
- this.regTime = regTime;
- }
-
- public void setRegIp(String regIp) {
- this.regIp = regIp;
- }
-
- public void setRegAddress(String regAddress) {
- this.regAddress = regAddress;
- }
-
- public void setImg1Key(String img1Key) {
- this.img1Key = img1Key;
- }
-
- public void setImg2Key(String img2Key) {
- this.img2Key = img2Key;
- }
-
- public void setImg3Key(String img3Key) {
- this.img3Key = img3Key;
- }
-
- public void setIsActive(Integer isActive) {
- this.isActive = isActive;
- }
-
- public void setAuthMsg(String authMsg) {
- this.authMsg = authMsg;
- }
-
- public void setUserAmt(BigDecimal userAmt) {
- this.userAmt = userAmt;
- }
-
- public void setEnableAmt(BigDecimal enableAmt) {
- this.enableAmt = enableAmt;
- }
-
- public void setUserIndexAmt(BigDecimal userIndexAmt) {
- this.userIndexAmt = userIndexAmt;
- }
-
- public void setEnableIndexAmt(BigDecimal enableIndexAmt) {
- this.enableIndexAmt = enableIndexAmt;
- }
-
- public void setUserFuturesAmt(BigDecimal userFuturesAmt) {
- this.userFuturesAmt = userFuturesAmt;
- }
-
- public void setEnableFuturesAmt(BigDecimal enableFuturesAmt) {
- this.enableFuturesAmt = enableFuturesAmt;
- }
-
- public void setAllProfitAndLose(BigDecimal allProfitAndLose) {
- this.allProfitAndLose = allProfitAndLose;
- }
-
- public void setAllFreezAmt(BigDecimal allFreezAmt) {
- this.allFreezAmt = allFreezAmt;
- }
-
- public void setAllIndexProfitAndLose(BigDecimal allIndexProfitAndLose) {
- this.allIndexProfitAndLose = allIndexProfitAndLose;
- }
-
- public void setAllIndexFreezAmt(BigDecimal allIndexFreezAmt) {
- this.allIndexFreezAmt = allIndexFreezAmt;
- }
-
- public void setAllFuturesProfitAndLose(BigDecimal allFuturesProfitAndLose) {
- this.allFuturesProfitAndLose = allFuturesProfitAndLose;
- }
-
- public void setAllFuturesFreezAmt(BigDecimal allFuturesFreezAmt) {
- this.allFuturesFreezAmt = allFuturesFreezAmt;
- }
-
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof UserInfoVO)) return false;
- UserInfoVO other = (UserInfoVO) o;
- if (!other.canEqual(this)) return false;
- Object this$id = getId(), other$id = other.getId();
- if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id)) return false;
- Object this$agentId = getAgentId(), other$agentId = other.getAgentId();
- if ((this$agentId == null) ? (other$agentId != null) : !this$agentId.equals(other$agentId)) return false;
- Object this$agentName = getAgentName(), other$agentName = other.getAgentName();
- if ((this$agentName == null) ? (other$agentName != null) : !this$agentName.equals(other$agentName))
- return false;
- Object this$phone = getPhone(), other$phone = other.getPhone();
- if ((this$phone == null) ? (other$phone != null) : !this$phone.equals(other$phone)) return false;
- Object this$nickName = getNickName(), other$nickName = other.getNickName();
- if ((this$nickName == null) ? (other$nickName != null) : !this$nickName.equals(other$nickName)) return false;
- Object this$realName = getRealName(), other$realName = other.getRealName();
- if ((this$realName == null) ? (other$realName != null) : !this$realName.equals(other$realName)) return false;
- Object this$idCard = getIdCard(), other$idCard = other.getIdCard();
- if ((this$idCard == null) ? (other$idCard != null) : !this$idCard.equals(other$idCard)) return false;
- Object this$accountType = getAccountType(), other$accountType = other.getAccountType();
- if ((this$accountType == null) ? (other$accountType != null) : !this$accountType.equals(other$accountType))
- return false;
- Object this$recomPhone = getRecomPhone(), other$recomPhone = other.getRecomPhone();
- if ((this$recomPhone == null) ? (other$recomPhone != null) : !this$recomPhone.equals(other$recomPhone))
- return false;
- Object this$isLock = getIsLock(), other$isLock = other.getIsLock();
- if ((this$isLock == null) ? (other$isLock != null) : !this$isLock.equals(other$isLock)) return false;
- Object this$regTime = getRegTime(), other$regTime = other.getRegTime();
- if ((this$regTime == null) ? (other$regTime != null) : !this$regTime.equals(other$regTime)) return false;
- Object this$regIp = getRegIp(), other$regIp = other.getRegIp();
- if ((this$regIp == null) ? (other$regIp != null) : !this$regIp.equals(other$regIp)) return false;
- Object this$regAddress = getRegAddress(), other$regAddress = other.getRegAddress();
- if ((this$regAddress == null) ? (other$regAddress != null) : !this$regAddress.equals(other$regAddress))
- return false;
- Object this$img1Key = getImg1Key(), other$img1Key = other.getImg1Key();
- if ((this$img1Key == null) ? (other$img1Key != null) : !this$img1Key.equals(other$img1Key)) return false;
- Object this$img2Key = getImg2Key(), other$img2Key = other.getImg2Key();
- if ((this$img2Key == null) ? (other$img2Key != null) : !this$img2Key.equals(other$img2Key)) return false;
- Object this$img3Key = getImg3Key(), other$img3Key = other.getImg3Key();
- if ((this$img3Key == null) ? (other$img3Key != null) : !this$img3Key.equals(other$img3Key)) return false;
- Object this$isActive = getIsActive(), other$isActive = other.getIsActive();
- if ((this$isActive == null) ? (other$isActive != null) : !this$isActive.equals(other$isActive)) return false;
- Object this$authMsg = getAuthMsg(), other$authMsg = other.getAuthMsg();
- if ((this$authMsg == null) ? (other$authMsg != null) : !this$authMsg.equals(other$authMsg)) return false;
- Object this$userAmt = getUserAmt(), other$userAmt = other.getUserAmt();
- if ((this$userAmt == null) ? (other$userAmt != null) : !this$userAmt.equals(other$userAmt)) return false;
- Object this$enableAmt = getEnableAmt(), other$enableAmt = other.getEnableAmt();
- if ((this$enableAmt == null) ? (other$enableAmt != null) : !this$enableAmt.equals(other$enableAmt))
- return false;
- Object this$userIndexAmt = getUserIndexAmt(), other$userIndexAmt = other.getUserIndexAmt();
- if ((this$userIndexAmt == null) ? (other$userIndexAmt != null) : !this$userIndexAmt.equals(other$userIndexAmt))
- return false;
- Object this$enableIndexAmt = getEnableIndexAmt(), other$enableIndexAmt = other.getEnableIndexAmt();
- if ((this$enableIndexAmt == null) ? (other$enableIndexAmt != null) : !this$enableIndexAmt.equals(other$enableIndexAmt))
- return false;
- Object this$userFuturesAmt = getUserFuturesAmt(), other$userFuturesAmt = other.getUserFuturesAmt();
- if ((this$userFuturesAmt == null) ? (other$userFuturesAmt != null) : !this$userFuturesAmt.equals(other$userFuturesAmt))
- return false;
- Object this$enableFuturesAmt = getEnableFuturesAmt(), other$enableFuturesAmt = other.getEnableFuturesAmt();
- if ((this$enableFuturesAmt == null) ? (other$enableFuturesAmt != null) : !this$enableFuturesAmt.equals(other$enableFuturesAmt))
- return false;
- Object this$allProfitAndLose = getAllProfitAndLose(), other$allProfitAndLose = other.getAllProfitAndLose();
- if ((this$allProfitAndLose == null) ? (other$allProfitAndLose != null) : !this$allProfitAndLose.equals(other$allProfitAndLose))
- return false;
- Object this$allFreezAmt = getAllFreezAmt(), other$allFreezAmt = other.getAllFreezAmt();
- if ((this$allFreezAmt == null) ? (other$allFreezAmt != null) : !this$allFreezAmt.equals(other$allFreezAmt))
- return false;
- Object this$allIndexProfitAndLose = getAllIndexProfitAndLose(), other$allIndexProfitAndLose = other.getAllIndexProfitAndLose();
- if ((this$allIndexProfitAndLose == null) ? (other$allIndexProfitAndLose != null) : !this$allIndexProfitAndLose.equals(other$allIndexProfitAndLose))
- return false;
- Object this$allIndexFreezAmt = getAllIndexFreezAmt(), other$allIndexFreezAmt = other.getAllIndexFreezAmt();
- if ((this$allIndexFreezAmt == null) ? (other$allIndexFreezAmt != null) : !this$allIndexFreezAmt.equals(other$allIndexFreezAmt))
- return false;
- Object this$allFuturesProfitAndLose = getAllFuturesProfitAndLose(), other$allFuturesProfitAndLose = other.getAllFuturesProfitAndLose();
- if ((this$allFuturesProfitAndLose == null) ? (other$allFuturesProfitAndLose != null) : !this$allFuturesProfitAndLose.equals(other$allFuturesProfitAndLose))
- return false;
- Object this$allFuturesFreezAmt = getAllFuturesFreezAmt(), other$allFuturesFreezAmt = other.getAllFuturesFreezAmt();
- return !((this$allFuturesFreezAmt == null) ? (other$allFuturesFreezAmt != null) : !this$allFuturesFreezAmt.equals(other$allFuturesFreezAmt));
- }
-
- protected boolean canEqual(Object other) {
- return other instanceof UserInfoVO;
- }
-
- public int hashCode() {
- int PRIME = 59;
- int result = 1;
- Object $id = getId();
- result = result * 59 + (($id == null) ? 43 : $id.hashCode());
- Object $agentId = getAgentId();
- result = result * 59 + (($agentId == null) ? 43 : $agentId.hashCode());
- Object $agentName = getAgentName();
- result = result * 59 + (($agentName == null) ? 43 : $agentName.hashCode());
- Object $phone = getPhone();
- result = result * 59 + (($phone == null) ? 43 : $phone.hashCode());
- Object $nickName = getNickName();
- result = result * 59 + (($nickName == null) ? 43 : $nickName.hashCode());
- Object $realName = getRealName();
- result = result * 59 + (($realName == null) ? 43 : $realName.hashCode());
- Object $idCard = getIdCard();
- result = result * 59 + (($idCard == null) ? 43 : $idCard.hashCode());
- Object $accountType = getAccountType();
- result = result * 59 + (($accountType == null) ? 43 : $accountType.hashCode());
- Object $recomPhone = getRecomPhone();
- result = result * 59 + (($recomPhone == null) ? 43 : $recomPhone.hashCode());
- Object $isLock = getIsLock();
- result = result * 59 + (($isLock == null) ? 43 : $isLock.hashCode());
- Object $regTime = getRegTime();
- result = result * 59 + (($regTime == null) ? 43 : $regTime.hashCode());
- Object $regIp = getRegIp();
- result = result * 59 + (($regIp == null) ? 43 : $regIp.hashCode());
- Object $regAddress = getRegAddress();
- result = result * 59 + (($regAddress == null) ? 43 : $regAddress.hashCode());
- Object $img1Key = getImg1Key();
- result = result * 59 + (($img1Key == null) ? 43 : $img1Key.hashCode());
- Object $img2Key = getImg2Key();
- result = result * 59 + (($img2Key == null) ? 43 : $img2Key.hashCode());
- Object $img3Key = getImg3Key();
- result = result * 59 + (($img3Key == null) ? 43 : $img3Key.hashCode());
- Object $isActive = getIsActive();
- result = result * 59 + (($isActive == null) ? 43 : $isActive.hashCode());
- Object $authMsg = getAuthMsg();
- result = result * 59 + (($authMsg == null) ? 43 : $authMsg.hashCode());
- Object $userAmt = getUserAmt();
- result = result * 59 + (($userAmt == null) ? 43 : $userAmt.hashCode());
- Object $enableAmt = getEnableAmt();
- result = result * 59 + (($enableAmt == null) ? 43 : $enableAmt.hashCode());
- Object $userIndexAmt = getUserIndexAmt();
- result = result * 59 + (($userIndexAmt == null) ? 43 : $userIndexAmt.hashCode());
- Object $enableIndexAmt = getEnableIndexAmt();
- result = result * 59 + (($enableIndexAmt == null) ? 43 : $enableIndexAmt.hashCode());
- Object $userFuturesAmt = getUserFuturesAmt();
- result = result * 59 + (($userFuturesAmt == null) ? 43 : $userFuturesAmt.hashCode());
- Object $enableFuturesAmt = getEnableFuturesAmt();
- result = result * 59 + (($enableFuturesAmt == null) ? 43 : $enableFuturesAmt.hashCode());
- Object $allProfitAndLose = getAllProfitAndLose();
- result = result * 59 + (($allProfitAndLose == null) ? 43 : $allProfitAndLose.hashCode());
- Object $allFreezAmt = getAllFreezAmt();
- result = result * 59 + (($allFreezAmt == null) ? 43 : $allFreezAmt.hashCode());
- Object $allIndexProfitAndLose = getAllIndexProfitAndLose();
- result = result * 59 + (($allIndexProfitAndLose == null) ? 43 : $allIndexProfitAndLose.hashCode());
- Object $allIndexFreezAmt = getAllIndexFreezAmt();
- result = result * 59 + (($allIndexFreezAmt == null) ? 43 : $allIndexFreezAmt.hashCode());
- Object $allFuturesProfitAndLose = getAllFuturesProfitAndLose();
- result = result * 59 + (($allFuturesProfitAndLose == null) ? 43 : $allFuturesProfitAndLose.hashCode());
- Object $allFuturesFreezAmt = getAllFuturesFreezAmt();
- return result * 59 + (($allFuturesFreezAmt == null) ? 43 : $allFuturesFreezAmt.hashCode());
- }
-
- public String toString() {
- return "UserInfoVO(id=" + getId() + ", agentId=" + getAgentId() + ", agentName=" + getAgentName() + ", phone=" + getPhone() + ", nickName=" + getNickName() + ", realName=" + getRealName() + ", idCard=" + getIdCard() + ", accountType=" + getAccountType() + ", recomPhone=" + getRecomPhone() + ", isLock=" + getIsLock() + ", regTime=" + getRegTime() + ", regIp=" + getRegIp() + ", regAddress=" + getRegAddress() + ", img1Key=" + getImg1Key() + ", img2Key=" + getImg2Key() + ", img3Key=" + getImg3Key() + ", isActive=" + getIsActive() + ", authMsg=" + getAuthMsg() + ", userAmt=" + getUserAmt() + ", enableAmt=" + getEnableAmt() + ", userIndexAmt=" + getUserIndexAmt() + ", enableIndexAmt=" + getEnableIndexAmt() + ", userFuturesAmt=" + getUserFuturesAmt() + ", enableFuturesAmt=" + getEnableFuturesAmt() + ", allProfitAndLose=" + getAllProfitAndLose() + ", allFreezAmt=" + getAllFreezAmt() + ", allIndexProfitAndLose=" + getAllIndexProfitAndLose() + ", allIndexFreezAmt=" + getAllIndexFreezAmt() + ", allFuturesProfitAndLose=" + getAllFuturesProfitAndLose() + ", allFuturesFreezAmt=" + getAllFuturesFreezAmt() + ",siteLever=" +getSiteLever()+ ",tradingAmount="+ getTradingAmount() + ")";
- }
-
-
- public Integer getId() {
- return this.id;
- }
-
-
- public Integer getAgentId() {
- return this.agentId;
- }
-
-
- public String getAgentName() {
- return this.agentName;
- }
-
-
- public String getPhone() {
- return this.phone;
- }
-
-
- public String getNickName() {
- return this.nickName;
- }
-
-
- public String getRealName() {
- return this.realName;
- }
-
-
- public String getIdCard() {
- return this.idCard;
- }
-
-
- public Integer getAccountType() {
- return this.accountType;
- }
-
-
- public String getRecomPhone() {
- return this.recomPhone;
- }
-
-
- public Integer getIsLock() {
- return this.isLock;
- }
-
-
- public Date getRegTime() {
- return this.regTime;
- }
-
-
- public String getRegIp() {
- return this.regIp;
- }
-
-
- public String getRegAddress() {
- return this.regAddress;
- }
-
-
- public String getImg1Key() {
- return this.img1Key;
- }
-
-
- public String getImg2Key() {
- return this.img2Key;
- }
-
-
- public String getImg3Key() {
- return this.img3Key;
- }
-
-
- public Integer getIsActive() {
- return this.isActive;
- }
-
-
- public String getAuthMsg() {
- return this.authMsg;
- }
-
-
- public BigDecimal getUserAmt() {
- return this.userAmt;
- }
-
-
- public BigDecimal getEnableAmt() {
- return this.enableAmt;
- }
-
-
- public BigDecimal getUserIndexAmt() {
- return this.userIndexAmt;
- }
-
-
- public BigDecimal getEnableIndexAmt() {
- return this.enableIndexAmt;
- }
-
-
- public BigDecimal getUserFuturesAmt() {
- return this.userFuturesAmt;
- }
-
-
- public BigDecimal getEnableFuturesAmt() {
- return this.enableFuturesAmt;
- }
-
-
- public BigDecimal getAllProfitAndLose() {
- return this.allProfitAndLose;
- }
-
-
- public BigDecimal getAllFreezAmt() {
- return this.allFreezAmt;
- }
-
-
- public BigDecimal getAllIndexProfitAndLose() {
- return this.allIndexProfitAndLose;
- }
-
-
- public BigDecimal getAllIndexFreezAmt() {
- return this.allIndexFreezAmt;
- }
-
-
- public BigDecimal getAllFuturesProfitAndLose() {
- return this.allFuturesProfitAndLose;
- }
-
-
- public BigDecimal getAllFuturesFreezAmt() {
- return this.allFuturesFreezAmt;
- }
-
- public String getSiteLever() {
- return siteLever;
- }
+ private String usTotalAssets;
- public void setSiteLever(String siteLever) {
- this.siteLever = siteLever;
- }
- public BigDecimal getTradingAmount() {
- return tradingAmount;
- }
- public void setTradingAmount(BigDecimal tradingAmount) {
- this.tradingAmount = tradingAmount;
- }
}
diff --git a/src/main/java/com/nq/ws/USWebsocketRunClient.java b/src/main/java/com/nq/ws/USWebsocketRunClient.java
index 0ef31a1..be2df7d 100644
--- a/src/main/java/com/nq/ws/USWebsocketRunClient.java
+++ b/src/main/java/com/nq/ws/USWebsocketRunClient.java
@@ -1,13 +1,16 @@
package com.nq.ws;
import com.google.gson.Gson;
-import com.nq.constant.StockConstant;
import com.nq.enums.EStockType;
import com.nq.pojo.StockRealTimeBean;
+import com.nq.service.IMandatoryLiquidationService;
+import com.nq.service.impl.MandatoryLiquidationService;
+import com.nq.utils.ApplicationContextRegisterUtil;
import com.nq.utils.redis.RedisKeyUtil;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
+import org.springframework.context.ApplicationContext;
import java.net.URI;
@@ -20,15 +23,18 @@
@Override
public void onOpen(ServerHandshake serverHandshake) {
- log.info("webSocket 客服端链接成功");
send(("key:"+ EStockType.US.stockKey+":"+EStockType.US.getContryId()).getBytes());
}
@Override
public void onMessage(String s) {
try {
+
StockRealTimeBean stockDetailBean = new Gson().fromJson(s, StockRealTimeBean.class);
RedisKeyUtil.setCacheRealTimeStock(EStockType.US,stockDetailBean);
+ ApplicationContext act = ApplicationContextRegisterUtil.getApplicationContext();
+ MandatoryLiquidationService liquidationService = (MandatoryLiquidationService) act.getBean(IMandatoryLiquidationService.class);
+ liquidationService.RealTimeDataProcess(EStockType.US,stockDetailBean);
}catch (Exception e){
}
diff --git a/src/main/java/com/nq/ws/WebSocketClientBeanConfig.java b/src/main/java/com/nq/ws/WebSocketClientBeanConfig.java
index 8d731e5..7db3159 100644
--- a/src/main/java/com/nq/ws/WebSocketClientBeanConfig.java
+++ b/src/main/java/com/nq/ws/WebSocketClientBeanConfig.java
@@ -1,8 +1,8 @@
package com.nq.ws;
-import com.nq.constant.StockConstant;
import com.nq.enums.EStockType;
+import com.nq.utils.PropertiesUtil;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.springframework.context.annotation.Bean;
@@ -26,7 +26,7 @@
try {
- WebsocketRunClient websocketRunClient = new WebsocketRunClient(new URI(StockConstant.WS_URL));
+ WebsocketRunClient websocketRunClient = new WebsocketRunClient(new URI(PropertiesUtil.getProperty("US_WS_URL")));
websocketRunClient.connect();
websocketRunClient.setConnectionLostTimeout(0);
new Thread(() -> {
@@ -43,25 +43,25 @@
retMap.put(EStockType.IN.getStockKey(), websocketRunClient);
} catch (Exception e) {
}
-
- try {
- USWebsocketRunClient usWebsocketRunClient = new USWebsocketRunClient(new URI(StockConstant.US_WS_URL));
- usWebsocketRunClient.connect();
- usWebsocketRunClient.setConnectionLostTimeout(0);
- new Thread(() -> {
- while (true) {
- try {
- Thread.sleep(8000);
- usWebsocketRunClient.send("heartbeat".getBytes());
- } catch (Exception e) {
- usWebsocketRunClient.reconnect();
- usWebsocketRunClient.setConnectionLostTimeout(0);
- }
- }
- }).start();
- retMap.put(EStockType.US.getStockKey(), usWebsocketRunClient);
- } catch (Exception e) {
- }
+//
+// try {
+// USWebsocketRunClient usWebsocketRunClient = new USWebsocketRunClient(new URI(PropertiesUtil.getProperty("IN_WS_URL")));
+// usWebsocketRunClient.connect();
+// usWebsocketRunClient.setConnectionLostTimeout(0);
+// new Thread(() -> {
+// while (true) {
+// try {
+// Thread.sleep(8000);
+// usWebsocketRunClient.send("heartbeat".getBytes());
+// } catch (Exception e) {
+// usWebsocketRunClient.reconnect();
+// usWebsocketRunClient.setConnectionLostTimeout(0);
+// }
+// }
+// }).start();
+// retMap.put(EStockType.US.getStockKey(), usWebsocketRunClient);
+// } catch (Exception e) {
+// }
return retMap;
}
diff --git a/src/main/java/com/nq/ws/WebsocketRunClient.java b/src/main/java/com/nq/ws/WebsocketRunClient.java
index f6fe1c9..f134b2a 100644
--- a/src/main/java/com/nq/ws/WebsocketRunClient.java
+++ b/src/main/java/com/nq/ws/WebsocketRunClient.java
@@ -1,14 +1,16 @@
package com.nq.ws;
import com.google.gson.Gson;
-import com.nq.constant.StockConstant;
import com.nq.enums.EStockType;
import com.nq.pojo.StockRealTimeBean;
+import com.nq.service.IMandatoryLiquidationService;
+import com.nq.service.impl.MandatoryLiquidationService;
+import com.nq.utils.ApplicationContextRegisterUtil;
import com.nq.utils.redis.RedisKeyUtil;
-import com.nq.utils.redis.RedisShardedPoolUtils;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
+import org.springframework.context.ApplicationContext;
import java.net.URI;
@@ -21,15 +23,18 @@
@Override
public void onOpen(ServerHandshake serverHandshake) {
- log.info("webSocket 客服端链接成功");
- send(("key:"+ StockConstant.KEY+":"+EStockType.IN.getContryId()).getBytes());
+ send(("key:"+ EStockType.IN.getStockKey()+":"+EStockType.IN.getContryId()).getBytes());
}
@Override
public void onMessage(String s) {
try {
+
+
+ ApplicationContext act = ApplicationContextRegisterUtil.getApplicationContext();
+ MandatoryLiquidationService liquidationService = (MandatoryLiquidationService) act.getBean(IMandatoryLiquidationService.class);
StockRealTimeBean stockDetailBean = new Gson().fromJson(s, StockRealTimeBean.class);
- RedisKeyUtil.setCacheRealTimeStock(EStockType.IN,stockDetailBean);
+ liquidationService.RealTimeDataProcess(EStockType.IN,stockDetailBean);
}catch (Exception e){
}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index e7fd2f1..d829f66 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -5,22 +5,16 @@
#2. ??ifconfig????vsftpd?????
#3. ???? ftp://??
-ftp.server.ip=27.50.59.221
-ftp.user=ftp_anxinsecurities_com
-ftp.pass=Ja6jjhShJPySEzLP
-ftp.server.http.prefix=http://ftp.anxinsecurities.com/
-#ftp.server.ip=47.56.200.145
-#ftp.user=ofsuccess
-#ftp.pass=fdymdM34HHsS8iB6
-#ftp.server.http.prefix=http://www.img.yfkgzq.com/
+ftp.server.ip=45.204.85.67
+ftp.user=ftp_stock
+ftp.pass=123456
+ftp.server.http.prefix=https://img.3falcon.com/
-# redis config start
+
redis1.ip=localhost
redis1.port=6379
redis1.pwd=
redis1.timeout=10000
-#redis2.ip=47.52.34.37
-#redis2.port=6380
redis.max.total=50
redis.max.idle=10
redis.min.idle=2
@@ -36,6 +30,39 @@
agent.key.prefix=Mi
admin.super.name=18916320007
+
+
+#股票key的地址
+IN_HTTP_API = http://api-in.js-stock.top/
+IN_WS_URL = ws://api-in-ws.js-stock.top
+IN_KEY = r3ZAgtcYzuBizmqge2hK
+
+US_HTTP_API = http://test.js-stock.top/
+US_WS_URL = ws://api-in-ws.js-stock.top
+US_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+HK_HTTP_API = http://test.js-stock.top/
+HK_WS_URL = ws://api-in-ws.js-stock.top
+HK_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+
+HG_HTTP_API = http://test.js-stock.top/
+HG_WS_URL = ws://api-in-ws.js-stock.top
+HG_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+
+
+TH_HTTP_API = http://test.js-stock.top/
+TH_WS_URL = ws://api-in-ws.js-stock.top
+TH_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+MAS_HTTP_API = http://test.js-stock.top/
+MAS_WS_URL = ws://api-in-ws.js-stock.top
+MAS_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+SZHB_HTTP_API = https://api.huobi.pro/
+SZHB_WS_URL = ws://api-in-ws.js-stock.top
+SZHB_KEY = GBZAcUPLKZzDMDjvV9Ea
#?? ?? - ????
@@ -59,21 +86,8 @@
#juhe api
juhe.stock.key=e27571e4f5f2f07440bf4996d01d5770
juhe.ip.key=e5ad6f81997d4f101cc3d17409e18d96
-#??juhe.ip.key1=ea84726df1d952b8271e118eca51be34//a86451534a6e72728b8cea430dabc633//e5ad6f81997d4f101cc3d17409e18d96//ea84726df1d952b8271e118eca51be34
-
-#juhe api end
-
-#site setting
-site.email.auth.url=/api/admin/authCharge.do
-site.pc.reg.url=/homes/#/register?code=
-site.m.reg.url=/wap/#/register?code=
-
-#??????
-#pc.refresh.time=3000
-# ?? API ??
-#sina.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_sh000001,s_sz399001,s_sz399006,s_sz399300,s_sz399005,s_sz399673
sina.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_sh000001,s_sz399001,s_sz399006,s_sz399300,s_sz399005,s_sz399673,s_sz399106,s_sz399004,s_sz399100
sina.single.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_
@@ -88,14 +102,11 @@
sina.single.stock.week.url=http://image.sinajs.cn/newchart/weekly/n/
sina.single.stock.month.url=http://image.sinajs.cn/newchart/monthly/n/
getUrl=http://192.168.10.3
-#????cookle
cookle=xq_a_token=d269ad4aee7ece063038900846f9541a7d0ead07
-#????
hk.stock.url = https://32.push2delay.eastmoney.com/api/qt/clist/get?pn=1&pz=9999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f3&fs=m:128+t:3,m:128+t:4,m:128+t:1,m:128+t:2&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
hk.stock.introduction.url =https://datacenter.eastmoney.com/securities/api/data/v1/get?reportName=RPT_HKF10_INFO_ORGPROFILE&columns=SECUCODE,SECURITY_CODE,ORG_NAME,ORG_EN_ABBR,BELONG_INDUSTRY,FOUND_DATE,CHAIRMAN,SECRETARY,ACCOUNT_FIRM,REG_ADDRESS,ADDRESS,YEAR_SETTLE_DAY,EMP_NUM,ORG_TEL,ORG_FAX,ORG_EMAIL,ORG_WEB,ORG_PROFILE,REG_PLACE"eColumns=&filter=(SECUCODE=
hk.index.url = https://56.push2.eastmoney.com/api/qt/clist/get?pn=1&pz=9999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f5&fs=m:124,m:125,m:305&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
hk.index.introduction.url = https://newsinfo.eastmoney.com/kuaixun/v2/api/Channel/5/0/0/50
-#????
us.stock.url = https://1.push2.eastmoney.com/api/qt/clist/get?cb=jQuery1124024849404112285045_1668165974609&pn=1&pz=99999999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f2&fs=m:105,m:106,m:107&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
us.stock.introduction.url =https://emweb.eastmoney.com/pc_usf10/CompanyInfo/PageAjax?fullCode=
us.stock.buy.url = https://push2.eastmoney.com/api/qt/stock/details/get?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f55&fltt=2&pos=-14&secid=
@@ -142,57 +153,13 @@
sina.StockType.list.url=http://b.workingman.icu/stock/api/stock/getStockType?exchange=
sina.StockCategory.list.url=http://b.workingman.icu/stock/api/stock/getWapStocks
-http.proxyHost =
-http.proxyPort =
-https.proxyHost =
-https.proxyPort =
-
-# ????
-#????
-juhe1.pay.callbackurl=http://xx.com
-#??????
-juhe1.pay.notifyurl=http://xx.com
#Fly ??
fly.pay.merchantid=SLPNXG
fly.pay.token=0a17a92f45816a88431fa326b3b61baf
-#Cmc ??
-#??????
-cmc.pay.key=0a17a92f45816a88431fa326b3b61baf
-#????appid
-cmc.pay.uid=74021809
-#??????
-cmc.pay.return_url=https://www.bldzb666888.com/homes/#/rechargelist
-#??????
-cmc.pay.notify_url=https://www.bldzb666888.com/api/pay/juhenewpayNotify.do
-#???????
-cmc.pay.url=http://pay.phu889.com/api.php/webRequest/tradePay
-
-fly.pay.serverbackurl=http://www.honghoo.top/api/pay/flyNotify.do
-fly.pay.callbackurl=http://www.honghoo.top/wap/#/user
-
-fly.pay.payurl=https://zf.flyotcpay.com/payment/
-
-
-#????
-#???
-wj.sms.uid=yhi1993
-#??
-wj.sms.key=5802bf8c5e3c5bc46c48
-#??gbk/utf8
-wj.sms.coding=utf8
-#短信宝
-#dxb.sms.USERNAME=banbao
-#dxb.sms.PASSWORD=a705312041274b72b77d43b0ce136913
-#?????
-website.domain.url=http://www.huijuwang888.com
-website.token=0DC8F78384C7AAFF3192A9C60A473FEE7F89C62888689616B98A06910E86B510
-#?????
-news.main.url=http://eminfo.eastmoney.com
-spring.main.allow-circular-references=true
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 109fcbe..d3f9d35 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -13,13 +13,11 @@
max: 800
# Tomcat启动初始化的线程数,默认值10
min-spare: 100
-
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
-
# token配置
token:
# 令牌自定义标识
@@ -65,6 +63,21 @@
time-zone: Asia/Kolkata
profiles:
active: druid
+ flyway:
+ enabled: true
+ # 禁止清理数据库表
+ clean-disabled: false
+ # 如果数据库不是空表,需要设置成 true,否则启动报错
+ baseline-on-migrate: true
+ # 与 baseline-on-migrate: true 搭配使用
+ baseline-version: 0
+ #数据库连接配置
+ url: ${spring.datasource.url}
+ user: ${spring.datasource.name}
+ password: ${spring.datasource.password}
+ locations: classpath:db/migration/ #(根据个人情况设置,多个路径使用逗号分隔)
+ #版本控制日志表,默认flyway_schema_history
+ table: flyway_schema_history
# 文件上传
servlet:
multipart:
@@ -109,12 +122,9 @@
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://127.0.0.1:3306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
- rname: root
- password: root
-# url: jdbc:mysql://114.29.252.25:3306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-# username: root
-# password: Err;2[eoGFUriwdgr
+ url: jdbc:mysql://45.204.85.67111:6306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ name: root
+ password: f6fac591b6fcd9d6
druid:
# 初始连接数
initialSize: 5
diff --git a/src/main/resources/mapper/SitePayMapper.xml b/src/main/resources/mapper/SitePayMapper.xml
index 7199f33..129bea7 100644
--- a/src/main/resources/mapper/SitePayMapper.xml
+++ b/src/main/resources/mapper/SitePayMapper.xml
@@ -2,31 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.SitePayMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.SitePay" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
+ <id column="id" property="id"/>
+ <result column="c_type" property="cType"/>
+ <result column="form_url" property="formUrl"/>
+ <result column="form_code" property="formCode"/>
- <arg column="c_type" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="form_url" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="form_code" jdbcType="VARCHAR" javaType="java.lang.String" />
-
- <arg column="channel_type" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_desc" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_account" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_img" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_min_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="channel_max_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="is_show" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="totalPrice" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
+ <result column="channel_type" property="channelType"/>
+ <result column="channel_name" property="channelName"/>
+ <result column="channel_desc" property="channelDesc"/>
+ <result column="channel_account" property="channelAccount"/>
+ <result column="channel_img" property="channelImg"/>
+ <result column="channel_min_limit" property="channelMinLimit"/>
+ <result column="channel_max_limit" property="channelMaxLimit"/>
+ <result column="is_show" property="isShow"/>
+ <result column="is_lock" property="isLock"/>
+ <result column="total_price" property="totalPrice"/>
+ <result column="assets_type" property="assetsType"/>
- </constructor>
</resultMap>
<sql id="Base_Column_List" >
id, c_type,form_url,form_code,channel_type, channel_name, channel_desc, channel_account, channel_img, channel_min_limit,
- channel_max_limit, is_show, is_lock, totalPrice
+ channel_max_limit, is_show, is_lock, total_price,assets_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
@@ -235,10 +233,7 @@
<select id="getPayInfo" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
- FROM site_pay WHERE is_show = 0 and channel_max_limit>totalPrice
- <if test="payAmt != null and payAmt > 0">
- and channel_min_limit <= #{payAmt} and channel_max_limit> #{payAmt}
- </if>
+ FROM site_pay WHERE is_show = 0
</select>
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index 84fc361..8efe003 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -2,421 +2,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.nq.pojo.User">
- <constructor>
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="user_pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="with_pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="real_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="id_card" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="account_type" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="user_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="sum_charge_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="sum_buy_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="recom_phone" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="is_login" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="reg_time" jdbcType="TIMESTAMP" javaType="java.util.Date"/>
- <arg column="reg_ip" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="reg_address" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img1_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img2_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img3_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="is_active" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="auth_msg" jdbcType="VARCHAR" javaType="java.lang.String"/>
+ <id column="id" property="id"/>
+ <result column="agent_id" property="agentId"/>
+ <result column="agent_name" property="agentName"/>
+ <result column="phone" property="phone"/>
+ <result column="user_pwd" property="userPwd"/>
+ <result column="with_pwd" property="withPwd"/>
+ <result column="nick_name" property="nickName"/>
+ <result column="real_name" property="realName"/>
+ <result column="id_card" property="idCard"/>
+ <result column="account_type" property="accountType"/>
+ <result column="is_lock" property="isLock"/>
+ <result column="is_login" property="isLogin"/>
+ <result column="reg_time" property="regTime"/>
+ <result column="reg_ip" property="regIp"/>
+ <result column="reg_address" property="regAddress"/>
+ <result column="img1_key" property="img1Key"/>
+ <result column="img2_key" property="img2Key"/>
+ <result column="img3_key" property="img3Key"/>
+ <result column="is_active" property="isActive"/>
+ <result column="auth_msg" property="authMsg"/>
+ <result column="withdrawal_Pwd" property="withdrawalPwd"/>
+ <result column="vaild_number" property="vaildNumber"/>
- <arg column="user_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="user_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="withdrawal_Pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="trading_amount" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="djzj" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="vaild_number" jdbcType="VARCHAR" javaType="java.lang.String"/>
-
- </constructor>
</resultMap>
<sql id="Base_Column_List">
id, agent_id, agent_name, phone, user_pwd, with_pwd, nick_name, real_name, id_card,
- account_type, user_amt, enable_amt, sum_charge_amt, sum_buy_amt, recom_phone, is_lock, is_login,
+ account_type, is_lock, is_login,
reg_time, reg_ip, reg_address, img1_key, img2_key, img3_key, is_active, auth_msg,
- user_index_amt, enable_index_amt, user_fut_amt, enable_fut_amt, withdrawal_Pwd,trading_amount,djzj,vaild_number
+ withdrawal_Pwd,vaild_number
</sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- <include refid="Base_Column_List"/>
- from user
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from user
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.nq.pojo.User">
- insert into user (id, agent_id, agent_name,
- phone, user_pwd, with_pwd,
- nick_name, real_name, id_card,
- account_type, user_amt, enable_amt,
- sum_charge_amt, sum_buy_amt, recom_phone,
- is_lock,is_login, reg_time, reg_ip,
- reg_address, img1_key, img2_key,
- img3_key, is_active, auth_msg,
- user_index_amt, enable_index_amt, user_fut_amt, enable_fut_amt, trading_amount,djzj
- )
- values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR},
- #{phone,jdbcType=VARCHAR}, #{userPwd,jdbcType=VARCHAR}, #{withPwd,jdbcType=VARCHAR},
- #{nickName,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
- #{accountType,jdbcType=INTEGER}, #{userAmt,jdbcType=DECIMAL}, #{enableAmt,jdbcType=DECIMAL},
- #{sumChargeAmt,jdbcType=DECIMAL}, #{sumBuyAmt,jdbcType=DECIMAL}, #{recomPhone,jdbcType=VARCHAR},
- #{isLock,jdbcType=INTEGER},#{isLogin,jdbcType=INTEGER}, #{regTime,jdbcType=TIMESTAMP}, #{regIp,jdbcType=VARCHAR},
- #{regAddress,jdbcType=VARCHAR}, #{img1Key,jdbcType=VARCHAR}, #{img2Key,jdbcType=VARCHAR},
- #{img3Key,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{authMsg,jdbcType=VARCHAR},
- #{userIndexAmt,jdbcType=DECIMAL}, #{enableIndexAmt,jdbcType=DECIMAL},
- #{userFutAmt,jdbcType=DECIMAL}, #{enableFutAmt,jdbcType=DECIMAL}, #{tradingAmount,jdbcType=DECIMAL},#{djzj,jdbcType=DECIMAL}
- )
- </insert>
-
- <insert id="insertSelective" parameterType="com.nq.pojo.User">
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="agentId != null">
- agent_id,
- </if>
- <if test="agentName != null">
- agent_name,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="userPwd != null">
- user_pwd,
- </if>
- <if test="withPwd != null">
- with_pwd,
- </if>
- <if test="nickName != null">
- nick_name,
- </if>
- <if test="realName != null">
- real_name,
- </if>
- <if test="idCard != null">
- id_card,
- </if>
- <if test="accountType != null">
- account_type,
- </if>
- <if test="userAmt != null">
- user_amt,
- </if>
- <if test="enableAmt != null">
- enable_amt,
- </if>
- <if test="sumChargeAmt != null">
- sum_charge_amt,
- </if>
- <if test="sumBuyAmt != null">
- sum_buy_amt,
- </if>
- <if test="recomPhone != null">
- recom_phone,
- </if>
- <if test="isLock != null">
- is_lock,
- </if>
- <if test="isLogin != null">
- is_login,
- </if>
- <if test="regTime != null">
- reg_time,
- </if>
- <if test="regIp != null">
- reg_ip,
- </if>
- <if test="regAddress != null">
- reg_address,
- </if>
- <if test="img1Key != null">
- img1_key,
- </if>
- <if test="img2Key != null">
- img2_key,
- </if>
- <if test="img3Key != null">
- img3_key,
- </if>
- <if test="isActive != null">
- is_active,
- </if>
- <if test="authMsg != null">
- auth_msg,
- </if>
- <if test="userIndexAmt != null">
- user_index_amt,
- </if>
- <if test="enableIndexAmt != null">
- enable_index_amt,
- </if>
- <if test="userFutAmt != null">
- user_fut_amt,
- </if>
- <if test="enableFutAmt != null">
- enable_fut_amt,
- </if>
- <if test="tradingAmount != null">
- trading_amount,
- </if>
-
-
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="agentId != null">
- #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentName != null">
- #{agentName,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="userPwd != null">
- #{userPwd,jdbcType=VARCHAR},
- </if>
- <if test="withPwd != null">
- #{withPwd,jdbcType=VARCHAR},
- </if>
- <if test="nickName != null">
- #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="realName != null">
- #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCard != null">
- #{idCard,jdbcType=VARCHAR},
- </if>
- <if test="accountType != null">
- #{accountType,jdbcType=INTEGER},
- </if>
- <if test="userAmt != null">
- #{userAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableAmt != null">
- #{enableAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumChargeAmt != null">
- #{sumChargeAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumBuyAmt != null">
- #{sumBuyAmt,jdbcType=DECIMAL},
- </if>
- <if test="recomPhone != null">
- #{recomPhone,jdbcType=VARCHAR},
- </if>
- <if test="isLock != null">
- #{isLock,jdbcType=INTEGER},
- </if>
- <if test="isLogin != null">
- #{isLogin,jdbcType=INTEGER},
- </if>
- <if test="regTime != null">
- #{regTime,jdbcType=TIMESTAMP},
- </if>
- <if test="regIp != null">
- #{regIp,jdbcType=VARCHAR},
- </if>
- <if test="regAddress != null">
- #{regAddress,jdbcType=VARCHAR},
- </if>
- <if test="img1Key != null">
- #{img1Key,jdbcType=VARCHAR},
- </if>
- <if test="img2Key != null">
- #{img2Key,jdbcType=VARCHAR},
- </if>
- <if test="img3Key != null">
- #{img3Key,jdbcType=VARCHAR},
- </if>
- <if test="isActive != null">
- #{isActive,jdbcType=INTEGER},
- </if>
- <if test="authMsg != null">
- #{authMsg,jdbcType=VARCHAR},
- </if>
- <if test="userIndexAmt != null">
- #{userIndexAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableIndexAmt != null">
- #{enableIndexAmt,jdbcType=DECIMAL},
- </if>
-
- <if test="userFutAmt != null">
- #{userFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableFutAmt != null">
- #{enableFutAmt,jdbcType=DECIMAL},
- </if>
-
-
- </trim>
- </insert>
-
- <update id="updateByPrimaryKeySelective" parameterType="com.nq.pojo.User">
- update user
- <set>
- <if test="agentId != null">
- agent_id = #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentName != null">
- agent_name = #{agentName,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="userPwd != null">
- user_pwd = #{userPwd,jdbcType=VARCHAR},
- </if>
- <if test="withPwd != null">
- with_pwd = #{withPwd,jdbcType=VARCHAR},
- </if>
- <if test="nickName != null">
- nick_name = #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="realName != null">
- real_name = #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCard != null">
- id_card = #{idCard,jdbcType=VARCHAR},
- </if>
- <if test="accountType != null">
- account_type = #{accountType,jdbcType=INTEGER},
- </if>
- <if test="userAmt != null">
- user_amt = #{userAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableAmt != null">
- enable_amt = #{enableAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumChargeAmt != null">
- sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumBuyAmt != null">
- sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
- </if>
- <if test="recomPhone != null">
- recom_phone = #{recomPhone,jdbcType=VARCHAR},
- </if>
- <if test="isLock != null">
- is_lock = #{isLock,jdbcType=INTEGER},
- </if>
- <if test="isLogin != null">
- is_login = #{isLogin,jdbcType=INTEGER},
- </if>
- <if test="regTime != null">
- reg_time = #{regTime,jdbcType=TIMESTAMP},
- </if>
- <if test="regIp != null">
- reg_ip = #{regIp,jdbcType=VARCHAR},
- </if>
- <if test="regAddress != null">
- reg_address = #{regAddress,jdbcType=VARCHAR},
- </if>
- <if test="img1Key != null">
- img1_key = #{img1Key,jdbcType=VARCHAR},
- </if>
- <if test="img2Key != null">
- img2_key = #{img2Key,jdbcType=VARCHAR},
- </if>
- <if test="img3Key != null">
- img3_key = #{img3Key,jdbcType=VARCHAR},
- </if>
- <if test="isActive != null">
- is_active = #{isActive,jdbcType=INTEGER},
- </if>
- <if test="authMsg != null">
- auth_msg = #{authMsg,jdbcType=VARCHAR},
- </if>
- <if test="userIndexAmt != null">
- user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableIndexAmt != null">
- enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
- </if>
-
- <if test="userFutAmt != null">
- user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableFutAmt != null">
- enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="tradingAmount != null">
- trading_amount = #{tradingAmount,jdbcType=DECIMAL},
- </if>
- <if test="djzj != null">
- djzj = #{djzj,jdbcType=DECIMAL},
- </if>
- <if test = "vaildNumber != null">
- vaild_number =#{vaildNumber,jdbcType=VARCHAR}
- </if>
-
-
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.nq.pojo.User">
- update user
- set agent_id = #{agentId,jdbcType=INTEGER},
- agent_name = #{agentName,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- user_pwd = #{userPwd,jdbcType=VARCHAR},
- with_pwd = #{withPwd,jdbcType=VARCHAR},
- nick_name = #{nickName,jdbcType=VARCHAR},
- real_name = #{realName,jdbcType=VARCHAR},
- id_card = #{idCard,jdbcType=VARCHAR},
- account_type = #{accountType,jdbcType=INTEGER},
- user_amt = #{userAmt,jdbcType=DECIMAL},
- enable_amt = #{enableAmt,jdbcType=DECIMAL},
- sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
- sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
- recom_phone = #{recomPhone,jdbcType=VARCHAR},
- is_lock = #{isLock,jdbcType=INTEGER},
- is_login = #{isLogin,jdbcType=INTEGER},
- reg_time = #{regTime,jdbcType=TIMESTAMP},
- reg_ip = #{regIp,jdbcType=VARCHAR},
- reg_address = #{regAddress,jdbcType=VARCHAR},
- img1_key = #{img1Key,jdbcType=VARCHAR},
- img2_key = #{img2Key,jdbcType=VARCHAR},
- img3_key = #{img3Key,jdbcType=VARCHAR},
- is_active = #{isActive,jdbcType=INTEGER},
- auth_msg = #{authMsg,jdbcType=VARCHAR},
- user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
- enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
- user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
- enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
- trading_amount = #{tradingAmount,jdbcType=DECIMAL},
- djzj = #{djzj,jdbcType=DECIMAL},
- vaild_number =#{vaildNumber,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
-
-
- <select id="findByPhone" parameterType="string" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM user
- WHERE phone = #{phoneNum}
- </select>
<select id="login" resultMap="BaseResultMap" parameterType="map">
SELECT
@@ -480,23 +97,4 @@
</where>
ORDER BY id DESC
</select>
-
-
- <select id="CountUserSize" parameterType="integer" resultType="int">
- SELECT COUNT(id) FROM user WHERE account_type = #{accountType}
- </select>
-
- <select id="CountUserAmt" parameterType="integer" resultType="decimal">
- SELECT sum(user_amt) FROM user WHERE account_type = #{accountType}
- </select>
- <select id="CountEnableAmt" parameterType="integer" resultType="decimal">
- SELECT sum(enable_amt) FROM user WHERE account_type = #{accountType}
- </select>
-
-
-
- <update id="updateUserAmt">
- update `user` set user_amt = user_amt + #{user_amt} where id = #{user_id}
- </update>
-
</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/UserPositionMapper.xml b/src/main/resources/mapper/UserPositionMapper.xml
index f96e1da..1351a56 100644
--- a/src/main/resources/mapper/UserPositionMapper.xml
+++ b/src/main/resources/mapper/UserPositionMapper.xml
@@ -603,5 +603,7 @@
limit 1
</select>
+
+
</mapper>
diff --git a/src/main/resources/mapper/UserRechargeMapper.xml b/src/main/resources/mapper/UserRechargeMapper.xml
index 75981d4..3f5580d 100644
--- a/src/main/resources/mapper/UserRechargeMapper.xml
+++ b/src/main/resources/mapper/UserRechargeMapper.xml
@@ -2,36 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserRechargeMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.UserRecharge" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="order_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_channel" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="order_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="order_desc" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="add_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="pay_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="pay_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- </constructor>
+ <id column="id" property="id" />
+ <result column="user_id" property="userId"/>
+ <result column="nick_name" property="nickName"/>
+ <result column="agent_id" property="agentId"/>
+ <result column="order_sn" property="orderSn"/>
+ <result column="pay_sn" property="paySn"/>
+ <result column="pay_channel" property="payChannel"/>
+ <result column="pay_amt" property="payAmt"/>
+ <result column="order_status" property="orderStatus"/>
+ <result column="order_desc" property="orderDesc"/>
+ <result column="add_time" property="addTime"/>
+ <result column="pay_time" property="payTime"/>
+ <result column="pay_id" property="payId"/>
+ <result column="img" property="img"/>
</resultMap>
<sql id="Base_Column_List" >
id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status,
- order_desc, add_time, pay_time, pay_id
+ order_desc, add_time, pay_time, pay_id,img
</sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from user_recharge
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from user_recharge
- where id = #{id,jdbcType=INTEGER}
- </delete>
<insert id="insert" parameterType="com.nq.pojo.UserRecharge" >
insert into user_recharge (id, user_id, nick_name,
agent_id, order_sn, pay_sn,
@@ -224,8 +213,11 @@
<select id="listByAdmin" parameterType="map" resultType="com.nq.pojo.UserRecharge">
SELECT
- <include refid="Base_Column_List"/>
- FROM user_recharge
+ s.id, s.user_id, s.nick_name, s.agent_id, s.order_sn, s.pay_sn, s.pay_channel,
+ s.pay_amt, s.order_status,s.order_desc,s.add_time,s.pay_time,s.pay_id,s.img ,p.channel_name,p.assets_type
+ FROM user_recharge s
+ join site_pay p
+ on s.pay_id = p.id
where agent_id != 1
<if test="agentId != null">
and ( agent_id = #{agentId}
@@ -252,7 +244,7 @@
<if test="end_time != null ">
and pay_time <![CDATA[<=]]> #{end_time}
</if>
- ORDER BY id DESC
+ ORDER BY s.id DESC
</select>
diff --git a/src/main/resources/mapper/UserWithdrawMapper.xml b/src/main/resources/mapper/UserWithdrawMapper.xml
index 7fc67ae..6311b02 100644
--- a/src/main/resources/mapper/UserWithdrawMapper.xml
+++ b/src/main/resources/mapper/UserWithdrawMapper.xml
@@ -2,22 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserWithdrawMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.UserWithdraw" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="apply_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="trans_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="with_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_no" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_address" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="with_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_fee" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="with_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
- </constructor>
+ <id column="id" jdbcType="INTEGER" property="id" />
+ <result column="user_id" property="userId" />
+ <result column="nick_name" property="nickName" />
+ <result column="agent_id" property="agentId" />
+ <result column="with_amt" property="withAmt" />
+ <result column="apply_time" property="applyTime"/>
+ <result column="trans_time" property="transTime" />
+ <result column="with_name" property="withName"/>
+ <result column="bank_no" property="bankNo"/>
+ <result column="bank_name" property="bankName"/>
+ <result column="bank_address" property="bankAddress" />
+ <result column="with_status" property="withStatus"/>
+ <result column="with_fee" property="withFee"/>
+ <result column="with_msg" property="withMsg"/>
</resultMap>
<sql id="Base_Column_List" >
id, user_id, nick_name, agent_id, with_amt, apply_time, trans_time, with_name, bank_no,
diff --git a/target/classes/application.properties b/target/classes/application.properties
index fa185fb..d829f66 100644
--- a/target/classes/application.properties
+++ b/target/classes/application.properties
@@ -5,22 +5,16 @@
#2. ??ifconfig????vsftpd?????
#3. ???? ftp://??
-ftp.server.ip=27.50.59.221
-ftp.user=ftp_anxinsecurities_com
-ftp.pass=Ja6jjhShJPySEzLP
-ftp.server.http.prefix=http://ftp.anxinsecurities.com/
-#ftp.server.ip=47.56.200.145
-#ftp.user=ofsuccess
-#ftp.pass=fdymdM34HHsS8iB6
-#ftp.server.http.prefix=http://www.img.yfkgzq.com/
+ftp.server.ip=45.204.85.67
+ftp.user=ftp_stock
+ftp.pass=123456
+ftp.server.http.prefix=https://img.3falcon.com/
-# redis config start
+
redis1.ip=localhost
redis1.port=6379
redis1.pwd=
redis1.timeout=10000
-#redis2.ip=47.52.34.37
-#redis2.port=6380
redis.max.total=50
redis.max.idle=10
redis.min.idle=2
@@ -31,11 +25,44 @@
#cookie config start
user.cookie.name=USERTOKEN
-agent.cookie.name=AGENTTOKEN
+agent.cookie.name=agenttoken
admin.cookie.name=admintoken
agent.key.prefix=Mi
admin.super.name=18916320007
+
+
+#股票key的地址
+IN_HTTP_API = http://api-in.js-stock.top/
+IN_WS_URL = ws://api-in-ws.js-stock.top
+IN_KEY = r3ZAgtcYzuBizmqge2hK
+
+US_HTTP_API = http://test.js-stock.top/
+US_WS_URL = ws://api-in-ws.js-stock.top
+US_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+HK_HTTP_API = http://test.js-stock.top/
+HK_WS_URL = ws://api-in-ws.js-stock.top
+HK_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+
+HG_HTTP_API = http://test.js-stock.top/
+HG_WS_URL = ws://api-in-ws.js-stock.top
+HG_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+
+
+TH_HTTP_API = http://test.js-stock.top/
+TH_WS_URL = ws://api-in-ws.js-stock.top
+TH_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+MAS_HTTP_API = http://test.js-stock.top/
+MAS_WS_URL = ws://api-in-ws.js-stock.top
+MAS_KEY = GBZAcUPLKZzDMDjvV9Ea
+
+SZHB_HTTP_API = https://api.huobi.pro/
+SZHB_WS_URL = ws://api-in-ws.js-stock.top
+SZHB_KEY = GBZAcUPLKZzDMDjvV9Ea
#?? ?? - ????
@@ -59,21 +86,8 @@
#juhe api
juhe.stock.key=e27571e4f5f2f07440bf4996d01d5770
juhe.ip.key=e5ad6f81997d4f101cc3d17409e18d96
-#??juhe.ip.key1=ea84726df1d952b8271e118eca51be34//a86451534a6e72728b8cea430dabc633//e5ad6f81997d4f101cc3d17409e18d96//ea84726df1d952b8271e118eca51be34
-
-#juhe api end
-
-#site setting
-site.email.auth.url=/api/admin/authCharge.do
-site.pc.reg.url=/homes/#/register?code=
-site.m.reg.url=/wap/#/register?code=
-
-#??????
-#pc.refresh.time=3000
-# ?? API ??
-#sina.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_sh000001,s_sz399001,s_sz399006,s_sz399300,s_sz399005,s_sz399673
sina.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_sh000001,s_sz399001,s_sz399006,s_sz399300,s_sz399005,s_sz399673,s_sz399106,s_sz399004,s_sz399100
sina.single.market.url=https://hq.sinajs.cn/rn=1520407404627&list=s_
@@ -88,14 +102,11 @@
sina.single.stock.week.url=http://image.sinajs.cn/newchart/weekly/n/
sina.single.stock.month.url=http://image.sinajs.cn/newchart/monthly/n/
getUrl=http://192.168.10.3
-#????cookle
cookle=xq_a_token=d269ad4aee7ece063038900846f9541a7d0ead07
-#????
hk.stock.url = https://32.push2delay.eastmoney.com/api/qt/clist/get?pn=1&pz=9999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f3&fs=m:128+t:3,m:128+t:4,m:128+t:1,m:128+t:2&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
hk.stock.introduction.url =https://datacenter.eastmoney.com/securities/api/data/v1/get?reportName=RPT_HKF10_INFO_ORGPROFILE&columns=SECUCODE,SECURITY_CODE,ORG_NAME,ORG_EN_ABBR,BELONG_INDUSTRY,FOUND_DATE,CHAIRMAN,SECRETARY,ACCOUNT_FIRM,REG_ADDRESS,ADDRESS,YEAR_SETTLE_DAY,EMP_NUM,ORG_TEL,ORG_FAX,ORG_EMAIL,ORG_WEB,ORG_PROFILE,REG_PLACE"eColumns=&filter=(SECUCODE=
hk.index.url = https://56.push2.eastmoney.com/api/qt/clist/get?pn=1&pz=9999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f5&fs=m:124,m:125,m:305&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
hk.index.introduction.url = https://newsinfo.eastmoney.com/kuaixun/v2/api/Channel/5/0/0/50
-#????
us.stock.url = https://1.push2.eastmoney.com/api/qt/clist/get?cb=jQuery1124024849404112285045_1668165974609&pn=1&pz=99999999&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&wbp2u=%7C0%7C0%7C0%7Cweb&fid=f2&fs=m:105,m:106,m:107&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_=
us.stock.introduction.url =https://emweb.eastmoney.com/pc_usf10/CompanyInfo/PageAjax?fullCode=
us.stock.buy.url = https://push2.eastmoney.com/api/qt/stock/details/get?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f55&fltt=2&pos=-14&secid=
@@ -142,57 +153,13 @@
sina.StockType.list.url=http://b.workingman.icu/stock/api/stock/getStockType?exchange=
sina.StockCategory.list.url=http://b.workingman.icu/stock/api/stock/getWapStocks
-http.proxyHost =
-http.proxyPort =
-https.proxyHost =
-https.proxyPort =
-
-# ????
-#????
-juhe1.pay.callbackurl=http://xx.com
-#??????
-juhe1.pay.notifyurl=http://xx.com
#Fly ??
fly.pay.merchantid=SLPNXG
fly.pay.token=0a17a92f45816a88431fa326b3b61baf
-#Cmc ??
-#??????
-cmc.pay.key=0a17a92f45816a88431fa326b3b61baf
-#????appid
-cmc.pay.uid=74021809
-#??????
-cmc.pay.return_url=https://www.bldzb666888.com/homes/#/rechargelist
-#??????
-cmc.pay.notify_url=https://www.bldzb666888.com/api/pay/juhenewpayNotify.do
-#???????
-cmc.pay.url=http://pay.phu889.com/api.php/webRequest/tradePay
-
-fly.pay.serverbackurl=http://www.honghoo.top/api/pay/flyNotify.do
-fly.pay.callbackurl=http://www.honghoo.top/wap/#/user
-
-fly.pay.payurl=https://zf.flyotcpay.com/payment/
-
-
-#????
-#???
-wj.sms.uid=yhi1993
-#??
-wj.sms.key=5802bf8c5e3c5bc46c48
-#??gbk/utf8
-wj.sms.coding=utf8
-#短信宝
-#dxb.sms.USERNAME=banbao
-#dxb.sms.PASSWORD=a705312041274b72b77d43b0ce136913
-#?????
-website.domain.url=http://www.huijuwang888.com
-website.token=0DC8F78384C7AAFF3192A9C60A473FEE7F89C62888689616B98A06910E86B510
-#?????
-news.main.url=http://eminfo.eastmoney.com
-spring.main.allow-circular-references=true
diff --git a/target/classes/application.yml b/target/classes/application.yml
index 109fcbe..1f7c668 100644
--- a/target/classes/application.yml
+++ b/target/classes/application.yml
@@ -13,13 +13,11 @@
max: 800
# Tomcat启动初始化的线程数,默认值10
min-spare: 100
-
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
-
# token配置
token:
# 令牌自定义标识
@@ -65,6 +63,21 @@
time-zone: Asia/Kolkata
profiles:
active: druid
+ flyway:
+ enabled: true
+ # 禁止清理数据库表
+ clean-disabled: false
+ # 如果数据库不是空表,需要设置成 true,否则启动报错
+ baseline-on-migrate: true
+ # 与 baseline-on-migrate: true 搭配使用
+ baseline-version: 0
+ #数据库连接配置
+ url: ${spring.datasource.url}
+ user: ${spring.datasource.name}
+ password: ${spring.datasource.password}
+ locations: classpath:db/migration/ #(根据个人情况设置,多个路径使用逗号分隔)
+ #版本控制日志表,默认flyway_schema_history
+ table: flyway_schema_history
# 文件上传
servlet:
multipart:
@@ -109,12 +122,9 @@
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://127.0.0.1:3306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
- rname: root
- password: root
-# url: jdbc:mysql://114.29.252.25:3306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-# username: root
-# password: Err;2[eoGFUriwdgr
+ url: jdbc:mysql://14.128.50.174:6306/stock?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ name: root
+ password: f6fac591b6fcd9d6
druid:
# 初始连接数
initialSize: 5
diff --git a/target/classes/mapper/SitePayMapper.xml b/target/classes/mapper/SitePayMapper.xml
index 7199f33..129bea7 100644
--- a/target/classes/mapper/SitePayMapper.xml
+++ b/target/classes/mapper/SitePayMapper.xml
@@ -2,31 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.SitePayMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.SitePay" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
+ <id column="id" property="id"/>
+ <result column="c_type" property="cType"/>
+ <result column="form_url" property="formUrl"/>
+ <result column="form_code" property="formCode"/>
- <arg column="c_type" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="form_url" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="form_code" jdbcType="VARCHAR" javaType="java.lang.String" />
-
- <arg column="channel_type" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_desc" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_account" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_img" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="channel_min_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="channel_max_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="is_show" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="totalPrice" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
+ <result column="channel_type" property="channelType"/>
+ <result column="channel_name" property="channelName"/>
+ <result column="channel_desc" property="channelDesc"/>
+ <result column="channel_account" property="channelAccount"/>
+ <result column="channel_img" property="channelImg"/>
+ <result column="channel_min_limit" property="channelMinLimit"/>
+ <result column="channel_max_limit" property="channelMaxLimit"/>
+ <result column="is_show" property="isShow"/>
+ <result column="is_lock" property="isLock"/>
+ <result column="total_price" property="totalPrice"/>
+ <result column="assets_type" property="assetsType"/>
- </constructor>
</resultMap>
<sql id="Base_Column_List" >
id, c_type,form_url,form_code,channel_type, channel_name, channel_desc, channel_account, channel_img, channel_min_limit,
- channel_max_limit, is_show, is_lock, totalPrice
+ channel_max_limit, is_show, is_lock, total_price,assets_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
@@ -235,10 +233,7 @@
<select id="getPayInfo" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
- FROM site_pay WHERE is_show = 0 and channel_max_limit>totalPrice
- <if test="payAmt != null and payAmt > 0">
- and channel_min_limit <= #{payAmt} and channel_max_limit> #{payAmt}
- </if>
+ FROM site_pay WHERE is_show = 0
</select>
diff --git a/target/classes/mapper/UserMapper.xml b/target/classes/mapper/UserMapper.xml
index 84fc361..8efe003 100644
--- a/target/classes/mapper/UserMapper.xml
+++ b/target/classes/mapper/UserMapper.xml
@@ -2,421 +2,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.nq.pojo.User">
- <constructor>
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="user_pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="with_pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="real_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="id_card" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="account_type" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="user_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="sum_charge_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="sum_buy_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="recom_phone" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="is_login" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="reg_time" jdbcType="TIMESTAMP" javaType="java.util.Date"/>
- <arg column="reg_ip" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="reg_address" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img1_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img2_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="img3_key" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="is_active" jdbcType="INTEGER" javaType="java.lang.Integer"/>
- <arg column="auth_msg" jdbcType="VARCHAR" javaType="java.lang.String"/>
+ <id column="id" property="id"/>
+ <result column="agent_id" property="agentId"/>
+ <result column="agent_name" property="agentName"/>
+ <result column="phone" property="phone"/>
+ <result column="user_pwd" property="userPwd"/>
+ <result column="with_pwd" property="withPwd"/>
+ <result column="nick_name" property="nickName"/>
+ <result column="real_name" property="realName"/>
+ <result column="id_card" property="idCard"/>
+ <result column="account_type" property="accountType"/>
+ <result column="is_lock" property="isLock"/>
+ <result column="is_login" property="isLogin"/>
+ <result column="reg_time" property="regTime"/>
+ <result column="reg_ip" property="regIp"/>
+ <result column="reg_address" property="regAddress"/>
+ <result column="img1_key" property="img1Key"/>
+ <result column="img2_key" property="img2Key"/>
+ <result column="img3_key" property="img3Key"/>
+ <result column="is_active" property="isActive"/>
+ <result column="auth_msg" property="authMsg"/>
+ <result column="withdrawal_Pwd" property="withdrawalPwd"/>
+ <result column="vaild_number" property="vaildNumber"/>
- <arg column="user_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="user_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="enable_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="withdrawal_Pwd" jdbcType="VARCHAR" javaType="java.lang.String"/>
- <arg column="trading_amount" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="djzj" jdbcType="DECIMAL" javaType="java.math.BigDecimal"/>
- <arg column="vaild_number" jdbcType="VARCHAR" javaType="java.lang.String"/>
-
- </constructor>
</resultMap>
<sql id="Base_Column_List">
id, agent_id, agent_name, phone, user_pwd, with_pwd, nick_name, real_name, id_card,
- account_type, user_amt, enable_amt, sum_charge_amt, sum_buy_amt, recom_phone, is_lock, is_login,
+ account_type, is_lock, is_login,
reg_time, reg_ip, reg_address, img1_key, img2_key, img3_key, is_active, auth_msg,
- user_index_amt, enable_index_amt, user_fut_amt, enable_fut_amt, withdrawal_Pwd,trading_amount,djzj,vaild_number
+ withdrawal_Pwd,vaild_number
</sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- <include refid="Base_Column_List"/>
- from user
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from user
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.nq.pojo.User">
- insert into user (id, agent_id, agent_name,
- phone, user_pwd, with_pwd,
- nick_name, real_name, id_card,
- account_type, user_amt, enable_amt,
- sum_charge_amt, sum_buy_amt, recom_phone,
- is_lock,is_login, reg_time, reg_ip,
- reg_address, img1_key, img2_key,
- img3_key, is_active, auth_msg,
- user_index_amt, enable_index_amt, user_fut_amt, enable_fut_amt, trading_amount,djzj
- )
- values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR},
- #{phone,jdbcType=VARCHAR}, #{userPwd,jdbcType=VARCHAR}, #{withPwd,jdbcType=VARCHAR},
- #{nickName,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
- #{accountType,jdbcType=INTEGER}, #{userAmt,jdbcType=DECIMAL}, #{enableAmt,jdbcType=DECIMAL},
- #{sumChargeAmt,jdbcType=DECIMAL}, #{sumBuyAmt,jdbcType=DECIMAL}, #{recomPhone,jdbcType=VARCHAR},
- #{isLock,jdbcType=INTEGER},#{isLogin,jdbcType=INTEGER}, #{regTime,jdbcType=TIMESTAMP}, #{regIp,jdbcType=VARCHAR},
- #{regAddress,jdbcType=VARCHAR}, #{img1Key,jdbcType=VARCHAR}, #{img2Key,jdbcType=VARCHAR},
- #{img3Key,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{authMsg,jdbcType=VARCHAR},
- #{userIndexAmt,jdbcType=DECIMAL}, #{enableIndexAmt,jdbcType=DECIMAL},
- #{userFutAmt,jdbcType=DECIMAL}, #{enableFutAmt,jdbcType=DECIMAL}, #{tradingAmount,jdbcType=DECIMAL},#{djzj,jdbcType=DECIMAL}
- )
- </insert>
-
- <insert id="insertSelective" parameterType="com.nq.pojo.User">
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="agentId != null">
- agent_id,
- </if>
- <if test="agentName != null">
- agent_name,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="userPwd != null">
- user_pwd,
- </if>
- <if test="withPwd != null">
- with_pwd,
- </if>
- <if test="nickName != null">
- nick_name,
- </if>
- <if test="realName != null">
- real_name,
- </if>
- <if test="idCard != null">
- id_card,
- </if>
- <if test="accountType != null">
- account_type,
- </if>
- <if test="userAmt != null">
- user_amt,
- </if>
- <if test="enableAmt != null">
- enable_amt,
- </if>
- <if test="sumChargeAmt != null">
- sum_charge_amt,
- </if>
- <if test="sumBuyAmt != null">
- sum_buy_amt,
- </if>
- <if test="recomPhone != null">
- recom_phone,
- </if>
- <if test="isLock != null">
- is_lock,
- </if>
- <if test="isLogin != null">
- is_login,
- </if>
- <if test="regTime != null">
- reg_time,
- </if>
- <if test="regIp != null">
- reg_ip,
- </if>
- <if test="regAddress != null">
- reg_address,
- </if>
- <if test="img1Key != null">
- img1_key,
- </if>
- <if test="img2Key != null">
- img2_key,
- </if>
- <if test="img3Key != null">
- img3_key,
- </if>
- <if test="isActive != null">
- is_active,
- </if>
- <if test="authMsg != null">
- auth_msg,
- </if>
- <if test="userIndexAmt != null">
- user_index_amt,
- </if>
- <if test="enableIndexAmt != null">
- enable_index_amt,
- </if>
- <if test="userFutAmt != null">
- user_fut_amt,
- </if>
- <if test="enableFutAmt != null">
- enable_fut_amt,
- </if>
- <if test="tradingAmount != null">
- trading_amount,
- </if>
-
-
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="agentId != null">
- #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentName != null">
- #{agentName,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="userPwd != null">
- #{userPwd,jdbcType=VARCHAR},
- </if>
- <if test="withPwd != null">
- #{withPwd,jdbcType=VARCHAR},
- </if>
- <if test="nickName != null">
- #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="realName != null">
- #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCard != null">
- #{idCard,jdbcType=VARCHAR},
- </if>
- <if test="accountType != null">
- #{accountType,jdbcType=INTEGER},
- </if>
- <if test="userAmt != null">
- #{userAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableAmt != null">
- #{enableAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumChargeAmt != null">
- #{sumChargeAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumBuyAmt != null">
- #{sumBuyAmt,jdbcType=DECIMAL},
- </if>
- <if test="recomPhone != null">
- #{recomPhone,jdbcType=VARCHAR},
- </if>
- <if test="isLock != null">
- #{isLock,jdbcType=INTEGER},
- </if>
- <if test="isLogin != null">
- #{isLogin,jdbcType=INTEGER},
- </if>
- <if test="regTime != null">
- #{regTime,jdbcType=TIMESTAMP},
- </if>
- <if test="regIp != null">
- #{regIp,jdbcType=VARCHAR},
- </if>
- <if test="regAddress != null">
- #{regAddress,jdbcType=VARCHAR},
- </if>
- <if test="img1Key != null">
- #{img1Key,jdbcType=VARCHAR},
- </if>
- <if test="img2Key != null">
- #{img2Key,jdbcType=VARCHAR},
- </if>
- <if test="img3Key != null">
- #{img3Key,jdbcType=VARCHAR},
- </if>
- <if test="isActive != null">
- #{isActive,jdbcType=INTEGER},
- </if>
- <if test="authMsg != null">
- #{authMsg,jdbcType=VARCHAR},
- </if>
- <if test="userIndexAmt != null">
- #{userIndexAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableIndexAmt != null">
- #{enableIndexAmt,jdbcType=DECIMAL},
- </if>
-
- <if test="userFutAmt != null">
- #{userFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableFutAmt != null">
- #{enableFutAmt,jdbcType=DECIMAL},
- </if>
-
-
- </trim>
- </insert>
-
- <update id="updateByPrimaryKeySelective" parameterType="com.nq.pojo.User">
- update user
- <set>
- <if test="agentId != null">
- agent_id = #{agentId,jdbcType=INTEGER},
- </if>
- <if test="agentName != null">
- agent_name = #{agentName,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="userPwd != null">
- user_pwd = #{userPwd,jdbcType=VARCHAR},
- </if>
- <if test="withPwd != null">
- with_pwd = #{withPwd,jdbcType=VARCHAR},
- </if>
- <if test="nickName != null">
- nick_name = #{nickName,jdbcType=VARCHAR},
- </if>
- <if test="realName != null">
- real_name = #{realName,jdbcType=VARCHAR},
- </if>
- <if test="idCard != null">
- id_card = #{idCard,jdbcType=VARCHAR},
- </if>
- <if test="accountType != null">
- account_type = #{accountType,jdbcType=INTEGER},
- </if>
- <if test="userAmt != null">
- user_amt = #{userAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableAmt != null">
- enable_amt = #{enableAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumChargeAmt != null">
- sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
- </if>
- <if test="sumBuyAmt != null">
- sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
- </if>
- <if test="recomPhone != null">
- recom_phone = #{recomPhone,jdbcType=VARCHAR},
- </if>
- <if test="isLock != null">
- is_lock = #{isLock,jdbcType=INTEGER},
- </if>
- <if test="isLogin != null">
- is_login = #{isLogin,jdbcType=INTEGER},
- </if>
- <if test="regTime != null">
- reg_time = #{regTime,jdbcType=TIMESTAMP},
- </if>
- <if test="regIp != null">
- reg_ip = #{regIp,jdbcType=VARCHAR},
- </if>
- <if test="regAddress != null">
- reg_address = #{regAddress,jdbcType=VARCHAR},
- </if>
- <if test="img1Key != null">
- img1_key = #{img1Key,jdbcType=VARCHAR},
- </if>
- <if test="img2Key != null">
- img2_key = #{img2Key,jdbcType=VARCHAR},
- </if>
- <if test="img3Key != null">
- img3_key = #{img3Key,jdbcType=VARCHAR},
- </if>
- <if test="isActive != null">
- is_active = #{isActive,jdbcType=INTEGER},
- </if>
- <if test="authMsg != null">
- auth_msg = #{authMsg,jdbcType=VARCHAR},
- </if>
- <if test="userIndexAmt != null">
- user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableIndexAmt != null">
- enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
- </if>
-
- <if test="userFutAmt != null">
- user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="enableFutAmt != null">
- enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
- </if>
- <if test="tradingAmount != null">
- trading_amount = #{tradingAmount,jdbcType=DECIMAL},
- </if>
- <if test="djzj != null">
- djzj = #{djzj,jdbcType=DECIMAL},
- </if>
- <if test = "vaildNumber != null">
- vaild_number =#{vaildNumber,jdbcType=VARCHAR}
- </if>
-
-
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.nq.pojo.User">
- update user
- set agent_id = #{agentId,jdbcType=INTEGER},
- agent_name = #{agentName,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- user_pwd = #{userPwd,jdbcType=VARCHAR},
- with_pwd = #{withPwd,jdbcType=VARCHAR},
- nick_name = #{nickName,jdbcType=VARCHAR},
- real_name = #{realName,jdbcType=VARCHAR},
- id_card = #{idCard,jdbcType=VARCHAR},
- account_type = #{accountType,jdbcType=INTEGER},
- user_amt = #{userAmt,jdbcType=DECIMAL},
- enable_amt = #{enableAmt,jdbcType=DECIMAL},
- sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
- sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
- recom_phone = #{recomPhone,jdbcType=VARCHAR},
- is_lock = #{isLock,jdbcType=INTEGER},
- is_login = #{isLogin,jdbcType=INTEGER},
- reg_time = #{regTime,jdbcType=TIMESTAMP},
- reg_ip = #{regIp,jdbcType=VARCHAR},
- reg_address = #{regAddress,jdbcType=VARCHAR},
- img1_key = #{img1Key,jdbcType=VARCHAR},
- img2_key = #{img2Key,jdbcType=VARCHAR},
- img3_key = #{img3Key,jdbcType=VARCHAR},
- is_active = #{isActive,jdbcType=INTEGER},
- auth_msg = #{authMsg,jdbcType=VARCHAR},
- user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
- enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
- user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
- enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
- trading_amount = #{tradingAmount,jdbcType=DECIMAL},
- djzj = #{djzj,jdbcType=DECIMAL},
- vaild_number =#{vaildNumber,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
-
-
- <select id="findByPhone" parameterType="string" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM user
- WHERE phone = #{phoneNum}
- </select>
<select id="login" resultMap="BaseResultMap" parameterType="map">
SELECT
@@ -480,23 +97,4 @@
</where>
ORDER BY id DESC
</select>
-
-
- <select id="CountUserSize" parameterType="integer" resultType="int">
- SELECT COUNT(id) FROM user WHERE account_type = #{accountType}
- </select>
-
- <select id="CountUserAmt" parameterType="integer" resultType="decimal">
- SELECT sum(user_amt) FROM user WHERE account_type = #{accountType}
- </select>
- <select id="CountEnableAmt" parameterType="integer" resultType="decimal">
- SELECT sum(enable_amt) FROM user WHERE account_type = #{accountType}
- </select>
-
-
-
- <update id="updateUserAmt">
- update `user` set user_amt = user_amt + #{user_amt} where id = #{user_id}
- </update>
-
</mapper>
\ No newline at end of file
diff --git a/target/classes/mapper/UserPositionMapper.xml b/target/classes/mapper/UserPositionMapper.xml
index f96e1da..1351a56 100644
--- a/target/classes/mapper/UserPositionMapper.xml
+++ b/target/classes/mapper/UserPositionMapper.xml
@@ -603,5 +603,7 @@
limit 1
</select>
+
+
</mapper>
diff --git a/target/classes/mapper/UserRechargeMapper.xml b/target/classes/mapper/UserRechargeMapper.xml
index 75981d4..3f5580d 100644
--- a/target/classes/mapper/UserRechargeMapper.xml
+++ b/target/classes/mapper/UserRechargeMapper.xml
@@ -2,36 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserRechargeMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.UserRecharge" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="order_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_channel" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="pay_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="order_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="order_desc" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="add_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="pay_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="pay_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- </constructor>
+ <id column="id" property="id" />
+ <result column="user_id" property="userId"/>
+ <result column="nick_name" property="nickName"/>
+ <result column="agent_id" property="agentId"/>
+ <result column="order_sn" property="orderSn"/>
+ <result column="pay_sn" property="paySn"/>
+ <result column="pay_channel" property="payChannel"/>
+ <result column="pay_amt" property="payAmt"/>
+ <result column="order_status" property="orderStatus"/>
+ <result column="order_desc" property="orderDesc"/>
+ <result column="add_time" property="addTime"/>
+ <result column="pay_time" property="payTime"/>
+ <result column="pay_id" property="payId"/>
+ <result column="img" property="img"/>
</resultMap>
<sql id="Base_Column_List" >
id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status,
- order_desc, add_time, pay_time, pay_id
+ order_desc, add_time, pay_time, pay_id,img
</sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from user_recharge
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from user_recharge
- where id = #{id,jdbcType=INTEGER}
- </delete>
<insert id="insert" parameterType="com.nq.pojo.UserRecharge" >
insert into user_recharge (id, user_id, nick_name,
agent_id, order_sn, pay_sn,
@@ -224,8 +213,11 @@
<select id="listByAdmin" parameterType="map" resultType="com.nq.pojo.UserRecharge">
SELECT
- <include refid="Base_Column_List"/>
- FROM user_recharge
+ s.id, s.user_id, s.nick_name, s.agent_id, s.order_sn, s.pay_sn, s.pay_channel,
+ s.pay_amt, s.order_status,s.order_desc,s.add_time,s.pay_time,s.pay_id,s.img ,p.channel_name,p.assets_type
+ FROM user_recharge s
+ join site_pay p
+ on s.pay_id = p.id
where agent_id != 1
<if test="agentId != null">
and ( agent_id = #{agentId}
@@ -252,7 +244,7 @@
<if test="end_time != null ">
and pay_time <![CDATA[<=]]> #{end_time}
</if>
- ORDER BY id DESC
+ ORDER BY s.id DESC
</select>
diff --git a/target/classes/mapper/UserWithdrawMapper.xml b/target/classes/mapper/UserWithdrawMapper.xml
index 7fc67ae..6311b02 100644
--- a/target/classes/mapper/UserWithdrawMapper.xml
+++ b/target/classes/mapper/UserWithdrawMapper.xml
@@ -2,22 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nq.dao.UserWithdrawMapper" >
<resultMap id="BaseResultMap" type="com.nq.pojo.UserWithdraw" >
- <constructor >
- <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="apply_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="trans_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
- <arg column="with_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_no" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_name" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="bank_address" jdbcType="VARCHAR" javaType="java.lang.String" />
- <arg column="with_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
- <arg column="with_fee" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
- <arg column="with_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
- </constructor>
+ <id column="id" jdbcType="INTEGER" property="id" />
+ <result column="user_id" property="userId" />
+ <result column="nick_name" property="nickName" />
+ <result column="agent_id" property="agentId" />
+ <result column="with_amt" property="withAmt" />
+ <result column="apply_time" property="applyTime"/>
+ <result column="trans_time" property="transTime" />
+ <result column="with_name" property="withName"/>
+ <result column="bank_no" property="bankNo"/>
+ <result column="bank_name" property="bankName"/>
+ <result column="bank_address" property="bankAddress" />
+ <result column="with_status" property="withStatus"/>
+ <result column="with_fee" property="withFee"/>
+ <result column="with_msg" property="withMsg"/>
</resultMap>
<sql id="Base_Column_List" >
id, user_id, nick_name, agent_id, with_amt, apply_time, trans_time, with_name, bank_no,
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index 8c6f6de..4632ed4 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,8 +1,11 @@
-com\nq\utils\stock\sina\StockApi.class
-com\nq\utils\stock\sina\StockApi$2.class
-com\nq\utils\stock\sina\StockApi$3.class
-com\nq\utils\stock\sina\StockApi$4.class
+com\nq\service\impl\UserStockSubscribeServiceImpl.class
+com\nq\service\impl\AgentAgencyFeeServiceImpl.class
+com\nq\service\impl\UserIndexPositionServiceImpl.class
+com\nq\service\impl\UserRechargeServiceImpl.class
com\nq\service\impl\UserPositionServiceImpl.class
-com\nq\service\impl\StockServiceImpl.class
-com\nq\utils\stock\sina\StockApi$1.class
-com\nq\service\impl\StockOptionServiceImpl.class
+com\nq\service\impl\PayServiceImpl.class
+com\nq\service\impl\UserFundsPositionServiceImpl.class
+com\nq\service\impl\UserWithdrawServiceImpl.class
+com\nq\service\impl\UserPendingorderServiceImpl.class
+com\nq\enums\EUserAssets.class
+com\nq\service\impl\UserServiceImpl.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 3758aba..a7d1d24 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,430 +1,430 @@
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\QhBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\sms\ali\AliyunSms.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteSettingMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockMarket.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsSecuritiesInfo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\enums\EStockType.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\PayConst.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteLoginLog.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentRechargeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\SignUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\Bank.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IDkServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\GoogleCodeConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\ClosingStayTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockFuturesService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\JuheIpApi.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockOptionServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\StockPoll.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteIndexSetting.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsLeverService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockCoinController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserWithdrawMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserPositionMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteProductMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\EChoMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\WithDrawUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\futuresposition\AdminFuturesPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserCashDetailService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\SmsApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserStockSubscribeService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\AgentUser.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\news\NewsTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockUsVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\constant\StockConstant.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteIndexSettingMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\RealTimeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IPayService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteLoginLogService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserFuturesPositionServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\futuresposition\FuturesPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentCashDetailController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockMarketsDayService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\UserPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockOptionService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteNews.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\ServerResponse.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteSettingServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteSpreadServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\VerifyCodeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\AgentUserMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsTradingAccountMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\RealTime.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteBannerServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsAppendServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteSetting.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteProductServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminNewStockController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteArticleMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\FTPUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\WebMvcConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\ReponseBase.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\indexposition\AgentIndexPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stockfutures\StockFuturesListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteTaskLogMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\StockTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stockfutures\CoinAdminListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\AdminPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteInfoController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminPendingorder.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockMarketsDay.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockSubscribeServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IAgentAgencyFeeService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserIndexPositionService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteAdmin.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\pay\FlyPayVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockDzServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsTradingAccountService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\HttpRequest.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteAmtTransLogServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteArticleService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockIndex.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteBannerService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockFutures.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\annotation\SameUrlData.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteSmsLog.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\sms\ali\SmsDemo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\DkServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsDealerInstitutions.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\AgentAgencyFeeMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\SiteAdminIndexService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteAdminIndex.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\interceptor\ApiUserAuthorityInterceptor.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IEchoServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\dk\DkModelVo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsSecuritiesInfoMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserWithdrawServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserPosition.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentIndexPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteMessageServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserBankServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\AgentApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\EChoBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteArticleServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockSubscribeService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminWithDrawController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteFuturesSetting.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\RealTimeServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteLoginLogServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserFundsPositionService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserBankController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockCoin.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserBankMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteArticle.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\PositionProfitVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockIndexServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\PayContacts.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\PropertiesUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteIndexSettingService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\Mandate.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\sina\StockApi.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\StockDzService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\pinyin\GetPyByChinese.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserRecharge.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\AgentAgencyFeeServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\Text.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteAmtTransLog.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\HttpClientRequest.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsSecuritiesInfoServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteNewsServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockCoinService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsLeverServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\AgentUserServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserWithdraw.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\StockIndexApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\ResponseCode.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisConst.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\GeneratePosition.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\AgentPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFileUploadService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\SiteApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteProductService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisShardedPoolUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteSmsLogMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\smsUtil\smsUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\PayChnnelServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\pay\CmcPayOuterRequestUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsAppendMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\StockApplication.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\DkJgBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserPositionServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteInfoMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteAdminMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SitePayMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\ScheduleConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\sina\vo\SinaStockMinData.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\PayServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteBanner.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\DkJGMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\ws\WebsocketRunClient.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockAdminListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserIndexPosition.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsApplyService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\pay\PayInfo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\BigDecimalUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockCoinServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteLoginLogMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserWithdrawService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\DkMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminAgentController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\BankController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockCoinMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\KeyUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentInfoVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IAgentDistributionUserService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteMessageService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteInfoServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsAppend.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminIndexPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteSpread.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\translate\GoogleTranslateUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminFundsDealerInstitutionsController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockDzMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IBankServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\security\xss\DispatcherServletWrapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteMessageMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\user\UserLoginResultVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IAgentUserService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\UserPendingorderService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsSettingMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\BankMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteMessage.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\EchoServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\AgentAgencyFee.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminPendingOrderController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserFuturesPosition.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsApplyServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteFuturesSettingServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\ArticleApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteAmtTransLogService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockDz.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsSettingServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentUserController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsSettingService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserStockSubscribeServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteTaskLogServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\k\echarts\EchartsDataVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockMarketsDayServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\Md5Utils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\CmcPayConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\PositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pay\PayUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentWithdrawController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisKeyUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\DkModel.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\StockFuturesApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\index\ForceSellIndexTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\AgentDistributionUser.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserFundsPosition.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserFundsPositionServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SitePayServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\juhe\AddressResult.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteInfoService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteIndexSettingController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\foreigncurrency\ExchangeVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsDealerInstitutionsServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISitePayService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\filter\SessionExpireFilter.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\MarketVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSitePayController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsAppendService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\PayChnnel.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserRechargeMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\security\xss\HandlerExecutionChainWrapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockMarketsDayMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\MyCorsFilter.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserStockSubscribe.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\HolidayUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminCashDetailController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentUserListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsTradingAccount.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\filter\ExceptionResolver.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteSettingService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\StockApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockFuturesServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsLeverMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\futuresposition\UserFuturesPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockDzVo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\User.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteFuturesSettingController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserFuturesPositionMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteAmtTransLogMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\futures\ForceSellFuturesTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\StockServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\MarketVOResult.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\StockListTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\interceptor\ApiAgentAuthorityInterceptor.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminFuturesPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\RealTimeService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\converter\MyJsonMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentIncomeVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\PayApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisShardedPool.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\futuresposition\FuturesPositionProfitVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteSmsLogService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\interceptor\ApiAdminAuthorityInterceptor.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\OrderEchoBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteSpreadService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteAdminIndexMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserBank.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserCashDetailServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\qq\QqStockApi.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserCashDetailController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\StockShTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserPayController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockFuturesMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\GoogleAuthenticator.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteTaskLog.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IPayChnnelServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\Md5Util.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserIndexPositionMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\PayController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockSubscribeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SitePay.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\user\UserBankInfoVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockSubscribe.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsSecuritiesInfoService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\SignAPI.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockDz.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\SaveDayMarketsTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserBankService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserPositionService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\StockTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\juhe\AddressResultsVo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\email\MailSender.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\sms\ali\AliyunSmsConst.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserStockSubscribeMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\config\MyBatisConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\Const.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockOptionMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteAdminService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockFuturesController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\admin\AdminPendingorderVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\RealTimeTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\DataStockBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserIndexPositionServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\AgentDistributionUserServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteInNew.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\NewStockTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteIndexSettingServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserCashDetailMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\IpUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\SiteNewsController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\pay\GuoPayVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\HttpClientUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stockindex\StockIndexVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\StockIndexConst.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteInfo.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\position\UserPendingorderVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\indexposition\IndexPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteAdminIndexServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\StringUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\SiteProduct.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteSpreadMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\indexposition\AdminIndexPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminFundsSettingController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisKeyConstant.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\k\MinDataVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\BuyAndSellUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminStockIndexController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteBannerMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\RealTimeMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteSmsLogServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteFuturesSettingService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\UserApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserIndexPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserRechargeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteNewsService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\Stock.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\YEBTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockIndexMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\StockSubscribeMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\BankServices.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FundsTradingAccountServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\AdminApiController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\InStockMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\CurrencyUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteProductController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteBannerController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISiteTaskLogService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\indexposition\IndexPositionProfitVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserFundsController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\email\SendHTMLMail.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\futuresposition\AgentFuturesPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SiteAdminServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\Pager.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserPendingorder.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserWithdrawController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsSetting.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\SymmetricCryptoUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteArticleController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\FileUploadServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\ip\ipUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\ws\WebSocketClientBeanConfig.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserRechargeService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\ForceSellTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentLoginResultVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsApplyMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserFundsPositionMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockRealTimeBean.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\user\UserInfoVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\PayDataObject.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\StockFuturesConst.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserOptionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\AgentDistributionUserMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserRechargeServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\stock\GetStayDays.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\common\interceptor\MyResponseBodyAdvice.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\task\stock\StockOthersTask.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminUserController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\dk\DkController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\JsonUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminLogsController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\OrderEchoMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\PayChnnelMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\CookieUtils.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\indexposition\UserIndexPositionVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\StockListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\redis\RedisPoolUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\pay\CmcPayTool.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stockfutures\FuturesAdminListVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsApply.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IUserFuturesPositionService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminRechargeController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\UserCashDetail.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\ISmsService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\UserPendingorderServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\utils\DateTimeUtil.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteNewsMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\SiteFuturesSettingMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminSiteSettingController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentSecondInfoVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\StockOption.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\protol\UserFuturesPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IStockIndexService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\IFundsDealerInstitutionsService.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stockfutures\FuturesVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\UserPendingorderMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\agent\AgentAgencyFeeVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\dao\FundsDealerInstitutionsMapper.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\admin\AdminCountVO.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\pojo\FundsLever.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentFuturesPositionController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\echo\EChoController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\backend\AdminFundsApplyController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\controller\agent\AgentController.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\service\impl\SmsServiceImpl.java
-D:\悦安科技\dabaopaystock2c1\src\main\java\com\nq\vo\stock\StockOptionListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentIndexPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\juhe\AddressResultsVo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\task\stock\StockTask.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminFundsDealerInstitutionsController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\ResponseCode.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisKeyConstant.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsApplyService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserFuturesPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsTradingAccountServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\converter\MyJsonMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteInfoMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentUserListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\ScheduleConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\dk\DkController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserRechargeMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminLogsController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserBankController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentAgencyFeeVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\PayController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\sms\ali\AliyunSmsConst.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\BigDecimalUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\email\MailSender.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteAdminIndexMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserBankMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\ReponseBase.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\enums\EStockType.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserPendingorderMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\DkMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockCoinMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockOptionListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\futuresposition\UserFuturesPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\security\xss\DispatcherServletWrapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsApplyMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\StockListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stockfutures\StockFuturesListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteSpreadServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserAssetsMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteBannerServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockAdminListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserBankService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserPosition.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SmsServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\juhe\AddressResult.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentIncomeVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteInfoServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\BankController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockFuturesMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserRechargeServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteProductController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\user\UserBankInfoVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockDz.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteAdminMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\sina\vo\SinaStockMinData.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteSetting.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\k\MinDataVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\PositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserFuturesPositionMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteAdminIndexServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSitePayController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\CookieUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsSecuritiesInfoService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsSecuritiesInfoMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisKeyUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsLeverServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisShardedPool.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteNewsServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\http\HttpClientUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ApplicationContextRegisterUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsLever.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockMarketsDay.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserIndexPositionService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\BankMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\echo\EChoController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\SiteNewsController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\StockApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteLoginLog.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\indexposition\IndexPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsApplyServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserWithdraw.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\ArticleApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\AgentAgencyFee.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteBannerMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\UserPendingorderService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\Md5Utils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsAppend.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\reponse\RUserAssets.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\PayChnnel.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserPayController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\smsUtil\smsUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\indexposition\AdminIndexPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\pinyin\GetPyByChinese.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\StockPoll.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsSecuritiesInfoServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\UserPendingorderVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\SignAPI.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\StockFuturesConst.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentWithdrawController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserIndexPositionMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\user\UserInfoVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserFuturesPosition.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserPositionService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteBanner.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteSmsLogService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockOption.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\AgentDistributionUserMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockDz.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\enums\EUserAssets.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserCashDetailServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\MarketVOResult.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\OrderEchoMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockMarket.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\ws\WebSocketClientBeanConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\RealTimeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteNewsService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\AgentUserServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsAppendServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisShardedPoolUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteSpread.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsLeverMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteFuturesSettingMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserStockSubscribe.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\http\HttpRequest.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\admin\AdminPendingorderVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsSettingMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteArticleService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockSubscribeMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\EChoMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentSecondInfoVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserFundsPositionService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockMarketsDayServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserRechargeService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\ws\USWebsocketRunClient.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stockfutures\FuturesAdminListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockUsVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentUserController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteAmtTransLogService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserStockSubscribeMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserBank.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\futuresposition\AdminFuturesPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\RealTimeMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteArticle.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\AgentDistributionUserServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserFundsController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pay\PayUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\indexposition\AgentIndexPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\BuyAndSellUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\DkServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserFundsPositionServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\foreigncurrency\ExchangeVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockDzMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteSettingService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\AgentAgencyFeeServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserIndexPosition.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteMessageService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsDealerInstitutions.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockOptionMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteIndexSetting.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\Text.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\StringUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteProductMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IMandatoryLiquidationService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserRechargeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\UserApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockCoinServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FileUploadServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\PayApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteProduct.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteIndexSettingServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserStockSubscribeService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\StockApplication.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\PayChnnelServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminPendingOrderController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserFuturesPositionServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\MandatoryLiquidationService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentInfoVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserBankServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\ServerResponse.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteTaskLogServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\security\xss\HandlerExecutionChainWrapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockFuturesService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserWithdrawMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminAgentController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteArticleMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteIndexSettingController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\Stock.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\UserPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\Const.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\admin\AdminCountVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\CurrencyUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteFuturesSettingService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\PayContacts.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\StockFuturesApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IAgentAgencyFeeService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\GoogleAuthenticator.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteFuturesSettingController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockDzVo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\http\HttpClientRequest.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserFundsPosition.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsSettingServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteSpreadService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\QhBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminRechargeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\pay\FlyPayVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserPositionServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockOptionService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\annotation\SameUrlData.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockIndexMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsSecuritiesInfo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IEchoServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockMarketsDayService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteAmtTransLog.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteTaskLogMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\PropertiesUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsTradingAccountService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentRechargeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\task\YEBTask.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteSpreadMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\SiteAdminIndexService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteNewsMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentFuturesPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\DkJgBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockIndex.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteLoginLogServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\sms\ali\SmsDemo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\sina\StockApi.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteFuturesSetting.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteAdmin.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteSmsLog.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\DataStockBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisPoolUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminIndexPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteMessageServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\task\news\NewsTask.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\EChoBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\SignUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteArticleServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\translate\GoogleTranslateUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SitePay.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\AdminApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteLoginLogMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserRecharge.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\MarketVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserPendingorder.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\filter\SessionExpireFilter.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockIndexController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\user\UserLoginResultVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteMessageMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteSmsLogMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockIndexService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsSettingService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\SymmetricCryptoUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\AgentDistributionUser.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IBankServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteTaskLog.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\interceptor\ApiAdminAuthorityInterceptor.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteProductService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ftp\FTPUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\GetStayDays.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserAssets.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsLeverService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteSettingServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockOptionServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\timeutil\DateTimeUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteInfoController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteMessage.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteSettingMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteAmtTransLogMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminPendingorder.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stockfutures\FuturesVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteBannerController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\AgentUser.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\AgentPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteAmtTransLogServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\interceptor\ApiAgentAuthorityInterceptor.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\RealTimeServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockSubscribeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\PositionProfitVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\InStockMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\UserCashDetail.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\User.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserPositionMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteInfoService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IAgentUserService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\PayConst.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminWithDrawController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\SmsApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockSubscribeService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\PayChnnelMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsApply.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IPayService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IStockCoinService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminCashDetailController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserWithdrawController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteInfo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\EchoServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\KeyUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\DkJGMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\MyCorsFilter.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteSmsLogServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserWithdrawServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISmsService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\HolidayUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\MyBatisConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsTradingAccountMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\FundsDealerInstitutionsServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockSubscribeServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\StockListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\pay\PayInfo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\VerifyCodeController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteLoginLogService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SiteIndexSettingMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\CmcPayConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserCashDetailController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\StockMarketsDayMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\RealTime.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\DkModel.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockCoinController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\PayDataObject.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\OrderEchoBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserCashDetailService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\PayServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\futuresposition\FuturesPositionProfitVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\futuresposition\FuturesPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminFuturesPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISitePayService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\sms\ali\AliyunSms.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminStockFuturesController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\SitePayMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteAdminServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserFuturesPositionService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\StockIndexConst.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\Md5Util.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\GoogleCodeConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\ipUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\AgentUserMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsTradingAccount.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\Mandate.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteNews.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\position\AdminPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\interceptor\ApiUserAuthorityInterceptor.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteSettingController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\SiteApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminPositionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteAdminService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockFutures.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IAgentDistributionUserService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\indexposition\IndexPositionProfitVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stock\k\echarts\EchartsDataVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\WebMvcConfig.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminFundsSettingController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteInNew.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\StockDzService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\agent\AgentCashDetailController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\AgentAgencyFeeMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserPendingorderServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\JuheIpApi.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserStockSubscribeServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteBannerService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\AgentApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SitePayServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockSubscribe.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\RedisConst.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\Pager.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminUserController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminFundsApplyController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\RealTimeService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\StockIndexApiController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\dk\DkModelVo.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminSiteArticleController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\redis\JsonUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsDealerInstitutionsService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\qq\QqStockApi.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockRealTimeBean.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\agent\AgentLoginResultVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\pay\GuoPayVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\ip\IpUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\ws\WebsocketRunClient.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\SiteAdminIndex.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsDealerInstitutionsMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\FundsAppendMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IPayChnnelServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockIndexServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserCashDetailMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteTaskLogService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stockindex\StockIndexVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\Bank.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\ISiteIndexSettingService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\WithDrawUtils.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockDzServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\stockfutures\CoinAdminListVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IDkServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserAssetsServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\config\StockTask.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\BankServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\dao\UserFundsPositionMapper.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\futuresposition\AgentFuturesPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\backend\AdminNewStockController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\StockCoin.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteProductServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\StockFuturesServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\pay\CmcPayOuterRequestUtil.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\filter\ExceptionResolver.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\SiteFuturesSettingServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IUserWithdrawService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\stock\GeneratePosition.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserIndexPositionServiceImpl.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\HBData.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFileUploadService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserOptionController.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\pojo\FundsSetting.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\common\interceptor\MyResponseBodyAdvice.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\email\SendHTMLMail.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\vo\indexposition\UserIndexPositionVO.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\impl\UserAssetsServices.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\utils\pay\CmcPayTool.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\service\IFundsAppendService.java
+D:\gitlocal\dabaogp\src\main\java\com\nq\controller\protol\UserIndexPositionController.java
diff --git a/target/stock-0.0.1-SNAPSHOT.jar.original b/target/stock-0.0.1-SNAPSHOT.jar.original
index 469b366..e4f6ea1 100644
--- a/target/stock-0.0.1-SNAPSHOT.jar.original
+++ b/target/stock-0.0.1-SNAPSHOT.jar.original
Binary files differ
--
Gitblit v1.9.3