| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.nq.common.ResponseCode; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockSubscribeMapper; |
| | | import com.nq.dao.UserAssetsMapper; |
| | |
| | | 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; |
| | |
| | | if (siteProduct.getRealNameDisplay() && user.getIsActive() != 2) { |
| | | return ServerResponse.createByErrorMsg("订单失败,请先实名认证",request); |
| | | } |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stockSubscribe.getStockType(), user.getId()); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stockSubscribe.getStockType(), user.getId()); |
| | | if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){ |
| | | return ServerResponse.createByErrorMsg("请先缴清待补资金", request); |
| | | } |
| | |
| | | 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.createBySuccess(list); |
| | | } |
| | | return ServerResponse.createByErrorMsg("请先登录",request); |
| | | return ServerResponse.createByErrorCodeMsg(ResponseCode.NEED_LOGIN.getCode(),"请先登录"); |
| | | } |
| | | /** |
| | | * 新股申购-用户提交金额 |
| | |
| | | return ServerResponse.createByErrorMsg("新股认购订单不存在!",request); |
| | | } |
| | | } |
| | | return ServerResponse.createByErrorMsg("请先登录",request); |
| | | return ServerResponse.createByErrorCodeMsg(ResponseCode.NEED_LOGIN.getCode(),"请先登录"); |
| | | } |
| | | /** |
| | | * 新股申购-删除 |
| | |
| | | } |
| | | return ServerResponse.createByErrorMsg("Operation failure"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |