11
This commit is contained in:
@@ -465,6 +465,30 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断文件类型是否是图片
|
||||
/// </summary>
|
||||
/// <param name="FiletExtension"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsImage(string FiletExtension)
|
||||
{
|
||||
bool result = false;
|
||||
List<String> list = new List<string>();
|
||||
list.Add(".png");
|
||||
list.Add(".jpg");
|
||||
list.Add(".jpeg");
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item == FiletExtension)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#region 根据图片路径转换为base64
|
||||
/// <summary>
|
||||
/// 根据图片路径转换为base64
|
||||
|
||||
@@ -355,8 +355,8 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
var uinit =UnitService.GetUnitByUnitId(unitId);
|
||||
if (uinit != null && uinit.IsBranch ==true)
|
||||
var uinit = UnitService.GetUnitByUnitId(unitId);
|
||||
if (uinit != null && uinit.IsBranch == true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
var user = Person_PersonsService.GetPerson_PersonsById(userId);
|
||||
if (user != null && (user.UnitId == Const.UnitId_SEDIN || user.UnitId == Const.UnitId_SEDINNB))
|
||||
if (user != null && (user.UnitId == Const.UnitId_SEDIN || user.UnitId == Const.UnitId_SEDINNB || user.UnitId == Const.UnitId_SEDINJH))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
@@ -691,5 +691,22 @@ namespace BLL
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region 根据项目id获取项目总包单位Id
|
||||
/// <summary>
|
||||
/// 得到本单位Id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetMainProjectUnitId(string projectId)
|
||||
{
|
||||
string unitId = string.Empty;
|
||||
var projectUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(e => e.ProjectId == projectId && e.UnitType == BLL.Const.ProjectUnitType_1);
|
||||
if (projectUnit != null)
|
||||
{
|
||||
unitId = projectUnit.UnitId;
|
||||
}
|
||||
return unitId;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
+112
-15
@@ -204,6 +204,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string UnitId_SEDINNB = "274fc39e-66e2-4bb9-8080-acb808499e82";
|
||||
/// <summary>
|
||||
/// 赛鼎焦化单位id
|
||||
/// </summary>
|
||||
public const string UnitId_SEDINJH = "2d2ffdfb-e2f7-430e-888a-240de2b12c06";
|
||||
/// <summary>
|
||||
/// 集团公司单位id
|
||||
/// </summary>
|
||||
public const string UnitId_CNCEC = "722090d1-b5de-4c3c-a4f7-14f308161a3b";
|
||||
@@ -857,7 +861,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 发起检查
|
||||
/// </summary>
|
||||
public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6";
|
||||
public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6";
|
||||
|
||||
/// <summary>
|
||||
/// 实业
|
||||
@@ -1601,7 +1605,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 安全监督检查报告
|
||||
/// </summary>
|
||||
public const string SuperviseCheckReportMenuId = "1C6F9CA9-FDAC-4CE5-A19C-5536538851E1";
|
||||
public const string SuperviseCheckReportMenuId = "40387C48-95A0-435C-82FB-57AF0A81B9D4";
|
||||
|
||||
/// <summary>
|
||||
/// 安全监督检查整改
|
||||
@@ -2952,6 +2956,10 @@ namespace BLL
|
||||
/// 包装管理
|
||||
/// </summary>
|
||||
public const string HJGL_PackagingManageMenuId = "25DED954-10C9-47CC-99F2-C44FDE9E0A81";
|
||||
/// <summary>
|
||||
/// 车次管理
|
||||
/// </summary>
|
||||
public const string HJGL_TrainNumberManageMenuId = "EEC0D060-C15E-4D25-B015-C2B91F735DAC";
|
||||
#endregion
|
||||
|
||||
#region 数据导入
|
||||
@@ -3217,19 +3225,19 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 工程量清单菜单id
|
||||
/// </summary>
|
||||
public const string TemQuantityListMenuId0= "326AA80C-6B01-4214-ACF2-B29595BA28D5";
|
||||
public const string TemQuantityListMenuId1= "0A679077-6D89-4272-A1B0-CF384DEDC9B8";
|
||||
public const string TemQuantityListMenuId2= "0E04FA16-FFA6-4987-A0A5-A4658F0099F2";
|
||||
public const string TemQuantityListMenuId3= "FAC4F0F7-A7C0-4F66-8BCB-846C082BCA40";
|
||||
public const string TemQuantityListMenuId4= "10586190-0FDD-4DA8-A877-CE4599D6F0DF";
|
||||
public const string TemQuantityListMenuId5= "1C770E20-7912-484C-9739-499B1B2F8DEB";
|
||||
public const string TemQuantityListMenuId5_1= "3593DF22-78C1-4A73-8468-B20CB44D88C9";
|
||||
public const string TemQuantityListMenuId5_2= "3ECE6333-6785-424D-996E-B923A650D8C7";
|
||||
public const string TemQuantityListMenuId5_3= "480F8C85-F5F2-4C5C-BE72-2ADABB7250CF";
|
||||
public const string TemQuantityListMenuId6= "92101A90-9C22-4B43-B012-9AFF8402F85D";
|
||||
public const string TemQuantityListMenuId7= "33A03E2C-4E00-4722-AA14-F50419468154";
|
||||
public const string TemQuantityListMenuId8= "A5A31FE8-0643-4396-99E3-A4A31A947789";
|
||||
public const string TemQuantityListMenuId9= "481E6B1E-A3D5-4012-B828-FE62EB6BA861";
|
||||
public const string TemQuantityListMenuId0 = "326AA80C-6B01-4214-ACF2-B29595BA28D5";
|
||||
public const string TemQuantityListMenuId1 = "0A679077-6D89-4272-A1B0-CF384DEDC9B8";
|
||||
public const string TemQuantityListMenuId2 = "0E04FA16-FFA6-4987-A0A5-A4658F0099F2";
|
||||
public const string TemQuantityListMenuId3 = "FAC4F0F7-A7C0-4F66-8BCB-846C082BCA40";
|
||||
public const string TemQuantityListMenuId4 = "10586190-0FDD-4DA8-A877-CE4599D6F0DF";
|
||||
public const string TemQuantityListMenuId5 = "1C770E20-7912-484C-9739-499B1B2F8DEB";
|
||||
public const string TemQuantityListMenuId5_1 = "3593DF22-78C1-4A73-8468-B20CB44D88C9";
|
||||
public const string TemQuantityListMenuId5_2 = "3ECE6333-6785-424D-996E-B923A650D8C7";
|
||||
public const string TemQuantityListMenuId5_3 = "480F8C85-F5F2-4C5C-BE72-2ADABB7250CF";
|
||||
public const string TemQuantityListMenuId6 = "92101A90-9C22-4B43-B012-9AFF8402F85D";
|
||||
public const string TemQuantityListMenuId7 = "33A03E2C-4E00-4722-AA14-F50419468154";
|
||||
public const string TemQuantityListMenuId8 = "A5A31FE8-0643-4396-99E3-A4A31A947789";
|
||||
public const string TemQuantityListMenuId9 = "481E6B1E-A3D5-4012-B828-FE62EB6BA861";
|
||||
/// <summary>
|
||||
/// 招标工程量清单定制
|
||||
/// </summary>
|
||||
@@ -3500,6 +3508,17 @@ namespace BLL
|
||||
/// 施工作业风险导出模板
|
||||
/// </summary>
|
||||
public const string ConstructionRiskOutTemplateUrl = "File\\Excel\\DataOut\\每周施工作业风险动态管控表.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 试压包导入模板
|
||||
/// </summary>
|
||||
public const string TestPackageTemplateUrl = "File\\Excel\\DataIn\\试压包导入模版.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 管道焊口检测结果通知单导入模板
|
||||
/// </summary>
|
||||
public const string NDTBatchTemplateUrl = "File\\Excel\\DataIn\\管道焊口检测结果通知单导入模板.xlsx";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
@@ -4797,7 +4816,19 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string Pipeline_ComponentPath = "File\\Excel\\DataIn\\组件管理二维码信息导入.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 排产计划导出模板
|
||||
/// </summary>
|
||||
public const string HJGL_ProductionSchedulingPlanPath = "File\\Excel\\DataOut\\排产计划导出模板.xlsx";
|
||||
/// <summary>
|
||||
/// 材料颜色标识导入模板
|
||||
/// </summary>
|
||||
public const string HJGL_MaterialColorDataImportPath = "File\\Excel\\DataIn\\管道颜色标识库导入模板.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 试压包导入文件路径
|
||||
/// </summary>
|
||||
public static string TestPackageDataImportPath = "FileUpload\\TestPackageDataImport\\";
|
||||
#region 焊接报表
|
||||
/// <summary>
|
||||
/// 管道焊接工作记录
|
||||
@@ -5160,5 +5191,71 @@ namespace BLL
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// QC小组注册
|
||||
/// </summary>
|
||||
public const string ProjectQCGroupRegistrationListMenuId = "8B1DFB6D-B48C-4FAB-821F-25AD582DBFAB";
|
||||
|
||||
/// <summary>
|
||||
/// 图纸会审管理
|
||||
/// </summary>
|
||||
public const string ReviewDrawingsMenuId = "856D53B3-C5FB-443F-917B-39E83BE685DB";
|
||||
|
||||
/// <summary>
|
||||
/// 图纸会审记录导入模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string ReviewDrawingsTemplateUrl = "File\\Excel\\DataIn\\图纸会审管理导入模板.xls";
|
||||
|
||||
/// <summary>
|
||||
/// 特设质保体系
|
||||
/// </summary>
|
||||
public const string CQMS_QualityAssuranceMenuId = "2C49EC5E-BF6F-4C44-BA02-9BD183CF68C6";
|
||||
|
||||
/// <summary>
|
||||
/// 施工技术交底管理导入模板原始虚拟路径
|
||||
/// </summary>
|
||||
public const string ConTechnologyDisclosureTemUrl = "File\\Excel\\DataIn\\施工技术交底管理导入模板.xls";
|
||||
|
||||
/// <summary>
|
||||
/// 施工技术交底管理
|
||||
/// </summary>
|
||||
public const string ConTechnologyDisclosureMenuId = "A16CFA9D-2783-4573-95F9-EBA2B682B7EA";
|
||||
|
||||
#region 综合管理审核流程
|
||||
|
||||
/// <summary>
|
||||
/// 重报
|
||||
/// </summary>
|
||||
public const string Comprehensive_ReCompile = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 驳回
|
||||
/// </summary>
|
||||
public const string Comprehensive_ReJect = "-1";
|
||||
|
||||
/// <summary>
|
||||
/// 编制
|
||||
/// </summary>
|
||||
public static string Comprehensive_Compile = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 专业工程师审核
|
||||
/// </summary>
|
||||
public static string Comprehensive_Audit = "2";
|
||||
|
||||
/// <summary>
|
||||
/// 审批完成
|
||||
/// </summary>
|
||||
public static string Comprehensive_Complete = "3";
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 质量隐患
|
||||
/// </summary>
|
||||
public const string CQMSRectifyMenuId = "D72BB321-11A8-485B-BAC7-367C7FCA7FBA";
|
||||
|
||||
|
||||
public const string BaseMaterialcolorMenuId = "F6194C00-D256-485D-9056-171FAB75928A";
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,11 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.Sys_Const.FirstOrDefault(e => e.ConstValue == constValue && e.GroupId == groupId);
|
||||
}
|
||||
|
||||
public static Sys_Const GetConstByConstText(string constText)
|
||||
{
|
||||
return Funs.DB.Sys_Const.FirstOrDefault(e => e.ConstText == constText);
|
||||
}
|
||||
public static void DeleteConstValueBygroupId(string groupId)
|
||||
{
|
||||
var q = Funs.DB.Sys_Const.Where(x => x.GroupId == groupId);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using NPOI.OpenXmlFormats.Shared;
|
||||
using QRCoder;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using ThoughtWorks.QRCode.Codec;
|
||||
using QRCoder;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -61,7 +60,7 @@ namespace BLL
|
||||
int iconBorderWidth:水印图标的边框。不能设为0,否则会显示“参数错误”,程序运行出错。
|
||||
bool drawQuietZones:静止区,即是否绘画二维码的空白边框区域,默认为true。
|
||||
*/
|
||||
public static string CreateCode_Simple(string nr,string filename)
|
||||
public static string CreateCode_Simple(string nr, string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -89,7 +88,7 @@ namespace BLL
|
||||
{
|
||||
Directory.CreateDirectory(filepath);
|
||||
}
|
||||
// string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg";
|
||||
// string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg";
|
||||
filename = filename + ".jpg";
|
||||
//if (File.Exists(filepath + filename))
|
||||
//{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using FastReport;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Web;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class FastReportService
|
||||
@@ -30,5 +32,58 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合并报表后打印
|
||||
/// </summary>
|
||||
/// <param name="fastReportItems">报表实体集</param>
|
||||
/// <param name="path">导出的路径</param>
|
||||
public static void ExportMergeReport(List<Model.FastReportItem> fastReportItems, string path, string printType)
|
||||
{
|
||||
Report report = new Report();
|
||||
report.PrintSettings.ShowDialog = false; //隐藏弹窗
|
||||
FastReport.EnvironmentSettings settings = new EnvironmentSettings();
|
||||
settings.ReportSettings.ShowProgress = false; //隐藏进度条
|
||||
for (int i = 0; i < fastReportItems.Count; i++)
|
||||
{
|
||||
report.Load(Funs.RootPath + fastReportItems[i].ReportPath); //加载报表
|
||||
|
||||
List<DataTable> dataTables = fastReportItems[i].DataTables;
|
||||
Dictionary<string, string> ParameterValues = fastReportItems[i].ParameterValues;
|
||||
if (dataTables != null && dataTables.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < dataTables.Count; j++)
|
||||
{
|
||||
report.RegisterData(dataTables[j], dataTables[j].TableName);//绑定数据源
|
||||
}
|
||||
}
|
||||
if (ParameterValues.Count > 0)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> kvp in ParameterValues)
|
||||
{
|
||||
report.SetParameterValue(kvp.Key, kvp.Value);//绑定参数
|
||||
}
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
report.Prepare();
|
||||
}
|
||||
else
|
||||
{
|
||||
report.Prepare(true);
|
||||
}
|
||||
}
|
||||
if (printType == "1")
|
||||
{
|
||||
FastReport.Export.Pdf.PDFExport exp = new FastReport.Export.Pdf.PDFExport();
|
||||
report.Export(exp, path);
|
||||
}
|
||||
else if (printType == "2")
|
||||
{
|
||||
FastReport.Export.OoXML.Word2007Export exportBase = new FastReport.Export.OoXML.Word2007Export();
|
||||
report.Export(export: exportBase, fileName: path.Replace(oldValue: "pdf", newValue: "docx"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+47
-3
@@ -2,7 +2,6 @@ namespace BLL
|
||||
{
|
||||
using MiniExcelLibs;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Quartz;
|
||||
using RestSharp;
|
||||
using System;
|
||||
@@ -73,6 +72,11 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务器路径
|
||||
/// </summary>
|
||||
public static string AttachRootPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统名称
|
||||
/// </summary>
|
||||
@@ -1207,7 +1211,7 @@ namespace BLL
|
||||
p.SetValue(entity, Convert.ToInt32(row[p.Name]), null);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
p.SetValue(entity, row[p.Name], null);
|
||||
}
|
||||
list.Add(entity);
|
||||
@@ -1359,7 +1363,7 @@ namespace BLL
|
||||
/// <param name="pageTotal">总数</param>
|
||||
/// <param name="pagesize">每页条数</param>
|
||||
/// <returns></returns>
|
||||
public static int GetEndPageNumber(int pageTotal,int pagesize )
|
||||
public static int GetEndPageNumber(int pageTotal, int pagesize)
|
||||
{
|
||||
double aa = (pageTotal + pagesize - 1) / pagesize; //使用数据条数/每页显示条数,来获得最大页数,是double类型
|
||||
|
||||
@@ -1446,6 +1450,46 @@ namespace BLL
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
public static string RequestPost(string Baseurl, Dictionary<string, string> Token, string JsonBody)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(Baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.POST);
|
||||
foreach (var item in Token)
|
||||
{
|
||||
request.AddHeader(item.Key, item.Value);
|
||||
}
|
||||
request.AddHeader("ClientId", SysConstSetService.ClientId);
|
||||
request.AddHeader("OperationCode", Baseurl.Substring(Baseurl.LastIndexOf("/", StringComparison.Ordinal) + 1));
|
||||
if (!string.IsNullOrEmpty(JsonBody))
|
||||
{
|
||||
request.AddJsonBody(JsonBody);
|
||||
}
|
||||
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
public static string RequestGet(string Baseurl, Dictionary<string, string> Token)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(Baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.GET);
|
||||
foreach (var item in Token)
|
||||
{
|
||||
request.AddHeader(item.Key, item.Value);
|
||||
}
|
||||
request.AddHeader("ClientId", SysConstSetService.ClientId);
|
||||
request.AddHeader("OperationCode", Baseurl.Substring(Baseurl.LastIndexOf("/", StringComparison.Ordinal) + 1));
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据星期几返回值
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FineUIPro;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
/// <summary>
|
||||
/// 处理多表头的类
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace BLL
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -272,9 +271,9 @@
|
||||
public static string GetRectifyNoticesTableHtmlAll(string projectId)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var getRectifyNoticesAll = from x in Funs.DB.Check_RectifyNotices
|
||||
var getRectifyNoticesAll = from x in Funs.DB.Check_RectifyNotices
|
||||
orderby x.RectifyNoticesCode
|
||||
where x.ProjectId == projectId
|
||||
where x.ProjectId == projectId
|
||||
select x;
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/word; charset=UTF-8\"/>");
|
||||
foreach (var getRectifyNotices in getRectifyNoticesAll)
|
||||
@@ -641,7 +640,7 @@
|
||||
where x.ProjectId == projectId
|
||||
select x;
|
||||
foreach (var getRectifyNotices in getRectifyNoticesAll)
|
||||
{
|
||||
{
|
||||
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;font-size: 11pt;\">");
|
||||
sb.Append("<tr style=\"height: 35px\">");
|
||||
sb.AppendFormat("<td align=\"center\" colspan=\"4\" style=\"width: 100%; font-size: 12pt; font-weight: bold;border-right: none;border-left: none;border-bottom: none;border-top: none; \">{0}</td> ", "安全隐患整改反馈单");
|
||||
@@ -1166,29 +1165,30 @@
|
||||
#region 5、本月大型、特种设备投入情况
|
||||
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;font-size: 10.5pt;\">");
|
||||
sb.Append("<tr style=\"height: 30px\">");
|
||||
sb.AppendFormat("<td align=\"left\" colspan=\"13\" style=\"width: 100%;font-weight: bold;\">{0}</td> "
|
||||
sb.AppendFormat("<td align=\"left\" colspan=\"14\" style=\"width: 100%;font-weight: bold;\">{0}</td> "
|
||||
, "5、本月大型、特种设备投入情况:");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr style=\"height: 20px\">");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 16%;\" rowspan=\"2\">{0}</td> ", "单位名称");
|
||||
sb.AppendFormat("<td align=\"center\" colspan=\"6\">{0}</td> ", "特种设备");
|
||||
sb.AppendFormat("<td align=\"center\" colspan=\"4\">{0}</td> ", "大型机具设备");
|
||||
sb.AppendFormat("<td align=\"center\" >{0}</td> ", "特殊机具设备");
|
||||
sb.AppendFormat("<td align=\"center\" colspan=\"2\">{0}</td> ", "特殊机具设备");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\" rowspan=\"2\">{0}</td> ", "合计");
|
||||
sb.Append("</tr>");
|
||||
|
||||
sb.Append("<tr style=\"height: 20px\">");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "汽车吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "履带吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\" >{0}</td> ", "塔吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "门式起重机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "升降机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "叉车");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "挖掘机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "装载机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "拖板车");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "桩机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 7%;\">{0}</td> ", "吊篮");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "汽车吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "履带吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\" >{0}</td> ", "塔吊");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "门式起重机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "升降机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "叉车");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "挖掘机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "装载机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "拖板车");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "桩机");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "吊篮");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 6%;\">{0}</td> ", "高空作业升降平台");
|
||||
sb.Append("</tr>");
|
||||
var getMonthReport5 = from x in Funs.DB.SeDin_MonthReport5
|
||||
where x.MonthReportId == monthReportId
|
||||
@@ -1212,9 +1212,10 @@
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", item.D03);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", item.D04);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", item.S01);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", item.S02);
|
||||
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", (item.T01 ?? 0) + (item.T02 ?? 0) + (item.T03 ?? 0) + (item.T04 ?? 0) + (item.T05 ?? 0) + (item.T06 ?? 0)
|
||||
+ (item.D01 ?? 0) + (item.D02 ?? 0) + (item.D03 ?? 0) + (item.D04 ?? 0) + (item.S01 ?? 0));
|
||||
+ (item.D01 ?? 0) + (item.D02 ?? 0) + (item.D03 ?? 0) + (item.D04 ?? 0) + (item.S01 ?? 0) + (item.S02 ?? 0));
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
@@ -1231,6 +1232,7 @@
|
||||
int sumd03 = getMonthReport5.Sum(x => x.D03) ?? 0;
|
||||
int sumd04 = getMonthReport5.Sum(x => x.D04) ?? 0;
|
||||
int sums01 = getMonthReport5.Sum(x => x.S01) ?? 0;
|
||||
int sums02 = getMonthReport5.Sum(x => x.S02) ?? 0;
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumt01);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumt02);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumt03);
|
||||
@@ -1242,7 +1244,8 @@
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumd03);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumd04);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sums01);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumt02 + sumt03 + sumt01 + sumt05 + sumt06 + sumd01 + sumd02 + sumd03 + sumd04 + sums01);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sums02);
|
||||
sb.AppendFormat("<td align=\"left\">{0}</td> ", sumt01 + sumt02 + sumt03 + sumt04+ sumt05 + sumt06 + sumd01 + sumd02 + sumd03 + sumd04 + sums01+ sums02);
|
||||
sb.Append("</tr>");
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
namespace BLL
|
||||
{
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class Sys_CQMS_DataInTempService
|
||||
{ /// <summary>
|
||||
/// 根据主键获取导入临时表信息
|
||||
/// </summary>
|
||||
/// <param name="tempId">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Sys_CQMS_DataInTemp GetDataInTempByTempId(string tempId)
|
||||
{
|
||||
return Funs.DB.Sys_CQMS_DataInTemp.FirstOrDefault(x => x.TempId == tempId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加导入临时表记录
|
||||
/// </summary>
|
||||
/// <param name="dataInTemp">委托实体</param>
|
||||
public static void AddDataInTemp(Model.Sys_CQMS_DataInTemp dataInTemp)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp();
|
||||
newDataInTemp.TempId = dataInTemp.TempId;
|
||||
newDataInTemp.ProjectId = dataInTemp.ProjectId;
|
||||
newDataInTemp.UserId = dataInTemp.UserId;
|
||||
newDataInTemp.Time = dataInTemp.Time;
|
||||
newDataInTemp.RowNo = dataInTemp.RowNo;
|
||||
newDataInTemp.Type = dataInTemp.Type;
|
||||
newDataInTemp.Value1 = dataInTemp.Value1;
|
||||
newDataInTemp.Value2 = dataInTemp.Value2;
|
||||
newDataInTemp.Value3 = dataInTemp.Value3;
|
||||
newDataInTemp.Value4 = dataInTemp.Value4;
|
||||
newDataInTemp.Value5 = dataInTemp.Value5;
|
||||
newDataInTemp.Value6 = dataInTemp.Value6;
|
||||
newDataInTemp.Value7 = dataInTemp.Value7;
|
||||
newDataInTemp.Value8 = dataInTemp.Value8;
|
||||
newDataInTemp.Value9 = dataInTemp.Value9;
|
||||
newDataInTemp.Value10 = dataInTemp.Value10;
|
||||
newDataInTemp.Value11 = dataInTemp.Value11;
|
||||
newDataInTemp.Value12 = dataInTemp.Value12;
|
||||
newDataInTemp.Value13 = dataInTemp.Value13;
|
||||
newDataInTemp.Value14 = dataInTemp.Value14;
|
||||
newDataInTemp.Value15 = dataInTemp.Value15;
|
||||
newDataInTemp.Value16 = dataInTemp.Value16;
|
||||
newDataInTemp.Value17 = dataInTemp.Value17;
|
||||
newDataInTemp.Value18 = dataInTemp.Value18;
|
||||
newDataInTemp.Value19 = dataInTemp.Value19;
|
||||
newDataInTemp.Value20 = dataInTemp.Value20;
|
||||
|
||||
newDataInTemp.ToopValue = dataInTemp.ToopValue;
|
||||
db.Sys_CQMS_DataInTemp.InsertOnSubmit(newDataInTemp);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void AddDataInTemp(List<Model.Sys_CQMS_DataInTemp> dataInTemps)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
foreach (var dataInTemp in dataInTemps)
|
||||
{
|
||||
Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp();
|
||||
newDataInTemp.TempId = dataInTemp.TempId;
|
||||
newDataInTemp.ProjectId = dataInTemp.ProjectId;
|
||||
newDataInTemp.UserId = dataInTemp.UserId;
|
||||
newDataInTemp.Time = dataInTemp.Time;
|
||||
newDataInTemp.RowNo = dataInTemp.RowNo;
|
||||
newDataInTemp.Type = dataInTemp.Type;
|
||||
newDataInTemp.Value1 = dataInTemp.Value1;
|
||||
newDataInTemp.Value2 = dataInTemp.Value2;
|
||||
newDataInTemp.Value3 = dataInTemp.Value3;
|
||||
newDataInTemp.Value4 = dataInTemp.Value4;
|
||||
newDataInTemp.Value5 = dataInTemp.Value5;
|
||||
newDataInTemp.Value6 = dataInTemp.Value6;
|
||||
newDataInTemp.Value7 = dataInTemp.Value7;
|
||||
newDataInTemp.Value8 = dataInTemp.Value8;
|
||||
newDataInTemp.Value9 = dataInTemp.Value9;
|
||||
newDataInTemp.Value10 = dataInTemp.Value10;
|
||||
newDataInTemp.Value11 = dataInTemp.Value11;
|
||||
newDataInTemp.Value12 = dataInTemp.Value12;
|
||||
newDataInTemp.Value13 = dataInTemp.Value13;
|
||||
newDataInTemp.Value14 = dataInTemp.Value14;
|
||||
newDataInTemp.Value15 = dataInTemp.Value15;
|
||||
newDataInTemp.Value16 = dataInTemp.Value16;
|
||||
newDataInTemp.Value17 = dataInTemp.Value17;
|
||||
newDataInTemp.Value18 = dataInTemp.Value18;
|
||||
newDataInTemp.Value19 = dataInTemp.Value19;
|
||||
newDataInTemp.Value20 = dataInTemp.Value20;
|
||||
|
||||
newDataInTemp.ToopValue = dataInTemp.ToopValue;
|
||||
db.Sys_CQMS_DataInTemp.InsertOnSubmit(newDataInTemp);
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改导入临时表记录
|
||||
/// </summary>
|
||||
/// <param name="weldReport">焊接实体</param>
|
||||
public static void UpdateDataInTemp(Model.Sys_CQMS_DataInTemp dataInTemp)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Sys_CQMS_DataInTemp newDataInTemp = db.Sys_CQMS_DataInTemp.FirstOrDefault(e => e.TempId == dataInTemp.TempId);
|
||||
if (newDataInTemp != null)
|
||||
{
|
||||
newDataInTemp.UserId = dataInTemp.UserId;
|
||||
newDataInTemp.Time = dataInTemp.Time;
|
||||
newDataInTemp.Value1 = dataInTemp.Value1;
|
||||
newDataInTemp.Value2 = dataInTemp.Value2;
|
||||
newDataInTemp.Value3 = dataInTemp.Value3;
|
||||
newDataInTemp.Value4 = dataInTemp.Value4;
|
||||
newDataInTemp.Value5 = dataInTemp.Value5;
|
||||
newDataInTemp.Value6 = dataInTemp.Value6;
|
||||
newDataInTemp.Value7 = dataInTemp.Value7;
|
||||
newDataInTemp.Value8 = dataInTemp.Value8;
|
||||
newDataInTemp.Value9 = dataInTemp.Value9;
|
||||
newDataInTemp.Value10 = dataInTemp.Value10;
|
||||
newDataInTemp.Value11 = dataInTemp.Value11;
|
||||
newDataInTemp.Value12 = dataInTemp.Value12;
|
||||
newDataInTemp.Value13 = dataInTemp.Value13;
|
||||
newDataInTemp.Value14 = dataInTemp.Value14;
|
||||
newDataInTemp.Value15 = dataInTemp.Value15;
|
||||
newDataInTemp.Value16 = dataInTemp.Value16;
|
||||
newDataInTemp.Value17 = dataInTemp.Value17;
|
||||
newDataInTemp.Value18 = dataInTemp.Value18;
|
||||
newDataInTemp.Value19 = dataInTemp.Value19;
|
||||
newDataInTemp.Value20 = dataInTemp.Value20;
|
||||
newDataInTemp.ToopValue = dataInTemp.ToopValue;
|
||||
newDataInTemp.Type = dataInTemp.Type;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除导入临时表记录
|
||||
/// </summary>
|
||||
/// <param name="tempId">委托主键</param>
|
||||
public static void DeleteDataInTempByDataInTempID(string tempId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Sys_CQMS_DataInTemp dataInTemp = db.Sys_CQMS_DataInTemp.FirstOrDefault(e => e.TempId == tempId);
|
||||
if (dataInTemp != null)
|
||||
{
|
||||
db.Sys_CQMS_DataInTemp.DeleteOnSubmit(dataInTemp);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目用户主键删除导入临时表记录
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="userId"></param>
|
||||
public static void DeleteDataInTempByProjectIdUserId(string projectId, string userId, string type)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var dataInTemp = from x in db.Sys_CQMS_DataInTemp where x.ProjectId == projectId && x.UserId == userId && x.Type == type select x;
|
||||
if (dataInTemp.Count() > 0)
|
||||
{
|
||||
db.Sys_CQMS_DataInTemp.DeleteAllOnSubmit(dataInTemp);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public class WeatherService
|
||||
{
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取事故类型
|
||||
|
||||
+76
-77
@@ -1,5 +1,4 @@
|
||||
using Aspose.Words;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -242,7 +241,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void WordIntoPdf(string wordPath, string pdfPath)
|
||||
/* public static void WordIntoPdf(string wordPath, string pdfPath)
|
||||
{
|
||||
Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.Application();
|
||||
Microsoft.Office.Interop.Word.Document document = null;
|
||||
@@ -261,7 +260,7 @@ namespace BLL
|
||||
document.Close();
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
/// <summary>
|
||||
/// html代码转word
|
||||
/// </summary>
|
||||
@@ -281,7 +280,7 @@ namespace BLL
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
public static string WordToHtml(object wordFileName)
|
||||
/* public static string WordToHtml(object wordFileName)
|
||||
{
|
||||
//在此处放置用户代码以初始化页面
|
||||
Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
|
||||
@@ -340,91 +339,91 @@ namespace BLL
|
||||
//process.Start();
|
||||
}
|
||||
|
||||
#endregion
|
||||
public static string GetPathByDocToHTML(string strFile)
|
||||
{
|
||||
if (string.IsNullOrEmpty(strFile))
|
||||
{
|
||||
return "0";//没有文件
|
||||
}
|
||||
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application()
|
||||
{
|
||||
Visible = false,
|
||||
AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable
|
||||
};
|
||||
//Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
|
||||
// word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
|
||||
Type wordType = word.GetType();
|
||||
Microsoft.Office.Interop.Word.Documents docs = word.Documents;
|
||||
#endregion*/
|
||||
//public static string GetPathByDocToHTML(string strFile)
|
||||
//{
|
||||
// if (string.IsNullOrEmpty(strFile))
|
||||
// {
|
||||
// return "0";//没有文件
|
||||
// }
|
||||
// Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application()
|
||||
// {
|
||||
// Visible = false,
|
||||
// AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable
|
||||
// };
|
||||
// //Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
|
||||
// // word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
|
||||
// Type wordType = word.GetType();
|
||||
// Microsoft.Office.Interop.Word.Documents docs = word.Documents;
|
||||
|
||||
// 打开文件
|
||||
Type docsType = docs.GetType();
|
||||
// // 打开文件
|
||||
// Type docsType = docs.GetType();
|
||||
|
||||
object fileName = strFile;
|
||||
// object fileName = strFile;
|
||||
|
||||
Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
|
||||
System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });
|
||||
// Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
|
||||
// System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });
|
||||
|
||||
// 转换格式,另存为html
|
||||
Type docType = doc.GetType();
|
||||
//给文件重新起名
|
||||
string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
|
||||
System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();
|
||||
// // 转换格式,另存为html
|
||||
// Type docType = doc.GetType();
|
||||
// //给文件重新起名
|
||||
// string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
|
||||
// System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();
|
||||
|
||||
string strFileFolder = "/html/";
|
||||
DateTime dt = DateTime.Now;
|
||||
//以yyyymmdd形式生成子文件夹名
|
||||
string strFileSubFolder = dt.Year.ToString();
|
||||
strFileSubFolder += (dt.Month < 10) ? ("0" + dt.Month.ToString()) : dt.Month.ToString();
|
||||
strFileSubFolder += (dt.Day < 10) ? ("0" + dt.Day.ToString()) : dt.Day.ToString();
|
||||
string strFilePath = strFileFolder + strFileSubFolder + "/";
|
||||
// 判断指定目录下是否存在文件夹,如果不存在,则创建
|
||||
if (!Directory.Exists(strFilePath))
|
||||
{
|
||||
// 创建up文件夹
|
||||
Directory.CreateDirectory(strFilePath);
|
||||
}
|
||||
// string strFileFolder = "/html/";
|
||||
// DateTime dt = DateTime.Now;
|
||||
// //以yyyymmdd形式生成子文件夹名
|
||||
// string strFileSubFolder = dt.Year.ToString();
|
||||
// strFileSubFolder += (dt.Month < 10) ? ("0" + dt.Month.ToString()) : dt.Month.ToString();
|
||||
// strFileSubFolder += (dt.Day < 10) ? ("0" + dt.Day.ToString()) : dt.Day.ToString();
|
||||
// string strFilePath = strFileFolder + strFileSubFolder + "/";
|
||||
// // 判断指定目录下是否存在文件夹,如果不存在,则创建
|
||||
// if (!Directory.Exists(strFilePath))
|
||||
// {
|
||||
// // 创建up文件夹
|
||||
// Directory.CreateDirectory(strFilePath);
|
||||
// }
|
||||
|
||||
//被转换的html文档保存的位置
|
||||
// HttpContext.Current.Server.MapPath("html" + strFileSubFolder + filename + ".html")
|
||||
string ConfigPath = strFilePath + filename + ".html";
|
||||
object saveFileName = ConfigPath;
|
||||
// //被转换的html文档保存的位置
|
||||
// // HttpContext.Current.Server.MapPath("html" + strFileSubFolder + filename + ".html")
|
||||
// string ConfigPath = strFilePath + filename + ".html";
|
||||
// object saveFileName = ConfigPath;
|
||||
|
||||
/*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成:
|
||||
* docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
* null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
|
||||
* 其它格式:
|
||||
* wdFormatHTML
|
||||
* wdFormatDocument
|
||||
* wdFormatDOSText
|
||||
* wdFormatDOSTextLineBreaks
|
||||
* wdFormatEncodedText
|
||||
* wdFormatRTF
|
||||
* wdFormatTemplate
|
||||
* wdFormatText
|
||||
* wdFormatTextLineBreaks
|
||||
* wdFormatUnicodeText
|
||||
*/
|
||||
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });
|
||||
// /*下面是Microsoft Word 9 Object Library的写法,如果是10,可能写成:
|
||||
// * docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
// * null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
|
||||
// * 其它格式:
|
||||
// * wdFormatHTML
|
||||
// * wdFormatDocument
|
||||
// * wdFormatDOSText
|
||||
// * wdFormatDOSTextLineBreaks
|
||||
// * wdFormatEncodedText
|
||||
// * wdFormatRTF
|
||||
// * wdFormatTemplate
|
||||
// * wdFormatText
|
||||
// * wdFormatTextLineBreaks
|
||||
// * wdFormatUnicodeText
|
||||
// */
|
||||
// docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
// null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });
|
||||
|
||||
//docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
// null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });
|
||||
// //docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
|
||||
// // null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });
|
||||
|
||||
//关闭文档
|
||||
docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
|
||||
null, doc, new object[] { null, null, null });
|
||||
// //关闭文档
|
||||
// docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
|
||||
// null, doc, new object[] { null, null, null });
|
||||
|
||||
// 退出 Word
|
||||
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
|
||||
//转到新生成的页面
|
||||
//return ("/" + filename + ".html");
|
||||
// // 退出 Word
|
||||
// wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
|
||||
// //转到新生成的页面
|
||||
// //return ("/" + filename + ".html");
|
||||
|
||||
//转化HTML页面统一编码格式
|
||||
TransHTMLEncoding(ConfigPath);
|
||||
// //转化HTML页面统一编码格式
|
||||
// TransHTMLEncoding(ConfigPath);
|
||||
|
||||
return (strFilePath + filename + ".html");
|
||||
}
|
||||
// return (strFilePath + filename + ".html");
|
||||
//}
|
||||
public static void TransHTMLEncoding(string strFilePath)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user