2023-03-03 合同打印修改,在线编辑文档控件增加
This commit is contained in:
@@ -268,7 +268,7 @@ namespace BLL
|
||||
/// 合同评审、审批表
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
public static void Print(string ContractReviewId)
|
||||
public static Document Print(string ContractReviewId)
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
string initTemplatePath = string.Empty;
|
||||
@@ -281,7 +281,6 @@ namespace BLL
|
||||
{
|
||||
initTemplatePath = "File\\Word\\PHTGL\\合同评审、审批表Old.docx";
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -542,7 +541,7 @@ namespace BLL
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -576,17 +575,35 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
var table0 = docc.GetChildNodes(NodeType.Table, true)[0] as Aspose.Words.Tables.Table;
|
||||
|
||||
docc.Save(newUrl);
|
||||
Document doc1 = new Aspose.Words.Document(newUrl);
|
||||
File.Delete(newUrl);
|
||||
return doc1;
|
||||
}
|
||||
|
||||
public static void PrintFile( string ContractReviewId)
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId);
|
||||
|
||||
string newUrl = string.Empty;
|
||||
newUrl = rootPath + "File\\Word\\PHTGL\\合同评审、审批表.docx";
|
||||
newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx");
|
||||
if (File.Exists(newUrl))
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
var doc = Print(ContractReviewId);
|
||||
doc.Save(newUrl);
|
||||
|
||||
//生成PDF文件
|
||||
string pdfUrl = newUrl.Replace(".docx", ".pdf");
|
||||
BLL.AsposeWordHelper.WordIntoPdf(newUrl, pdfUrl);
|
||||
|
||||
//Document doc1 = new Aspose.Words.Document(newUrl);
|
||||
//if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
//doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
||||
string fileName = Path.GetFileName(filePath).Replace("合同评审", txtContractNum + "合同评审");
|
||||
Document doc1 = new Aspose.Words.Document(newUrl);
|
||||
//验证参数
|
||||
if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
||||
string fileName = Path.GetFileName(pdfUrl).Replace("合同评审", getFireWork.ContractNum + "合同评审");
|
||||
FileInfo info = new FileInfo(pdfUrl);
|
||||
long fileSize = info.Length;
|
||||
System.Web.HttpContext.Current.Response.Clear();
|
||||
@@ -598,6 +615,37 @@ namespace BLL
|
||||
System.Web.HttpContext.Current.Response.Close();
|
||||
File.Delete(newUrl);
|
||||
File.Delete(pdfUrl);
|
||||
|
||||
}
|
||||
|
||||
public static void PrintApprovalForm(string ContractReviewId)
|
||||
{
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId);
|
||||
switch (getFireWork.ConfirmWay)
|
||||
{
|
||||
case "1":
|
||||
break;
|
||||
case "2":
|
||||
break;
|
||||
case "3":
|
||||
break;
|
||||
case "4":
|
||||
break;
|
||||
case "5":
|
||||
break;
|
||||
case "6":
|
||||
break;
|
||||
}
|
||||
}
|
||||
public static void PrintApprovalFormType_Act()
|
||||
{
|
||||
}
|
||||
public static void PrintApprovalFormType_SetSub()
|
||||
{
|
||||
}
|
||||
public static void PrintApprovalFormType__Con()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 分包合同协议书
|
||||
@@ -969,8 +1017,6 @@ namespace BLL
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 附件
|
||||
public static Document sch1(string AttachUrlId, int schnumber)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user