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
@@ -300,6 +300,8 @@ namespace FineUIPro.Web.HSSE.License
File.Copy(uploadfilepath, newUrl);
///更新书签
var getLiftingWork = LicensePublicService.GetLiftingWorkById(Id);
var projectName = ProjectService.GetProjectNameByProjectId(getLiftingWork.ProjectId);
Document doc = new Aspose.Words.Document(newUrl);
Bookmark bookmarkLicenseCode = doc.Range.Bookmarks["LicenseCode"];//编号
if (bookmarkLicenseCode != null)
@@ -309,6 +311,27 @@ namespace FineUIPro.Web.HSSE.License
bookmarkLicenseCode.Text = getLiftingWork.LicenseCode;
}
}
Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"];//编号
if (bookmarkProjectName != null)
{
if (!string.IsNullOrEmpty(projectName))
{
bookmarkProjectName.Text = projectName;
}
}
Bookmark bookmarkWorkLeader = doc.Range.Bookmarks["WorkLeader"];//现场负责人
if (bookmarkWorkLeader != null)
{
if (getLiftingWork != null)
{
var getUser = UserService.GetUserByUserId(getLiftingWork.WorkLeaderId);
if (getUser != null)
{
bookmarkWorkLeader.Text = getUser.UserName;
}
}
}
Bookmark bookmarkApplyManName = doc.Range.Bookmarks["ApplyManName"];//申请人
Bookmark bookmarkApplyManName1 = doc.Range.Bookmarks["ApplyManName1"];//申请人
Bookmark bookmarkApplyManPhone = doc.Range.Bookmarks["ApplyManPhone"];//申请人
@@ -416,10 +439,10 @@ namespace FineUIPro.Web.HSSE.License
if (getLiftingWork.ValidityStartTime.HasValue)
{
bookmarkValidityDate.Text = getLiftingWork.ValidityStartTime.Value.Year + "年" + getLiftingWork.ValidityStartTime.Value.Month + "月" + getLiftingWork.ValidityStartTime.Value.Day + "日" + getLiftingWork.ValidityStartTime.Value.Hour + "时至";
bookmarkValidityDate.Text = getLiftingWork.ValidityStartTime.Value.Year + "年" + getLiftingWork.ValidityStartTime.Value.Month + "月" + getLiftingWork.ValidityStartTime.Value.Day + "日" + getLiftingWork.ValidityStartTime.Value.Hour + "时" + getLiftingWork.ValidityStartTime.Value.Minute + "分至";
if (getLiftingWork.ValidityEndTime.HasValue)
{
bookmarkValidityDate.Text += getLiftingWork.ValidityEndTime.Value.Year + "年" + getLiftingWork.ValidityEndTime.Value.Month + "月" + getLiftingWork.ValidityEndTime.Value.Day + "日" + getLiftingWork.ValidityEndTime.Value.Hour + "时";
bookmarkValidityDate.Text += getLiftingWork.ValidityEndTime.Value.Year + "年" + getLiftingWork.ValidityEndTime.Value.Month + "月" + getLiftingWork.ValidityEndTime.Value.Day + "日" + getLiftingWork.ValidityEndTime.Value.Hour + "时" + getLiftingWork.ValidityEndTime.Value.Minute + "分";
}
}
}
@@ -442,363 +465,92 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkCapacityDes = doc.Range.Bookmarks["CapacityDes"];//规格
if (bookmarkCapacityDes != null)
{
if (getLiftingWork != null)
{
bookmarkCapacityDes.Text = getLiftingWork.CapacityDes;
}
}
Bookmark bookmarkOtherAttach = doc.Range.Bookmarks["OtherAttach"];//规格
if (bookmarkOtherAttach != null)
{
if (getLiftingWork != null)
{
bookmarkOtherAttach.Text = getLiftingWork.OtherAttach;
}
}
Bookmark bookmarkHasSpecial1 = doc.Range.Bookmarks["HasSpecial1"];//分析数据
Bookmark bookmarkHasSpecial2 = doc.Range.Bookmarks["HasSpecial2"];//分析数据
if (!string.IsNullOrEmpty(getLiftingWork.HasSpecialProgramme))
{
if (getLiftingWork.HasSpecialProgramme == "是")
{
bookmarkHasSpecial1.Text = "■";
bookmarkHasSpecial2.Text = "□";
}
else
{
bookmarkHasSpecial1.Text = "□";
bookmarkHasSpecial2.Text = "■";
}
}
else
{
bookmarkHasSpecial2.Text = "□";
bookmarkHasSpecial1.Text = "□";
}
Bookmark bookmarkWorkLevel = doc.Range.Bookmarks["WorkLevel"];//分析数据
if (!string.IsNullOrEmpty(getLiftingWork.WorkLevel))
{
if (getLiftingWork.WorkLevel == "m 100t(一级)")
{
bookmarkWorkLevel.Text = "■ m 100t(一级) □ 40t ≤ m ≤100t(二级) □ m 40t(三级)";
}
else if(getLiftingWork.WorkLevel == "40t ≤ m ≤100t(二级)")
{
bookmarkWorkLevel.Text = "□ m 100t(一级) ■ 40t ≤ m ≤100t(二级) □ m 40t(三级)";
} else if (getLiftingWork.WorkLevel == "m 40t(三级)")
{
bookmarkWorkLevel.Text = "□ m 100t(一级) □40t ≤ m ≤100t(二级) ■ m 40t(三级)";
}
else
{
bookmarkWorkLevel.Text = "□ m 100t(一级) □40t ≤ m ≤100t(二级) □ m 40t(三级)";
}
}
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 = "×";
}
}
}
}
var item13 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 13);
if (item13 != null)
{
if (item13.IsUsed == true)
{
Bookmark bookmarkUser13 = doc.Range.Bookmarks["User13"];//确认执行
if (bookmarkUser13 != null)
{
bookmarkUser13.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit13 = doc.Range.Bookmarks["IsFit13"];
if (bookmarkIsFit13 != null)
{
if (item13 != null)
{
bookmarkIsFit13.Text = "×";
}
}
}
}
var item14 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 14);
if (item14 != null)
{
if (item14.IsUsed == true)
{
Bookmark bookmarkUser14 = doc.Range.Bookmarks["User14"];//确认执行
if (bookmarkUser14 != null)
{
bookmarkUser14.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit14 = doc.Range.Bookmarks["IsFit14"];
if (bookmarkIsFit14 != null)
{
if (item14 != null)
{
bookmarkIsFit14.Text = "×";
}
}
}
}
var item15 = GetLicenseItemList.FirstOrDefault(x => x.SortIndex == 15);
if (item15 != null)
{
if (item15.IsUsed == true)
{
Bookmark bookmarkUser15 = doc.Range.Bookmarks["User15"];//确认执行
if (bookmarkUser15 != null)
{
bookmarkUser15.Text = "√";
}
}
else
{
Bookmark bookmarkIsFit15 = doc.Range.Bookmarks["IsFit15"];
if (bookmarkIsFit15 != null)
{
if (item15 != null)
{
bookmarkIsFit15.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");
}
//审核记录
var getFlows = LicensePublicService.GetFlowOperateListByDataId(Id);
@@ -960,59 +712,59 @@ namespace FineUIPro.Web.HSSE.License
}
}
}
//var getF4 = getFlows.FirstOrDefault(x => x.SortIndex == 4);
//if (getF4 != null)
//{
// var getUser = UserService.GetUserByUserId(getF4.OperaterId);
// Bookmark bookmarkOpinion4 = doc.Range.Bookmarks["Opinion4"];
// if (bookmarkOpinion4 != null)
// {
var getF4 = getFlows.FirstOrDefault(x => x.SortIndex == 4);
if (getF4 != null)
{
var getUser = UserService.GetUserByUserId(getF4.OperaterId);
Bookmark bookmarkOpinion4 = doc.Range.Bookmarks["Opinion4"];
if (bookmarkOpinion4 != null)
{
// if (getUser != null)
// {
// if (getF4.IsAgree == true)
// {
// bookmarkOpinion4.Text = getF4.Opinion;
// }
// else
// {
// bookmarkOpinion4.Text = "不同意: " + getF4.Opinion;
// }
// }
if (getUser != null)
{
if (getF4.IsAgree == true)
{
bookmarkOpinion4.Text = getF4.Opinion;
}
else
{
bookmarkOpinion4.Text = "不同意: " + getF4.Opinion;
}
}
// }
// Bookmark bookmarkOperaterMan4 = doc.Range.Bookmarks["OperaterMan4"];
// if (bookmarkOperaterMan4 != null)
// {
// if (getF4.OperaterTime.HasValue)
// {
// if (getUser != null)
// {
// DocumentBuilder builders = new DocumentBuilder(doc);
// if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
// {
// var file = rootPath + getUser.SignatureUrl;
// builders.MoveToBookmark("OperaterMan4");
// builders.InsertImage(file, 80, 20);
// }
// else
// {
// bookmarkOperaterMan4.Text = getUser.UserName;
// }
// }
// }
// }
// Bookmark bookmarkOperaterTime4 = doc.Range.Bookmarks["OperaterTime4"];
// if (bookmarkOperaterTime4 != null)
// {
// if (getF4.OperaterTime.HasValue)
// {
// bookmarkOperaterTime4.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF4.OperaterTime);
// }
// }
//}
}
Bookmark bookmarkOperaterMan4 = doc.Range.Bookmarks["OperaterMan4"];
if (bookmarkOperaterMan4 != null)
{
if (getF4.OperaterTime.HasValue)
{
if (getUser != null)
{
DocumentBuilder builders = new DocumentBuilder(doc);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
{
var file = rootPath + getUser.SignatureUrl;
builders.MoveToBookmark("OperaterMan4");
builders.InsertImage(file, 80, 20);
}
else
{
bookmarkOperaterMan4.Text = getUser.UserName;
}
}
}
}
Bookmark bookmarkOperaterTime4 = doc.Range.Bookmarks["OperaterTime4"];
if (bookmarkOperaterTime4 != null)
{
if (getF4.OperaterTime.HasValue)
{
bookmarkOperaterTime4.Text = string.Format("{0:yyyyMMdd HH:mm}", getF4.OperaterTime);
}
}
}
//var getF5 = getFlows.FirstOrDefault(x => x.SortIndex == 5);
//if (getF5 != null)
//{
@@ -1200,6 +952,30 @@ 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
}
}