| | |
| | | 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.ServerResponse; |
| | | import com.nq.dao.StockMapper; |
| | | import com.nq.dao.UserPositionMapper; |
| | | import com.nq.dao.UserStockSubscribeMapper; |
| | | import com.nq.pojo.Stock; |
| | | import com.nq.pojo.StockSubscribe; |
| | | import com.nq.pojo.UserPosition; |
| | | import com.nq.pojo.UserStockSubscribe; |
| | | import com.nq.pojo.*; |
| | | import com.nq.service.IStockSubscribeService; |
| | | import com.nq.dao.StockSubscribeMapper; |
| | | import com.nq.service.IUserService; |
| | | import com.nq.vo.stock.ai.StockAiOrderTypeVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | UserPositionMapper userPositionMapper; |
| | | @Autowired |
| | | IUserService iUserService; |
| | | |
| | | /** |
| | | * @Description: 用户新股列表 |
| | |
| | | return ServerResponse.createByErrorMsg("删除新股失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse listPageInfo(int pageNum, int pageSize, HttpServletRequest request) { |
| | | try { |
| | | QueryWrapper<StockSubscribe> queryWrapper = new QueryWrapper(); |
| | | //显示 0 |
| | | queryWrapper.eq("zt", 0); |
| | | queryWrapper.eq("type", 1); |
| | | queryWrapper.orderByDesc("list_date"); |
| | | |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<StockSubscribe> stockSubscribeList = this.stockSubscribeMapper.selectList(queryWrapper); |
| | | // 获取分页信息 |
| | | PageInfo<StockSubscribe> pageInfo = new PageInfo<>(stockSubscribeList); |
| | | |
| | | Date newDate = new Date(); |
| | | pageInfo.getList().forEach(stockSubscribe -> { |
| | | Date startDate = stockSubscribe.getSubscribeTime(); |
| | | Date endDate = stockSubscribe.getSubscriptionTime(); |
| | | |
| | | boolean isBetween = newDate.after(startDate) && newDate.before(endDate); |
| | | stockSubscribe.setIsBetween(isBetween); |
| | | }); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } catch (Exception e) { |
| | | log.error("IStockSubscribeService listPageInfo error", e); |
| | | } |
| | | return ServerResponse.createByError(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |