diff --git a/SGGL/BLL/API/HJGL/APIPipeJointService.cs b/SGGL/BLL/API/HJGL/APIPipeJointService.cs
index 712ef839..39478ac5 100644
--- a/SGGL/BLL/API/HJGL/APIPipeJointService.cs
+++ b/SGGL/BLL/API/HJGL/APIPipeJointService.cs
@@ -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;
}
}
+ ///
+ /// 回填小程序日报上传的焊前、焊后附件路径
+ ///
+ /// 数据库上下文
+ /// 焊口详情
+ 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");
+ }
+
+ ///
+ /// 按菜单和业务ID获取附件路径
+ ///
+ /// 数据库上下文
+ /// 菜单ID
+ /// 业务ID
+ /// 附件路径
+ 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
}
}
}
-}
\ No newline at end of file
+}
diff --git a/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs b/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs
index 9c1e7901..815ffb76 100644
--- a/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs
+++ b/SGGL/BLL/API/HJGL/APIPreWeldInspectionService.cs
@@ -41,10 +41,58 @@ namespace BLL
Misalignment = x.Misalignment
};
- return query.FirstOrDefault();
+ var item = query.FirstOrDefault();
+ if (item != null)
+ {
+ SetInspectionAttachUrl(db, item);
+ }
+
+ return item;
}
}
+ ///
+ /// 回填下料、组对抽检附件路径
+ ///
+ /// 数据库上下文
+ /// 焊前抽检基础信息
+ private static void SetInspectionAttachUrl(Model.SGGLDB db, Model.PreWeldJointItem item)
+ {
+ var cuttingCheckId = db.HJGL_PreWeldCuttingCheck
+ .Where(x => x.WeldJointId == item.WeldJointId)
+ .Select(x => x.CuttingCheckId)
+ .FirstOrDefault();
+ if (!string.IsNullOrEmpty(cuttingCheckId))
+ {
+ item.CuttingAttachUrl1 = GetAttachUrl(db, Const.HJGL_PreWeldCuttingCheckMenuId, cuttingCheckId);
+ }
+
+ var fitupCheckId = db.HJGL_PreWeldFitupCheck
+ .Where(x => x.WeldJointId == item.WeldJointId)
+ .Select(x => x.FitupCheckId)
+ .FirstOrDefault();
+ if (!string.IsNullOrEmpty(fitupCheckId))
+ {
+ item.FitupAttachUrl1 = GetAttachUrl(db, Const.HJGL_PreWeldFitupCheckMenuId, fitupCheckId);
+ }
+ }
+
+ ///
+ /// 按菜单和业务ID获取附件路径
+ ///
+ /// 数据库上下文
+ /// 菜单ID
+ /// 业务ID
+ /// 附件路径
+ 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('\\', '/');
+ }
+
///
/// 保存下料抽检,已存在同一焊口记录时更新原记录
///
@@ -92,6 +140,8 @@ namespace BLL
check.Remark = item.Remark;
db.SubmitChanges();
+
+ SaveInspectionAttachUrl(item.AttachUrl1, Const.HJGL_PreWeldCuttingCheckMenuId, check.CuttingCheckId);
}
}
@@ -158,6 +208,32 @@ namespace BLL
weldJoint.Misalignment = item.Misalignment;
db.SubmitChanges();
+
+ SaveInspectionAttachUrl(item.AttachUrl1, Const.HJGL_PreWeldFitupCheckMenuId, check.FitupCheckId);
+ }
+ }
+
+ ///
+ /// 保存焊前抽检附件,空附件时清理原附件。
+ ///
+ /// 附件路径
+ /// 菜单ID
+ /// 业务数据ID
+ private static void SaveInspectionAttachUrl(string attachUrl, string menuId, string dataId)
+ {
+ // AttachUrl1 为 null 表示旧调用方未传附件参数,避免误删已有附件;空字符串表示明确清空附件。
+ if (attachUrl == null)
+ {
+ return;
+ }
+
+ if (!string.IsNullOrEmpty(attachUrl))
+ {
+ UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, menuId, dataId);
+ }
+ else
+ {
+ CommonService.DeleteAttachFileById(menuId, dataId);
}
}
}
diff --git a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
index c0c884f1..180a31ff 100644
--- a/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
+++ b/SGGL/BLL/API/HJGL/APIPreWeldingDailyService.cs
@@ -277,6 +277,77 @@ namespace BLL
return BLL.WeldingDailyService.SaveWeldingDailyTempDetailByMobile(WeldJointId, Personid, time, weldingLocation, welderType);
}
+ ///
+ /// 保存焊接日报并维护焊前、焊后附件
+ ///
+ /// 焊接日报及附件参数
+ /// 错误信息
+ public static string SaveWeldingDailyByWeldJointIdWithAttach(Model.WeldingDailyByWeldJointAttachItem newItem)
+ {
+ if (newItem == null)
+ {
+ return "参数不能为空";
+ }
+
+ string res = BLL.WeldingDailyService.SaveWeldingDailyTempDetailByMobile(newItem.WeldJointId, newItem.Personid, newItem.time, newItem.weldingLocation, newItem.welderType);
+ if (!string.IsNullOrEmpty(res))
+ {
+ return res;
+ }
+
+ DateTime weldingDate;
+ if (!DateTime.TryParse(newItem.time, out weldingDate))
+ {
+ return "焊接日期不正确";
+ }
+ weldingDate = weldingDate.Date;
+
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ var tempDetail = db.HJGL_WeldingDailyTempDetail.FirstOrDefault(x => x.WeldJointId == newItem.WeldJointId
+ && x.WeldingDate >= weldingDate
+ && x.WeldingDate < weldingDate.AddDays(1)
+ && x.AuditState == 0);
+ if (tempDetail == null)
+ {
+ return "未找到待审核日报明细";
+ }
+
+ SaveWeldingDailyTempAttachUrl(newItem.PreWeldAttachUrl, tempDetail.TempDetailId + "#Before");
+ SaveWeldingDailyTempAttachUrl(newItem.PostWeldAttachUrl, tempDetail.TempDetailId + "#After");
+
+ // 明细表仅有一个附件字段,合并记录焊前、焊后附件路径,便于台账直接展示。
+ var preWeldAttachUrl = APIUpLoadFileService.getFileUrl(Const.HJGL_WeldReportMenuId, tempDetail.TempDetailId + "#Before", null);
+ var postWeldAttachUrl = APIUpLoadFileService.getFileUrl(Const.HJGL_WeldReportMenuId, tempDetail.TempDetailId + "#After", null);
+ tempDetail.AttachUrl = string.Join(",", new[] { preWeldAttachUrl, postWeldAttachUrl }.Where(x => !string.IsNullOrEmpty(x)));
+ db.SubmitChanges();
+ }
+
+ return string.Empty;
+ }
+
+ ///
+ /// 保存焊接日报待审核附件,null 表示不变,空字符串表示清空。
+ ///
+ /// 附件路径
+ /// 附件关联业务ID
+ private static void SaveWeldingDailyTempAttachUrl(string attachUrl, string toKeyId)
+ {
+ if (attachUrl == null)
+ {
+ return;
+ }
+
+ if (!string.IsNullOrEmpty(attachUrl))
+ {
+ UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(attachUrl, 10, null), attachUrl, Const.HJGL_WeldReportMenuId, toKeyId);
+ }
+ else
+ {
+ CommonService.DeleteAttachFileById(Const.HJGL_WeldReportMenuId, toKeyId);
+ }
+ }
+
#region 保存焊接日报明细
///
/// 保存焊接日报明细
diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
index e2c7d0bf..25ca93f9 100644
--- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
+++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx
@@ -176,7 +176,7 @@
+ AllowPaging="true" IsDatabasePaging="true" PageSize="10000" OnRowCommand="Grid3_RowCommand" AllowColumnLocking="true">
@@ -214,7 +214,7 @@
-
+
diff --git a/SGGL/FineUIPro.Web/File/Excel/DataOut/管道数据表导出模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataOut/管道数据表导出模板.xlsx
index 6662b4ad..cf580994 100644
Binary files a/SGGL/FineUIPro.Web/File/Excel/DataOut/管道数据表导出模板.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataOut/管道数据表导出模板.xlsx differ
diff --git a/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx b/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx
index 452bc220..feb3e7b7 100644
--- a/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx
+++ b/SGGL/FineUIPro.Web/File/Fastreport/材料入库条码.frx
@@ -1,5 +1,5 @@
-
+
@@ -7,14 +7,20 @@
+
+
+
+
-
+
+
+
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 581de11a..662b9dd6 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -17240,7 +17240,7 @@
-
+
diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs
index fd0373ad..22194ba8 100644
--- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs
@@ -474,7 +474,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
var weldJointData = weldJoints.Select((x, index) => new
{
No = index + 1,
- SingleNumber = SafeText(x.SingleNumber),
+ SingleNumber = SafeText(x.PipelineCode),
WeldJointCode = SafeText(x.WeldJointCode),
Dia = x.Dia,
Thickness = x.Thickness,
@@ -485,8 +485,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery
WelderCode = JoinTexts(x.BackingWelderCode, x.CoverWelderCode),
WelderExamDate = "/",
TestJointDate = "/",
- RootWeldingData = FormatWeldingData(x.WeldingMethodCode, x.WeldingRodCode, x.WeldingWireCode),
- RemainingWeldingData = FormatWeldingData(x.WeldingMethodCode, x.WeldingRodCode, x.WeldingWireCode),
+ RootWeldingData = FormatWeldingData(x.WeldingMethodCode),
+ RemainingWeldingData = FormatWeldingData(x.WeldingMethodCode),
// P列和V列按“管线需要热处理”判断,不按单个焊口判断。
PWHT = hotPipelineIdSet.Contains(x.PipelineId) ? "PWHT" : "/",
HotProcessAccept = hotPipelineIdSet.Contains(x.PipelineId) ? "ACC." : "/",
diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx
index b6fe93ad..e7d586b9 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx
@@ -47,6 +47,13 @@
+
+
+
+
+
+
@@ -60,6 +67,10 @@
+
+