0
This commit is contained in:
parent
85e89f085c
commit
6bab550029
@ -377,6 +377,7 @@
|
||||
<Compile Include="SQL\SqlManage.cs" />
|
||||
<Compile Include="SUB_PPBOM\AuditPOM.cs" />
|
||||
<Compile Include="T_IV_SALESIC\UnAuditS_Order.cs" />
|
||||
<Compile Include="Utils\LogUtil.cs" />
|
||||
<Compile Include="WebApiService\SaleOrderApiService.cs" />
|
||||
<Compile Include="XMYSLRB\AfterSave.cs" />
|
||||
<Compile Include="XMYSLRB\OnLoadLR.cs" />
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using GZ_LTHPilot_ORDER.Models.K3Request;
|
||||
using Gatedge.Enpower.BOS.PlugIn.Utils;
|
||||
using GZ_LTHPilot_ORDER.Models.K3Request;
|
||||
using GZ_LTHPilot_ORDER.Models.K3Result;
|
||||
using GZ_LTHPilot_ORDER.Models.VO;
|
||||
using Kingdee.BOS;
|
||||
@ -217,8 +218,10 @@ WHERE
|
||||
}
|
||||
};
|
||||
var paramString = JsonConvert.SerializeObject(param);
|
||||
LogUtil.Log("paramString", paramString);
|
||||
var resultDict = WebApiServiceCall.GetSysReportData(this.ctx, "SAL_DetailReport", paramString);
|
||||
var resultString = JsonConvert.SerializeObject(resultDict);
|
||||
LogUtil.Log("resultString", resultString);
|
||||
var result = JsonConvert.DeserializeObject<KingdeeResult<SaleExecuteOut>>(resultString);
|
||||
if (result.Result.RowCount == 0)
|
||||
{
|
||||
|
||||
65
Utils/LogUtil.cs
Normal file
65
Utils/LogUtil.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Kingdee.BOS.Log;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Gatedge.Enpower.BOS.PlugIn.Utils
|
||||
{
|
||||
internal class LogUtil
|
||||
{
|
||||
//private const string LogPath = "GzLog\\";
|
||||
private const string LogPath = "C:\\Kingdee_Gatedge_Log\\";
|
||||
|
||||
public static void Log(string logName, string logInfo)
|
||||
{
|
||||
var log = logInfo + "\r\n--------------------------------------------------------\r\n";
|
||||
var path = LogPath + logName;
|
||||
var fileName = GetFileName();
|
||||
var fullPath = path + fileName;
|
||||
WriteLog(fullPath, log);
|
||||
}
|
||||
|
||||
public static void Log(string[] logNames, string logInfo)
|
||||
{
|
||||
var log = logInfo + "\r\n--------------------------------------------------------\r\n";
|
||||
var pathName = string.Join("\\", logNames);
|
||||
var path = LogPath + pathName;
|
||||
var fileName = GetFileName();
|
||||
var fullPath = path + fileName;
|
||||
WriteLog(fullPath, log);
|
||||
}
|
||||
|
||||
private static string GetFileName()
|
||||
{
|
||||
var dateTime = DateTime.Now;
|
||||
var fileName = "\\KD_Gatedge_" + dateTime.ToString("yyyy-MM-dd_HH-mm-ss") + ".log";
|
||||
return "\\" + string.Empty;
|
||||
//return fileName;
|
||||
|
||||
}
|
||||
|
||||
private static void WriteLog(string path, string logInfo)
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(path)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
}
|
||||
FileStream fileStream = new FileStream(path, FileMode.OpenOrCreate);
|
||||
StreamWriter streamWriter = new StreamWriter(fileStream);
|
||||
fileStream.Position = fileStream.Length;
|
||||
streamWriter.Write(logInfo);
|
||||
streamWriter.Flush();
|
||||
streamWriter.Close();
|
||||
fileStream.Close();
|
||||
Logger.Info(path, logInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除早于该时间前的日志
|
||||
/// </summary>
|
||||
/// <param name="dateTime"></param>
|
||||
private static void RemoveLog(DateTime dateTime)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user