| | |
| | | package com.nq.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockMapper; |
| | |
| | | @Override |
| | | public ServerResponse saveStockSetting(StockSetting stockSetting) { |
| | | |
| | | |
| | | Long count = stockSettingMapper.selectCount(new LambdaQueryWrapper<StockSetting>().eq(StockSetting::getStockCode, stockSetting.getStockCode())); |
| | | if(count > 0){ |
| | | return ServerResponse.createByErrorMsg("已存在相同股票"); |
| | | } |
| | | Stock stock = stockMapper.findStockByCode(stockSetting.getStockCode()); |
| | | if(stock == null){ |
| | | return ServerResponse.createByErrorMsg("添加股票不存在"); |