|
|
@@ -51,7 +51,9 @@ namespace MySystem
|
|
|
if (string.IsNullOrEmpty(check))
|
|
|
{
|
|
|
function.WritePage("/GetFTPDepositYesterday/", "check" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString());
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----start", "监控头一天数据");
|
|
|
SaveDepositData(DateTime.Now.AddDays(-1).ToString("yyyyMMdd"), true);
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----end", "监控头一天数据");
|
|
|
Thread.Sleep(2000);
|
|
|
// GetDepositData();
|
|
|
// Thread.Sleep(60000);
|
|
|
@@ -121,9 +123,11 @@ namespace MySystem
|
|
|
{
|
|
|
// 要下载的文件路径
|
|
|
string filePath = "/haoda-deposit/deposit_" + Date + ".csv";
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----" + filePath, "监控头一天数据");
|
|
|
|
|
|
try
|
|
|
{
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----ok", "监控头一天数据");
|
|
|
// 创建FtpWebRequest对象
|
|
|
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpServerAddress + filePath);
|
|
|
request.Method = WebRequestMethods.Ftp.DownloadFile;
|
|
|
@@ -137,16 +141,21 @@ namespace MySystem
|
|
|
StreamReader reader = new StreamReader(responseStream);
|
|
|
// 读取数据
|
|
|
string fileContents = reader.ReadToEnd();
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----ready", "监控头一天数据");
|
|
|
if (!string.IsNullOrEmpty(fileContents))
|
|
|
{
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----have content", "监控头一天数据");
|
|
|
MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
|
|
|
List<string> SnNos = db.HdDepositTmp.Select(m => m.SnNo).ToList();
|
|
|
List<string> ChkSnNos = new List<string>();
|
|
|
var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----count:" + DataInfo.Length, "监控头一天数据");
|
|
|
if (DataInfo.Length > 1)
|
|
|
{
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----have record", "监控头一天数据");
|
|
|
int index = 0;
|
|
|
var DataList = DataInfo[1].Split('\n');
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----record count:" + DataList.Length, "监控头一天数据");
|
|
|
foreach (var DataListItem in DataList)
|
|
|
{
|
|
|
if(IsRedis)
|
|
|
@@ -175,6 +184,7 @@ namespace MySystem
|
|
|
index = 0;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----read data end", "监控头一天数据");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
}
|
|
|
@@ -186,7 +196,8 @@ namespace MySystem
|
|
|
}
|
|
|
catch (WebException ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "----err", "监控头一天数据");
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP押金数据异常");
|
|
|
}
|
|
|
}
|
|
|
|