From 5cf860884c04d6a7a5e25e449f0f8e29780f4318 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期五, 12 五月 2023 18:01:11 +0800
Subject: [PATCH] 枚举页面漏传
---
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java
index 4cc6e8d..bf83190 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java
@@ -9,8 +9,11 @@
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.vci.ubcs.starter.exception.VciBaseException;
+import com.vci.ubcs.starter.web.enumpck.BooleanEnum;
+import com.vci.ubcs.starter.web.enumpck.UserSecretEnum;
import com.vci.ubcs.starter.web.pagemodel.SessionInfo;
import com.vci.ubcs.starter.web.toolmodel.DateConverter;
+import com.vci.ubcs.starter.web.wrapper.VciQueryWrapperForDO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
@@ -76,7 +79,14 @@
return 0;
}
}
-
+ public static SessionInfo getCurrentUserSessionInfo() throws VciBaseException {
+ SessionInfo si = getCurrentUserSessionInfoNotException();
+ if (si == null) {
+ throw new VciBaseException("noLogin", new String[]{"娌℃湁褰撳墠鐢ㄦ埛淇℃伅"});
+ } else {
+ return si;
+ }
+ }
public static long getLong(String s) {
long l = 0L;
if (s == null) {
@@ -91,6 +101,11 @@
}
}
+ public static Integer getCurrentUserSecret() {
+ SessionInfo currentUserSession = getCurrentUserSessionInfoNotException();
+ return currentUserSession != null ? getInt(currentUserSession.getUserSecret()) : UserSecretEnum.NONE.getValue();
+ }
+
public static float getFloat(String s) {
float f = 0.0F;
if (s == null) {
@@ -137,6 +152,11 @@
}
}
+
+ public static boolean getBoolean(String s) {
+ return BooleanEnum.TRUE.getValue().equals(s);
+ }
+
public static String removeComma(String s) {
if (s != null && s.trim().length() != 0) {
if (s.startsWith(",")) {
@@ -829,6 +849,10 @@
return allField;
}
+ public static String getTableName(String btmname) {
+ return (VciQueryWrapperForDO.USER_TABLE_COMPATIBILITY ? "pl_code_" : "vcibt_") + btmname.trim().toLowerCase();
+ }
+
public static Field getTsField(Class c) {
List<Field> allField = getAllFieldForObj(c);
if (allField != null && allField.size() > 0) {
@@ -1199,5 +1223,19 @@
}
+ public static void setValueForField(String fieldName, Object obj, String value) {
+ try {
+ Field field = getFieldForObject(fieldName, obj);
+ if (field != null) {
+ setValueForField(field, obj, value);
+ }
+ } catch (Exception var4) {
+ if (log.isErrorEnabled()) {
+ log.error("璁剧疆灞炴�х殑鍊煎嚭閿欎簡閿欒", var4);
+ }
+ }
+
+ }
+
}
--
Gitblit v1.10.0