fix:导入焊口信息时检验临时数据表并同步坐标信息,轴测图显示中加载图纸json并绑定焊接字段

This commit is contained in:
2026-08-28 16:37:24 +08:00
parent 72dc1e30cb
commit 4a0b7ee840
9 changed files with 407 additions and 31 deletions
+23 -2
View File
@@ -7026,7 +7026,7 @@
</Compile>
<Compile Include="JGZL\Cover.aspx.cs">
<DependentUpon>Cover.aspx</DependentUpon>
<SubType>Component</SubType>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="JGZL\Cover.aspx.designer.cs">
<DependentUpon>Cover.aspx</DependentUpon>
@@ -7159,7 +7159,7 @@
</Compile>
<Compile Include="JGZL\CommencementReportEdit.aspx.cs">
<DependentUpon>CommencementReportEdit.aspx</DependentUpon>
<SubType>Component</SubType>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="JGZL\CommencementReportEdit.aspx.designer.cs">
<DependentUpon>CommencementReportEdit.aspx</DependentUpon>
@@ -8704,6 +8704,27 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<WarningLevel>0</WarningLevel>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<Use64BitIISExpress>
</Use64BitIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
@@ -16,6 +16,11 @@ namespace FineUIPro.Web.HJGL.DataIn
{
public partial class JointIn : PageBase
{
/// <summary>
/// 图纸标注生成的焊口临时数据类型。
/// </summary>
private const string DrawingJointTempType = "0";
/// <summary>
/// 导入的焊口Id
/// </summary>
@@ -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;
}
}
/// <summary>
/// 将图纸标注临时数据中的坐标同步到焊口,并删除已消费的临时记录。
/// </summary>
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<Model.HJGL_Sys_DataInTemp> 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
}
}
}
@@ -14,17 +14,18 @@
<link rel="stylesheet" crossorigin="" href="./assets/styles-CDHjsf7D.css">
<link rel="stylesheet" crossorigin="" href="./assets/viewer-BilNgxa5.css">--%>
<script type="module" crossorigin src="./assets/viewer-OAWYGAQy.js"></script>
<script type="module" crossorigin src="./assets/main-CAQAECJj.js"></script>
<link rel="modulepreload" crossorigin href="./assets/pdf-lib-AfLQbX6n.js">
<link rel="modulepreload" crossorigin href="./assets/pdfjs-DXqArq6h.js">
<link rel="modulepreload" crossorigin href="./assets/styles-BivZUUi2.js">
<link rel="stylesheet" crossorigin href="./assets/styles-D86IH2mE.css">
<link rel="stylesheet" crossorigin href="./assets/viewer-DahJGFsF.css">
<link rel="stylesheet" crossorigin href="./assets/main-BrQ26Trd.css">
</head>
<body>
<form id="form1" runat="server">
<input id="hdpdfurl" type="hidden" value="<%=URL %>"/>
<input id="annotionData" type="hidden" value='<%=JointData %>'/>
<input id="annotionData" type="hidden" runat="server"/>
<input id="hdworkRecord" type="hidden" runat="server"/>
<input id="imgurl2" type="hidden" runat="server"/>
<input id="imgurl1" type="hidden" runat="server"/>
@@ -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<string, string> HotProessDic = new Dictionary<string, string>();
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);
}
}
/// <summary>
/// 将焊口业务字段扩展到对应标注中。
/// </summary>
private static string ExtendDrawingJson(string drawingJson, DataTable jointTable)
{
JObject drawing = JObject.Parse(string.IsNullOrWhiteSpace(drawingJson) ? "{}" : drawingJson);
JObject annotations = drawing.Value<JObject>("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<JObject>())
{
string label = annotation.Value<string>("label");
DataRow jointRow = jointTable.Rows.Cast<DataRow>()
.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);
}
}
}
}
@@ -23,6 +23,15 @@ namespace FineUIPro.Web.HJGL.JoinMarking
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// annotionData 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden annotionData;
/// <summary>
/// hdworkRecord 控件。
/// </summary>
@@ -0,0 +1,229 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue PDF Viewer</title>
<script type="module" crossorigin src="./assets/main-CAQAECJj.js"></script>
<link rel="modulepreload" crossorigin href="./assets/pdf-lib-AfLQbX6n.js">
<link rel="modulepreload" crossorigin href="./assets/pdfjs-DXqArq6h.js">
<link rel="modulepreload" crossorigin href="./assets/styles-BivZUUi2.js">
<link rel="stylesheet" crossorigin href="./assets/styles-D86IH2mE.css">
<link rel="stylesheet" crossorigin href="./assets/main-BrQ26Trd.css">
</head>
<body>
<div id="app"></div>
<!-- <input id="hdpdfurl" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/03DR-003A-12-C1R_Sht_1.PDF">
<input id="imgurl1" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/Screenshots/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202026-01-12%20110935.png">
<input id="imgurl2" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/Screenshots/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202026-02-08%20132814.png"> -->
<!--
<input id="annotionData" value='{
"version": "1.0",
"exportDate": "2026-07-14T09:15:11.489Z",
"sourceFile": "03DR-003A-12-C1R_Sht_1.pdf",
"globalSettings": {
"startNumber": 1,
"increment": 1,
"prefix": "",
"suffix": "",
"fontSize": 10,
"borderStyle": "none",
"annotationStyle": "circle-outline"
},
"annotations": {
"1": [
{
"x": 202,
"y": 115,
"x2": 152,
"y2": 165,
"displayValue": 1,
"label": "1",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 215,
"y": 339,
"x2": 165,
"y2": 389,
"displayValue": 2,
"label": "2",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 361,
"y": 231,
"x2": 311,
"y2": 281,
"displayValue": 3,
"label": "3",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 190,
"y": 254,
"x2": 140,
"y2": 304,
"displayValue": 4,
"label": "4",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 327,
"y": 357,
"x2": 277,
"y2": 407,
"displayValue": 5,
"label": "5",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 451,
"y": 291,
"x2": 401,
"y2": 341,
"displayValue": 6,
"label": "6",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 370,
"y": 176,
"x2": 320,
"y2": 226,
"displayValue": 7,
"label": "7",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 380,
"y": 119,
"x2": 330,
"y2": 169,
"displayValue": 8,
"label": "8",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 307,
"y": 237,
"x2": 257,
"y2": 287,
"displayValue": 9,
"label": "9",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 327,
"y": 298,
"x2": 277,
"y2": 348,
"displayValue": 10,
"label": "10",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 323,
"y": 167,
"x2": 273,
"y2": 217,
"displayValue": 11,
"label": "11",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 358,
"y": 55,
"x2": 308,
"y2": 105,
"displayValue": 12,
"label": "12",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 299,
"y": 111,
"x2": 249,
"y2": 161,
"displayValue": 13,
"label": "13",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 293,
"y": 71,
"x2": 243,
"y2": 121,
"displayValue": 14,
"label": "14",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 275,
"y": 180,
"x2": 225,
"y2": 230,
"displayValue": 15,
"label": "15",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 179,
"y": 157,
"x2": 129,
"y2": 207,
"displayValue": 16,
"label": "16",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 189,
"y": 59,
"x2": 139,
"y2": 109,
"displayValue": 17,
"label": "17",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 293,
"y": 39,
"x2": 243,
"y2": 89,
"displayValue": 18,
"label": "18",
"style": "none",
"annotationStyle": "circle-outline"
},
{
"x": 209,
"y": 72,
"x2": 159,
"y2": 122,
"displayValue": 19,
"label": "19",
"style": "none",
"annotationStyle": "circle-outline"
}
]
}
}'> -->
</body>
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PDF 预览</title>
<script type="module" crossorigin src="./assets/viewer-OAWYGAQy.js"></script>
<link rel="modulepreload" crossorigin href="./assets/pdf-lib-AfLQbX6n.js">
<link rel="modulepreload" crossorigin href="./assets/pdfjs-DXqArq6h.js">
<link rel="modulepreload" crossorigin href="./assets/styles-BivZUUi2.js">
<link rel="stylesheet" crossorigin href="./assets/styles-D86IH2mE.css">
<link rel="stylesheet" crossorigin href="./assets/viewer-DahJGFsF.css">
</head>
<body>
<div id="app"></div>
<input id="hdpdfurl" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/03DR-003A-12-C1R_Sht_1.PDF">
<input id="imgurl1" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/Screenshots/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202026-01-12%20110935.png">
<input id="imgurl2" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/Screenshots/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202026-02-08%20132814.png">
<input id="orgname" value="中石化十六有限公司">
<input id="annotionData" value='[{"JOT_ID":"a1b2c3d4-1111-4000-a000-000000000001","JOT_JointNo":"GB1XX","WED_Code":"W001","JOT_Location":"1G","JOT_WeldDate":"2026-02-01","DetectionTypeCode":"RT","IsRepair":"否","IsHotProcess":"否","x":"50","y":"159.67","x2":"235","y2":"134.67","JOT_JointStatus":"正常"},{"JOT_ID":"a1b2c3d4-2222-4000-a000-000000000002","JOT_JointNo":"GB2XX","WED_Code":"W001","JOT_Location":"2G","JOT_WeldDate":"2026-02-02","DetectionTypeCode":"UT","IsRepair":"否","IsHotProcess":"是","x":"78","y":"203.67","x2":"248","y2":"159.67","JOT_JointStatus":"正常"},{"JOT_ID":"a1b2c3d4-3333-4000-a000-000000000003","JOT_JointNo":"GB3XX","WED_Code":"W002","JOT_Location":"5G","JOT_WeldDate":"2026-02-03","DetectionTypeCode":"RT","IsRepair":"是","IsHotProcess":"否","x":"67","y":"273.67","x2":"290","y2":"203.67","JOT_JointStatus":"返修"},{"JOT_ID":"a1b2c3d4-4444-4000-a000-000000000004","JOT_JointNo":"GB4XX","WED_Code":"W002","JOT_Location":"6G","JOT_WeldDate":"2026-02-03","DetectionTypeCode":"MT","IsRepair":"否","IsHotProcess":"是","x":"91","y":"346.67","x2":"302","y2":"246.67","JOT_JointStatus":"正常"},{"JOT_ID":"a1b2c3d4-5555-4000-a000-000000000005","JOT_JointNo":"GB5XX","WED_Code":"W003","JOT_Location":"1G","JOT_WeldDate":"2026-02-04","DetectionTypeCode":"RT","IsRepair":"是","IsHotProcess":"否","x":"86","y":"411.67","x2":"303","y2":"321.67","JOT_JointStatus":"返修"},{"JOT_ID":"a1b2c3d4-6666-4000-a000-000000000006","JOT_JointNo":"GB6XX","WED_Code":"W003","JOT_Location":"2G","JOT_WeldDate":"2026-02-05","DetectionTypeCode":"UT","IsRepair":"否","IsHotProcess":"否","x":"98","y":"492.67","x2":"302","y2":"405.67","JOT_JointStatus":"正常"},{"JOT_ID":"a1b2c3d4-7777-4000-a000-000000000007","JOT_JointNo":"GB7XX","WED_Code":"W004","JOT_Location":"5G","JOT_WeldDate":"2026-02-06","DetectionTypeCode":"PT","IsRepair":"是","IsHotProcess":"是","x":"139","y":"563.67","x2":"399","y2":"415.67","JOT_JointStatus":"返修"},{"JOT_ID":"a1b2c3d4-8888-4000-a000-000000000008","JOT_JointNo":"GB8XX","WED_Code":"W004","JOT_Location":"6G","JOT_WeldDate":"2026-02-07","DetectionTypeCode":"RT","IsRepair":"否","IsHotProcess":"否","x":"195","y":"599.67","x2":"439","y2":"459.67","JOT_JointStatus":"正常"}]' >
</body>
+3 -3
View File
@@ -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