| | |
| | | package com.nq.service.impl; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.nq.common.ResponseCode; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockMapper; |
| | | import com.nq.dao.UserPositionMapper; |
| | |
| | | import com.nq.service.IStockSubscribeService; |
| | | import com.nq.dao.StockSubscribeMapper; |
| | | import com.nq.service.IUserService; |
| | | import com.nq.vo.stock.ai.StockAiOrderTypeVO; |
| | | import com.nq.vo.subscribe.StockSubscribeVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.xml.stream.events.EntityDeclaration; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | UserStockSubscribeMapper userStockSubscribeMapper; |
| | | |
| | | @Autowired |
| | | StockMapper stockMapper; |
| | | |
| | | @Autowired |
| | | UserPositionMapper userPositionMapper; |
| | |
| | | @Override |
| | | public ServerResponse listPageInfo(int pageNum, int pageSize, HttpServletRequest request) { |
| | | try { |
| | | QueryWrapper<StockSubscribe> queryWrapper = new QueryWrapper(); |
| | | /*QueryWrapper<StockSubscribe> queryWrapper = new QueryWrapper(); |
| | | //显示 0 |
| | | queryWrapper.eq("zt", 0); |
| | | queryWrapper.eq("type", 1); |
| | |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<StockSubscribe> stockSubscribeList = this.stockSubscribeMapper.selectList(queryWrapper); |
| | | // 获取分页信息 |
| | | PageInfo<StockSubscribe> pageInfo = new PageInfo<>(stockSubscribeList); |
| | | PageInfo<StockSubscribe> pageInfo = new PageInfo<>(stockSubscribeList);*/ |
| | | User user = this.iUserService.getCurrentRefreshUser(request); |
| | | if (user == null) { |
| | | return ServerResponse.createByErrorCodeMsg(ResponseCode.NEED_LOGIN.getCode(),"请先登录", request); |
| | | } |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<StockSubscribeVO> subscribeVOs = stockSubscribeMapper.selectStockSubscribeVO(0 ,1 ,user.getId()); |
| | | PageInfo<StockSubscribeVO> pageInfo = new PageInfo<>(subscribeVOs); |
| | | |
| | | Date newDate = new Date(); |
| | | pageInfo.getList().forEach(stockSubscribe -> { |