| | |
| | | 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.service.IStockSubscribeService; |
| | | import com.nq.dao.StockSubscribeMapper; |
| | |
| | | |
| | | @Autowired |
| | | StockMapper stockMapper; |
| | | |
| | | @Autowired |
| | | UserPositionMapper userPositionMapper; |
| | | |
| | | /** |
| | | * @Description: 用户新股列表 |
| | |
| | | if (stockSubscribe == null) { |
| | | return ServerResponse.createByErrorMsg("新股不存在"); |
| | | } |
| | | Long count = stockSubscribeMapper.selectCount(new LambdaQueryWrapper<StockSubscribe>() |
| | | .eq(StockSubscribe::getCode, model.getCode()) |
| | | .ne(StockSubscribe::getNewlistId,model.getNewlistId())); |
| | | if(count > 0){ |
| | | return ServerResponse.createByErrorMsg("新股代码已存在"); |
| | | } |
| | | |
| | | //修改新股 |
| | | int resultCount = this.stockSubscribeMapper.updateById(model); |
| | |
| | | u.setNewCode(model.getCode()); |
| | | userStockSubscribeMapper.updateById(u); |
| | | } |
| | | List<UserPosition> userPositions = userPositionMapper.selectList(new LambdaQueryWrapper<UserPosition>().eq(UserPosition::getNewId, stockSubscribe.getNewlistId())); |
| | | for (UserPosition u : userPositions) { |
| | | u.setStockCode(model.getCode()); |
| | | userPositionMapper.updateById(u); |
| | | } |
| | | if (resultCount > 0) { |
| | | return ServerResponse.createBySuccessMsg("修改新股成功"); |
| | | } |