11 files modified
1 files added
| | |
| | | return serverResponse; |
| | | } |
| | | |
| | | /** |
| | | * 新股列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping({"getStockSubscribeList.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getStockSubscribeList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") int pageSize, |
| | | HttpServletRequest request) { |
| | | return this.iStockSubscribeService.listPageInfo(pageNum, pageSize, request); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户新股列表 |
| | |
| | | /*新股申购-用户新股申购数据*/ |
| | | @RequestMapping({"getOneSubscribeByUserId.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getOneSubscribeByUserId(@RequestParam(value ="type",required = false)String type, HttpServletRequest request) { |
| | | return this.iUserStockSubscribeService.getOneSubscribeByUserId(type,request); |
| | | public ServerResponse getOneSubscribeByUserId(@RequestParam(value ="type",required = false)String type, |
| | | @RequestParam(value ="status",required = false)Integer status, |
| | | HttpServletRequest request) { |
| | | return this.iUserStockSubscribeService.getOneSubscribeByUserId(type, status, request); |
| | | } |
| | | |
| | | /*新股申购-用户提交金额*/ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.nq.pojo.UserStockSubscribe; |
| | | import com.nq.vo.subscribe.UserStockSubscribeVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | **/ |
| | | List<UserStockSubscribe> getOneSubscribeByUserId(String phone); |
| | | |
| | | |
| | | List<UserStockSubscribeVo> getListByParam(@Param("userId") Integer userId, |
| | | @Param("type")String type, |
| | | @Param("status")Integer status); |
| | | } |
| | | |
| | |
| | | public class MoneyLog { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private int id; |
| | | private Integer id; |
| | | private String type; |
| | | private String amount; |
| | | private String descs; |
| | |
| | | |
| | | private Integer id; |
| | | |
| | | //基金id |
| | | private String eid; |
| | | |
| | | //回报率 |
| | | private String returnOfRate; |
| | | |
| | | //买入时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Kolkata") |
| | | private Date buyTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Kolkata") |
| | | private Date endTime; |
| | | |
| | | |
| | | //用户id |
| | | private String userId; |
| | | |
| | | |
| | | //买入金额 |
| | | private String money; |
| | | |
| | | //状态 1.进行中 2.已赎回 |
| | | private String state; |
| | | |
| | | //收益 |
| | | private String earnings; |
| | | |
| | | /** |
| | | * 周期时间 |
| | | * */ |
| | | private String returnTime; |
| | | |
| | | |
| | | /** |
| | | * 标题 |
| | | * */ |
| | | private String title; |
| | | |
| | | } |
| | |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.pojo.StockSubscribe; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.xml.crypto.Data; |
| | |
| | | ServerResponse update(StockSubscribe model, HttpServletRequest request); |
| | | |
| | | ServerResponse del(Integer id, HttpServletRequest request); |
| | | |
| | | ServerResponse listPageInfo(int pageNum, int pageSize, HttpServletRequest request); |
| | | |
| | | } |
| | |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.pojo.UserStockSubscribe; |
| | | import com.nq.vo.stock.UserStockSubscribeAddIn; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | |
| | | /** |
| | | * 新股申购-查询用户最新新股申购数据 |
| | | */ |
| | | ServerResponse getOneSubscribeByUserId(String type, HttpServletRequest request); |
| | | ServerResponse getOneSubscribeByUserId(String type, Integer status, HttpServletRequest request); |
| | | |
| | | /** |
| | | * 新股申购-用户提交金额 |
| | |
| | | ServerResponse userSubmit(Integer id,HttpServletRequest request); |
| | | |
| | | ServerResponse del(int id, HttpServletRequest request); |
| | | |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | PageInfo<UserPositionCheckDz> pageInfo = new PageInfo<>(userPositionCheckDzs); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } catch (Exception e) { |
| | | log.error("StockAiService getStockAiOrderList error", e); |
| | | log.error("IUserPositionService getDzOrderList error", e); |
| | | } |
| | | return ServerResponse.createByError(); |
| | | } |
| | |
| | | import com.nq.utils.timeutil.DateTimeUtil; |
| | | import com.nq.utils.KeyUtils; |
| | | import com.nq.utils.PropertiesUtil; |
| | | import com.nq.utils.redis.JsonUtil; |
| | | import com.nq.utils.redis.RedisShardedPoolUtils; |
| | | import com.nq.utils.stock.BuyAndSellUtils; |
| | | import com.nq.vo.stock.UserStockSubscribeAddIn; |
| | | import com.sun.org.apache.bcel.internal.generic.RETURN; |
| | | import com.nq.vo.subscribe.UserStockSubscribeVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public ServerResponse<PageInfo> getList(int pageNum, int pageSize, String keyword, String agentId,HttpServletRequest request){ |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<UserStockSubscribe> listData = this.userStockSubscribeMapper.pageList(pageNum, pageSize, keyword,agentId); |
| | | PageInfo pageInfo = new PageInfo(listData); |
| | | pageInfo.setList(listData); |
| | | PageInfo<UserStockSubscribe> pageInfo = new PageInfo<>(listData); |
| | | return ServerResponse.createBySuccess(pageInfo); |
| | | } |
| | | |
| | |
| | | |
| | | /*新股申购-查询用户最新新股申购数据*/ |
| | | @Override |
| | | public ServerResponse getOneSubscribeByUserId(String type,HttpServletRequest request) { |
| | | public ServerResponse getOneSubscribeByUserId(String type, Integer status, HttpServletRequest request) { |
| | | String property = PropertiesUtil.getProperty("user.cookie.name"); |
| | | String header = request.getHeader(property); |
| | | if (header != null) { |
| | | User user = iUserService.getCurrentRefreshUser(request); |
| | | List<UserStockSubscribe> userStockSubscribe = null; |
| | | if (type==null||type.equals("")){ |
| | | |
| | | List<UserStockSubscribeVo> userStockSubscribe = this.userStockSubscribeMapper.getListByParam(user.getId(), type, status); |
| | | /*if (type==null||type.equals("")){ |
| | | userStockSubscribe = this.userStockSubscribeMapper.selectList(new QueryWrapper<>(new UserStockSubscribe()).eq("user_id", user.getId()).orderByDesc("add_time")); |
| | | }else{ |
| | | userStockSubscribe = this.userStockSubscribeMapper.selectList(new QueryWrapper<>(new UserStockSubscribe()).eq("user_id", user.getId()).eq("type", type).orderByDesc("add_time")); |
| | | } |
| | | }*/ |
| | | |
| | | List<UserStockSubscribe> list = new ArrayList<>(); |
| | | for (UserStockSubscribe userStockSubscribe1 : userStockSubscribe) { |
| | | List<UserStockSubscribeVo> list = new ArrayList<>(); |
| | | for (UserStockSubscribeVo userStockSubscribe1 : userStockSubscribe) { |
| | | StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new QueryWrapper<>(new StockSubscribe()) |
| | | .eq("newlist_id", userStockSubscribe1.getNewStockId())); |
| | | if (stockSubscribe != null) { |
| | |
| | | } |
| | | return ServerResponse.createByErrorMsg("Operation failure"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.nq.vo.subscribe; |
| | | |
| | | import com.nq.pojo.UserStockSubscribe; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class UserStockSubscribeVo extends UserStockSubscribe { |
| | | |
| | | //股票类型 |
| | | private String stockType; |
| | | /** |
| | | * 上市时间 |
| | | */ |
| | | private Date listDate; |
| | | /** |
| | | 发行时间 |
| | | */ |
| | | private Date subscriptionTime; |
| | | |
| | | } |
| | | |
| | |
| | | from order_echo o |
| | | join echo e |
| | | on o.eid = e.id |
| | | where user_id = #{id} GROUP BY o.buy_time desc |
| | | where user_id = #{id} ORDER BY o.buy_time desc |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.nq.pojo.reponse.OrderEChoReponse"> |
| | |
| | | WHERE phone = #{phone} order by id |
| | | </select> |
| | | |
| | | <select id="getListByParam" resultType="com.nq.vo.subscribe.UserStockSubscribeVo"> |
| | | SELECT id, |
| | | order_no, |
| | | user_id, |
| | | real_name, |
| | | phone, |
| | | agent_id, |
| | | agent_name, |
| | | new_code, |
| | | new_name, |
| | | bond, |
| | | buy_price, |
| | | apply_nums, |
| | | apply_number, |
| | | status, |
| | | add_time, |
| | | submit_time, |
| | | end_time, |
| | | fix_time, |
| | | remarks, |
| | | u.type, |
| | | db_money, |
| | | new_stock_id |
| | | ,s.stock_type,s.list_date,s.subscription_time |
| | | FROM user_stock_subscribe u |
| | | LEFT JOIN stock_subscribe s on s.newlist_id = u.new_stock_id |
| | | WHERE 1=1 |
| | | <if test="userId != null"> |
| | | and u.user_id = #{userId} |
| | | </if> |
| | | <if test="type != null and type != ''"> |
| | | and u.type = #{type} |
| | | </if> |
| | | <if test="status != null"> |
| | | and u.status = #{status} |
| | | </if> |
| | | order by u.add_time desc |
| | | </select> |
| | | |
| | | |
| | | </mapper> |