| | |
| | | |
| | | |
| | | @Transactional |
| | | public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request,Integer userId) { |
| | | public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget,String password, HttpServletRequest request,Integer userId) { |
| | | |
| | | SiteProduct siteProduct = iSiteProductService.getProductSetting(); |
| | | |
| | |
| | | if (nowPrice.compareTo(new BigDecimal("0")) == 0) { |
| | | return ServerResponse.createByErrorMsg("报价0,请稍后再试", request); |
| | | } |
| | | // //vip抢筹 |
| | | // SiteSetting siteSetting = iSiteSettingService.getSiteSetting(); |
| | | // StockRealTimeBean stockRealTimeBean = RedisKeyUtil.getCacheRealTimeStock(stock); |
| | | // BigDecimal pcp = new BigDecimal(stockRealTimeBean.getPcp()); |
| | | //vip抢筹 |
| | | SiteSetting siteSetting = iSiteSettingService.getSiteSetting(); |
| | | StockRealTimeBean stockRealTimeBean = RedisKeyUtil.getCacheRealTimeStock(stock); |
| | | BigDecimal pcp = new BigDecimal(stockRealTimeBean.getPcp()); |
| | | // SiteVipRob siteVipRob = iSiteVipRobService.getByStockCode(stock.getStockCode()); |
| | | // // 检查VIP抢筹功能是否开启且用户符合条件 |
| | | // if (null != siteVipRob && siteVipRob.getStatus() == 1 && pcp.compareTo(siteVipRob.getStockChg()) >= 0) { |
| | |
| | | userPosition.setStockCode(stock.getStockCode()); |
| | | userPosition.setStockSpell(stock.getStockSpell()); |
| | | userPosition.setStockName(userStockSubscribe.getNewName()); |
| | | StringBuffer gid = new StringBuffer(); |
| | | gid.append(stockSubscribe.getStockType()!=null?stockSubscribe.getStockType():""); |
| | | gid.append(userStockSubscribe.getNewCode()!=null?userStockSubscribe.getNewCode():"stock code invaild"); |
| | | userPosition.setStockGid(gid.toString()); |
| | | userPosition.setStockGid(stock.getStockType()); |
| | | userPosition.setBuyOrderId(GeneratePosition.getPositionId()); |
| | | userPosition.setBuyOrderTime(new Date()); |
| | | userPosition.setBuyOrderPrice(userStockSubscribe.getBuyPrice()); |