From 986aa62ed00bee39363bab41b4eeb8259d446efd Mon Sep 17 00:00:00 2001
From: ludc <ludc@vci-tech.com>
Date: 星期四, 16 一月 2025 18:20:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/Service/BOFactory/src/com/vci/server/bof/server/ServiceFacadeUtil.java |  139 +++++++++++++++++++++------------------------
 1 files changed, 65 insertions(+), 74 deletions(-)

diff --git a/Source/Service/BOFactory/src/com/vci/server/bof/server/ServiceFacadeUtil.java b/Source/Service/BOFactory/src/com/vci/server/bof/server/ServiceFacadeUtil.java
index 6d20e89..562d53a 100644
--- a/Source/Service/BOFactory/src/com/vci/server/bof/server/ServiceFacadeUtil.java
+++ b/Source/Service/BOFactory/src/com/vci/server/bof/server/ServiceFacadeUtil.java
@@ -1,25 +1,14 @@
 package com.vci.server.bof.server;
 
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.commons.lang3.StringUtils;
-import org.hibernate.HibernateException;
 import com.vci.corba.omd.btm.BtmItem;
 import com.vci.corba.omd.data.AttributeValue;
-import com.vci.corba.omd.data.BusinessObject;
 import com.vci.corba.omd.data.LinkObject;
 import com.vci.server.base.exception.ExceptionLocalHandler;
-import com.vci.server.base.persistence.dao.HibernateSessionFactory;
-import com.vci.server.base.utility.ServerServiceProvider;
 import com.vci.server.cache.OMCacheProvider;
 import com.vci.common.exception.VciExceptionTool;
 import com.vci.corba.common.VCIError;
-import com.vci.corba.common.data.VCIInvocationInfo;
 import com.vci.corba.common.data.UserEntityInfo;
-import com.vci.corba.framework.method.FrameworkServicePrx;
-import com.vci.common.log.LogType;
 
 /**
  * 瀹氫箟宸ュ叿鏂规硶
@@ -46,21 +35,21 @@
 	 * @param oid锛氬璞ID
 	 * @throws VCIError 
 	 */
-	protected void recordLog(String user, String module, String ip, String operation, String type, String objName, String oid) throws VCIError {
-		userEntity.userName = user;
-		if(module.equalsIgnoreCase(type)){
-			userEntity.modules = getBtmShowName(module);
-		}else{
-			userEntity.modules = module;
-		}
-		userEntity.ip = ip;
-
-		String con = "鎿嶄綔鐨勬暟鎹槸->" + getBtmShowName(type) + ":" + objName;
-		//璁板綍鏃ュ織
-		
-		ServerServiceProvider.getFrameService().savelogGeneralOperation("鎿嶄綔鎴愬姛", con, userEntity, oid, type);
-		//LogRecordUtil.writeLog(userEntity, operation, "鎿嶄綔鎴愬姛", "鎿嶄綔鐨勬暟鎹槸->" + getBtmShowName(type) + ":" + objName, LogType.GeneralOperation, oid);
-	}
+//	protected void recordLog(String user, String module, String ip, String operation, String type, String objName, String oid) throws VCIError {
+//		userEntity.userName = user;
+//		if(module.equalsIgnoreCase(type)){
+//			userEntity.modules = getBtmShowName(module);
+//		}else{
+//			userEntity.modules = module;
+//		}
+//		userEntity.ip = ip;
+//
+//		String con = "鎿嶄綔鐨勬暟鎹槸->" + getBtmShowName(type) + ":" + objName;
+//		//璁板綍鏃ュ織
+//		
+//		ServerServiceProvider.getFrameService().savelogGeneralOperation("鎿嶄綔鎴愬姛", con, userEntity, oid, type);
+//		//LogRecordUtil.writeLog(userEntity, operation, "鎿嶄綔鎴愬姛", "鎿嶄綔鐨勬暟鎹槸->" + getBtmShowName(type) + ":" + objName, LogType.GeneralOperation, oid);
+//	}
 	
 	/**
 	 * 鎵归噺瀛樺偍log
@@ -71,57 +60,59 @@
 	 * @throws SQLException
 	 * @throws VCIError 
 	 */
-	protected void batchRecordLog(BusinessObject[] bos, String ip, String operation) throws HibernateException, SQLException, VCIError {
-		batchRecordLog(bos,ip,operation,"鎿嶄綔鎴愬姛");
-	}
+//	protected void batchRecordLog(BusinessObject[] bos, String ip, String operation) throws HibernateException, SQLException, VCIError {
+//		//batchRecordLog(bos,ip,operation,"鎿嶄綔鎴愬姛");
+//		LogRecordUtil.batchWriteLog(userEntity, bos, operation, "鎿嶄綔鎴愬姛");
+//	}
 	
