| | |
| | | IUserAssetsServices userAssetsServices; |
| | | |
| | | @Autowired |
| | | UserAssetsMapper userAssetsMapper; |
| | | |
| | | @Autowired |
| | | ISiteSettingService iSiteSettingService; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | IStockConfigServices iStockConfigServices; |
| | | |
| | | @Autowired |
| | | private UserAssetsMapper userAssetsMapper; |
| | | |
| | | @Transactional |
| | | public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) { |
| | |
| | | if (userPositions.size() > 0) { |
| | | for (UserPosition position : userPositions) { |
| | | UserPositionVO userPositionVO = UserPointUtil.assembleUserPositionVO(position, priceServices.getNowPrice(position.getStockCode())); |
| | | userPositionVO.setOrderTotalPrice(userPositionVO.getOrderTotalPrice().multiply(new BigDecimal(userPositionVO.getOrderLever()))); |
| | | userPositionVO.setProfitAndLose(userPositionVO.getProfitAndLose().multiply(new BigDecimal(userPositionVO.getOrderLever()))); |
| | | userPositionVOS.add(userPositionVO); |
| | | } |
| | | } |
| | |
| | | userPosition.setIsLock(Integer.valueOf(0)); |
| | | |
| | | |
| | | userPosition.setOrderLever(10); |
| | | userPosition.setOrderLever(1); |
| | | |
| | | |
| | | //递延费特殊处理 |
| | |
| | | return ServerResponse.createByErrorMsg("新股转持仓失败"); |
| | | } |
| | | userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(userPosition.getOrderTotalPrice())); |
| | | userAssetsMapper.updateById(userAssets); |
| | | if (ret > 0) { |
| | | userStockSubscribe.setStatus(5); |
| | | userStockSubscribeMapper.update1(userStockSubscribe); |
| | |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public ServerResponse buyDz(String stockCode, String password, Integer num, HttpServletRequest request) throws Exception { |
| | | public synchronized ServerResponse buyDz(String stockCode, String password, Integer num, HttpServletRequest request) throws Exception { |
| | | /*实名认证开关开启*/ |
| | | SiteProduct siteProduct = iSiteProductService.getProductSetting(); |
| | | User user = this.iUserService.getCurrentRefreshUser(request); |
| | | |
| | | if (siteProduct.getRealNameDisplay() && user.getIsActive() != 2) { |
| | | return ServerResponse.createByErrorMsg("Order failed, please first real name authentication"); |
| | | } |