合并天辰 作业票

This commit is contained in:
2023-06-10 12:00:41 +08:00
parent 1836f816cf
commit c4bcf04d74
72 changed files with 16423 additions and 2139 deletions
@@ -74,7 +74,7 @@ namespace FineUIPro.Web.HSSE.License
/// </summary>
private void BindGrid()
{
string strSql = "SELECT license.BreakGroundId,license.ProjectId,license.LicenseCode,license.ApplyUnitId,ApplyUnit.UnitName AS ApplyUnitName,license.ApplyManId,license.ApplyDate,license.WorkPalce,license.ValidityStartTime,license.ValidityEndTime,license.WorkMeasures,license.WorkDepth,license.States"
string strSql = "SELECT license.BreakGroundId,license.ProjectId,license.LicenseCode,license.ApplyUnitId,ApplyUnit.UnitName AS ApplyUnitName,license.ApplyManId,license.ApplyDate,license.WorkPalce,license.ValidityStartTime,license.ValidityEndTime,license.WorkMeasures,license.WorkDepth,license.RealWorkDepth,license.States"
+ @" ,(CASE WHEN license.States=-2 THEN '作废' WHEN license.States=0 THEN '待提交' WHEN license.States=1 THEN '审核中' WHEN license.States=2 THEN '作业中' WHEN license.States=3 THEN '已完成' WHEN license.States=-1 THEN '已取消' ELSE '未知' END) AS StatesName "
+ @" FROM dbo.License_BreakGround AS license "
+ @" LEFT JOIN Base_Unit AS ApplyUnit ON license.ApplyUnitId =ApplyUnit.UnitId"
@@ -291,8 +291,9 @@ namespace FineUIPro.Web.HSSE.License
string filePath = string.Empty;
initTemplatePath = "File\\Word\\HSSE\\动土作业票.doc";
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
string docfilename = Funs.GetNewFileName();
newUrl = uploadfilepath.Replace(".doc", docfilename + ".doc");
filePath = initTemplatePath.Replace(".doc", docfilename + ".pdf");
File.Copy(uploadfilepath, newUrl);
///更新书签
var getBreakGround = LicensePublicService.GetBreakGroundById(Id);
@@ -306,6 +307,8 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkApplyManName = doc.Range.Bookmarks["ApplyManName"];//申请人
Bookmark bookmarkApplyManName1 = doc.Range.Bookmarks["ApplyManName1"];//申请人
Bookmark bookmarkApplyManPhone = doc.Range.Bookmarks["ApplyManPhone"];//申请人
if (bookmarkApplyManName != null)
{
if (getBreakGround != null)
@@ -314,6 +317,14 @@ namespace FineUIPro.Web.HSSE.License
if (getUser != null)
{
bookmarkApplyManName.Text = getUser.UserName;
if (bookmarkApplyManName1 != null)
{
bookmarkApplyManName1.Text = getUser.UserName;
}
if (bookmarkApplyManPhone != null)
{
bookmarkApplyManPhone.Text = getUser.Telephone;
}
}
@@ -334,18 +345,36 @@ namespace FineUIPro.Web.HSSE.License
Bookmark bookmarkWorkPalce = doc.Range.Bookmarks["WorkPalce"];//作业地点
if (bookmarkWorkPalce != null)
{
if (getBreakGround != null)
if (getBreakGround != null && !string.IsNullOrEmpty(getBreakGround.WorkPalce))
{
bookmarkWorkPalce.Text = getBreakGround.WorkPalce;
}
}
Bookmark bookmarkWorkDepth = doc.Range.Bookmarks["WorkDepth"];//开挖深度
if (bookmarkWorkDepth != null)
Bookmark bookmarkFireWatchManName = doc.Range.Bookmarks["FireWatchManName"];//
if (bookmarkFireWatchManName != null)
{
if (getBreakGround != null)
if (getBreakGround != null&&!string.IsNullOrEmpty(getBreakGround.WatchMan))
{
bookmarkWorkDepth.Text = getBreakGround.WorkDepth;
bookmarkFireWatchManName.Text = getBreakGround.WatchMan;
}
}
Bookmark bookmarkWorkMan = doc.Range.Bookmarks["WorkMan"];//开挖深度
if (bookmarkWorkMan != null)
{
if (getBreakGround != null && !string.IsNullOrEmpty(getBreakGround.WorkMan))
{
bookmarkWorkMan.Text = getBreakGround.WorkMan;
}
}
Bookmark bookmarkIdNum = doc.Range.Bookmarks["IdNum"];//开挖深度
if (bookmarkIdNum != null)
{
if (getBreakGround != null && !string.IsNullOrEmpty(getBreakGround.IdNum))
{
bookmarkIdNum.Text = getBreakGround.IdNum;
}
}
@@ -676,106 +705,104 @@ namespace FineUIPro.Web.HSSE.License
var getF1 = getFlows.FirstOrDefault(x => x.SortIndex == 1);
if (getF1 != null)
{
var getUser = UserService.GetUserByUserId(getF1.OperaterId);
Bookmark bookmarkOpinion1 = doc.Range.Bookmarks["Opinion1"];
if (bookmarkOpinion1 != null)
{
if (getUser != null)
if (getF1.IsAgree == true)
{
if (getF1.IsAgree == true)
if (!string.IsNullOrEmpty(getF1.Opinion))
{
bookmarkOpinion1.Text = getF1.Opinion;
}
else
{
bookmarkOpinion1.Text = "同意: " + getF1.Opinion;
bookmarkOpinion1.Text = "同意。";
}
}
}
Bookmark bookmarkOperaterMan1 = doc.Range.Bookmarks["OperaterMan1"];
if (bookmarkOperaterMan1 != null)
{
if (getF1.OperaterTime.HasValue)
else
{
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("OperaterMan1");
builders.InsertImage(file, 80, 20);
}
else
{
bookmarkOperaterMan1.Text = getUser.UserName;
}
}
bookmarkOpinion1.Text = "不同意: " + getF1.Opinion;
}
}
if (!string.IsNullOrEmpty(getF1.SignatureUrl) && File.Exists(rootPath + getF1.SignatureUrl))
{
DocumentBuilder builders = new DocumentBuilder(doc);
var file = rootPath + getF1.SignatureUrl;
builders.MoveToBookmark("OperaterMan1");
builders.InsertImage(file, 80, 20);
}
else
{
var getUser = UserService.GetUserByUserId(getF1.OperaterId);
if (getUser != null)
{
Bookmark bookmarkOperaterMan1 = doc.Range.Bookmarks["OperaterMan1"];
if (bookmarkOperaterMan1 != null && getF1.OperaterTime.HasValue)
{
bookmarkOperaterMan1.Text = getUser.UserName;
}
}
}
Bookmark bookmarkOperaterTime1 = doc.Range.Bookmarks["OperaterTime1"];
if (bookmarkOperaterTime1 != null)
{
if (getF1.OperaterTime.HasValue)
{
bookmarkOperaterTime1.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF1.OperaterTime);
bookmarkOperaterTime1.Text = string.Format("{0:yyyyMMdd HH:mm}", getF1.OperaterTime);
}
}
}
var getF2 = getFlows.FirstOrDefault(x => x.SortIndex == 2);
if (getF2 != null)
{
var getUser = UserService.GetUserByUserId(getF2.OperaterId);
Bookmark bookmarkOpinion2 = doc.Range.Bookmarks["Opinion2"];
if (bookmarkOpinion2 != null)
{
if (getUser != null)
if (getF2.IsAgree == true)
{
if (getF2.IsAgree == true)
if (!string.IsNullOrEmpty(getF2.Opinion))
{
bookmarkOpinion2.Text = getF2.Opinion;
}
else
{
bookmarkOpinion2.Text = "同意: " + getF2.Opinion;
bookmarkOpinion2.Text = "同意。";
}
}
}
Bookmark bookmarkOperaterMan2 = doc.Range.Bookmarks["OperaterMan2"];
if (bookmarkOperaterMan2 != null)
{
if (getF2.OperaterTime.HasValue)
else
{
if (getUser != null)
bookmarkOpinion2.Text = "不同意: " + getF2.Opinion;
}
}
if (!string.IsNullOrEmpty(getF2.SignatureUrl) && File.Exists(rootPath + getF2.SignatureUrl))
{
DocumentBuilder builders = new DocumentBuilder(doc);
var file = rootPath + getF2.SignatureUrl;
builders.MoveToBookmark("OperaterMan2");
builders.InsertImage(file, 80, 20);
}
else
{
var getUser = UserService.GetUserByUserId(getF2.OperaterId);
if (getUser != null)
{
Bookmark bookmarkOperaterMan2 = doc.Range.Bookmarks["OperaterMan2"];
if (bookmarkOperaterMan2 != null&& getF2.OperaterTime.HasValue)
{
DocumentBuilder builders = new DocumentBuilder(doc);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
{
var file = rootPath + getUser.SignatureUrl;
builders.MoveToBookmark("OperaterMan2");
builders.InsertImage(file, 80, 20);
}
else
{
bookmarkOperaterMan2.Text = getUser.UserName;
}
bookmarkOperaterMan2.Text = getUser.UserName;
}
}
}
Bookmark bookmarkOperaterTime2 = doc.Range.Bookmarks["OperaterTime2"];
if (bookmarkOperaterTime2 != null)
{
if (getF2.OperaterTime.HasValue)
{
bookmarkOperaterTime2.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF2.OperaterTime);
bookmarkOperaterTime2.Text = string.Format("{0:yyyyMMdd HH:mm}", getF2.OperaterTime);
}
}
}
@@ -785,50 +812,51 @@ namespace FineUIPro.Web.HSSE.License
var getUser = UserService.GetUserByUserId(getF3.OperaterId);
Bookmark bookmarkOpinion3 = doc.Range.Bookmarks["Opinion3"];
if (bookmarkOpinion3 != null)
{
{
if (getUser != null)
{
if (getF3.IsAgree == true)
{
bookmarkOpinion3.Text = getF3.Opinion;
if (!string.IsNullOrEmpty(getF3.Opinion))
{
bookmarkOpinion3.Text = getF1.Opinion;
}
else
{
bookmarkOpinion3.Text = "同意。";
}
}
else
{
bookmarkOpinion3.Text = "不同意: " + getF3.Opinion;
}
}
}
}
Bookmark bookmarkOperaterMan3 = doc.Range.Bookmarks["OperaterMan3"];
if (bookmarkOperaterMan3 != null)
if (!string.IsNullOrEmpty(getF3.SignatureUrl) && File.Exists(rootPath + getF3.SignatureUrl))
{
if (getF3.OperaterTime.HasValue)
DocumentBuilder builders = new DocumentBuilder(doc);
var file = rootPath + getF3.SignatureUrl;
builders.MoveToBookmark("OperaterMan3");
builders.InsertImage(file, 80, 20);
}
else
{
if (getUser != null)
{
if (getUser != null)
Bookmark bookmarkOperaterMan3 = doc.Range.Bookmarks["OperaterMan3"];
if (bookmarkOperaterMan3 != null)
{
DocumentBuilder builders = new DocumentBuilder(doc);
if (!string.IsNullOrEmpty(getUser.SignatureUrl) && File.Exists(rootPath + getUser.SignatureUrl))
{
var file = rootPath + getUser.SignatureUrl;
builders.MoveToBookmark("OperaterMan3");
builders.InsertImage(file, 80, 20);
}
else
{
bookmarkOperaterMan3.Text = getUser.UserName;
}
bookmarkOperaterMan3.Text = getUser.UserName;
}
}
}
}
Bookmark bookmarkOperaterTime3 = doc.Range.Bookmarks["OperaterTime3"];
if (bookmarkOperaterTime3 != null)
{
if (getF3.OperaterTime.HasValue)
{
bookmarkOperaterTime3.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF3.OperaterTime);
bookmarkOperaterTime3.Text = string.Format("{0:yyyyMMdd HH:mm}", getF3.OperaterTime);
}
}
}
@@ -845,7 +873,14 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF4.IsAgree == true)
{
bookmarkOpinion4.Text = getF4.Opinion;
if (!string.IsNullOrEmpty(getF4.Opinion))
{
bookmarkOpinion4.Text = getF1.Opinion;
}
else
{
bookmarkOpinion4.Text = "同意。";
}
}
else
{
@@ -881,7 +916,7 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF4.OperaterTime.HasValue)
{
bookmarkOperaterTime4.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF4.OperaterTime);
bookmarkOperaterTime4.Text = string.Format("{0:yyyyMMdd HH:mm}", getF4.OperaterTime);
}
}
}
@@ -898,7 +933,14 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF5.IsAgree == true)
{
bookmarkOpinion5.Text = getF5.Opinion;
if (!string.IsNullOrEmpty(getF5.Opinion))
{
bookmarkOpinion5.Text = getF1.Opinion;
}
else
{
bookmarkOpinion5.Text = "同意。";
}
}
else
{
@@ -934,7 +976,7 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF5.OperaterTime.HasValue)
{
bookmarkOperaterTime5.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF5.OperaterTime);
bookmarkOperaterTime5.Text = string.Format("{0:yyyyMMdd HH:mm}", getF5.OperaterTime);
}
}
}
@@ -951,7 +993,14 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF6.IsAgree == true)
{
bookmarkOpinion6.Text = getF6.Opinion;
if (!string.IsNullOrEmpty(getF6.Opinion))
{
bookmarkOpinion6.Text = getF1.Opinion;
}
else
{
bookmarkOpinion6.Text = "同意。";
}
}
else
{
@@ -987,7 +1036,7 @@ namespace FineUIPro.Web.HSSE.License
{
if (getF6.OperaterTime.HasValue)
{
bookmarkOperaterTime6.Text = string.Format("{0:yyyy-MM-dd HH:mm}", getF6.OperaterTime);
bookmarkOperaterTime6.Text = string.Format("{0:yyyyMMdd HH:mm}", getF6.OperaterTime);
}
}
}