|
@@ -1,8 +1,9 @@
|
|
|
package com.zjugis.z_workflow.utils;
|
|
|
|
|
|
import com.zjugis.framework.workflow.form.YamlConfig;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.logging.log4j.util.Strings;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
/**
|
|
|
* Yml配置文件操作类
|
|
@@ -12,19 +13,54 @@ import org.apache.logging.log4j.util.Strings;
|
|
|
* @Copyright: 2019浙江万维空间信息技术有限公司
|
|
|
* @Version: v1.0
|
|
|
*/
|
|
|
+@Configuration
|
|
|
public class YmlUtil {
|
|
|
|
|
|
- private static String ymlName = "application.yaml";//yml文件名称
|
|
|
- private static String commonSystemUrl;//通用系统Url
|
|
|
- private static String zUserOrgRightUrl;
|
|
|
+ private static String ymlName = "application-dev.yaml";//yml文件名称
|
|
|
+ private static String commonSystemUrl;//通用系统Url
|
|
|
+ private static String zUserOrgRightUrl;
|
|
|
private static String zWorkFlowUrl;
|
|
|
private static String zFileManagement;
|
|
|
private static String UI;
|
|
|
private static String entranceIp;
|
|
|
private static String websocketUrl;
|
|
|
|
|
|
+ @Value("${serviceUrl.reportUrl}")
|
|
|
+ public void setCommonSystemUrl(String commonSystemUrl2) {
|
|
|
+ commonSystemUrl = commonSystemUrl2;
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
+ @Value("${serviceUrl.z_user_org_right}")
|
|
|
+ public void setzUserOrgRightUrl(String zUserOrgRightUrl2) {
|
|
|
+ zUserOrgRightUrl = zUserOrgRightUrl2;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Value("${serviceUrl.z_workflow}")
|
|
|
+ public void setzWorkFlowUrl(String zWorkFlowUrl2) {
|
|
|
+ zWorkFlowUrl = zWorkFlowUrl2;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Value("${serviceUrl.z_file_management}")
|
|
|
+ public void setzFileManagement(String zFileManagement2) {
|
|
|
+ zFileManagement = zFileManagement2;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Value("${serviceUrl.UI}")
|
|
|
+ public void setUI(String UI2) {
|
|
|
+ UI = UI2;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Value("${serviceUrl.entrance_ip}")
|
|
|
+ public void setEntranceIp(String entranceIp2) {
|
|
|
+ entranceIp = entranceIp2;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Value("${websocket.url}")
|
|
|
+ public void setWebsocketUrl(String websocketUrl2) {
|
|
|
+ websocketUrl = websocketUrl2;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取Yml配置Value值
|
|
|
*
|
|
|
* @author xufeng
|
|
@@ -49,9 +85,6 @@ public class YmlUtil {
|
|
|
}
|
|
|
|
|
|
public static String getWebsocketUrl() {
|
|
|
- if (Strings.isEmpty(websocketUrl)) {
|
|
|
- websocketUrl = GetYmlValue("websocket.url");
|
|
|
- }
|
|
|
return trimStr(websocketUrl);
|
|
|
}
|
|
|
/**
|
|
@@ -61,9 +94,6 @@ public class YmlUtil {
|
|
|
* @Date 2019/11/26 13:56
|
|
|
**/
|
|
|
public static String GetCommonSystemUrl() {
|
|
|
- if (StringUtils.isBlank(commonSystemUrl)) {
|
|
|
- commonSystemUrl = GetYmlValue("serviceUrl.reportUrl");
|
|
|
- }
|
|
|
return trimStr(commonSystemUrl);
|
|
|
}
|
|
|
/**
|
|
@@ -72,8 +102,6 @@ public class YmlUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getzUserOrgRightUrl() {
|
|
|
- if (StringUtils.isBlank(zUserOrgRightUrl))
|
|
|
- zUserOrgRightUrl = GetYmlValue("serviceUrl.z_user_org_right");
|
|
|
return trimStr(zUserOrgRightUrl);
|
|
|
}
|
|
|
|
|
@@ -83,8 +111,6 @@ public class YmlUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getzWorkFlowUrl() {
|
|
|
- if (StringUtils.isBlank(zWorkFlowUrl))
|
|
|
- zWorkFlowUrl = GetYmlValue("serviceUrl.z_workflow");
|
|
|
return trimStr(zWorkFlowUrl);
|
|
|
}
|
|
|
|
|
@@ -101,8 +127,6 @@ public class YmlUtil {
|
|
|
}
|
|
|
|
|
|
public static String getEntranceIp(){
|
|
|
- if (StringUtils.isBlank(entranceIp))
|
|
|
- entranceIp = GetYmlValue("entrance_ip");
|
|
|
return entranceIp;
|
|
|
}
|
|
|
|
|
@@ -112,8 +136,6 @@ public class YmlUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getzFileManagement() {
|
|
|
- if (StringUtils.isBlank(zFileManagement))
|
|
|
- zFileManagement = GetYmlValue("serviceUrl.z_file_management");
|
|
|
return trimStr(zFileManagement);
|
|
|
}
|
|
|
|
|
@@ -123,8 +145,6 @@ public class YmlUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static String getUI() {
|
|
|
- if (StringUtils.isBlank(UI))
|
|
|
- UI = GetYmlValue("serviceUrl.UI");
|
|
|
return trimStr(UI);
|
|
|
}
|
|
|
|