This commit is contained in:
2024-02-27 18:13:26 +08:00
parent 7f67a750c8
commit 6106fb7d9c
33 changed files with 2769 additions and 1820 deletions
@@ -297,7 +297,16 @@ namespace FineUIPro.Web.HSSE.License
File.Copy(uploadfilepath, newUrl);
///更新书签
var getBreakGround = LicensePublicService.GetBreakGroundById(Id);
var projectName = ProjectService.GetProjectNameByProjectId(getBreakGround.ProjectId);
Document doc = new Aspose.Words.Document(newUrl);
Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"];//编号
if (bookmarkProjectName != null)
{
if (!string.IsNullOrEmpty(projectName))
{
bookmarkProjectName.Text = projectName;
}
}
Bookmark bookmarkLicenseCode = doc.Range.Bookmarks["LicenseCode"];//编号
if (bookmarkLicenseCode != null)
{
@@ -330,6 +339,19 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkWorkLeader = doc.Range.Bookmarks["WorkLeader"];//现场负责人
if (bookmarkWorkLeader != null)
{
if (getBreakGround != null)
{
var getUser = UserService.GetUserByUserId(getBreakGround.WorkLeaderId);
if (getUser != null)
{
bookmarkWorkLeader.Text = getUser.UserName;
}
}
}
Bookmark bookmarkUnitName = doc.Range.Bookmarks["UnitName"];//申请单位
if (bookmarkUnitName != null)
{
@@ -403,300 +425,85 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkOtherAttach = doc.Range.Bookmarks["OtherAttach"];//其他附件(危害识别等)
if (bookmarkOtherAttach != null && !string.IsNullOrEmpty(getBreakGround.OtherAttach))
{
bookmarkOtherAttach.Text = getBreakGround.OtherAttach;
}
Bookmark bookmarkDrawingDes = doc.Range.Bookmarks["DrawingDes"];//图纸说明
if (bookmarkDrawingDes != null && !string.IsNullOrEmpty(getBreakGround.DrawingDes))
{
bookmarkDrawingDes.Text = getBreakGround.DrawingDes;
}
Bookmark bookmarkHasSpecial1 = doc.Range.Bookmarks["HasSpecial1"];//分析数据
Bookmark bookmarkHasSpecial2 = doc.Range.Bookmarks["HasSpecial2"];//分析数据
if (!string.IsNullOrEmpty(getBreakGround.HasSpecialProgramme))
{
if (getBreakGround.HasSpecialProgramme == "是")
{
bookmarkHasSpecial1.Text = "■";
bookmarkHasSpecial2.Text = "□";
}
else
{
bookmarkHasSpecial1.Text = "□";
bookmarkHasSpecial2.Text = "■";
}
}
else
{
bookmarkHasSpecial2.Text = "□";
bookmarkHasSpecial1.Text = "□";
}
Bookmark bookmarkHasDrawing1 = doc.Range.Bookmarks["HasDrawing1"];//分析数据
Bookmark bookmarkHasDrawing2 = doc.Range.Bookmarks["HasDrawing2"];//分析数据
if (!string.IsNullOrEmpty(getBreakGround.HasDrawing))
{
if (getBreakGround.HasDrawing == "是")
{
bookmarkHasDrawing1.Text = "■";
bookmarkHasDrawing2.Text = "□";
}
else
{
bookmarkHasDrawing1.Text = "□";
bookmarkHasDrawing2.Text = "■";
}
}
else
{
bookmarkHasDrawing1.Text = "□";
bookmarkHasDrawing2.Text = "□";
}
var GetLicenseItemList = LicensePublicService.GetLicenseItemListByDataId(Id);
if (GetLicenseItemList.Count > 0)
{
var item1 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 1);
if (item1 != null)
{
if (item1.IsUsed == true)
{
Bookmark bookmarkUser1 = doc.Range.Bookmarks["User1"];//确认执行
if (bookmarkUser1 != null)
{
bookmarkUser1.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit1 = doc.Range.Bookmarks["IsFit1"];
if (bookmarkIsFit1 != null)
{
if (item1 != null)
{
bookmarkIsFit1.Text = "×";
}
}
}
}
var item2 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 2);
if (item2 != null)
{
if (item2.IsUsed == true)
{
Bookmark bookmarkUser2 = doc.Range.Bookmarks["User2"];//确认执行
if (bookmarkUser2 != null)
{
bookmarkUser2.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit2 = doc.Range.Bookmarks["IsFit2"];
if (bookmarkIsFit2 != null)
{
if (item2 != null)
{
bookmarkIsFit2.Text = "×";
}
}
}
}
var item3 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 3);
if (item3 != null)
{
if (item3.IsUsed == true)
{
Bookmark bookmarkUser3 = doc.Range.Bookmarks["User3"];//确认执行
if (bookmarkUser3 != null)
{
bookmarkUser3.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit3 = doc.Range.Bookmarks["IsFit3"];
if (bookmarkIsFit3 != null)
{
if (item3 != null)
{
bookmarkIsFit3.Text = "×";
}
}
}
}
var item4 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 4);
if (item4 != null)
{
if (item4.IsUsed == true)
{
Bookmark bookmarkUser4 = doc.Range.Bookmarks["User4"];//确认执行
if (bookmarkUser4 != null)
{
bookmarkUser4.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit4 = doc.Range.Bookmarks["IsFit4"];
if (bookmarkIsFit4 != null)
{
if (item4 != null)
{
bookmarkIsFit4.Text = "×";
}
}
}
}
var item5 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 5);
if (item5 != null)
{
if (item5.IsUsed == true)
{
Bookmark bookmarkUser5 = doc.Range.Bookmarks["User5"];//确认执行
if (bookmarkUser5 != null)
{
bookmarkUser5.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit5 = doc.Range.Bookmarks["IsFit5"];
if (bookmarkIsFit5 != null)
{
if (item5 != null)
{
bookmarkIsFit5.Text = "×";
}
}
}
}
var item6 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 6);
if (item6 != null)
{
if (item6.IsUsed == true)
{
Bookmark bookmarkUser6 = doc.Range.Bookmarks["User6"];//确认执行
if (bookmarkUser6 != null)
{
bookmarkUser6.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit6 = doc.Range.Bookmarks["IsFit6"];
if (bookmarkIsFit6 != null)
{
if (item6 != null)
{
bookmarkIsFit6.Text = "×";
}
}
}
}
var item7 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 7);
if (item7 != null)
{
if (item7.IsUsed == true)
{
Bookmark bookmarkUser7 = doc.Range.Bookmarks["User7"];//确认执行
if (bookmarkUser7 != null)
{
bookmarkUser7.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit7 = doc.Range.Bookmarks["IsFit7"];
if (bookmarkIsFit7 != null)
{
if (item7 != null)
{
bookmarkIsFit7.Text = "×";
}
}
}
}
var item8 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 8);
if (item8 != null)
{
if (item8.IsUsed == true)
{
Bookmark bookmarkUser8 = doc.Range.Bookmarks["User8"];//确认执行
if (bookmarkUser8 != null)
{
bookmarkUser8.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit8 = doc.Range.Bookmarks["IsFit8"];
if (bookmarkIsFit8 != null)
{
if (item8 != null)
{
bookmarkIsFit8.Text = "×";
}
}
}
}
var item9 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 9);
if (item9 != null)
{
if (item9.IsUsed == true)
{
Bookmark bookmarkUser9 = doc.Range.Bookmarks["User9"];//确认执行
if (bookmarkUser9 != null)
{
bookmarkUser9.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit9 = doc.Range.Bookmarks["IsFit9"];
if (bookmarkIsFit9 != null)
{
if (item9 != null)
{
bookmarkIsFit9.Text = "×";
}
}
}
}
var item10 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 10);
if (item10 != null)
{
if (item10.IsUsed == true)
{
Bookmark bookmarkUser10 = doc.Range.Bookmarks["User10"];//确认执行
if (bookmarkUser10 != null)
{
bookmarkUser10.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit10 = doc.Range.Bookmarks["IsFit10"];
if (bookmarkIsFit10 != null)
{
if (item10 != null)
{
bookmarkIsFit10.Text = "×";
}
}
}
}
var item11 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 11);
if (item11 != null)
{
if (item11.IsUsed == true)
{
Bookmark bookmarkUser11 = doc.Range.Bookmarks["User11"];//确认执行
if (bookmarkUser11 != null)
{
bookmarkUser11.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit11 = doc.Range.Bookmarks["IsFit11"];
if (bookmarkIsFit11 != null)
{
if (item11 != null)
{
bookmarkIsFit11.Text = "×";
}
}
}
}
var item12 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 12);
if (item12 != null)
{
if (item12.IsUsed == true)
{
Bookmark bookmarkUser12 = doc.Range.Bookmarks["User12"];//确认执行
if (bookmarkUser12 != null)
{
bookmarkUser12.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit12 = doc.Range.Bookmarks["IsFit12"];
if (bookmarkIsFit12 != null)
{
if (item12 != null)
{
bookmarkIsFit12.Text = "×";
}
}
}
}
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 1, "LicenseItemList1");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 2, "LicenseItemList2");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 3, "LicenseItemList3");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 4, "LicenseItemList4");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 5, "LicenseItemList5");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 6, "LicenseItemList6");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 7, "LicenseItemList7");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 8, "LicenseItemList8");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 9, "LicenseItemList9");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 10, "LicenseItemList10");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 11, "LicenseItemList11");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 12, "LicenseItemList12");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 13, "LicenseItemList13");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 14, "LicenseItemList14");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 15, "LicenseItemList15");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 16, "LicenseItemList16");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 17, "LicenseItemList17");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 18, "LicenseItemList18");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 19, "LicenseItemList19");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 20, "LicenseItemList20");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 21, "LicenseItemList21");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 22, "LicenseItemList22");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 23, "LicenseItemList23");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 24, "LicenseItemList24");
}
//审核记录
var getFlows = LicensePublicService.GetFlowOperateListByDataId(Id);
@@ -1121,6 +928,31 @@ namespace FineUIPro.Web.HSSE.License
File.Delete(newUrl);
File.Delete(pdfUrl);
}
private void bookmarLicense_LicenseItem(Document doc, List<Model.License_LicenseItem> list, int index, string LicenseItem)
{
var item1 = list.FirstOrDefault(x => x.SortIndex == index);
if (item1 != null)
{
Bookmark bookmarkUser1 = doc.Range.Bookmarks[LicenseItem];//确认执行
if (item1.IsUsed == true)
{
if (bookmarkUser1 != null)
{
bookmarkUser1.Text = "■" + item1.SafetyMeasures;
}
}
else
{
if (bookmarkUser1 != null)
{
bookmarkUser1.Text = "□" + item1.SafetyMeasures;
}
}
}
}
#endregion
}
}