From 75ceef6a3c8be1b3042e013ce562828627c19a58 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Tue, 29 Jul 2025 20:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E8=AF=86=E5=88=AB=E9=A2=86?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeldMat/UsingSentMat/FaceRecognition.aspx | 24 +++++++++++++++++-- .../UsingSentMat/FaceRecognition.aspx.cs | 4 ++-- .../common/WelderManage/WelderSave.aspx | 2 +- .../common/WelderManage/WelderSave.aspx.cs | 15 +++++++++--- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx index 852793f..5c61b92 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx @@ -117,15 +117,35 @@ } else { // window.location.href = 'UsingMat.aspx?welderQRCode=' + data.d ; - window.open('UsingMat.aspx?welderCode=' + data.d , '_blank'); + //window.open('UsingMat.aspx?welderCode=' + data.d , '_blank'); //var activeWindow = F.getActiveWindow(); //activeWindow.window.backData(data.d); //activeWindow.hide(); + + var node = { + + iframeUrl: '~\\WeldMat\\UsingSentMat\\UsingMat.aspx?welderCode=' + data.d, + title: "焊材领用", + id: "UsingMat" + getFormattedDate() + }; + + window.parent.addExampleTab(node); + } } }) } - + function getFormattedDate() { + const now = new Date(); + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); + const day = String(now.getDate()).padStart(2, '0'); + const hours = String(now.getHours()).padStart(2, '0'); + const minutes = String(now.getMinutes()).padStart(2, '0'); + const seconds = String(now.getSeconds()).padStart(2, '0'); + + return year + month + day + hours + minutes + seconds; + } diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.cs index 7f24801..2b24571 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using SgManager.AI; using System; using System.Collections.Generic; using System.Drawing; @@ -13,8 +14,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat public partial class FaceRecognition : Page { protected void Page_Load(object sender, EventArgs e) - { - + { } [WebMethod] public static string UploadData(string data) diff --git a/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx b/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx index 2a13684..719344c 100644 --- a/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx +++ b/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx @@ -90,7 +90,7 @@ - + diff --git a/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx.cs b/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx.cs index 3bcb2db..a2351e0 100644 --- a/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/common/WelderManage/WelderSave.aspx.cs @@ -1,6 +1,7 @@ namespace FineUIPro.Web.common.WelderManage { using BLL; + using Model; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SgManager.AI; @@ -252,13 +253,14 @@ } #endregion - public string PersonFace(Model.HJGL_BS_Welder person) + public string PersonFace(Model.HJGL_BS_Welder person) { string message = string.Empty; - string filePath = Server.MapPath("~/") + person.PhotoUrl; + string filePath = Server.MapPath(person.PhotoUrl); List kqFace = null; try { + ErrLogInfo.WriteLog("filePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePathfilePath:" + filePath); kqFace = (List)SgManager.AI.FaceClass.SearchFileFace(filePath); if (kqFace != null || kqFace.Count > 0 || kqFace[0].errMess == "SUCCESS") { @@ -330,7 +332,7 @@ else message = "识别不到人脸"; if (isOK) { - var faceResult = FaceClass.add(person.WED_ID, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["HJGLUrl"].ToString() + person.PhotoUrl, AccessToken.getAccessToken()); + var faceResult = FaceClass.add(person.WED_ID, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["HJGLUrl"].ToString() + person.PhotoUrl.Replace("~\\", "").Replace("\\","/"), AccessToken.getAccessToken()); var face = JsonConvert.DeserializeObject(faceResult); // JsonConvert.DeserializeObject(myPunishItem); if (face.error_code == 0 || face.error_code == 223105) @@ -403,6 +405,13 @@ imgPhoto1.ImageUrl = "~/upload/" + fileName; // 清空文件上传组件 filePhoto1.Reset(); + + var welder = Funs.DB.HJGL_BS_Welder.FirstOrDefault(x=>x.WED_ID== WED_ID); + welder.PhotoUrl = imgPhoto1.ImageUrl.Replace("/", "\\"); + Funs.DB.SubmitChanges(); + Alert.ShowInParent(PersonFace(welder), MessageBoxIcon.Warning); + + } }