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 @@ + diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.cs index ee6b9114..ac7ba15b 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.cs @@ -88,5 +88,24 @@ namespace FineUIPro.Web.HJGL.PreWeld ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } + + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + string cuttingCheckId = CuttingCheckId; + if (string.IsNullOrEmpty(cuttingCheckId) && !string.IsNullOrEmpty(drpWeldJoint.SelectedValue)) + { + var check = Funs.DB.HJGL_PreWeldCuttingCheck.FirstOrDefault(x => x.WeldJointId == drpWeldJoint.SelectedValue); + cuttingCheckId = check == null ? string.Empty : check.CuttingCheckId; + } + if (string.IsNullOrEmpty(cuttingCheckId)) + { + Alert.ShowInTop("请先保存下料抽检记录后再上传附件!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(WindowAtt.GetShowReference( + string.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL/PreWeld/CuttingCheck&menuId={1}&edit=1&type=-1", + cuttingCheckId, Const.HJGL_PreWeldCuttingCheckMenuId))); + } } } diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.designer.cs index d337f239..8a6ef848 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/CuttingCheckEdit.aspx.designer.cs @@ -86,6 +86,15 @@ namespace FineUIPro.Web.HJGL.PreWeld /// protected global::FineUIPro.TextArea txtRemark; + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + /// /// Toolbar1 控件。 /// @@ -112,5 +121,14 @@ namespace FineUIPro.Web.HJGL.PreWeld /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; } } diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx index 280c2da3..9c312d33 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx @@ -64,6 +64,13 @@ + + + + + + @@ -77,6 +84,10 @@ + diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.cs index dd4ab52e..b161881f 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.cs @@ -129,5 +129,22 @@ namespace FineUIPro.Web.HJGL.PreWeld ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } + + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + string weldJointId = drpWeldJoint.SelectedValue; + var check = string.IsNullOrEmpty(weldJointId) + ? null + : Funs.DB.HJGL_PreWeldFitupCheck.FirstOrDefault(x => x.WeldJointId == weldJointId); + if (check == null) + { + Alert.ShowInTop("请先保存组对抽检记录后再上传附件!", MessageBoxIcon.Warning); + return; + } + + PageContext.RegisterStartupScript(WindowAtt.GetShowReference( + string.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL/PreWeld/FitupCheck&menuId={1}&edit=1&type=-1", + check.FitupCheckId, Const.HJGL_PreWeldFitupCheckMenuId))); + } } } diff --git a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.designer.cs index 988ac02b..b4521ce2 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreWeld/FitupCheckEdit.aspx.designer.cs @@ -113,6 +113,15 @@ namespace FineUIPro.Web.HJGL.PreWeld /// protected global::FineUIPro.TextArea txtRemark; + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + /// /// Toolbar1 控件。 /// @@ -139,5 +148,14 @@ namespace FineUIPro.Web.HJGL.PreWeld /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; } } diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index edfe3aae..fb520189 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -38,7 +38,7 @@ .f-grid-row.priority { /* background-color: #1e88e5;*/ - color: #fff; + color: blue; font-weight: bold; } @@ -135,11 +135,11 @@ - - @@ -181,13 +181,13 @@ - 焊接日报 + + +
@@ -177,6 +203,18 @@ DataField="WeldingLocationCode" SortField="WeldingLocationCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px"> + + + + + + + + + + @@ -205,7 +243,7 @@ + LabelWidth="90px" Width="220px" AutoPostBack="true" OnTextChanged="PendingFilter_TextChanged" AutoShowClearIcon="true"> @@ -265,6 +303,18 @@ + + + + + + + + + + @@ -329,8 +379,38 @@ return false; } function reloadGrid() { - __doPostBack(null, 'reloadGrid'); - } + __doPostBack(null, 'reloadGrid'); +} +var imgIDs = ['<%=Grid1.ClientID %>', '<%=GridPending.ClientID %>']; +function showImg() { + $.each(imgIDs, function(_, imgID) { + var $wrap = $("#" + imgID); + $wrap.find('img').off('click.weldreport').on('click.weldreport', function() { + var src = $(this).attr('src'); + if (!src || src.indexOf("/res/icon") != -1) { + return; + } + var div = document.createElement('div'); + div.style.display = 'none'; + div.innerHTML = ''; // 创建一个包含图片的 div 元素 + document.body.appendChild(div); // 将 div 元素添加到页面中 + + var viewer = new Viewer(div.firstChild); // 创建 Viewer 实例并传入图片元素 + viewer.show(); // 显示图片预览 + + // 在 Viewer 关闭后移除添加的 div 元素 + viewer.on('hidden', function() { + document.body.removeChild(div); + }); + }); + }); + $('.imgPreview').on('click', function() { + // $('.imgPreview').hide() + }); +} +F.ready(function() { + showImg(); + }) diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs index 269c9052..76d23bbc 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.cs @@ -202,23 +202,36 @@ namespace FineUIPro.Web.HJGL.WeldingManage Grid1.DataBind(); return; } - string strSql = @"SELECT WeldingDailyId,WeldJointId,PipelineCode,WeldJointCode, - BackingWelderCode,CoverWelderCode,Material1Code,Material2Code, - Dia,DNDia,Thickness,WeldTypeCode,WeldingMethodCode,WeldingWireCode,WeldingMode, - WeldingRodCode,Size,JointAttribute,CoverWelderTeamGroupName,BackingWelderTeamGroupName,WeldingLocationCode + string strSql = @"SELECT jot.WeldingDailyId,jot.WeldJointId,jot.PipelineCode,jot.WeldJointCode, + jot.BackingWelderCode,jot.CoverWelderCode,jot.Material1Code,jot.Material2Code, + jot.Dia,jot.DNDia,jot.Thickness,jot.WeldTypeCode,jot.WeldingMethodCode,jot.WeldingWireCode,jot.WeldingMode, + jot.WeldingRodCode,jot.Size,jot.JointAttribute,jot.CoverWelderTeamGroupName,jot.BackingWelderTeamGroupName,jot.WeldingLocationCode, + beforeAtt.AttachUrl AS BeforePhotoUrl, + afterAtt.AttachUrl AS AfterPhotoUrl - FROM dbo.View_HJGL_WeldJoint - WHERE WeldingDailyId=@WeldingDailyId"; + FROM dbo.View_HJGL_WeldJoint AS jot + OUTER APPLY ( + SELECT TOP 1 temp.TempDetailId + FROM dbo.HJGL_WeldingDailyTempDetail AS temp + WHERE temp.WeldJointId = jot.WeldJointId AND temp.AuditState = 1 + ORDER BY temp.AuditDate DESC, temp.SubmitDate DESC + ) AS reportTemp + LEFT JOIN dbo.AttachFile AS beforeAtt ON beforeAtt.MenuId = @WeldReportMenuId + AND beforeAtt.ToKeyId = reportTemp.TempDetailId + '#Before' + LEFT JOIN dbo.AttachFile AS afterAtt ON afterAtt.MenuId = @WeldReportMenuId + AND afterAtt.ToKeyId = reportTemp.TempDetailId + '#After' + WHERE jot.WeldingDailyId=@WeldingDailyId"; List listStr = new List(); listStr.Add(new SqlParameter("@WeldingDailyId", tvControlItem.SelectedNodeID)); + listStr.Add(new SqlParameter("@WeldReportMenuId", Const.HJGL_WeldReportMenuId)); if (!string.IsNullOrEmpty(txtPipelineCode.Text.Trim())) { - strSql += " AND PipelineCode LIKE @pipelineCode "; + strSql += " AND jot.PipelineCode LIKE @pipelineCode "; listStr.Add(new SqlParameter("@pipelineCode", "%" + this.txtPipelineCode.Text.Trim() + "%")); } if (!string.IsNullOrEmpty(txtWelderCode.Text.Trim())) { - strSql += " AND (BackingWelderCode LIKE @welderCode OR CoverWelderCode LIKE @welderCode)"; + strSql += " AND (jot.BackingWelderCode LIKE @welderCode OR jot.CoverWelderCode LIKE @welderCode)"; listStr.Add(new SqlParameter("@welderCode", "%" + this.txtWelderCode.Text.Trim() + "%")); } SqlParameter[] parameter = listStr.ToArray(); @@ -263,16 +276,23 @@ namespace FineUIPro.Web.HJGL.WeldingManage jot.Thickness, jot.WeldingMethodCode, submitPerson.PersonName AS SubmitPersonName, - temp.SubmitDate + temp.SubmitDate, + beforeAtt.AttachUrl AS BeforePhotoUrl, + afterAtt.AttachUrl AS AfterPhotoUrl FROM dbo.HJGL_WeldingDailyTempDetail AS temp LEFT JOIN dbo.View_HJGL_WeldJoint AS jot ON jot.WeldJointId = temp.WeldJointId LEFT JOIN dbo.SitePerson_Person AS coverWelder ON coverWelder.PersonId = temp.CoverWelderId LEFT JOIN dbo.SitePerson_Person AS backingWelder ON backingWelder.PersonId = temp.BackingWelderId LEFT JOIN dbo.Base_WeldingLocation AS location ON location.WeldingLocationId = temp.WeldingLocationId LEFT JOIN dbo.Person_Persons AS submitPerson ON submitPerson.PersonId = temp.SubmitPersonId + LEFT JOIN dbo.AttachFile AS beforeAtt ON beforeAtt.MenuId = @WeldReportMenuId + AND beforeAtt.ToKeyId = temp.TempDetailId + '#Before' + LEFT JOIN dbo.AttachFile AS afterAtt ON afterAtt.MenuId = @WeldReportMenuId + AND afterAtt.ToKeyId = temp.TempDetailId + '#After' WHERE temp.ProjectId = @ProjectId AND temp.AuditState = 0"; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@WeldReportMenuId", Const.HJGL_WeldReportMenuId)); var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(tvControlItem.SelectedNodeID); if (unitWork == null) @@ -380,7 +400,16 @@ namespace FineUIPro.Web.HJGL.WeldingManage #endregion #endregion + protected string ConvertImageUrlByImage(object photoUrl) + { + string url = string.Empty; + if (photoUrl != null) + { + url = BLL.UploadAttachmentService.ShowImage("../../", photoUrl.ToString()); + } + return url; + } #region 焊接日报 维护事件 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs index d8bee4a9..277e222b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HJGL.WeldingManage { - - - public partial class WeldReport { - +namespace FineUIPro.Web.HJGL.WeldingManage +{ + + + public partial class WeldReport + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// txtMonth 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtMonth; - + /// /// tvControlItem 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// Panel2 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel2; - + /// /// panelCenterRegion 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtUnitName 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtUnitName; - + /// /// txtTabler 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTabler; - + /// /// txtTableDate 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTableDate; - + /// /// txtWeldingDate 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWeldingDate; - + /// /// txtSumSize 控件。 /// @@ -155,7 +157,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtSumSize; - + /// /// txtTeam 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtTeam; - + /// /// txtRemark 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtRemark; - + /// /// Toolbar3 控件。 /// @@ -182,7 +184,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar3; - + /// /// txtPipelineCode 控件。 /// @@ -191,7 +193,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtPipelineCode; - + /// /// txtWelderCode 控件。 /// @@ -200,7 +202,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWelderCode; - + /// /// ToolbarFill1 控件。 /// @@ -209,7 +211,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// hdWeldingDailyCode 控件。 /// @@ -218,7 +220,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdWeldingDailyCode; - + + /// + /// lbReportBeforePhotoUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbReportBeforePhotoUrl; + + /// + /// lbReportAfterPhotoUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbReportAfterPhotoUrl; + /// /// ToolbarSeparator1 控件。 /// @@ -227,7 +247,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -236,7 +256,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -318,6 +338,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// protected global::FineUIPro.Button btnPendingDelete; + /// + /// lbPendingBeforePhotoUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbPendingBeforePhotoUrl; + + /// + /// lbPendingAfterPhotoUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbPendingAfterPhotoUrl; + /// /// ToolbarSeparatorPending 控件。 /// @@ -344,7 +382,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPendingPageSize; - + /// /// Window1 控件。 /// @@ -353,7 +391,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -362,7 +400,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuAdd 控件。 /// @@ -371,7 +409,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuAdd; - + /// /// btnMenuEdit 控件。 /// @@ -389,7 +427,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuImport; - + /// /// btnMenuOut 控件。 /// @@ -398,7 +436,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuOut; - + /// /// btnMenuDelete 控件。 /// @@ -407,7 +445,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuDelete; - + /// /// Menu2 控件。 /// @@ -416,7 +454,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu2; - + /// /// btnMenuDeleteDetail 控件。 /// diff --git a/SGGL/Model/APIItem/HJGL/HJGL_PreWeldingDailyItem.cs b/SGGL/Model/APIItem/HJGL/HJGL_PreWeldingDailyItem.cs index b8bb103f..f9569f01 100644 --- a/SGGL/Model/APIItem/HJGL/HJGL_PreWeldingDailyItem.cs +++ b/SGGL/Model/APIItem/HJGL/HJGL_PreWeldingDailyItem.cs @@ -77,4 +77,45 @@ // get; set; // } } + + /// + /// 小程序按焊口保存焊接日报及焊前、焊后附件参数 + /// + public class WeldingDailyByWeldJointAttachItem + { + /// + /// 焊口ID + /// + public string WeldJointId { get; set; } + + /// + /// 人员ID + /// + public string Personid { get; set; } + + /// + /// 焊接日期 + /// + public string time { get; set; } + + /// + /// 焊接位置ID + /// + public string weldingLocation { get; set; } + + /// + /// 焊工类型 0 全部 1 打底 2 盖面 + /// + public int welderType { get; set; } + + /// + /// 焊前附件路径 + /// + public string PreWeldAttachUrl { get; set; } + + /// + /// 焊后附件路径 + /// + public string PostWeldAttachUrl { get; set; } + } } diff --git a/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs b/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs index e2fd9872..17f3c2f7 100644 --- a/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs +++ b/SGGL/Model/APIItem/HJGL/PreWeldInspectionItem.cs @@ -32,6 +32,16 @@ namespace Model public decimal? FitupGap { get; set; } public decimal? Misalignment { get; set; } + + /// + /// 下料抽检附件路径 + /// + public string CuttingAttachUrl1 { get; set; } + + /// + /// 组对抽检附件路径 + /// + public string FitupAttachUrl1 { get; set; } } /// @@ -65,6 +75,8 @@ namespace Model public DateTime? CreateTime { get; set; } + public string AttachUrl1 { get; set; } + public string Remark { get; set; } } @@ -107,6 +119,8 @@ namespace Model public DateTime? CreateTime { get; set; } + public string AttachUrl1 { get; set; } + public string Remark { get; set; } } } diff --git a/SGGL/Model/APIItem/HJGL/ViewHJGLWeldJointExtend.cs b/SGGL/Model/APIItem/HJGL/ViewHJGLWeldJointExtend.cs new file mode 100644 index 00000000..ad99f657 --- /dev/null +++ b/SGGL/Model/APIItem/HJGL/ViewHJGLWeldJointExtend.cs @@ -0,0 +1,15 @@ +namespace Model +{ + public partial class View_HJGL_WeldJoint + { + /// + /// 焊前附件路径 + /// + public string PreWeldAttachUrl { get; set; } + + /// + /// 焊后附件路径 + /// + public string PostWeldAttachUrl { get; set; } + } +} diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index e293ab7c..5edae2cc 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -127,6 +127,7 @@ + diff --git a/SGGL/WebAPI/Controllers/HJGL/WeldingManage/PreWeldingDailyController.cs b/SGGL/WebAPI/Controllers/HJGL/WeldingManage/PreWeldingDailyController.cs index 27e2ca3a..c489dc19 100644 --- a/SGGL/WebAPI/Controllers/HJGL/WeldingManage/PreWeldingDailyController.cs +++ b/SGGL/WebAPI/Controllers/HJGL/WeldingManage/PreWeldingDailyController.cs @@ -233,6 +233,34 @@ namespace WebAPI.Controllers return responeData; } + /// + /// 根据焊口id保存到日报,并保存焊前、焊后附件 + /// + /// 焊口日报和附件参数 + /// + [HttpPost] + public Model.ResponeData SaveWeldingDailyByWeldJointId([FromBody] Model.WeldingDailyByWeldJointAttachItem newItem) + { + var responeData = new Model.ResponeData(); + try + { + string res = APIPreWeldingDailyService.SaveWeldingDailyByWeldJointIdWithAttach(newItem); + + if (!string.IsNullOrEmpty(res)) + { + responeData.code = 0; + responeData.message = res; + } + + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + #endregion #region 更新焊接日报焊口信息