Commit b0608934 by 泽锋 李

fix

parent bd1e01f5
......@@ -279,7 +279,7 @@ namespace AutoTurnOver.Services
return DB.dc_auto_turnover.SkuNewSupplierDeliveryList();
}
public MemoryStream Export(UserData user, Condition_AutoTurnOver m,string order,string sort)
public string Export(UserData user, Condition_AutoTurnOver m,string order,string sort)
{
var fileName = AppContext.BaseDirectory + $@"Result\RealtimeStock\{user.UserAccount}周转表.csv";
......@@ -398,14 +398,15 @@ namespace AutoTurnOver.Services
page++;
}
var memory = new MemoryStream();
using (var stream = new FileStream(fileName, FileMode.Open))
{
stream.CopyTo(memory);
}
memory.Position = 0;
//var memory = new MemoryStream();
//using (var stream = new FileStream(fileName, FileMode.Open))
//{
// stream.CopyTo(memory);
//}
//memory.Position = 0;
return memory;
//return memory;
return fileName;
}
/// <summary>
......@@ -414,16 +415,16 @@ namespace AutoTurnOver.Services
/// <returns></returns>
public async void GenerateData()
{
try
{
var memory = Export(new UserData { UserAccount = "admin" }, new Condition_AutoTurnOver { warehouse_code = "GZBLWH" }, "", "");
var fileData = await QiNiuCloudHelper.UploadAsync(memory, $"zhouzhuangshuj_{DateTime.Now.ToString("yyyyMMddHHmmss")}.csv");
ApiServices.QiYeJiQiRenMsPush(new QiYeJiQiRenMsDto { msgtype = "text", text = new QiYeJiQiRenMsDto.text_dto { content = "广州01周转数据:" + fileData } });
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
//try
//{
// var memory = Export(new UserData { UserAccount = "admin" }, new Condition_AutoTurnOver { warehouse_code = "GZBLWH" }, "", "");
// var fileData = await QiNiuCloudHelper.UploadAsync(memory, $"zhouzhuangshuj_{DateTime.Now.ToString("yyyyMMddHHmmss")}.csv");
// ApiServices.QiYeJiQiRenMsPush(new QiYeJiQiRenMsDto { msgtype = "text", text = new QiYeJiQiRenMsDto.text_dto { content = "广州01周转数据:" + fileData } });
//}
//catch (Exception ex)
//{
// Console.WriteLine(ex.Message);
//}
}
......
......@@ -66,6 +66,16 @@ namespace AutoTurnOver.Services
var fileData = await AutoTurnOver.Utility.QiNiuCloudHelper.UploadSectioningAsync(memory);
return fileData;
}
/// <summary>
/// 下载周转表
/// </summary>
public async Task<string> DownloadAuto(string par_json, dc_task_download download_data)
{
Condition_AutoTurnOver search_data = par_json.ToObject<Condition_AutoTurnOver>();
var memory = new SkuAutoTurnServices().Export(search_data);
var fileData = await AutoTurnOver.Utility.QiNiuCloudHelper.UploadSectioningAsync(memory);
return fileData;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment