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
@@ -299,7 +299,16 @@ namespace FineUIPro.Web.HSSE.License
File.Copy(uploadfilepath, newUrl);
///更新书签
var getTempElectricity = LicensePublicService.GetTempElectricityById(Id);
var projectName = ProjectService.GetProjectNameByProjectId(getTempElectricity.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)
{
@@ -308,29 +317,20 @@ namespace FineUIPro.Web.HSSE.License
bookmarkLicenseCode.Text = getTempElectricity.LicenseCode;
}
}
Bookmark bookmarkApplyManName = doc.Range.Bookmarks["ApplyManName"];//申请
Bookmark bookmarkApplyManName1= doc.Range.Bookmarks["ApplyManName1"];//申请人
Bookmark bookmarkApplyManPhone = doc.Range.Bookmarks["ApplyManPhone"];//申请人
if (bookmarkApplyManName != null)
Bookmark bookmarkWorkLeader = doc.Range.Bookmarks["WorkLeader"];//现场负责
if (bookmarkWorkLeader != null)
{
if (getTempElectricity != null)
{
var getUser = UserService.GetUserByUserId(getTempElectricity.ApplyManId);
var getUser = UserService.GetUserByUserId(getTempElectricity.WorkLeaderId);
if (getUser != null)
{
bookmarkApplyManName.Text = getUser.UserName;
if (bookmarkApplyManName1 != null)
{
bookmarkApplyManName1.Text = getUser.UserName;
}
if (bookmarkApplyManPhone != null)
{
bookmarkApplyManPhone.Text = getUser.Telephone;
}
bookmarkWorkLeader.Text = getUser.UserName;
}
}
}
Bookmark bookmarkUnitName = doc.Range.Bookmarks["UnitName"];//申请单位
if (bookmarkUnitName != null)
{
@@ -343,28 +343,71 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkWorkPalce = doc.Range.Bookmarks["WorkPalce"];//作业地点
Bookmark bookmarkUseTo = doc.Range.Bookmarks["UseTo"];//用电用途
if (bookmarkUseTo != null)
{
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.UseTo))
{
bookmarkUseTo.Text = getTempElectricity.UseTo;
}
}
Bookmark bookmarkWorkPalce = doc.Range.Bookmarks["WorkPalce"];//用电地点
if (bookmarkWorkPalce != null)
{
if (getTempElectricity != null)
if (getTempElectricity != null &&!string.IsNullOrEmpty(getTempElectricity.WorkPalce))
{
bookmarkWorkPalce.Text = getTempElectricity.WorkPalce;
}
}
Bookmark bookmarkElectrician = doc.Range.Bookmarks["Electrician"];//监火人员
Bookmark bookmarkAccessPoint = doc.Range.Bookmarks["AccessPoint"];//接入点名称
if (bookmarkAccessPoint != null)
{
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.AccessPoint))
{
bookmarkAccessPoint.Text = getTempElectricity.AccessPoint;
}
}
Bookmark bookmarkAccessPointNo = doc.Range.Bookmarks["AccessPointNo"];//接入点编号
if (bookmarkAccessPointNo != null)
{
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.AccessPointNo))
{
bookmarkAccessPointNo.Text = getTempElectricity.AccessPointNo;
}
}
Bookmark bookmarkAccessPointAddress = doc.Range.Bookmarks["AccessPointAddress"];//接入点位置
if (bookmarkAccessPointAddress != null)
{
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.AccessPointAddress))
{
bookmarkAccessPointAddress.Text = getTempElectricity.AccessPointAddress;
}
}
Bookmark bookmarkWorkingVoltage = doc.Range.Bookmarks["WorkingVoltage"];//接入点位置
if (bookmarkWorkingVoltage != null)
{
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.WorkingVoltage))
{
bookmarkWorkingVoltage.Text = getTempElectricity.WorkingVoltage;
}
}
Bookmark bookmarkElectrician = doc.Range.Bookmarks["Electrician"];// 电气专业人员 姓名及手机号
if (bookmarkElectrician != null)
{
if (getTempElectricity != null)
{
var getUser = UserService.GetUserByUserId(getTempElectricity.Electrician);
if (getUser != null)
{
bookmarkElectrician.Text = getUser.UserName;
}
bookmarkElectrician.Text = getTempElectricity.Electrician + "\n" + getTempElectricity.ElectricianPhone;
}
}
Bookmark bookmarkWatchManName = doc.Range.Bookmarks["WatchManName"];//监火人员
if (bookmarkWatchManName != null)
{
@@ -391,15 +434,22 @@ namespace FineUIPro.Web.HSSE.License
if (getTempElectricity.ValidityStartTime.HasValue)
{
bookmarkValidityDate.Text = getTempElectricity.ValidityStartTime.Value.Year + "年" + getTempElectricity.ValidityStartTime.Value.Month + "月" + getTempElectricity.ValidityStartTime.Value.Day + "日" + getTempElectricity.ValidityStartTime.Value.Hour + "时至";
bookmarkValidityDate.Text = getTempElectricity.ValidityStartTime.Value.Year + "年" + getTempElectricity.ValidityStartTime.Value.Month + "月" + getTempElectricity.ValidityStartTime.Value.Day + "日" + getTempElectricity.ValidityStartTime.Value.Hour + "时"+ getTempElectricity.ValidityStartTime.Value.Minute + "分至";
if (getTempElectricity.ValidityEndTime.HasValue)
{
bookmarkValidityDate.Text += getTempElectricity.ValidityEndTime.Value.Year + "年" + getTempElectricity.ValidityEndTime.Value.Month + "月" + getTempElectricity.ValidityEndTime.Value.Day + "日" + getTempElectricity.ValidityEndTime.Value.Hour + "时";
bookmarkValidityDate.Text += getTempElectricity.ValidityEndTime.Value.Year + "年" + getTempElectricity.ValidityEndTime.Value.Month + "月" + getTempElectricity.ValidityEndTime.Value.Day + "日" + getTempElectricity.ValidityEndTime.Value.Hour + "时" + getTempElectricity.ValidityEndTime.Value.Minute + "分";
}
}
}
}
Bookmark bookmarkTools = doc.Range.Bookmarks["Tools"];//监火人员
Bookmark bookmarkOtherAttach = doc.Range.Bookmarks["OtherAttach"];//
if (bookmarkOtherAttach != null && !string.IsNullOrEmpty(getTempElectricity.OtherAttach))
{
bookmarkOtherAttach.Text = getTempElectricity.OtherAttach;
}
Bookmark bookmarkTools = doc.Range.Bookmarks["Tools"];//
if (bookmarkTools != null)
{
if (getTempElectricity != null&&!string.IsNullOrEmpty(getTempElectricity.Tools))
@@ -411,253 +461,90 @@ namespace FineUIPro.Web.HSSE.License
Bookmark bookmarkWorkMeasures = doc.Range.Bookmarks["WorkMeasures"];//作业内容
if (bookmarkWorkMeasures != null)
{
if (getTempElectricity != null)
if (getTempElectricity != null && !string.IsNullOrEmpty(getTempElectricity.WorkMeasures))
{
bookmarkWorkMeasures.Text = getTempElectricity.WorkMeasures;
}
}
Bookmark bookmarkEquipmentLoadDes = doc.Range.Bookmarks["EquipmentLoadDes"];//作业内容
if (bookmarkEquipmentLoadDes != null)
{
if (getTempElectricity != null&&!string.IsNullOrEmpty(getTempElectricity.EquipmentLoadDes))
{
bookmarkEquipmentLoadDes.Text = getTempElectricity.EquipmentLoadDes;
}
}
Bookmark bookmarkHasSpecial1 = doc.Range.Bookmarks["HasSpecial1"];//
Bookmark bookmarkHasSpecial2 = doc.Range.Bookmarks["HasSpecial2"];//
if (!string.IsNullOrEmpty(getTempElectricity.HasSpecialProgramme))
{
if (getTempElectricity.HasSpecialProgramme == "是")
{
bookmarkHasSpecial1.Text = "■";
bookmarkHasSpecial2.Text = "□";
}
else
{
bookmarkHasSpecial1.Text = "□";
bookmarkHasSpecial2.Text = "■";
}
}
else
{
bookmarkHasSpecial2.Text = "□";
bookmarkHasSpecial1.Text = "□";
}
Bookmark bookmarkEquipmentLoadList1 = doc.Range.Bookmarks["EquipmentLoadList1"];//
Bookmark bookmarkEquipmentLoadList2 = doc.Range.Bookmarks["EquipmentLoadList2"];//
if (!string.IsNullOrEmpty(getTempElectricity.EquipmentLoadList))
{
if (getTempElectricity.EquipmentLoadList == "是")
{
bookmarkEquipmentLoadList1.Text = "■";
bookmarkEquipmentLoadList2.Text = "□";
}
else
{
bookmarkEquipmentLoadList1.Text = "□";
bookmarkEquipmentLoadList2.Text = "■";
}
}
else
{
bookmarkEquipmentLoadList1.Text = "□";
bookmarkEquipmentLoadList2.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 = "×";
}
}
}
}
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");
bookmarLicense_LicenseItem(doc, GetLicenseItemList, 25, "LicenseItemList25");
}
//审核记录
@@ -904,6 +791,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
}
}