| | |
| | | @Autowired |
| | | UserPositionCheckDzService userPositionCheckDzService; |
| | | |
| | | |
| | | @Autowired |
| | | UserPendingorderService userPendingorderService; |
| | | |
| | | @Transactional |
| | | public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) { |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public ServerResponse goldCrudeOilbuy(String name, Integer buyNum, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) { |
| | | public ServerResponse goldCrudeOilbuy(String name, Integer buyNum, Integer buyType,Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) { |
| | | |
| | | SiteProduct siteProduct = iSiteProductService.getProductSetting(); |
| | | |
| | |
| | | userPosition.setBuyOrderId(GeneratePosition.getPositionId()); |
| | | userPosition.setBuyOrderTime(new Date()); |
| | | userPosition.setBuyOrderPrice(price); |
| | | userPosition.setOrderDirection("买涨"); |
| | | userPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌"); |
| | | userPosition.setOrderNum(buyNum); |
| | | userPosition.setIsLock(Integer.valueOf(0)); |
| | | userPosition.setOrderLever(lever); |
| | |
| | | |
| | | public ServerResponse findMyPositionByCodeAndSpell(String stockCode, String stockSpell, |
| | | Integer state, HttpServletRequest request, |
| | | int pageNum, int pageSize, String stockType) { |
| | | int pageNum, int pageSize, String stockType,Integer pendingStatus) { |
| | | User user = this.iUserService.getCurrentUser(request); |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<UserPosition> userPositions = null; |
| | | |
| | | |
| | | if(state == 2){ |
| | | List<UserPendingorder> list = userPendingorderService.list(new LambdaQueryWrapper<>(UserPendingorder.class) |
| | | .eq(UserPendingorder::getUserId, user.getId()) |
| | | .eq(UserPendingorder::getStockGid,(null != stockCode && "HJYY".equals(stockCode)) ? stockCode : stockType) |
| | | .eq(UserPendingorder::getPositionType,pendingStatus) |
| | | ); |
| | | PageInfo pageInfo = new PageInfo(); |
| | | pageInfo.setList(list); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | }else { |
| | | if(stockCode.equals("HJYY")){ |
| | | LambdaQueryWrapper<UserPosition> wrapper = getUserPositionLambdaQueryWrapper(stockCode, state, user); |
| | | userPositions = userPositionMapper.selectList(wrapper); |
| | |
| | | |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } |
| | | } |
| | | |
| | | private static LambdaQueryWrapper<UserPosition> getUserPositionLambdaQueryWrapper(String stockCode, Integer state, User user) { |
| | | LambdaQueryWrapper<UserPosition> wrapper = new LambdaQueryWrapper<>(); |