| | |
| | | return true; |
| | | } |
| | | |
| | | SiteAdmin siteAdmin = null; |
| | | /*SiteAdmin siteAdmin = null; |
| | | String loginToken = httpServletRequest.getHeader(PropertiesUtil.getProperty("admin.cookie.name")); |
| | | if (StringUtils.isNotEmpty(loginToken)) { |
| | | String adminJsonStr = RedisShardedPoolUtils.get(loginToken); |
| | |
| | | writer.flush(); |
| | | writer.close(); |
| | | return false; |
| | | } |
| | | }*/ |
| | | |
| | | // 194.26.73.150, 172.70.34.195 |
| | | // String ip = IpUtils.getIp(httpServletRequest); |
| | |
| | | package com.nq.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.service.IStockService; |
| | | import com.nq.service.StockDzService; |
| | | import com.nq.pojo.User; |
| | | import com.nq.pojo.UserPositionCheckDz; |
| | | import com.nq.service.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | IStockService iStockService; |
| | | @Autowired |
| | | StockDzService stockDzService; |
| | | @Autowired |
| | | IUserPositionService iUserPositionService; |
| | | |
| | | //查询 股票指数、大盘指数信息 |
| | | @RequestMapping({"getMarket.do"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | *大宗交易 列表 |
| | | * 大宗交易 列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param orderBy |
| | | * @param keyWords 搜索内容 |
| | | * @return |
| | | */ |
| | | @PostMapping({"getDzList.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getDzList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum, |
| | | @RequestParam(value = "pageSize", defaultValue = "10") int pageSize, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") int pageSize, |
| | | @RequestParam(value = "orderBy", required = false) String orderBy, |
| | | @RequestParam(value = "keyWords", required = false) String keyWords, |
| | | HttpServletRequest request) { |
| | | return stockDzService.getDzList(pageNum, pageSize, orderBy,keyWords , request); |
| | | } |
| | | |
| | | /** |
| | | * 大宗交易订单列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param status 状态 //0:待审核 1:成功 2:失败 |
| | | * @return |
| | | */ |
| | | @RequestMapping({"getDzOrderList.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getDzOrderList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") int pageSize, |
| | | @RequestParam(value = "status", required = false) Integer status, |
| | | HttpServletRequest request) { |
| | | return iUserPositionService.getDzOrderList(pageNum, pageSize, status, request); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * vip 抢筹列表 |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface UserPositionMapper extends BaseMapper<UserPosition> { |
| | |
| | | |
| | | UserPosition findUserPositionByCode(@Param("userId") Integer paramInteger,@Param("stockCode") String stockCode); |
| | | |
| | | |
| | | List<UserPosition> getUserPositionDzList(@Param("userId") Integer userId,@Param("checkType") Integer checkType); |
| | | } |
| | |
| | | //k线 |
| | | private Object kData; |
| | | |
| | | private String stockType; |
| | | |
| | | } |
| | |
| | | private BigDecimal spreadRate; |
| | | |
| | | private BigDecimal increaseRatio; |
| | | |
| | | //最小购买数量 |
| | | private Integer stockNum; |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String password; |
| | |
| | | ServerResponse buyStockDzList(HttpServletRequest request); |
| | | |
| | | void stockConstraint(List<UserPosition> userPositions); |
| | | |
| | | ServerResponse getDzOrderList(int pageNum, int pageSize, Integer status, HttpServletRequest request); |
| | | } |
| | |
| | | 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.google.common.collect.Lists; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockDzMapper; |
| | |
| | | import com.nq.utils.timeutil.DateTimeUtil; |
| | | import com.nq.vo.stock.StockDzVo; |
| | | import com.nq.vo.stock.StockListVO; |
| | | import com.nq.vo.stock.ai.StockAiOrderTypeVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Override |
| | | public ServerResponse getDzList(int pageNum, int pageSize, String orderBy, String keyWords, HttpServletRequest request) { |
| | | String formatDate = DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN); |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | if (keyWords == null || keyWords.trim().isEmpty()) { |
| | | /*if (keyWords == null || keyWords.trim().isEmpty()) { |
| | | // 如果 keyWords 为空,则直接返回空分页结果 |
| | | return ServerResponse.createBySuccess(new RPageInfo()); |
| | | } |
| | | String formatDate = DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN); |
| | | }*/ |
| | | List<StockDz> stockTypeDz = stockMapper.findStockTypeDz(orderBy, keyWords,formatDate); |
| | | RPageInfo pageInfo = new RPageInfo(); |
| | | pageInfo.setList(stockTypeDz); |
| | | PageInfo<StockDz> pageInfo = new PageInfo<>(stockTypeDz); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } |
| | | |
| | |
| | | Gson gson = new Gson(); |
| | | List<kData> dataList = gson.fromJson(kData.toString(), new TypeToken<List<kData>>(){}.getType()); |
| | | cacheBaseStock.setKData(dataList); |
| | | cacheBaseStock.setStockType(stockType); |
| | | usDataStockBeans.add(cacheBaseStock); |
| | | } |
| | | for (int i = 0; i < mxStockCodeList.size(); i++) { |
| | |
| | | Gson gson = new Gson(); |
| | | List<kData> dataList = gson.fromJson(kData.toString(), new TypeToken<List<kData>>(){}.getType()); |
| | | cacheBaseStock.setKData(dataList); |
| | | cacheBaseStock.setStockType(stockType); |
| | | mxDataStockBeans.add(cacheBaseStock); |
| | | } |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | |
| | | import com.nq.vo.position.PositionVO; |
| | | import com.nq.vo.position.UserPositionVO; |
| | | import com.nq.vo.stock.StockListVO; |
| | | import com.nq.vo.stock.ai.StockAiOrderTypeVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取大宗交易订单 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param status |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ServerResponse getDzOrderList(int pageNum, int pageSize, Integer status, HttpServletRequest request) { |
| | | try { |
| | | User user = iUserService.getCurrentUser(request); |
| | | if (user == null ){ |
| | | return ServerResponse.createBySuccessMsg("请先登录"); |
| | | } |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<UserPosition> userPositions = userPositionMapper.getUserPositionDzList(user.getId(), status); |
| | | // 获取分页信息 |
| | | PageInfo<UserPosition> pageInfo = new PageInfo<>(userPositions); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } catch (Exception e) { |
| | | log.error("StockAiService getStockAiOrderList error", e); |
| | | } |
| | | return ServerResponse.createByError(); |
| | | } |
| | | |
| | | private Result getResult(UserPosition position) { |
| | | // 检查订单是否存在 |
| | | if (position == null) { |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getUserPositionDzList" resultType="com.nq.pojo.UserPosition"> |
| | | SELECT u.* |
| | | FROM user_position u |
| | | LEFT JOIN user_position_check_dz dz ON dz.id = u.dz_id |
| | | |
| | | <where> |
| | | <if test="userId != null "> |
| | | and u.user_id = #{userId} |
| | | </if> |
| | | <if test="checkType != null "> |
| | | and dz.check_type = #{checkType} |
| | | </if> |
| | | </where> |
| | | ORDER BY u.buy_order_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | | |