|
@@ -21,6 +21,7 @@ import com.xc.vo.futuresposition.FuturesPositionVO;
|
|
|
import com.xc.vo.indexposition.IndexPositionVO;
|
|
|
import com.xc.vo.position.PositionVO;
|
|
|
import com.xc.vo.position.UserPositionVO;
|
|
|
+import com.xc.vo.stock.StockListVO;
|
|
|
import com.xc.vo.stock.StockOptionListVO;
|
|
|
import com.xc.vo.stock.StockVO;
|
|
|
import com.xc.vo.user.UserInfoVO;
|
|
@@ -105,6 +106,8 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
@Autowired
|
|
|
UserTokenMapper userTokenMapper;
|
|
|
+ @Autowired
|
|
|
+ DbStockService dbStockService;
|
|
|
|
|
|
public ServerResponse reg(String yzmCode, String agentCode, String phone, String userPwd, HttpServletRequest request) {
|
|
|
if (StringUtils.isBlank(agentCode) || StringUtils.isBlank(phone) ||
|
|
@@ -242,16 +245,13 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
public ServerResponse addOption(String code, HttpServletRequest request) {
|
|
|
User user = getCurrentUser(request);
|
|
|
-
|
|
|
StockOption dboption = this.stockOptionMapper.findMyOptionIsExistByCode(user.getId(), code);
|
|
|
-
|
|
|
if (dboption != null) {
|
|
|
return ServerResponse.createByErrorMsg("添加失败,自选股已存在");
|
|
|
}
|
|
|
-
|
|
|
Stock stock = this.stockMapper.findStockByCode(code);
|
|
|
if (stock == null) {
|
|
|
- return ServerResponse.createByErrorMsg("添加失败,指数不存在");
|
|
|
+ return ServerResponse.createByErrorMsg("添加失败,货币不存在");
|
|
|
}
|
|
|
String gid = stock.getStockGid();
|
|
|
String sinaResult = SinaStockApi.getSinaStock(gid);
|
|
@@ -281,13 +281,10 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
public ServerResponse delOption(String code, HttpServletRequest request) {
|
|
|
User user = getCurrentUser(request);
|
|
|
-
|
|
|
StockOption dboption = this.stockOptionMapper.findMyOptionIsExistByCode(user.getId(), code);
|
|
|
-
|
|
|
if (dboption == null) {
|
|
|
return ServerResponse.createByErrorMsg("删除失败, 自选股不存在");
|
|
|
}
|
|
|
-
|
|
|
int delCount = this.stockOptionMapper.deleteByPrimaryKey(dboption.getId());
|
|
|
if (delCount > 0) {
|
|
|
return ServerResponse.createBySuccessMsg("删除自选股成功");
|
|
@@ -322,12 +319,10 @@ public class UserServiceImpl implements IUserService {
|
|
|
if (StringUtils.isBlank(oldPwd) || StringUtils.isBlank(newPwd)) {
|
|
|
return ServerResponse.createByErrorMsg("参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
User user = getCurrentRefreshUser(request);
|
|
|
if (!oldPwd.equals(user.getUserPwd())) {
|
|
|
return ServerResponse.createByErrorMsg("密码错误");
|
|
|
}
|
|
|
-
|
|
|
user.setUserPwd(newPwd);
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
@@ -346,7 +341,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
}else {
|
|
|
return ServerResponse.createBySuccessMsg("用户不存在");
|
|
|
}
|
|
|
-
|
|
|
}else {
|
|
|
if (user != null) {
|
|
|
return ServerResponse.createBySuccessMsg("用户已存在");
|
|
@@ -365,22 +359,17 @@ public class UserServiceImpl implements IUserService {
|
|
|
StringUtils.isBlank(newPwd)) {
|
|
|
return ServerResponse.createByErrorMsg("参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
String keys = "AliyunSmsCode:" + phone;
|
|
|
String redis_yzm = RedisShardedPoolUtils.get(keys);
|
|
|
-
|
|
|
log.info("redis_yzm = {} , code = {}", redis_yzm, code);
|
|
|
//redis_yzm
|
|
|
if (!code.equals("6666")) {
|
|
|
return ServerResponse.createByErrorMsg("修改密码失败,验证码错误");
|
|
|
}
|
|
|
-
|
|
|
User user = this.userMapper.findByPhone(phone);
|
|
|
if (user == null) {
|
|
|
return ServerResponse.createByErrorMsg("用户不存在");
|
|
|
}
|
|
|
-
|
|
|
user.setUserPwd(newPwd);
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
@@ -401,7 +390,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
user.setAgentName(agentUser.getAgentName());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
User userMapperById = this.userMapper.findById(user.getId());
|
|
|
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
@@ -428,29 +416,23 @@ public class UserServiceImpl implements IUserService {
|
|
|
StringUtils.isBlank(img1key) ||
|
|
|
StringUtils.isBlank(img2key))
|
|
|
{
|
|
|
-
|
|
|
return ServerResponse.createByErrorMsg("参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
User user = getCurrentRefreshUser(request);
|
|
|
if (user == null) {
|
|
|
return ServerResponse.createByErrorMsg("请登录!");
|
|
|
}
|
|
|
-
|
|
|
if (((0 != user.getIsActive().intValue())) & ((3 != user.getIsActive().intValue()) ))
|
|
|
{
|
|
|
return ServerResponse.createByErrorMsg("当前状态不能认证");
|
|
|
}
|
|
|
-
|
|
|
user.setNickName(realName);
|
|
|
user.setRealName(realName);
|
|
|
user.setIdCard(idCard);
|
|
|
-
|
|
|
user.setImg1Key(img1key);
|
|
|
user.setImg2Key(img2key);
|
|
|
user.setImg3Key(img3key);
|
|
|
user.setIsActive(Integer.valueOf(1));
|
|
|
-
|
|
|
log.info("##### 用户认证 ####,用户总资金 = {} 可用资金 = {}", user
|
|
|
.getUserAmt(), user.getEnableAmt());
|
|
|
|
|
@@ -468,18 +450,14 @@ public class UserServiceImpl implements IUserService {
|
|
|
if (amt.intValue() <= 0) {
|
|
|
return ServerResponse.createByErrorMsg("金额不正确");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if (1 == type.intValue()) {
|
|
|
if (user.getEnableAmt().compareTo(new BigDecimal(amt.intValue())) == -1) {
|
|
|
return ServerResponse.createByErrorMsg("融资账户可用资金不足");
|
|
|
}
|
|
|
-
|
|
|
BigDecimal userAmt = user.getUserAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableAmt = user.getEnableAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal userIndexAmt = user.getUserIndexAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableIndexAmt = user.getEnableIndexAmt().add(new BigDecimal(amt.intValue()));
|
|
|
-
|
|
|
user.setUserAmt(userAmt);
|
|
|
user.setEnableAmt(enableAmt);
|
|
|
user.setUserIndexAmt(userIndexAmt);
|
|
@@ -491,19 +469,14 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("转账失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (2 == type.intValue()) {
|
|
|
if (user.getEnableIndexAmt().compareTo(new BigDecimal(amt.intValue())) == -1) {
|
|
|
- return ServerResponse.createByErrorMsg("指数账户可用资金不足");
|
|
|
+ return ServerResponse.createByErrorMsg("货币账户可用资金不足");
|
|
|
}
|
|
|
-
|
|
|
BigDecimal userAmt = user.getUserAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableAmt = user.getEnableAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal userIndexAmt = user.getUserIndexAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableIndexAmt = user.getEnableIndexAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
-
|
|
|
user.setUserAmt(userAmt);
|
|
|
user.setEnableAmt(enableAmt);
|
|
|
user.setUserIndexAmt(userIndexAmt);
|
|
@@ -515,19 +488,14 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("转账失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (3 == type.intValue()) {
|
|
|
if (user.getEnableAmt().compareTo(new BigDecimal(amt.intValue())) == -1) {
|
|
|
- return ServerResponse.createByErrorMsg("指数账户可用资金不足");
|
|
|
+ return ServerResponse.createByErrorMsg("货币账户可用资金不足");
|
|
|
}
|
|
|
-
|
|
|
BigDecimal userAmt = user.getUserAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableAmt = user.getEnableAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal userFutAmt = user.getUserFutAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableFutAmt = user.getEnableFutAmt().add(new BigDecimal(amt.intValue()));
|
|
|
-
|
|
|
user.setUserAmt(userAmt);
|
|
|
user.setEnableAmt(enableAmt);
|
|
|
user.setUserFutAmt(userFutAmt);
|
|
@@ -539,24 +507,18 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("转账失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (4 == type.intValue()) {
|
|
|
if (user.getEnableFutAmt().compareTo(new BigDecimal(amt.intValue())) == -1) {
|
|
|
return ServerResponse.createByErrorMsg("期货账户可用资金不足");
|
|
|
}
|
|
|
-
|
|
|
BigDecimal userAmt = user.getUserAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableAmt = user.getEnableAmt().add(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal userFutAmt = user.getUserFutAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
BigDecimal enableFutAmt = user.getEnableFutAmt().subtract(new BigDecimal(amt.intValue()));
|
|
|
-
|
|
|
user.setUserAmt(userAmt);
|
|
|
user.setEnableAmt(enableAmt);
|
|
|
user.setUserFutAmt(userFutAmt);
|
|
|
user.setEnableFutAmt(enableFutAmt);
|
|
|
-
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
|
saveAmtTransLog(user, type, amt);
|
|
@@ -564,8 +526,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("转账失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
return ServerResponse.createByErrorMsg("类型错误");
|
|
|
}
|
|
|
|
|
@@ -577,10 +537,10 @@ public class UserServiceImpl implements IUserService {
|
|
|
String amtTo = "";
|
|
|
if (1 == type.intValue()) {
|
|
|
amtFrom = "融资";
|
|
|
- amtTo = "指数";
|
|
|
+ amtTo = "货币";
|
|
|
}
|
|
|
else if (2 == type.intValue()) {
|
|
|
- amtFrom = "指数";
|
|
|
+ amtFrom = "货币";
|
|
|
amtTo = "融资";
|
|
|
}
|
|
|
else if (3 == type.intValue()) {
|
|
@@ -621,15 +581,15 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
|
|
|
public void ForceSellTask() {
|
|
|
- // 获取指数当前价格
|
|
|
+ // 获取货币当前价格
|
|
|
List<IndexInfo> indexInfoList = stockMapper.selectStockList();
|
|
|
Map<String, IndexInfo> indexMap = new HashMap<>();
|
|
|
BigDecimal nowPrice;
|
|
|
for (IndexInfo indexInfo : indexInfoList) {
|
|
|
if (StringUtils.isNotEmpty(indexInfo.getDataDbName())) {
|
|
|
try {
|
|
|
- String nowPriceStr = userPositionService.getNowPriceStrByDbName(indexInfo.getDataDbName());
|
|
|
- nowPrice = BigDecimal.valueOf(Double.valueOf(nowPriceStr));
|
|
|
+ StockListVO stockListVO = dbStockService.getStockListVO(indexInfo.getCode());
|
|
|
+ nowPrice = new BigDecimal(stockListVO.getNowPrice());
|
|
|
indexInfo.setNowPrice(nowPrice);
|
|
|
} catch (Exception e) {
|
|
|
// 数据库不存在
|
|
@@ -639,17 +599,16 @@ public class UserServiceImpl implements IUserService {
|
|
|
indexMap.put(indexInfo.getCnName(), indexInfo);
|
|
|
}
|
|
|
List<Integer> userIdList = this.iUserPositionService.findDistinctUserIdList();
|
|
|
- log.info("当前有持仓单的用户数量 为 {}", Integer.valueOf(userIdList.size()));
|
|
|
+ log.info("当前有持仓单的用户数量 为 {}", userIdList.size());
|
|
|
for (int i = 0; i < userIdList.size(); i++) {
|
|
|
log.info("=====================");
|
|
|
Integer userId = userIdList.get(i);
|
|
|
User user = this.userMapper.selectByPrimaryKey(userId);
|
|
|
-// List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(userId);
|
|
|
List<UserPosition> userPositions = this.userPositionMapper.findMyPositionByCodeAndSpell(user.getId(), null, null, 0);
|
|
|
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[] { userId, user.getRealName(), Integer.valueOf(userPositions.size()) });
|
|
|
+ log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", userId, user.getRealName(), userPositions.size());
|
|
|
//可用资金
|
|
|
BigDecimal enable_user_amt = user.getEnableAmt();
|
|
|
- // (可用+指数保证金+指数盈亏-手续费) /指数保证金<70%爆仓
|
|
|
+ // (可用+货币保证金+货币盈亏-手续费) /货币保证金<70%爆仓
|
|
|
// 爆仓率
|
|
|
BigDecimal bcl = new BigDecimal(0);
|
|
|
BigDecimal yk = new BigDecimal(0);
|
|
@@ -658,7 +617,7 @@ public class UserServiceImpl implements IUserService {
|
|
|
BigDecimal sxf = new BigDecimal(0);
|
|
|
BigDecimal forceStopPercent = new BigDecimal(0);
|
|
|
for (UserPosition position : userPositions) {
|
|
|
- // 用户持仓指数现价
|
|
|
+ // 用户持仓货币现价
|
|
|
IndexInfo indexInfo = indexMap.get(position.getStockName());
|
|
|
forceStopPercent = indexInfo.getForceStopPercent();
|
|
|
//盈亏公式 做多 (现价—开仓价)*合约单位*手数 做空 (开仓价-现价)*合约单位*手数
|
|
@@ -679,14 +638,14 @@ public class UserServiceImpl implements IUserService {
|
|
|
ForceSellByUserId(userId);
|
|
|
// iUserPositionService.closeOut(position.getId());
|
|
|
SiteTaskLog siteTaskLog = new SiteTaskLog();
|
|
|
- siteTaskLog.setTaskType("强平任务-指数持仓");
|
|
|
+ siteTaskLog.setTaskType("强平任务-货币持仓");
|
|
|
String taskcnt = user.getRealName() + "被强平[两融盈亏达到最大亏损] 用户id = " + user.getId() + ", 可用资金 = " + enable_user_amt + "冻结保证金 = " + bzj +
|
|
|
", 强平比例 = " + forceStopPercent + ", 总盈亏" + yk;
|
|
|
siteTaskLog.setTaskCnt(taskcnt);
|
|
|
- String tasktarget = "此次强平" + userPositions.size() + "条指数持仓订单, 用户ID为" + userId;
|
|
|
+ String tasktarget = "此次强平" + userPositions.size() + "条持仓订单, 用户ID为" + userId;
|
|
|
siteTaskLog.setTaskTarget(tasktarget);
|
|
|
siteTaskLog.setAddTime(new Date());
|
|
|
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
|
|
|
+ siteTaskLog.setIsSuccess(0);
|
|
|
siteTaskLog.setErrorMsg("");
|
|
|
int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
|
|
|
if (insertTaskCount > 0) {
|
|
@@ -701,86 +660,57 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
public void ForceSellIndexTask() {
|
|
|
List<Integer> userIdList = this.iUserIndexPositionService.findDistinctUserIdList();
|
|
|
-
|
|
|
- log.info("当前有 指数持仓 的用户数量 为 {}", Integer.valueOf(userIdList.size()));
|
|
|
-
|
|
|
+ log.info("当前有 货币持仓 的用户数量 为 {}", userIdList.size());
|
|
|
for (int i = 0; i < userIdList.size(); i++) {
|
|
|
log.info("=====================");
|
|
|
Integer userId = (Integer)userIdList.get(i);
|
|
|
User user = this.userMapper.selectByPrimaryKey(userId);
|
|
|
-
|
|
|
-
|
|
|
List<UserIndexPosition> userIndexPositions = this.iUserIndexPositionService.findIndexPositionByUserIdAndSellPriceIsNull(userId);
|
|
|
-
|
|
|
- log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", new Object[] { userId, user
|
|
|
- .getRealName(), Integer.valueOf(userIndexPositions.size()) });
|
|
|
-
|
|
|
-
|
|
|
+ log.info("用户id = {} 姓名 = {} 持仓中订单数: {}", 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 });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", 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 = force_stop_percent.multiply(all_freez_amt);
|
|
|
-
|
|
|
-
|
|
|
BigDecimal user_force_amt = enable_index_amt.add(force_stop_amt);
|
|
|
log.info("用户强制平仓线金额 = {}", user_force_amt);
|
|
|
-
|
|
|
boolean isProfit = false;
|
|
|
-
|
|
|
isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) == -1 && user_force_amt.compareTo(all_profit_and_lose.negate()) != 1);
|
|
|
-
|
|
|
if (isProfit) {
|
|
|
- log.info("强制平仓该用户所有的指数持仓单");
|
|
|
-
|
|
|
+ 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();
|
|
|
+ arrs[k] = userIndexPosition.getId();
|
|
|
try {
|
|
|
this.iUserIndexPositionService.sellIndex(userIndexPosition.getPositionSn(), 0);
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
- log.error("[盈亏达到最大亏损]强制平仓指数失败...");
|
|
|
+ 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.setTaskType("强平任务-货币持仓");
|
|
|
+ String accountType = (user.getAccountType() == 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);
|
|
|
+ String tasktarget = "此次强平" + userIndexPositions.size() + "条货币持仓订单, 订单号为" + Arrays.toString(arrs);
|
|
|
siteTaskLog.setTaskTarget(tasktarget);
|
|
|
siteTaskLog.setAddTime(new Date());
|
|
|
- siteTaskLog.setIsSuccess(Integer.valueOf(0));
|
|
|
+ siteTaskLog.setIsSuccess(0);
|
|
|
siteTaskLog.setErrorMsg("");
|
|
|
int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
|
|
|
if (insertTaskCount > 0) {
|
|
|
- log.info("[盈亏达到最大亏损] 保存强制平仓 指数 task任务成功");
|
|
|
+ log.info("[盈亏达到最大亏损] 保存强制平仓 货币 task任务成功");
|
|
|
} else {
|
|
|
- log.info("[盈亏达到最大亏损] 保存强制平仓 指数 task任务失败");
|
|
|
+ log.info("[盈亏达到最大亏损] 保存强制平仓 货币 task任务失败");
|
|
|
}
|
|
|
} else {
|
|
|
- log.info("用户指数持仓未达到强制平仓线, 不做强平处理...");
|
|
|
+ log.info("用户货币持仓未达到强制平仓线, 不做强平处理...");
|
|
|
}
|
|
|
|
|
|
log.info("=====================");
|
|
@@ -789,8 +719,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
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);
|
|
@@ -800,38 +728,26 @@ public class UserServiceImpl implements IUserService {
|
|
|
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()) });
|
|
|
-
|
|
|
+ log.info("用户id = {} 姓名 = {} 期货持仓中订单数 {}", userId, user
|
|
|
+ .getRealName(), 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 });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ log.info("用户 {} 可用资金 = {} 总冻结保证金 = {} 所有持仓单的总盈亏 = {}", 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 = force_stop_percent.multiply(all_deposit_amt);
|
|
|
BigDecimal user_force_amt = enable_Futures_amt.add(force_stop_amt);
|
|
|
log.info("用户强制平仓线金额 = {}", user_force_amt);
|
|
|
-
|
|
|
boolean isProfit = false;
|
|
|
-
|
|
|
isProfit = (all_profit_and_lose.compareTo(new BigDecimal("0")) == -1 && user_force_amt.compareTo(all_profit_and_lose.negate()) != 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();
|
|
|
+ arrs[k] = userFuturesPosition.getId();
|
|
|
try {
|
|
|
this.iUserFuturesPositionService.sellFutures(userFuturesPosition.getPositionSn(), 0);
|
|
|
}
|
|
@@ -839,21 +755,15 @@ public class UserServiceImpl implements IUserService {
|
|
|
log.error("[盈亏达到最大亏损] 强制平仓 期货 失败...");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
SiteTaskLog siteTaskLog = new SiteTaskLog();
|
|
|
siteTaskLog.setTaskType("强平任务-期货持仓");
|
|
|
- String accountType = (user.getAccountType().intValue() == 0) ? "正式用户" : "模拟用户";
|
|
|
+ String accountType = (user.getAccountType() == 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.setIsSuccess(0);
|
|
|
siteTaskLog.setErrorMsg("");
|
|
|
int insertTaskCount = this.siteTaskLogMapper.insert(siteTaskLog);
|
|
|
if (insertTaskCount > 0) {
|
|
@@ -922,11 +832,10 @@ public class UserServiceImpl implements IUserService {
|
|
|
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));
|
|
|
+ user.setIsLock(0);
|
|
|
+ user.setIsLogin(0);
|
|
|
+ user.setIsActive(0);
|
|
|
user.setRegTime(new Date());
|
|
|
-
|
|
|
if (accountType == 1) {
|
|
|
// user.setPhone(phone+"-Active");
|
|
|
// if (new BigDecimal(amt).compareTo(new BigDecimal("100000")) == -1){
|
|
@@ -937,21 +846,17 @@ public class UserServiceImpl implements IUserService {
|
|
|
user.setIsActive(2);
|
|
|
// user.setIdCard("000000000000000000");
|
|
|
}
|
|
|
-
|
|
|
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);
|
|
|
user.setAgentName(agentUser.getAgentName());
|
|
|
user.setAgentId(agentUser.getId());
|
|
|
}
|
|
|
-
|
|
|
int insertCount = this.userMapper.insert(user);
|
|
|
if (insertCount > 0) {
|
|
|
-
|
|
|
// if (accountType != 1){
|
|
|
//// user.setUserPwd("123456");
|
|
|
// user.setPhone(user.getPhone()+"-Active");
|
|
@@ -987,23 +892,16 @@ public class UserServiceImpl implements IUserService {
|
|
|
// return ServerResponse.createBySuccessMsg("模拟用户添加成功。模拟银行卡添加失败,请手动添加");
|
|
|
// }
|
|
|
// }
|
|
|
-
|
|
|
return ServerResponse.createBySuccessMsg("用户添加成功");
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("用户添加失败");
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public ServerResponse listByAdmin(String realName, String phone, Integer agentId, Integer accountType, int pageNum, int pageSize, HttpServletRequest request) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
-
|
|
|
List<User> users = this.userMapper.listByAdmin(realName, phone, agentId, accountType);
|
|
|
-
|
|
|
PageInfo pageInfo = new PageInfo(users);
|
|
|
-
|
|
|
return ServerResponse.createBySuccess(pageInfo);
|
|
|
}
|
|
|
|
|
@@ -1019,13 +917,11 @@ public class UserServiceImpl implements IUserService {
|
|
|
if (user == null) {
|
|
|
return ServerResponse.createByErrorMsg("用户不存在");
|
|
|
}
|
|
|
-
|
|
|
if (user.getIsLock().intValue() == 1) {
|
|
|
user.setIsLock(Integer.valueOf(0));
|
|
|
} else {
|
|
|
user.setIsLock(Integer.valueOf(1));
|
|
|
}
|
|
|
-
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
|
return ServerResponse.createBySuccess("修改成功");
|
|
@@ -1041,12 +937,10 @@ public class UserServiceImpl implements IUserService {
|
|
|
if (userId == null || amt == null || direction == null) {
|
|
|
return ServerResponse.createByErrorMsg("参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
User user = this.userMapper.selectByPrimaryKey(userId);
|
|
|
if (user == null) {
|
|
|
return ServerResponse.createByErrorMsg("用户不存在");
|
|
|
}
|
|
|
-
|
|
|
BigDecimal user_amt = user.getUserAmt();
|
|
|
BigDecimal user_enable = user.getEnableAmt();
|
|
|
|
|
@@ -1069,13 +963,9 @@ public class UserServiceImpl implements IUserService {
|
|
|
} else {
|
|
|
return ServerResponse.createByErrorMsg("不存在此操作");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
user.setUserAmt(user_amt_back);
|
|
|
user.setEnableAmt(user_enable_back);
|
|
|
this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
-
|
|
|
-
|
|
|
SiteTaskLog siteTaskLog = new SiteTaskLog();
|
|
|
siteTaskLog.setTaskType("管理员修改金额");
|
|
|
StringBuffer cnt = new StringBuffer();
|
|
@@ -1090,12 +980,9 @@ public class UserServiceImpl implements IUserService {
|
|
|
.append("修改前 总资金 = ").append(user_amt).append(" 可用 = ").append(user_enable)
|
|
|
.append("修改后 总资金 = ").append(user_amt_back).append(" 可用 = ").append(user_enable_back);
|
|
|
target.append(" - 备注:"+info);
|
|
|
-
|
|
|
siteTaskLog.setTaskTarget(target.toString());
|
|
|
-
|
|
|
siteTaskLog.setIsSuccess(Integer.valueOf(0));
|
|
|
siteTaskLog.setAddTime(new Date());
|
|
|
-
|
|
|
int insertCount = this.siteTaskLogMapper.insert(siteTaskLog);
|
|
|
if (insertCount > 0) {
|
|
|
return ServerResponse.createBySuccessMsg("修改资金成功");
|
|
@@ -1111,50 +998,37 @@ public class UserServiceImpl implements IUserService {
|
|
|
String logintoken = CookieUtils.readLoginToken(request, cookie_name);
|
|
|
String adminJson = RedisShardedPoolUtils.get(logintoken);
|
|
|
SiteAdmin siteAdmin = (SiteAdmin)JsonUtil.string2Obj(adminJson, SiteAdmin.class);
|
|
|
-
|
|
|
log.info("管理员 {} 删除用户 {}", siteAdmin.getAdminName(), userId);
|
|
|
-
|
|
|
-
|
|
|
int delChargeCount = this.iUserRechargeService.deleteByUserId(userId);
|
|
|
if (delChargeCount > 0) {
|
|
|
log.info("删除 充值 记录成功");
|
|
|
} else {
|
|
|
log.info("删除 充值 记录失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
int delWithdrawCount = this.iUserWithdrawService.deleteByUserId(userId);
|
|
|
if (delWithdrawCount > 0) {
|
|
|
log.info("删除 提现 记录成功");
|
|
|
} else {
|
|
|
log.info("删除 提现 记录失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
int delCashCount = this.iUserCashDetailService.deleteByUserId(userId);
|
|
|
if (delCashCount > 0) {
|
|
|
log.info("删除 资金 记录成功");
|
|
|
} else {
|
|
|
log.info("删除 资金 记录成功");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
int delPositionCount = this.iUserPositionService.deleteByUserId(userId);
|
|
|
if (delPositionCount > 0) {
|
|
|
log.info("删除 持仓 记录成功");
|
|
|
} else {
|
|
|
log.info("删除 持仓 记录失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
int delLogCount = this.iSiteLoginLogService.deleteByUserId(userId);
|
|
|
if (delLogCount > 0) {
|
|
|
log.info("删除 登录 记录成功");
|
|
|
} else {
|
|
|
log.info("删除 登录 记录失败");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
int delUserCount = this.userMapper.deleteByPrimaryKey(userId);
|
|
|
if (delUserCount > 0) {
|
|
|
return ServerResponse.createBySuccessMsg("操作成功");
|
|
@@ -1162,45 +1036,27 @@ public class UserServiceImpl implements IUserService {
|
|
|
return ServerResponse.createByErrorMsg("操作失败, 查看日志");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public int CountUserSize(Integer accountType) { return this.userMapper.CountUserSize(accountType); }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public BigDecimal CountUserAmt(Integer accountType) { return this.userMapper.CountUserAmt(accountType); }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public BigDecimal CountEnableAmt(Integer accountType) { return this.userMapper.CountEnableAmt(accountType); }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public ServerResponse authByAdmin(Integer userId, Integer state, String authMsg) {
|
|
|
if (state == null || userId == null) {
|
|
|
return ServerResponse.createByErrorMsg("id和state不能为空");
|
|
|
}
|
|
|
-
|
|
|
User user = this.userMapper.selectByPrimaryKey(userId);
|
|
|
if (user == null) {
|
|
|
return ServerResponse.createByErrorMsg("查不到此用户");
|
|
|
}
|
|
|
-
|
|
|
if (state.intValue() == 3) {
|
|
|
if (StringUtils.isBlank(authMsg)) {
|
|
|
return ServerResponse.createByErrorMsg("审核失败信息必填");
|
|
|
}
|
|
|
user.setAuthMsg(authMsg);
|
|
|
}
|
|
|
-
|
|
|
user.setIsActive(state);
|
|
|
-
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
|
return ServerResponse.createBySuccessMsg("审核成功");
|
|
@@ -1211,7 +1067,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
@Override
|
|
|
public ServerResponse findIdWithPwd(String phone) {
|
|
|
String idWithPwd = userMapper.findIdWithPwd(phone);
|
|
|
-
|
|
|
if (idWithPwd==null){
|
|
|
return ServerResponse.createByErrorMsg("请设置提现密码!");
|
|
|
}else {
|
|
@@ -1221,17 +1076,13 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
@Override
|
|
|
public ServerResponse updateWithPwd(String with_pwd, String phone) {
|
|
|
-
|
|
|
if (StringUtils.isBlank(with_pwd)||StringUtils.isBlank(phone)){
|
|
|
return ServerResponse.createByErrorMsg("参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
String withPwd = userMapper.findWithPwd(with_pwd);
|
|
|
-
|
|
|
if (withPwd!=null){
|
|
|
return ServerResponse.createByErrorMsg("您已经添加了提现密码!");
|
|
|
}
|
|
|
-
|
|
|
int i = userMapper.updateWithPwd(with_pwd, phone);
|
|
|
if (i>0){
|
|
|
return ServerResponse.createBySuccessMsg("添加成功!");
|
|
@@ -1243,7 +1094,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
|
|
|
private AgentUserListVO assembleAgentUserListVO(User user, BigDecimal forcePercent, BigDecimal indexForcePercent, BigDecimal futuresForcePercent) {
|
|
|
AgentUserListVO agentUserListVO = new AgentUserListVO();
|
|
|
-
|
|
|
agentUserListVO.setId(user.getId());
|
|
|
agentUserListVO.setAgentId(user.getAgentId());
|
|
|
agentUserListVO.setAgentName(user.getAgentName());
|
|
@@ -1255,58 +1105,38 @@ public class UserServiceImpl implements IUserService {
|
|
|
agentUserListVO.setIsLogin(user.getIsLogin());
|
|
|
agentUserListVO.setRegAddress(user.getRegAddress());
|
|
|
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());
|
|
|
BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose();
|
|
|
BigDecimal allFreezAmt = positionVO.getAllFreezAmt();
|
|
|
agentUserListVO.setAllProfitAndLose(allProfitAndLose);
|
|
|
agentUserListVO.setAllFreezAmt(allFreezAmt);
|
|
|
-
|
|
|
BigDecimal forceLine = forcePercent.multiply(allFreezAmt);
|
|
|
forceLine = forceLine.add(user.getEnableAmt());
|
|
|
agentUserListVO.setForceLine(forceLine);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(user.getId());
|
|
|
agentUserListVO.setAllIndexProfitAndLose(indexPositionVO.getAllIndexProfitAndLose());
|
|
|
agentUserListVO.setAllIndexFreezAmt(indexPositionVO.getAllIndexFreezAmt());
|
|
|
-
|
|
|
BigDecimal indexForceLine = indexForcePercent.multiply(indexPositionVO.getAllIndexFreezAmt());
|
|
|
indexForceLine = indexForceLine.add(user.getEnableIndexAmt());
|
|
|
agentUserListVO.setIndexForceLine(indexForceLine);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
FuturesPositionVO futuresPositionVO = this.iUserFuturesPositionService.findUserFuturesPositionAllProfitAndLose(user.getId());
|
|
|
agentUserListVO.setAllFuturesFreezAmt(futuresPositionVO.getAllFuturesDepositAmt());
|
|
|
agentUserListVO.setAllFuturesProfitAndLose(futuresPositionVO.getAllFuturesProfitAndLose());
|
|
|
-
|
|
|
BigDecimal futuresForceLine = futuresForcePercent.multiply(futuresPositionVO.getAllFuturesDepositAmt());
|
|
|
futuresForceLine = futuresForceLine.add(user.getEnableFutAmt());
|
|
|
agentUserListVO.setFuturesForceLine(futuresForceLine);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
UserBank userBank = this.iUserBankService.findUserBankByUserId(user.getId());
|
|
|
if (userBank != null) {
|
|
|
agentUserListVO.setBankName(userBank.getBankName());
|
|
|
agentUserListVO.setBankNo(userBank.getBankNo());
|
|
|
agentUserListVO.setBankAddress(userBank.getBankAddress());
|
|
|
}
|
|
|
-
|
|
|
return agentUserListVO;
|
|
|
}
|
|
|
|
|
@@ -1330,43 +1160,31 @@ public class UserServiceImpl implements IUserService {
|
|
|
userInfoVO.setImg3Key(user.getImg3Key());
|
|
|
userInfoVO.setIsActive(user.getIsActive());
|
|
|
userInfoVO.setAuthMsg(user.getAuthMsg());
|
|
|
-
|
|
|
userInfoVO.setEnableAmt(user.getEnableAmt());
|
|
|
-
|
|
|
// 冻结保证金 总盈亏
|
|
|
PositionVO positionVO = this.iUserPositionService.findUserPositionAllProfitAndLose(user.getId());
|
|
|
userInfoVO.setAllFreezAmt(positionVO.getAllFreezAmt());
|
|
|
BigDecimal allProfitAndLose = positionVO.getAllProfitAndLose();
|
|
|
userInfoVO.setAllProfitAndLose(allProfitAndLose);
|
|
|
-
|
|
|
BigDecimal userAllAmt = user.getUserAmt();
|
|
|
userAllAmt = userAllAmt.add(allProfitAndLose);
|
|
|
userInfoVO.setUserAmt(userAllAmt);
|
|
|
-
|
|
|
userInfoVO.setEnableIndexAmt(user.getEnableIndexAmt());
|
|
|
-
|
|
|
IndexPositionVO indexPositionVO = this.iUserIndexPositionService.findUserIndexPositionAllProfitAndLose(user.getId());
|
|
|
BigDecimal allIndexProfitAndLose = indexPositionVO.getAllIndexProfitAndLose();
|
|
|
userInfoVO.setAllIndexProfitAndLose(allIndexProfitAndLose);
|
|
|
userInfoVO.setAllIndexFreezAmt(indexPositionVO.getAllIndexFreezAmt());
|
|
|
-
|
|
|
BigDecimal userAllIndexAmt = user.getUserIndexAmt();
|
|
|
userAllIndexAmt = userAllIndexAmt.add(allIndexProfitAndLose);
|
|
|
userInfoVO.setUserIndexAmt(userAllIndexAmt);
|
|
|
-
|
|
|
userInfoVO.setEnableFuturesAmt(user.getEnableFutAmt());
|
|
|
-
|
|
|
FuturesPositionVO futuresPositionVO = this.iUserFuturesPositionService.findUserFuturesPositionAllProfitAndLose(user.getId());
|
|
|
-
|
|
|
userInfoVO.setAllFuturesFreezAmt(futuresPositionVO.getAllFuturesDepositAmt());
|
|
|
-
|
|
|
BigDecimal allFuturesProfitAndLose = futuresPositionVO.getAllFuturesProfitAndLose();
|
|
|
userInfoVO.setAllFuturesProfitAndLose(allFuturesProfitAndLose);
|
|
|
-
|
|
|
BigDecimal userAllFuturesAmt = user.getUserFutAmt();
|
|
|
userAllFuturesAmt = userAllFuturesAmt.add(allFuturesProfitAndLose);
|
|
|
userInfoVO.setUserFuturesAmt(userAllFuturesAmt);
|
|
|
-
|
|
|
// 获取用户是否有绑定银行卡
|
|
|
if(0 == userMapper.selectHaveBankCardByUserId(userInfoVO.getId())){
|
|
|
userInfoVO.setHaveBankCard(false);
|
|
@@ -1377,24 +1195,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- int a = 3;
|
|
|
-
|
|
|
- System.out.println((a != 0));
|
|
|
- System.out.println((a != 3));
|
|
|
-
|
|
|
- System.out.println(((a != 0) ? 1 : 0) & ((a != 3) ? 1 : 0));
|
|
|
- System.out.println((a != 0 && a != 3));
|
|
|
-
|
|
|
-
|
|
|
- if (a != 0 && a != 3) {
|
|
|
- System.out.println("不能认证");
|
|
|
- } else {
|
|
|
- System.out.println("可以认证");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public void updateUserAmt(Double amt, Integer user_id) {
|
|
|
userMapper.updateUserAmt(amt, user_id);
|
|
@@ -1429,7 +1229,6 @@ public class UserServiceImpl implements IUserService {
|
|
|
agentUserList.add(currentAgent);
|
|
|
Set<Integer> pidSet = new HashSet<>();
|
|
|
pidSet.add(currentAgent.getId());
|
|
|
-
|
|
|
List<AgentUser> agentUserListTemp = this.agentUserMapper.selectAgentUserList();
|
|
|
for(AgentUser a : agentUserListTemp){
|
|
|
if(pidSet.contains(a.getParentId())){
|