add:增加手持入库业务

This commit is contained in:
2025-06-30 21:55:34 +08:00
parent bf1480032f
commit fee412a92f
10 changed files with 290 additions and 149 deletions

View File

@@ -20,7 +20,6 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.nl.config.ElAdminProperties;
import org.nl.config.SpringContextHolder;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
@@ -245,4 +244,7 @@ public class StringUtils {
return "";
}
}
}

View File

@@ -16,6 +16,7 @@
package org.nl.common.utils;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import org.nl.common.exception.BadRequestException;
import org.nl.config.language.LangProcess;
@@ -31,7 +32,7 @@ public class ValidationUtil{
*/
public static void isNull(Object obj, String entity, String parameter , String value){
if(ObjectUtil.isNull(obj)){
throw new BadRequestException(LangProcess.msg("error_isNull",entity+"_"+parameter+"_"+value));
throw new BadRequestException(LangProcess.msg("error_isNull", entity + "_" + parameter + "_" + value));
}
}
@@ -41,4 +42,20 @@ public class ValidationUtil{
public static boolean isEmail(String email) {
return true;
}
/**
* 入参校验
*/
public static void assertNotBlankJson(JSONObject json, String message, String... keys) {
if (json == null) {
throw new IllegalArgumentException(message);
}
for (String key : keys) {
String value = json.getString(key);
if (value == null || value.trim().isEmpty()) {
throw new IllegalArgumentException(message);
}
}
}
}