From 08d8ff2ded6c4bcccdf76085a6f2330b430ab3d8 Mon Sep 17 00:00:00 2001
From: fei550 <1420031550@qq.com>
Date: Thu, 19 Nov 2026 16:00:10 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat(weldmat):=20=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8=20DP30S=20=E6=89=93=E5=8D=B0=E7=84=8A?=
=?UTF-8?q?=E6=9D=90=E6=A0=87=E7=AD=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
让领料确认和领用查询页面能够通过 DTPWeb 调用本机 DP30S,并与原打印方式共用标签取数,保持两种方式的字段口径一致。
---
HJGL_DS/BLL/BLL.csproj | 1 +
.../UsingSentMat/DtpWebMaterialLabel.cs | 24 +++++
.../WeldMat/UsingSentMat/UsingMatService.cs | 27 ++++++
HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj | 1 +
.../WeldMat/UsingSentMat/UsingMatCheck.aspx | 7 ++
.../UsingSentMat/UsingMatCheck.aspx.cs | 73 +++------------
.../UsingMatCheck.aspx.designer.cs | 9 ++
.../WeldMat/UsingSentMat/UsingtMatSelect.aspx | 3 +
.../UsingSentMat/UsingtMatSelect.aspx.cs | 67 ++-----------
.../UsingtMatSelect.aspx.designer.cs | 9 ++
.../res/js/dtpweb-material-label.js | 93 +++++++++++++++++++
11 files changed, 192 insertions(+), 122 deletions(-)
create mode 100644 HJGL_DS/BLL/WeldMat/UsingSentMat/DtpWebMaterialLabel.cs
create mode 100644 HJGL_DS/FineUIPro.Web/res/js/dtpweb-material-label.js
diff --git a/HJGL_DS/BLL/BLL.csproj b/HJGL_DS/BLL/BLL.csproj
index 82fcd1f..f884ce4 100644
--- a/HJGL_DS/BLL/BLL.csproj
+++ b/HJGL_DS/BLL/BLL.csproj
@@ -340,6 +340,7 @@
+
diff --git a/HJGL_DS/BLL/WeldMat/UsingSentMat/DtpWebMaterialLabel.cs b/HJGL_DS/BLL/WeldMat/UsingSentMat/DtpWebMaterialLabel.cs
new file mode 100644
index 0000000..b6bfc96
--- /dev/null
+++ b/HJGL_DS/BLL/WeldMat/UsingSentMat/DtpWebMaterialLabel.cs
@@ -0,0 +1,24 @@
+using FineUIPro;
+using Newtonsoft.Json;
+
+namespace BLL
+{
+ public static class DtpWebMaterialLabel
+ {
+ public static void RegisterPrint(string usingMatId)
+ {
+ var material = string.IsNullOrEmpty(usingMatId) ? null : UsingMatService.GetUsingMatById(usingMatId);
+ if (material == null)
+ {
+ Alert.Show("未找到对应的焊材领用记录。", MessageBoxIcon.Warning);
+ return;
+ }
+
+ var fields = JsonConvert.SerializeObject(UsingMatService.GetMaterialLabelParameters(material), new JsonSerializerSettings
+ {
+ StringEscapeHandling = StringEscapeHandling.EscapeHtml
+ });
+ PageContext.RegisterStartupScript("DtpWebMaterialLabel.print(" + fields + ");");
+ }
+ }
+}
diff --git a/HJGL_DS/BLL/WeldMat/UsingSentMat/UsingMatService.cs b/HJGL_DS/BLL/WeldMat/UsingSentMat/UsingMatService.cs
index 9aa1a67..7c31b3a 100644
--- a/HJGL_DS/BLL/WeldMat/UsingSentMat/UsingMatService.cs
+++ b/HJGL_DS/BLL/WeldMat/UsingSentMat/UsingMatService.cs
@@ -20,6 +20,33 @@ namespace BLL
return Funs.DB.Weld_UsingMat.FirstOrDefault(e => e.UsingMatId == usingMatId);
}
+ public static Dictionary GetMaterialLabelParameters(Model.Weld_UsingMat material)
+ {
+ var weld = string.IsNullOrEmpty(material?.WeldId) ? null : WeldInfoService.GetWeldInfoById(material.WeldId);
+ var weldType = string.IsNullOrEmpty(weld?.WeldTypeId) ? null : WeldTypeService.GetWeldTypeById(weld.WeldTypeId);
+ var welder = string.IsNullOrEmpty(material?.UsingMan) ? null : HJGL_PersonManageService.GetWelderByWenId(material.UsingMan);
+ var store = string.IsNullOrEmpty(material?.StoreMan) ? null : StoremanInfoService.GetStoremanById(material.StoreMan);
+
+ var number = string.Empty;
+ if (material?.Amount != null || material?.TwoAmount != null)
+ {
+ var amount = material.Amount.GetValueOrDefault() + material.TwoAmount.GetValueOrDefault();
+ var unit = weldType?.WeldTypeName == "焊丝" || weldType?.WeldTypeName == "焊条" ? "根" : "Kg";
+ number = amount.ToString("0.#") + unit;
+ }
+
+ var usingDate = material?.UsingDate;
+ return new Dictionary
+ {
+ { "WeldSpec", weld?.WeldSpec ?? string.Empty },
+ { "WeldName", weld?.WeldName ?? string.Empty },
+ { "WelderName", welder == null ? string.Empty : welder.WED_Name + "(" + welder.WED_Code + ")" },
+ { "Number", number },
+ { "StoreName", store?.StoreName ?? string.Empty },
+ { "UsingDate", usingDate.HasValue ? usingDate.Value.ToShortDateString() + " " + usingDate.Value.ToShortTimeString() : string.Empty }
+ };
+ }
+
///
/// 添加焊材领用
///
diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj
index 904b250..e1feef2 100644
--- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1577,6 +1577,7 @@
+
diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingMatCheck.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingMatCheck.aspx
index 002c995..6701802 100644
--- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingMatCheck.aspx
+++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingMatCheck.aspx
@@ -6,6 +6,7 @@
领料确认单
+