From 72c7bbd66b8456db7dabf0dbc15f7aa9c2af2b9d Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期三, 05 六月 2024 14:53:54 +0800
Subject: [PATCH] 项目引用调整

---
 Source/platformProject/vci-platform-web/src/main/java/com/vci/web/initTask/VciWebInitTaskComponent.java |   86 ++++++++++++++++++++++--------------------
 1 files changed, 45 insertions(+), 41 deletions(-)

diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/initTask/VciWebInitTaskComponent.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/initTask/VciWebInitTaskComponent.java
index 96b4dea..fa613af 100644
--- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/initTask/VciWebInitTaskComponent.java
+++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/initTask/VciWebInitTaskComponent.java
@@ -3,12 +3,12 @@
 import com.alibaba.fastjson.JSONObject;
 import com.vci.client.mw.ClientContextVariable;
 import com.vci.client.mw.LaunchModeEnum;
+import com.vci.corba.common.PLException;
 import com.vci.corba.omd.data.AttributeValue;
 import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant;
 import com.vci.frameworkcore.properties.VciFramworkCompatibilityProperties;
 import com.vci.starter.web.annotation.config.VciConfigField;
 import com.vci.starter.web.annotation.config.VciConfigModule;
-import com.vci.starter.web.enumpck.DataSecretEnum;
 import com.vci.starter.web.enumpck.SessionStorageTypeEnum;
 import com.vci.starter.web.enumpck.UserSecretEnum;
 import com.vci.starter.web.interceptor.VciSessionForLoginI;
@@ -19,7 +19,9 @@
 import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
 import com.vci.web.pageModel.OsAttributeVO;
 import com.vci.web.properties.WebProperties;
-import com.vci.web.service.*;
+import com.vci.web.service.OsAttributeServiceI;
+import com.vci.web.service.VciMdServiceI;
+import com.vci.web.service.WebSecretServiceI;
 import com.vci.web.service.impl.UIEngineServiceImpl;
 import com.vci.web.service.impl.WebContextInfoFetcher;
 import com.vci.web.service.impl.WebInitServiceImpl;
@@ -41,6 +43,8 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -279,8 +283,8 @@
     public void initSetting() {
         System.out.println("----鍒濆鍖栫敤浜庢煡璇㈤厤缃殑鐢ㄦ埛----");
         ClientContextVariable.setClientLanuchMode(LaunchModeEnum.WebApp);
-        InvocationUtility.registerIInvocationContext(contextInfoFetcher);
-        JacorbClientRequestInterceptor.sessionContext = contextInfoFetcher;
+//        InvocationUtility.registerIInvocationContext(contextInfoFetcher);
+//        JacorbClientRequestInterceptor.sessionContext = contextInfoFetcher;
         System.out.println("----鍒濆鍖栫敤浜庢煡璇㈤厤缃殑鐢ㄦ埛瀹屾垚----");
         System.out.println("----寮�濮嬫壂鎻忔湁VciConfigModule娉ㄨВ鐨勭被----");
         String[] namesForAnnotation = ApplicationContextProvider.getApplicationContext().getBeanNamesForAnnotation(VciConfigModule.class);
@@ -302,43 +306,43 @@
                         }
                         configFieldMap.put(vciConfigField.value(),field);
                     });
-//                    configFieldMap.forEach((configField,field)->{
-//                        String configValue = null;
-//                        try {
-//                            configValue = platformClientUtil.getLogonFactoryService().getFrameworkService().getConfigValue("",configField);
-//                        } catch (VCIError vciError) {
-//                           if(logger.isErrorEnabled()){
-//                               logger.error(vciError.error_code,vciError);
-//                           }
-//                        }
-//                        Class<?> fieldType = field.getType();
-//                        Method method = WebUtil.getSetmethod(bean.getClass(), field);
-//                        Object value = null;
-//                        if(fieldType.equals(Boolean.class) || fieldType.equals(boolean.class)){
-//                            value = ("on".equalsIgnoreCase(configValue) || "true".equalsIgnoreCase(configValue))?true:false;
-//                        }else if(fieldType.equals(Double.class) || fieldType.equals(double.class)){
-//                            value = WebUtil.getDouble(configValue);
-//                        }else if(fieldType.equals(Long.class) || fieldType.equals(long.class)){
-//                            value = WebUtil.getLong(configValue);
-//                        }else if(fieldType.equals(Float.class) || fieldType.equals(float.class)){
-//                            value = WebUtil.getFloat(configValue);
-//                        }else if(fieldType.equals(Integer.class) || fieldType.equals(int.class)){
-//                            value = WebUtil.getInt(configValue);
-//                        }else{
-//                            value = configValue;
-//                        }
-//                        try {
-//                            method.invoke(bean,value);
-//                        } catch (IllegalAccessException e) {
-//                            if(logger.isErrorEnabled()){
-//                                logger.error(e.getMessage(),e);
-//                            }
-//                        } catch (InvocationTargetException e) {
-//                            if(logger.isErrorEnabled()){
-//                                logger.error(e.getMessage(),e);
-//                            }
-//                        }
-//                    });
+                    configFieldMap.forEach((configField,field)->{
+                        String configValue = null;
+                        try {
+                            configValue = platformClientUtil.getFrameworkService().getConfigValue(configField);
+                        } catch (PLException vciError) {
+                           if(logger.isErrorEnabled()){
+                               logger.error(vciError.code,vciError);
+                           }
+                        }
+                        Class<?> fieldType = field.getType();
+                        Method method = WebUtil.getSetmethod(bean.getClass(), field);
+                        Object value = null;
+                        if(fieldType.equals(Boolean.class) || fieldType.equals(boolean.class)){
+                            value = ("on".equalsIgnoreCase(configValue) || "true".equalsIgnoreCase(configValue))?true:false;
+                        }else if(fieldType.equals(Double.class) || fieldType.equals(double.class)){
+                            value = WebUtil.getDouble(configValue);
+                        }else if(fieldType.equals(Long.class) || fieldType.equals(long.class)){
+                            value = WebUtil.getLong(configValue);
+                        }else if(fieldType.equals(Float.class) || fieldType.equals(float.class)){
+                            value = WebUtil.getFloat(configValue);
+                        }else if(fieldType.equals(Integer.class) || fieldType.equals(int.class)){
+                            value = WebUtil.getInt(configValue);
+                        }else{
+                            value = configValue;
+                        }
+                        try {
+                            method.invoke(bean,value);
+                        } catch (IllegalAccessException e) {
+                            if(logger.isErrorEnabled()){
+                                logger.error(e.getMessage(),e);
+                            }
+                        } catch (InvocationTargetException e) {
+                            if(logger.isErrorEnabled()){
+                                logger.error(e.getMessage(),e);
+                            }
+                        }
+                    });
                 }
             }
         }

--
Gitblit v1.9.3