feat(hjgl)焊前准备,日报管理增加附件
This commit is contained in:
@@ -54,10 +54,50 @@ namespace BLL
|
||||
var weldjoint = db.View_HJGL_WeldJoint
|
||||
.Where(p => p.WeldJointId == WeldJointId)
|
||||
.FirstOrDefault();
|
||||
if (weldjoint != null)
|
||||
{
|
||||
SetWeldingDailyAttachUrl(db, weldjoint);
|
||||
}
|
||||
return weldjoint;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 回填小程序日报上传的焊前、焊后附件路径
|
||||
/// </summary>
|
||||
/// <param name="db">数据库上下文</param>
|
||||
/// <param name="weldJoint">焊口详情</param>
|
||||
private static void SetWeldingDailyAttachUrl(Model.SGGLDB db, Model.View_HJGL_WeldJoint weldJoint)
|
||||
{
|
||||
var tempDetail = db.HJGL_WeldingDailyTempDetail
|
||||
.Where(x => x.WeldJointId == weldJoint.WeldJointId)
|
||||
.OrderByDescending(x => x.SubmitDate)
|
||||
.FirstOrDefault();
|
||||
if (tempDetail == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
weldJoint.PreWeldAttachUrl = GetAttachUrl(db, Const.HJGL_WeldReportMenuId, tempDetail.TempDetailId + "#Before");
|
||||
weldJoint.PostWeldAttachUrl = GetAttachUrl(db, Const.HJGL_WeldReportMenuId, tempDetail.TempDetailId + "#After");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按菜单和业务ID获取附件路径
|
||||
/// </summary>
|
||||
/// <param name="db">数据库上下文</param>
|
||||
/// <param name="menuId">菜单ID</param>
|
||||
/// <param name="toKeyId">业务ID</param>
|
||||
/// <returns>附件路径</returns>
|
||||
private static string GetAttachUrl(Model.SGGLDB db, string menuId, string toKeyId)
|
||||
{
|
||||
var attachUrl = db.AttachFile
|
||||
.Where(x => x.MenuId == menuId && x.ToKeyId == toKeyId)
|
||||
.Select(x => x.AttachUrl)
|
||||
.FirstOrDefault();
|
||||
return string.IsNullOrEmpty(attachUrl) ? attachUrl : attachUrl.Replace('\\', '/');
|
||||
}
|
||||
|
||||
|
||||
#region 获取未焊接的焊口信息
|
||||
|
||||
@@ -626,4 +666,4 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user