From c8ca3dc63582b2a8a8e9454a745682548bcda453 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Tue, 01 Oct 2024 19:18:24 +0800
Subject: [PATCH] 1
---
src/main/java/com/nq/service/impl/StockConfigServicesImpl.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/nq/service/impl/StockConfigServicesImpl.java b/src/main/java/com/nq/service/impl/StockConfigServicesImpl.java
index 98000f9..1e5fb2f 100644
--- a/src/main/java/com/nq/service/impl/StockConfigServicesImpl.java
+++ b/src/main/java/com/nq/service/impl/StockConfigServicesImpl.java
@@ -4,8 +4,10 @@
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;
@@ -19,9 +21,19 @@
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("设置失败");
}
--
Gitblit v1.9.3