-	private void batchRecordLog(BusinessObject[] bos, String ip, String operation,String result) throws HibernateException, SQLException, VCIError{
-		if (bos == null || bos.length < 1) {
-			return;
-		}
-		
-		VCIInvocationInfo invInfo = HibernateSessionFactory.getVciSessionInfo();
-		
-		if (StringUtils.isEmpty(invInfo.userName))
-			userEntity.userName = bos[0].creator;
-		else
-			userEntity.userName = invInfo.userName;
-		
-		userEntity.ip = ip;
-		
-		String type = bos[0].btName;
-		userEntity.modules = getBtmShowName(type);
-		
-		FrameworkServicePrx fService= ServerServiceProvider.getFrameService();
-
-//		ArrayList<String> logList = new ArrayList<String>();
-		for (int i = 0; i < bos.length; i++) {
-			BusinessObject bo = bos[i];
-			String info = StringUtils.isNotBlank(bo.name)?bo.name:(StringUtils.isNotBlank(bo.id)?bo.id:bo.oid);
-			String btmShowName = getBtmShowName(bos[i].btName);
-			
-			try {
-				fService.saveLogV2(result, "鎿嶄綔鐨勬暟鎹负->"+ btmShowName + ":" + info, operation, (short)LogType.GeneralOperation.getIntVal(), bos[i].oid, userEntity);
-			} catch (VCIError e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			
-//			logList.add(LogRecordUtil.getLogSql(userEntity, operation, result, "鎿嶄綔鐨勬暟鎹负->"+ btmShowName + ":" + info, LogType.GeneralOperation, bos[i].oid, role, btmShowName));
-//			if ((i + 1) % 200 == 0) {
-//				LogRecordUtil.batchSaveLog(logList.toArray(new String[logList.size()]));
-//				logList.clear();
-//			}
-		}
-//		if (bos.length % 200 != 0) {
-//			LogRecordUtil.batchSaveLog(logList.toArray(new String[logList.size()]));
-//			logList.clear();
+//	private void batchRecordLog(BusinessObject[] bos, String ip, String operation,String result) throws HibernateException, SQLException, VCIError{
+//		if (bos == null || bos.length < 1) {
+//			return;
 //		}
-	}
+//		
+//		VCIInvocationInfo invInfo = HibernateSessionFactory.getVciSessionInfo();
+//		
+//		if (StringUtils.isEmpty(invInfo.userName))
+//			userEntity.userName = bos[0].creator;
+//		else
+//			userEntity.userName = invInfo.userName;
+//		
+//		userEntity.ip = ip;
+//		
+//		String type = bos[0].btName;
+//		userEntity.modules = getBtmShowName(type);
+//		
+//		FrameworkServicePrx fService= ServerServiceProvider.getFrameService();
+//
+////		ArrayList<String> logList = new ArrayList<String>();
+//		for (int i = 0; i < bos.length; i++) {
+//			BusinessObject bo = bos[i];
+//			String info = StringUtils.isNotBlank(bo.name)?bo.name:(StringUtils.isNotBlank(bo.id)?bo.id:bo.oid);
+//			String btmShowName = getBtmShowName(bos[i].btName);
+//			
+//			try {
+//				LogRecordUtil.writeLog(userEntity, result, "鎿嶄綔鐨勬暟鎹负->"+ btmShowName + ":" + info, operation, (short)LogType.GeneralOperation.getIntVal(), bos[i].oid);
+//				//LogRecordUtil.w (result, "鎿嶄綔鐨勬暟鎹负->"+ btmShowName + ":" + info, operation, (short)LogType.GeneralOperation.getIntVal(), bos[i].oid, userEntity);
+//			} catch (VCIError e) {
+//				// TODO Auto-generated catch block
+//				e.printStackTrace();
+//			}
+//			
+////			logList.add(LogRecordUtil.getLogSql(userEntity, operation, result, "鎿嶄綔鐨勬暟鎹负->"+ btmShowName + ":" + info, LogType.GeneralOperation, bos[i].oid, role, btmShowName));
+////			if ((i + 1) % 200 == 0) {
+////				LogRecordUtil.batchSaveLog(logList.toArray(new String[logList.size()]));
+////				logList.clear();
+////			}
+//		}
+////		if (bos.length % 200 != 0) {
+////			LogRecordUtil.batchSaveLog(logList.toArray(new String[logList.size()]));
+////			logList.clear();
+////		}
+//	}
 	
-	protected void batchFailRecordLog(BusinessObject[] bos, String ip, String operation) throws HibernateException, SQLException, VCIError{
-		batchRecordLog(bos,ip,operation,"鎿嶄綔澶辫触");
-	}
+//	protected void batchFailRecordLog(BusinessObject[] bos, String ip, String operation) throws HibernateException, SQLException, VCIError{
+//		batchRecordLog(bos,ip,operation,"鎿嶄綔澶辫触");
+//	}
 	
 	
 	/**

--
Gitblit v1.9.3