From 4a0b7ee840e766ad210bcb68c7d7af54bdf49115 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Fri, 28 Aug 2026 16:37:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AF=BC=E5=85=A5=E7=84=8A=E5=8F=A3?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=B6=E6=A3=80=E9=AA=8C=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8=E5=B9=B6=E5=90=8C=E6=AD=A5=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E4=BF=A1=E6=81=AF=EF=BC=8C=E8=BD=B4=E6=B5=8B=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=AD=E5=8A=A0=E8=BD=BD=E5=9B=BE=E7=BA=B8?= =?UTF-8?q?json=E5=B9=B6=E7=BB=91=E5=AE=9A=E7=84=8A=E6=8E=A5=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj | 25 +- .../FineUIPro.Web/FineUIPro.Web.csproj.user | 5 +- .../FineUIPro.Web/HJGL/DataIn/JointIn.aspx.cs | 68 +++++- .../HJGL/JoinMarking/PDFShow.aspx | 7 +- .../HJGL/JoinMarking/PDFShow.aspx.cs | 66 +++-- .../HJGL/JoinMarking/PDFShow.aspx.designer.cs | 9 + .../FineUIPro.Web/HJGL/JoinMarking/index.html | 229 ++++++++++++++++++ .../HJGL/JoinMarking/viewer.html | 23 ++ HJGL_DS/SGGL.sln | 6 +- 9 files changed, 407 insertions(+), 31 deletions(-) create mode 100644 HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/index.html create mode 100644 HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/viewer.html diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj index 36f19ba..953d204 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj @@ -7026,7 +7026,7 @@ Cover.aspx - Component + ASPXCodeBehind Cover.aspx @@ -7159,7 +7159,7 @@ CommencementReportEdit.aspx - Component + ASPXCodeBehind CommencementReportEdit.aspx @@ -8704,6 +8704,27 @@ 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + true + bin\ + DEBUG;TRACE + true + full + x86 + 7.3 + prompt + + + bin\ + TRACE + true + true + 0 + pdbonly + x86 + 7.3 + prompt + diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index abef49a..bd5d3de 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,9 +1,10 @@ - + true Debug|Any CPU - + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/DataIn/JointIn.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/DataIn/JointIn.aspx.cs index e558b26..84ad7d6 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/DataIn/JointIn.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/DataIn/JointIn.aspx.cs @@ -16,6 +16,11 @@ namespace FineUIPro.Web.HJGL.DataIn { public partial class JointIn : PageBase { + /// + /// 图纸标注生成的焊口临时数据类型。 + /// + private const string DrawingJointTempType = "0"; + /// /// 导入的焊口Id /// @@ -915,6 +920,11 @@ namespace FineUIPro.Web.HJGL.DataIn } newJointInfo.JOT_ID = SQLHelper.GetNewID(typeof(Model.HJGL_PW_JointInfo)); BLL.HJGL_PW_JointInfoService.AddJointInfo(newJointInfo); + SyncCoordinatesFromTempAndDelete( + newJointInfo.JOT_ID, + getProject.ProjectId, + getPWisInfo.ISO_IsoNo, + col2); // 更新排序字段 string strSort = @"UPDATE dbo.HJGL_PW_JointInfo SET Sort1=(case when PATINDEX('[A-Z]%',JOT_JointNo)>0 THEN 'B' @@ -962,6 +972,11 @@ namespace FineUIPro.Web.HJGL.DataIn } newJointInfo.JOT_ID = getJoint.JOT_ID; BLL.HJGL_PW_JointInfoService.UpdateJointInfo(newJointInfo); + SyncCoordinatesFromTempAndDelete( + newJointInfo.JOT_ID, + getProject.ProjectId, + getPWisInfo.ISO_IsoNo, + col2); // 更新排序字段 string strSort = @"UPDATE dbo.HJGL_PW_JointInfo SET @@ -1018,6 +1033,57 @@ namespace FineUIPro.Web.HJGL.DataIn return; } } + + /// + /// 将图纸标注临时数据中的坐标同步到焊口,并删除已消费的临时记录。 + /// + private void SyncCoordinatesFromTempAndDelete( + string jointId, + string projectId, + string isoNo, + string jointNo) + { + if (string.IsNullOrWhiteSpace(jointId) + || string.IsNullOrWhiteSpace(projectId) + || string.IsNullOrWhiteSpace(isoNo) + || string.IsNullOrWhiteSpace(jointNo)) + { + return; + } + + Model.SGGLDB db = Funs.DB; + List tempJointList = db.HJGL_Sys_DataInTemp + .Where(x => x.ProjectId == projectId + && x.UserId == this.CurrUser.UserId + && x.Type == DrawingJointTempType + && x.Value3 == isoNo + && x.Value4 == jointNo) + .ToList(); + if (tempJointList.Count == 0) + { + return; + } + + Model.HJGL_PW_JointInfo jointInfo = db.HJGL_PW_JointInfo + .FirstOrDefault(x => x.JOT_ID == jointId); + if (jointInfo == null) + { + return; + } + + Model.HJGL_Sys_DataInTemp coordinateSource = tempJointList + .OrderByDescending(x => x.Time) + .ThenByDescending(x => x.RowNo) + .First(); + jointInfo.X = coordinateSource.Value46; + jointInfo.Y = coordinateSource.Value47; + jointInfo.X2 = coordinateSource.Value48; + jointInfo.Y2 = coordinateSource.Value49; + + db.HJGL_Sys_DataInTemp.DeleteAllOnSubmit(tempJointList); + db.SubmitChanges(); + } + #endregion protected void imgbtnUpload_Click(object sender, EventArgs e) { @@ -1077,4 +1143,4 @@ namespace FineUIPro.Web.HJGL.DataIn } #endregion } -} \ No newline at end of file +} diff --git a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx index c37162d..2795007 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx @@ -14,17 +14,18 @@ --%> - + - +
- + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.cs index 50cd2d0..d97c624 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.cs @@ -2,6 +2,7 @@ using BLL.Common; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -59,18 +60,6 @@ namespace FineUIPro.Web.HJGL.JoinMarking ViewState["URL"] = value; } } - public string JointData - { - get - { - return (string)ViewState["JointData"]; - } - set - { - ViewState["JointData"] = value; - } - } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -79,6 +68,7 @@ namespace FineUIPro.Web.HJGL.JoinMarking ISO_ID = Request.Params["ISO_ID"]; FileId = Request.Params["FileId"]; URL = Funs.HJGLUrl + Request.Params["pdfurl"]; + annotionData.Value = DrawingInfoService.GetDrawingJson(FileId) ?? "{}"; var iso = Funs.DB.HJGL_PW_IsoInfo.FirstOrDefault(x => x.ISO_ID == ISO_ID); if (iso != null) @@ -132,7 +122,7 @@ namespace FineUIPro.Web.HJGL.JoinMarking Dictionary HotProessDic = new Dictionary(); if (tbCheck != null) { - foreach (DataRow row in tbTrust.Rows) + foreach (DataRow row in tbCheck.Rows) { string WeldJointId = row["WeldJointId"].ToString(); string HotProessTrustId = row["HotProessTrustId"].ToString(); @@ -174,17 +164,53 @@ namespace FineUIPro.Web.HJGL.JoinMarking } } - JointData = JsonConvert.SerializeObject(tb1); + annotionData.Value = ExtendDrawingJson(annotionData.Value, tb1); } } - - - - - + /// + /// 将焊口业务字段扩展到对应标注中。 + /// + private static string ExtendDrawingJson(string drawingJson, DataTable jointTable) + { + JObject drawing = JObject.Parse(string.IsNullOrWhiteSpace(drawingJson) ? "{}" : drawingJson); + JObject annotations = drawing.Value("annotations"); + if (annotations == null || jointTable == null || jointTable.Rows.Count == 0) + { + return drawing.ToString(Formatting.None); + } + + foreach (JObject annotation in annotations.Properties() + .SelectMany(x => (x.Value as JArray) ?? new JArray()) + .OfType()) + { + string label = annotation.Value("label"); + DataRow jointRow = jointTable.Rows.Cast() + .FirstOrDefault(x => string.Equals( + x["JOT_JointNo"].ToString(), + label, + StringComparison.OrdinalIgnoreCase)); + if (jointRow == null) + { + continue; + } + + annotation["JOT_ID"] = jointRow["JOT_ID"].ToString(); + annotation["JOT_JointNo"] = jointRow["JOT_JointNo"].ToString(); + annotation["WED_Code"] = jointRow["WED_Code"].ToString(); + annotation["JOT_Location"] = jointRow["JOT_Location"].ToString(); + annotation["JOT_WeldDate"] = jointRow["JOT_WeldDate"].ToString(); + annotation["DetectionTypeCode"] = jointRow["DetectionTypeCode"].ToString(); + annotation["IsRepair"] = jointRow["IsRepair"].ToString(); + annotation["IsHotProcess"] = jointRow["IsHotProcess"].ToString(); + annotation["JOT_JointStatus"] = jointRow["JOT_JointStatus"].ToString(); + } + + return drawing.ToString(Formatting.None); + } + } -} \ No newline at end of file +} diff --git a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.designer.cs index ba77354..d428eb9 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/PDFShow.aspx.designer.cs @@ -23,6 +23,15 @@ namespace FineUIPro.Web.HJGL.JoinMarking /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// + /// annotionData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlInputHidden annotionData; + /// /// hdworkRecord 控件。 /// diff --git a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/index.html b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/index.html new file mode 100644 index 0000000..44814c7 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/index.html @@ -0,0 +1,229 @@ + + + + + + Vue PDF Viewer + + + + + + + + +
+ + + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/viewer.html b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/viewer.html new file mode 100644 index 0000000..4a68996 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/viewer.html @@ -0,0 +1,23 @@ + + + + + + PDF 预览 + + + + + + + + +
+ + + + + + + + diff --git a/HJGL_DS/SGGL.sln b/HJGL_DS/SGGL.sln index f86bbdc..6128cb1 100644 --- a/HJGL_DS/SGGL.sln +++ b/HJGL_DS/SGGL.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.36001.139 +# Visual Studio Version 18 +VisualStudioVersion = 18.10.12120.281 insiders MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FineUIPro.Web", "FineUIPro.Web\FineUIPro.Web.csproj", "{C88D3156-2D56-4DB0-922E-1995FB61C9BD}" EndProject @@ -27,7 +27,7 @@ Global {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Any CPU.Build.0 = Debug|Any CPU {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|x86.ActiveCfg = Debug|Any CPU + {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Debug|x86.ActiveCfg = Debug|x86 {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Any CPU.ActiveCfg = Release|Any CPU {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Any CPU.Build.0 = Release|Any CPU {C88D3156-2D56-4DB0-922E-1995FB61C9BD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU