longht 4 éve
szülő
commit
991e39cfba

+ 9 - 6
.classpath

@@ -8,11 +8,14 @@
 	<classpathentry kind="src" path="METADATA"/>
 	<classpathentry kind="src" path="script"/>
 	<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Product_Common_Library"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Middleware_Library"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Module_Public_Library"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Module_Client_Library"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Module_Private_Library"/>
-	<classpathentry exported="true" kind="con" path="com.yonyou.ria.g2.container/Module_Lang_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Ant_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Product_Common_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Middleware_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Framework_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Module_Public_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Module_Client_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Module_Private_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Module_Lang_Library"/>
+	<classpathentry kind="con" path="com.yonyou.ria.g2.container/Generated_EJB"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

+ 37 - 22
src/private/nc/impl/pubtool/logserver/DevExecLogServer_RequiresNewimpl.java

@@ -9,69 +9,84 @@ import nc.vo.pub.pubtool.logserver.NCFileDownLogVO;
 
 public class DevExecLogServer_RequiresNewimpl implements
 		IDevExecLogServer_RequiresNew {
-
+	@Override
 	public boolean insertLog_RequiresNew(UFBoolean isSuccess, String operation,
 			String resultInfo, String errorInfo, String sendData,
 			String billId, String billType, String billName) {
 		// TODO Auto-generated method stub
+		
+		return insertLog_RequiresNew( isSuccess,  resultInfo,  errorInfo,
+				 sendData,  billId,  billType,  billName, 2);
+	}
+
+	@Override
+	public boolean insertFileLog_RequiresNew(UFBoolean isSuccess, String operation, String resultInfo, String errorInfo,
+			String sendData, String filename, String downdate, String downtype, String filetype) {
+		// TODO Auto-generated method stub
+
+		// TODO Auto-generated method stub
 		try {
 			Logger.debug("==============enter method insertLog_RequiresNew ========");
 			long spendtime = System.currentTimeMillis();
-			Logger.debug("执行 日志写入操作 start time:--- " + System.currentTimeMillis());
+			Logger.debug("执行 文件下载日志写入操作 start time:--- " + System.currentTimeMillis());
 			
-			NCDevExecLogVO logVO = new NCDevExecLogVO();
+			NCFileDownLogVO logVO = new NCFileDownLogVO();
 			logVO.setIssuccess(isSuccess);// 是否成功
 			logVO.setOperation(operation);// 操作
 			logVO.setResultinfo(resultInfo);// 结果信息
 			logVO.setErrorinfo(errorInfo);// 异常信息
 			logVO.setSenddata(sendData);// 发送的数据
-			logVO.setSrc_pk_billtype(billType);// 所属单据编码
-			logVO.setSrc_pk_billname(billName);// 所属单据名称
-			logVO.setSrc_pk_bill(billId);// 单据主键
+			logVO.setFilename(filename);//文件名
+			logVO.setFiletype(filetype);//文件类型
+			logVO.setDowndate(downdate);//下载日期
+			logVO.setDowntype(downtype);//下载方式
 			new BaseDAO().insertVO(logVO);
-			Logger.debug("执行 日志写入操作 end  耗时 : "
+			Logger.debug("执行 文件下载日志写入操作 end  耗时 : "
 					+ (System.currentTimeMillis() - spendtime) / 1000f + " 秒 ");
 			return true;
 		} catch (Exception e) {
-			Logger.error("====" + billName + "写入日志插入异常===" + e.getMessage());
+			Logger.error("====" + filename + "写入日志插入异常===" + e.getMessage());
 			return false;
 		}
 
 		
+	
 	}
 
 	@Override
-	public boolean insertFileLog_RequiresNew(UFBoolean isSuccess, String operation, String resultInfo, String errorInfo,
-			String sendData, String filename, String downdate, String downtype, String filetype) {
-		// TODO Auto-generated method stub
-
+	public boolean insertLog_RequiresNew(UFBoolean isSuccess, String resultInfo, String errorInfo,
+			String sendData, String billId, String billType, String billName, int dir) {
 		// TODO Auto-generated method stub
 		try {
 			Logger.debug("==============enter method insertLog_RequiresNew ========");
 			long spendtime = System.currentTimeMillis();
-			Logger.debug("执行 文件下载日志写入操作 start time:--- " + System.currentTimeMillis());
+			Logger.debug("执行 日志写入操作 start time:--- " + System.currentTimeMillis());
 			
-			NCFileDownLogVO logVO = new NCFileDownLogVO();
+			NCDevExecLogVO logVO = new NCDevExecLogVO();
 			logVO.setIssuccess(isSuccess);// 是否成功
-			logVO.setOperation(operation);// 操作
 			logVO.setResultinfo(resultInfo);// 结果信息
 			logVO.setErrorinfo(errorInfo);// 异常信息
 			logVO.setSenddata(sendData);// 发送的数据
-			logVO.setFilename(filename);//文件名
-			logVO.setFiletype(filetype);//文件类型
-			logVO.setDowndate(downdate);//下载日期
-			logVO.setDowntype(downtype);//下载方式
+			logVO.setSrc_pk_billtype(billType);// 所属单据编码
+			logVO.setSrc_pk_billname(billName);// 所属单据名称
+			logVO.setSrc_pk_bill(billId);// 单据主键
+			if(dir==0) {
+				logVO.setOperation("NC->OUTSYS");//方向
+			}else if(dir==1) {
+				logVO.setOperation("OUTSYS->NC");// 方向
+			}else {
+				logVO.setOperation("NCLOG");// 方向
+			}
 			new BaseDAO().insertVO(logVO);
-			Logger.debug("执行 文件下载日志写入操作 end  耗时 : "
+			Logger.debug("执行 日志写入操作 end  耗时 : "
 					+ (System.currentTimeMillis() - spendtime) / 1000f + " 秒 ");
 			return true;
 		} catch (Exception e) {
-			Logger.error("====" + filename + "写入日志插入异常===" + e.getMessage());
+			Logger.error("====" + billName + "写入日志插入异常===" + e.getMessage());
 			return false;
 		}
 
 		
-	
 	}
 
 }

+ 20 - 0
src/public/nc/itf/pubdev/pubtool/logserver/IDevExecLogServer_RequiresNew.java

@@ -6,6 +6,7 @@ import nc.vo.pub.lang.UFBoolean;
 public interface IDevExecLogServer_RequiresNew {
 	
 	/**
+	 * @deprecated
 	 * 记录二开程序日志
 	 * @param isSuccess 状态(Y:成功,N:失败)
 	 * @param operation 操作
@@ -40,5 +41,24 @@ public interface IDevExecLogServer_RequiresNew {
 	public boolean insertFileLog_RequiresNew(UFBoolean isSuccess, String operation,
 			String resultInfo, String errorInfo, String sendData,
 			String filename, String downdate, String downtype,String filetype);
+	
+	
+	/**
+	 * 
+	 * 记录二开程序日志
+	 * @param isSuccess 状态(Y:成功,N:失败)
+	 * @param resultInfo 结果信息
+	 * @param errorInfo 异常信息
+	 * @param sendData 执行的数据
+	 * @param billId 单据id
+	 * @param billType 单据类型编码
+	 * @param billName 单据名称
+	 * @param dir 0:NC->OUTSYS 1:OUTSYS->NC 2:NCLOG
+	 * @return
+	 * @throws BusinessException
+	 */
+	public boolean insertLog_RequiresNew(UFBoolean isSuccess, 
+			String resultInfo, String errorInfo, String sendData,
+			String billId, String billType, String billName,int dir) ;
 
 }

+ 37 - 0
src/public/nc/pub/tools/pubtool/LogRecordTool.java

@@ -0,0 +1,37 @@
+package nc.pub.tools.pubtool;
+
+import nc.bs.framework.common.NCLocator;
+import nc.itf.pubdev.pubtool.logserver.IDevExecLogServer_RequiresNew;
+import nc.vo.pub.lang.UFBoolean;
+
+/**
+ * 日志工具
+ * @author longht
+ *
+ */
+public class LogRecordTool {
+	
+	/**方向 OUTSYS->NC*/
+	public  static  int INDIR = 0 ; 
+	
+	/**方向 NC->OUTSYS*/
+	public  static  int OUTDIR = 1 ; 
+	
+	/**方向 NCLOG*/
+	public  static  int INNERDIR = 2 ; 
+	
+	/**
+	 * 记录日志 
+	 * @param issuccess 是否成功
+	 * @param logcode 日志编码
+	 * @param result 结果报文
+	 * @param senddate 发送/接收报文
+	 * @param logname 日志名称
+	 * @param errmsg 报错信息
+	 * @param dir 数据接口方向  0:NC->OUTSYS 1:OUTSYS->NC 2:NCLOG
+	 */
+	public static void doLog(UFBoolean issuccess,String logcode,String logname,String result,String senddate,String errmsg,int dir) {
+		NCLocator.getInstance().lookup(IDevExecLogServer_RequiresNew.class).insertLog_RequiresNew(issuccess,  result, errmsg, senddate,logname,  logcode, logname,dir);
+	}
+
+}