Ver código fonte

调试CMS下发文件

临城职教中职
ndbs 2 anos atrás
pai
commit
8d1e1d1611
3 arquivos alterados com 7 adições e 127 exclusões
  1. +0
    -124
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/CMSController.cs
  2. +0
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  3. +7
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs

+ 0
- 124
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/CMSController.cs Ver arquivo

@@ -1,124 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Learun.Application.Base.SystemModule;
using Learun.Application.OA.File.FilePreview;
using Learun.Util;
using Quanjiang.DigitalSchool.AsposeHelper;

namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
{
public class CMSController : MvcControllerBaseNoLogin
{
// GET: LR_SystemModule/CMS
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();

public ActionResult Index()
{
return View();
}

#region 预览附件
/// <summary>
/// 文件预览
/// </summary>
/// <param name="fileId">文件ID</param>
/// <returns></returns>
public void PreviewFile(string fileId)
{
FilePreviewIBLL filePreviewIBLL = new FilePreviewBLL();
var data = annexesFileIBLL.GetEntity(fileId);
if (data == null)
{
return;
}
string filename = data.F_FileName;//客户端保存的文件名
string filepath = data.F_FilePath;//路径
if (data.F_FileType == "xlsx" || data.F_FileType == "xls")
{
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
//filePreviewIBLL.GetExcelData(data.F_FilePath);
//liang 2021-6-25 改aspose预览
AsposeCore.GetExcelData(data.F_FilePath);
}
}
if (data.F_FileType == "docx" || data.F_FileType == "doc")
{
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
//filePreviewIBLL.GetWordData(data.F_FilePath);
//liang 2021-6-25 改aspose预览
AsposeCore.GetWordData(data.F_FilePath);
}
}
if (data.F_FileType == "ppt" || data.F_FileType == "pptx")
{
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
//filePreviewIBLL.GetPptData(data.F_FilePath);
//liang 2021-6-25 改aspose预览
AsposeCore.GetWordData(data.F_FilePath);
}
}
Response.ClearContent();
switch (data.F_FileType)
{
case "jpg":
Response.ContentType = "image/jpeg";
break;
case "gif":
Response.ContentType = "image/gif";
break;
case "png":
Response.ContentType = "image/png";
break;
case "bmp":
Response.ContentType = "application/x-bmp";
break;
case "jpeg":
Response.ContentType = "image/jpeg";
break;
case "doc":
Response.ContentType = "application/pdf";
break;
case "docx":
Response.ContentType = "application/pdf";
break;
case "ppt":
Response.ContentType = "application/pdf";
break;
case "pptx":
Response.ContentType = "application/pdf";
break;
case "xls":
Response.ContentType = "application/pdf";
break;
case "xlsx":
Response.ContentType = "application/pdf";
break;
case "pdf":
Response.ContentType = "application/pdf";
break;
case "txt":
Response.ContentType = "text/plain";
break;
case "csv":
Response.ContentType = "";
break;
default:
Response.ContentType = "application/pdf";
break;
}
Response.Charset = "GB2312";
Response.WriteFile(filepath);
//Response.BinaryWrite(ms.ToArray());
}
#endregion
}
}

+ 0
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Ver arquivo

@@ -459,7 +459,6 @@
<Compile Include="Areas\LR_ReportTest\LR_ReportTestAreaRegistration.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\AnnexesController.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\AreaController.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\CMSController.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\CodeRuleController.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\CustmerQueryController.cs" />
<Compile Include="Areas\LR_SystemModule\Controllers\DatabaseLinkController.cs" />


+ 7
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs Ver arquivo

@@ -250,6 +250,9 @@ namespace Learun.Application.OA
};

string responses = HttpMethods.HttpPosts("http://" + ports + "/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId);
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson),VALUES (newid(),,'2222','" +
responses + "') ");

//#region 修改审核状态
//string Nid = JsonConvert.DeserializeObject<Root>(responses).value.id;
@@ -270,9 +273,11 @@ namespace Learun.Application.OA
//#endregion
}
}
catch (Exception ex)
catch (ArithmeticException ex)
{

BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson),VALUES (newid(),'2222','" +
ex.Message + "') ");
}
}



Carregando…
Cancelar
Salvar