Commit b06ef206 authored by 黄奎's avatar 黄奎

页面修改

parent e8c7b1ee
......@@ -17,9 +17,8 @@ namespace Edu.Common.Plugin
/// <param name="templatePath">模板文件</param>
/// <param name="newFilePath">新文件保存路径</param>
/// <returns></returns>
public static bool UrlToWord(string url, string templatePath, string newFilePath)
public static byte[] UrlToWord(string url, string templatePath)
{
FileStream pFileStream = null;
try
{
WebRequest req = WebRequest.Create(url);
......@@ -38,24 +37,20 @@ namespace Edu.Common.Plugin
NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
MemoryStream firstStream = new MemoryStream();
doc.Save(firstStream, SaveFormat.Doc);
var pReadByte = firstStream.GetBuffer();
pFileStream = new FileStream(newFilePath, FileMode.OpenOrCreate);
pFileStream.Write(pReadByte, 0, pReadByte.Length);
return firstStream.GetBuffer();
}
catch
{
return false;
}
finally
{
if (pFileStream != null)
pFileStream.Close();
}
return true;
return null;
}
/// <summary>
#endregion
}
......
......@@ -1320,5 +1320,34 @@ namespace Edu.WebApi.Controllers.Course
}
#endregion
/// <summary>
/// 下载学员跟进信息
/// </summary>
/// <returns></returns>
[HttpPost]
[Obsolete]
public FileContentResult DownLoadBank()
{
List<ExcelDataSource> slist = new List<ExcelDataSource>();
string BankIds = base.ParmJObj.GetStringValue("BankId");
string fileName = DateTime.Now.Ticks + ".doc";
try
{
string url = Common.Config.UploadSiteUrl + "/Home/JieHeQuestion?showType=1&BankIds=" + BankIds;
string basepath = AppContext.BaseDirectory;
string tempPath = basepath + "\\upfile\\Template\\";
string path_server = tempPath + "template.doc";
var byteData = Common.Plugin.WordTemplateHelper.UrlToWord(url, path_server);
return File(byteData, "application/octet-stream", fileName);
}
catch (Exception ex)
{
LogHelper.Write(ex, "DownLoadBank");
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", fileName);
}
}
}
}
\ No newline at end of file
......@@ -63,7 +63,7 @@ namespace Edu.WebApi.Controllers.User
[AllowAnonymous]
public ApiResult Test()
{
TestMethod();
new OrderModule().GetClassNameList("1337");
return ApiResult.Success();
}
......
......@@ -26,7 +26,7 @@
"IsSendMsg": 2,
"AllowedHosts": "*",
"OpenValidation": "False",
"UploadSiteUrl": "http://192.168.10.46:8120",
"UploadSiteUrl": "http://192.168.10.128:8120",
"ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com",
"ErpViewFileSiteUrl": "http://imgfile.oytour.com",
"ErpUrl": "http://localhost:8181/#",
......
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