提交代码

This commit is contained in:
高飞 2025-03-22 19:40:40 +08:00
parent c382b9f28c
commit 2aaca27161
1 changed files with 138 additions and 107 deletions

View File

@ -2972,140 +2972,153 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
#region 23. #region 23.
string imageUrl = "res/images/R-C.png"; string imageUrl = "res/images/R-C.png";
var imageUrl1 = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null)
if (!string.IsNullOrWhiteSpace(imageUrl1) && imageUrl1 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl1 = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl;
string url = rootPathUrl + imageUrl1; if (!string.IsNullOrWhiteSpace(imageUrl1) && imageUrl1 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl1");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl1;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl1, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl1");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl1, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null)
var imageUrl2 = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
if (!string.IsNullOrWhiteSpace(imageUrl2) && imageUrl2 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl2 = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
string url = rootPathUrl + imageUrl2; if (!string.IsNullOrWhiteSpace(imageUrl2) && imageUrl2 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl2");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl2;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl2, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl2");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl2, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null)
var imageUrl3 = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
if (!string.IsNullOrWhiteSpace(imageUrl3) && imageUrl3 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl3 = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
string url = rootPathUrl + imageUrl3; if (!string.IsNullOrWhiteSpace(imageUrl3) && imageUrl3 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl3");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl3;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl3, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl3");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl3, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null)
var imageUrl4 = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
if (!string.IsNullOrWhiteSpace(imageUrl4) && imageUrl4 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl4 = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
string url = rootPathUrl + imageUrl4; if (!string.IsNullOrWhiteSpace(imageUrl4) && imageUrl4 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl4");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl4;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl4, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl4");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl4, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null)
var imageUrl5 = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
if (!string.IsNullOrWhiteSpace(imageUrl5) && imageUrl5 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl5 = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
string url = rootPathUrl + imageUrl5; if (!string.IsNullOrWhiteSpace(imageUrl5) && imageUrl5 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl5");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl5;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl5, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl5");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl5, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null)
var imageUrl6 = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
if (!string.IsNullOrWhiteSpace(imageUrl6) && imageUrl6 != imageUrl)
{ {
string rootPathUrl = rootPath.Replace("\\", "/"); var imageUrl6 = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
string url = rootPathUrl + imageUrl6; if (!string.IsNullOrWhiteSpace(imageUrl6) && imageUrl6 != imageUrl)
//DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("ImageUrl6");
if (!string.IsNullOrEmpty(url))
{ {
System.Drawing.Size JpgSize; string rootPathUrl = rootPath.Replace("\\", "/");
float Wpx; string url = rootPathUrl + imageUrl6;
float Hpx; //DocumentBuilder builder = new DocumentBuilder(doc);
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl6, out JpgSize, out Wpx, out Hpx); builder.MoveToBookmark("ImageUrl6");
//double w = 1; if (!string.IsNullOrEmpty(url))
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{ {
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w); System.Drawing.Size JpgSize;
builder.InsertImage(url, 200, 150); float Wpx;
float Hpx;
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl6, out JpgSize, out Wpx, out Hpx);
//double w = 1;
//w = JpgSize.Width / 50.0;
if (File.Exists(url))
{
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
builder.InsertImage(url, 200, 150);
}
} }
} }
} }
@ -3113,37 +3126,55 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
bkmark = doc.Range.Bookmarks["ImageContent1"]; bkmark = doc.Range.Bookmarks["ImageContent1"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText;
}
} }
bkmark = doc.Range.Bookmarks["ImageContent2"]; bkmark = doc.Range.Bookmarks["ImageContent2"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText;
}
} }
bkmark = doc.Range.Bookmarks["ImageContent3"]; bkmark = doc.Range.Bookmarks["ImageContent3"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText;
}
} }
bkmark = doc.Range.Bookmarks["ImageContent4"]; bkmark = doc.Range.Bookmarks["ImageContent4"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText;
}
} }
bkmark = doc.Range.Bookmarks["ImageContent5"]; bkmark = doc.Range.Bookmarks["ImageContent5"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText;
}
} }
bkmark = doc.Range.Bookmarks["ImageContent6"]; bkmark = doc.Range.Bookmarks["ImageContent6"];
if (bkmark != null) if (bkmark != null)
{ {
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null)
{
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText;
}
} }
#endregion #endregion