| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockConfigMapper; |
| | | import com.nq.enums.EConfigKey; |
| | | import com.nq.pojo.StockConfig; |
| | | import com.nq.service.IStockConfigServices; |
| | | import org.apache.commons.lang3.math.NumberUtils; |
| | | import org.apache.http.util.TextUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | StockConfigMapper stockConfigMapper; |
| | | @Override |
| | | public ServerResponse updateStockConfig(StockConfig stockConfig) { |
| | | if(stockConfig.getCKey().equals(EConfigKey.AGENT_MAX_GRADE.getCode())){ |
| | | try { |
| | | int number = Integer.parseInt(stockConfig.getCValue()); |
| | | if(number <= 0){ |
| | | return ServerResponse.createByErrorMsg("请输入有效等级"); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | return ServerResponse.createByErrorMsg("请输入有效等级"); |
| | | } |
| | | } |
| | | int ref = stockConfigMapper.updateById(stockConfig); |
| | | if(ref>0){ |
| | | return ServerResponse.createBySuccess(); |
| | | return ServerResponse.createBySuccessMsg("设置成功"); |
| | | } |
| | | return ServerResponse.createByErrorMsg("设置失败"); |
| | | } |