| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.nq.Repository.ExchangeRateRepository; |
| | | import com.nq.common.ResponseCode; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockAiMapper; |
| | | import com.nq.dao.StockAiOrderMapper; |
| | |
| | | IUserService iUserService; |
| | | @Autowired |
| | | IUserAssetsServices iUserAssetsServices; |
| | | @Autowired |
| | | ExchangeRateRepository exchangeRateRepository; |
| | | |
| | | /** |
| | | * 获取上架ai产品 |
| | |
| | | try { |
| | | User user = iUserService.getCurrentUser(request); |
| | | if (user == null ){ |
| | | return ServerResponse.createByErrorCodeMsg(401,"请先登录"); |
| | | return ServerResponse.createByErrorCodeMsg(ResponseCode.NEED_LOGIN.getCode(),"请先登录"); |
| | | } |
| | | Object lock = locks.computeIfAbsent(Long.valueOf(user.getId()), k -> new Object()); |
| | | synchronized (lock){ |
| | |
| | | try { |
| | | User user = iUserService.getCurrentUser(request); |
| | | if (user == null ){ |
| | | return ServerResponse.createByErrorCodeMsg(401,"请先登录"); |
| | | return ServerResponse.createByErrorCodeMsg(ResponseCode.NEED_LOGIN.getCode(),"请先登录"); |
| | | } |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<StockAiOrderTypeVO> stockAIOrders = stockAiOrderMapper.getStockAiOrderList(user.getId(), status); |
| | |
| | | |
| | | if (!pageInfo.getList().isEmpty()) { |
| | | List<StockAiVO> newStockAiList = pageInfo.getList(); |
| | | newStockAiList.forEach(stockAiVO -> { |
| | | pageInfo.getList().forEach(stockAiVO -> { |
| | | EStockType eStockType = EStockType.getEStockTypeByCode(stockAiVO.getStockType()); |
| | | stockAiVO.setStockTypeName(eStockType.getSymbol1()); |
| | | stockAiVO.setSymbol(stockType); |
| | | }); |
| | | pageInfo.setList(newStockAiList); |
| | | } |
| | | |
| | | |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } catch (Exception ex) { |
| | | log.error("StockAiService getAdminStockAiList error", ex); |