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 |  119 ++++++++++++++++++++++++++++-------------------------------
 1 files changed, 57 insertions(+), 62 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 8cbffd3..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
@@ -1,19 +1,14 @@
 package com.vci.web.initTask;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.vci.corba.common.VCIError;
-import com.vci.frameworkcore.compatibility.ISmFunctionQueryService;
+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.mw.client.ClientContextVariable;
-import com.vci.mw.client.InvocationUtility;
-import com.vci.mw.client.LaunchModeEnum;
-import com.vci.starter.corba.initializer.JacorbClientRequestInterceptor;
-import com.vci.starter.corba.properties.JacorbClientMapProperties;
 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;
@@ -24,8 +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.impl.OsAttributeServiceImpl;
+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,7 +37,6 @@
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ResourceUtils;
-import plm.bs.bom.common.AttributeValue;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -133,11 +128,11 @@
     @Autowired
     private WebSecretServiceI secretService;
 
-    /**
-     * corba鐨勫鎴风
-     */
-    @Autowired(required = false)
-    private JacorbClientMapProperties jacorbClientMapProperties;
+//    /**
+//     * corba鐨勫鎴风
+//     */
+//    @Autowired(required = false)
+//    private JacorbClientMapProperties jacorbClientMapProperties;
 
     /**
      * 鎵ц鍒濆鍖�
@@ -258,12 +253,12 @@
                 properties.load(new FileInputStream(file));
                 String url = properties.getProperty("NameService");
                 String name = properties.getProperty("InstanceIdentity");
-                if (StringUtils.isNotBlank(url)) {
-                    jacorbClientMapProperties.setUrl(url);
-                }
-                if (StringUtils.isNotBlank(name)) {
-                    jacorbClientMapProperties.setInstanceIdentity(name);
-                }
+//                if (StringUtils.isNotBlank(url)) {
+//                    jacorbClientMapProperties.setUrl(url);
+//                }
+//                if (StringUtils.isNotBlank(name)) {
+//                    jacorbClientMapProperties.setInstanceIdentity(name);
+//                }
             }
         }catch (IOException e) {
             logger.error("璇诲彇骞冲彴鐨刢orb閰嶇疆鏂囦欢鍑虹幇浜嗛敊璇�",e);
@@ -288,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);
@@ -311,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