| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private IUserIndexPositionService iUserIndexPositionService; |
| | | @Autowired |
| | | private IStockCoinService iStockCoinService; |
| | | @Autowired |
| | | private IStockFuturesService iStockFuturesService; |
| | | @Autowired |
| | | private ISiteSettingService iSiteSettingService; |
| | | @Autowired |
| | | private UserPositionMapper userPositionMapper; |
| | | |
| | | @Override |
| | | public ServerResponse addOrder(String stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, BigDecimal targetPrice, HttpServletRequest request) { |
| | |
| | | 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; |
| | | } |
| | |
| | | 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 = ""; |
| | |
| | | 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()); |
| | |
| | | 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()); |