添加头像到百度
This commit is contained in:
parent
63eb85a30f
commit
d46c8bddbe
|
@ -1336,6 +1336,7 @@
|
|||
<Content Include="WeldMat\UsingPlan\UsingPlanImport.aspx" />
|
||||
<Content Include="WeldMat\UsingPlan\UsingPlanImport2.aspx" />
|
||||
<Content Include="WeldMat\UsingSentMat\CodeConfirm.aspx" />
|
||||
<Content Include="WeldMat\UsingSentMat\FaceRecognition.aspx" />
|
||||
<Content Include="WeldMat\UsingSentMat\LC700.aspx" />
|
||||
<Content Include="WeldMat\UsingSentMat\ModityWeld.aspx" />
|
||||
<Content Include="WeldMat\UsingSentMat\ShowReturnMat.aspx" />
|
||||
|
@ -6962,6 +6963,13 @@
|
|||
<Compile Include="WeldMat\UsingSentMat\CodeConfirm.aspx.designer.cs">
|
||||
<DependentUpon>CodeConfirm.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WeldMat\UsingSentMat\FaceRecognition.aspx.cs">
|
||||
<DependentUpon>FaceRecognition.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WeldMat\UsingSentMat\FaceRecognition.aspx.designer.cs">
|
||||
<DependentUpon>FaceRecognition.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WeldMat\UsingSentMat\LC700.aspx.cs">
|
||||
<DependentUpon>LC700.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -7447,6 +7455,10 @@
|
|||
<Project>{FD1E1931-1688-4B4A-BCD6-335A81465343}</Project>
|
||||
<Name>Model</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SgManager.AI\SgManager.AI.csproj">
|
||||
<Project>{55f4e1e2-5fb3-4ab4-b692-432ce41b3e61}</Project>
|
||||
<Name>SgManager.AI</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="aspnet_client\FreeTextBox\images\misc\buttonbackgrounds.psd" />
|
||||
|
|
|
@ -23,6 +23,22 @@
|
|||
<!--系统:焊接管理为:HJGL,焊材管理:HJCLGL-->
|
||||
<add key="SystemCode" value="HJCLGL"/>
|
||||
<add key="http" value="http://localhost/test/"/>
|
||||
<!--BAIDU AI配置-->
|
||||
<add key="APP_ID" value="23957173"/>
|
||||
<add key="API_KEY" value="G2aNlnPXNAoGLF4DdcyVFORI"/>
|
||||
<add key="SECRET_KEY" value="FdkDmVNHnZn7191YK9TrMIpEj0g4e5Nk"/>
|
||||
<!--人脸检测参数-->
|
||||
<!--人脸活体检测参数1最好,0最差 建议0.995 -->
|
||||
<add key="BD_face_liveness" value="0.3"/>
|
||||
<!--人脸高宽建议100-200-->
|
||||
<!--<add key="BD_width" value="200" />-->
|
||||
<!--<add key="BD_height" value="200" />-->
|
||||
<!--人脸角度-->
|
||||
<add key="BD_roll" value="40"/>
|
||||
<!--人脸遮档度0最好,1最不好-->
|
||||
<add key="BD_occlusion" value="1"/>
|
||||
<!--人脸模糊度0最好,1最不好-->
|
||||
<add key="BD_blur" value="0.1"/>
|
||||
</appSettings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FaceRecognition.aspx.cs" Inherits="FineUIPro.Web.WeldMat.UsingSentMat.FaceRecognition" %>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head id="Head1" runat="server">
|
||||
<title>人脸识别</title>
|
||||
<style id="Style1" runat="server" type="text/css">
|
||||
.title
|
||||
{
|
||||
font-size:14pt;
|
||||
font-weight:bold;
|
||||
text-align:center;
|
||||
}
|
||||
video, canvas { border: 1px solid #ccc; margin: 10px; }
|
||||
button { padding: 8px 16px; margin: 5px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="true" BodyPadding="5px" IconFont="PlusCircle" Title="人脸识别"
|
||||
TitleToolTip="人脸识别" AutoScroll="true">
|
||||
<Items>
|
||||
<f:ContentPanel ShowBorder="false" ShowHeader="false" ID="ContentPanel1" runat ="server" BodyStyle="text-align:center">
|
||||
<video id="video" width="480" height="640" autoplay></video>
|
||||
<canvas id="canvas" width="480" height="640" style="display:none" ></canvas>
|
||||
<div>
|
||||
<button id="captureBtn" type="button">识别</button>
|
||||
</div>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
const video = document.getElementById('video');
|
||||
const canvas = document.getElementById('canvas');
|
||||
const captureBtn = document.getElementById('captureBtn');
|
||||
const ctx = canvas.getContext('2d');
|
||||
let stream = null;
|
||||
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
stream = await navigator.mediaDevices.getUserMedia({
|
||||
video: {
|
||||
width: { ideal:480 },
|
||||
height: { ideal:640 },
|
||||
facingMode: "environment" // 后置摄像头
|
||||
},
|
||||
audio: false
|
||||
});
|
||||
video.srcObject = stream;
|
||||
} catch (err) {
|
||||
console.error("摄像头访问错误:", err);
|
||||
alert(`无法访问摄像头: ${err.message}`);
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
|
||||
|
||||
// 截图功能
|
||||
document.getElementById('captureBtn').addEventListener('click', () => {
|
||||
if (!stream) return alert('请先开启摄像头');
|
||||
|
||||
if (captureBtn.innerHTML == '识别') {
|
||||
captureBtn.innerHTML = '重新识别'
|
||||
|
||||
canvas.style = "";
|
||||
video.style = "display:none";
|
||||
// 适配高DPI屏幕
|
||||
const scale = window.devicePixelRatio || 1;
|
||||
canvas.width = video.videoWidth * scale;
|
||||
canvas.height = video.videoHeight * scale;
|
||||
|
||||
ctx.scale(scale, scale);
|
||||
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
||||
|
||||
// 生成图片下载链接
|
||||
const imgUrl = canvas.toDataURL('image/jpeg');
|
||||
|
||||
upLoadFile(imgUrl)
|
||||
//const link = document.createElement('a');
|
||||
//link.download = 'capture-' + new Date().getTime() + '.jpg';
|
||||
//link.href = imgUrl;
|
||||
//link.click();
|
||||
|
||||
} else {
|
||||
captureBtn.innerHTML = '识别'
|
||||
|
||||
video.style = "";
|
||||
canvas.style = "display:none";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
function upLoadFile(data) {
|
||||
$.ajax({
|
||||
url: "FaceRecognition.aspx/UploadData",
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({
|
||||
data: data,
|
||||
projectId:'<%=CurrUser.LoginProjectId%>'
|
||||
}),
|
||||
success: function (data) {
|
||||
/*window.parent.backData(data.d)*/
|
||||
alert(data.d)
|
||||
if (data.d.indexOf('识别失败') !== -1) {
|
||||
alert('识别失败请重新识别')
|
||||
}
|
||||
else {
|
||||
window.location.href = 'UsingMat.aspx?welderQRCode=' + data.d + '';
|
||||
var activeWindow = F.getActiveWindow();
|
||||
activeWindow.window.backData(data.d);
|
||||
activeWindow.hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Services;
|
||||
|
||||
|
||||
namespace FineUIPro.Web.WeldMat.UsingSentMat
|
||||
{
|
||||
public partial class FaceRecognition : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
[WebMethod]
|
||||
public static string UploadData(string data,string projectId)
|
||||
{
|
||||
byte[] imageBytes = Convert.FromBase64String(data.Substring("data:image/jpeg;base64,".Length));
|
||||
string filePath = "/FileUpLoad/FaceRecognition/" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".jpeg";
|
||||
if (!Directory.Exists(BLL.Funs.RootPath + "/FileUpLoad/FaceRecognition/"))
|
||||
{
|
||||
Directory.CreateDirectory(BLL.Funs.RootPath + "/FileUpLoad/FaceRecognition/");
|
||||
}
|
||||
|
||||
// 使用MemoryStream将字节数组转换为图片
|
||||
using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
|
||||
{
|
||||
System.Drawing.Image mImage = System.Drawing.Image.FromStream(ms);
|
||||
|
||||
// 使用Bitmap类从MemoryStream创建图片
|
||||
using (Bitmap image = new Bitmap(mImage))
|
||||
{
|
||||
// 保存图片到文件
|
||||
image.Save(BLL.Funs.RootPath + filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
var kqFace = (List<SgManager.AI.faceResult>)SgManager.AI.FaceClass.SearchFileFace(BLL.Funs.RootPath + filePath);
|
||||
if (kqFace == null || kqFace.Count == 0)
|
||||
{
|
||||
|
||||
return "识别失败";
|
||||
}
|
||||
else if (kqFace[0].errMess != "SUCCESS")
|
||||
{
|
||||
|
||||
return "识别失败;" + kqFace[0].errMess;
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
string idCard = kqFace[0].user_id;
|
||||
var welder = Funs.DB.HJGL_BS_Welder.FirstOrDefault(x => x.ProjectId == projectId && x.IdentityCard == idCard);
|
||||
if (welder != null)
|
||||
{
|
||||
return welder.WED_Code;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "识别失败;身份证号"+ idCard+"未找到焊工";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
return "识别失败";
|
||||
}
|
||||
}
|
||||
}
|
80
HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.designer.cs
generated
Normal file
80
HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/FaceRecognition.aspx.designer.cs
generated
Normal file
|
@ -0,0 +1,80 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.WeldMat.UsingSentMat
|
||||
{
|
||||
|
||||
|
||||
public partial class FaceRecognition
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Head1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
|
||||
|
||||
/// <summary>
|
||||
/// Style1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl Style1;
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
}
|
||||
}
|
|
@ -85,6 +85,16 @@
|
|||
</f:Image>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload ID="filePhoto1" runat="server" ButtonText="上传头像到百度" ButtonOnly="true"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto1_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Image ID="imgPhoto1" CssClass="userphoto" runat="server" BoxFlex="1" MarginLeft="10px">
|
||||
</f:Image>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
namespace FineUIPro.Web.common.WelderManage
|
||||
{
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using BLL;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SgManager.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ThoughtWorks.QRCode.Codec;
|
||||
using ThoughtWorks.QRCode.Codec.Data;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
public partial class WelderSave : PageBase
|
||||
{
|
||||
|
@ -225,6 +230,8 @@
|
|||
welder.ProjectId = this.CurrUser.LoginProjectId;
|
||||
welder.AttachUrl = this.AttachUrl;
|
||||
welder.SignatureUrl = imgPhoto.ImageUrl;
|
||||
welder.PhotoUrl = imgPhoto1.ImageUrl;
|
||||
|
||||
welder.IsOAM = true;
|
||||
if (string.IsNullOrEmpty(this.WED_ID))
|
||||
{
|
||||
|
@ -237,9 +244,125 @@
|
|||
BLL.HJGL_PersonManageService.UpdateBSWelder(welder);
|
||||
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "修改人员信息!");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(welder.PhotoUrl) )
|
||||
{
|
||||
Alert.ShowInParent(PersonFace(welder), MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
public static string PersonFace(Model.HJGL_BS_Welder person)
|
||||
{
|
||||
string message = string.Empty;
|
||||
string filePath = ConfigurationManager.AppSettings["localRoot"] + person.PhotoUrl;
|
||||
List<SgManager.AI.faceResult> kqFace = null;
|
||||
try
|
||||
{
|
||||
kqFace = (List<SgManager.AI.faceResult>)SgManager.AI.FaceClass.SearchFileFace(filePath);
|
||||
if (kqFace != null || kqFace.Count > 0 || kqFace[0].errMess == "SUCCESS")
|
||||
{
|
||||
string result = FaceClass.FaceVerify(filePath);
|
||||
JObject jresult = JObject.Parse(result);
|
||||
JObject lvresult = jresult.Value<JObject>("result");
|
||||
bool isOK = false;
|
||||
if (jresult.Value<int>("error_code") == 0)
|
||||
{
|
||||
if (lvresult.Value<double>("face_liveness") >= ConfigAppSetting.getConfigAppSetting("BD_face_liveness") ? true : false)//99.5%//活体度
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["location"]["width"]) > ConfigAppSetting.getConfigAppSetting("BD_width") ? true : false)
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["location"]["height"]) > ConfigAppSetting.getConfigAppSetting("BD_height") ? true : false)
|
||||
{
|
||||
if (System.Math.Abs(Convert.ToDouble(lvresult["face_list"][0]["angle"]["roll"])) <= ConfigAppSetting.getConfigAppSetting("BD_roll") ? true : false)//角度正负度数
|
||||
{
|
||||
if (System.Math.Abs(Convert.ToDouble(lvresult["face_list"][0]["angle"]["yaw"])) <= ConfigAppSetting.getConfigAppSetting("BD_roll") + 1 ? true : false)//角度正负度数
|
||||
{
|
||||
if (System.Math.Abs(Convert.ToDouble(lvresult["face_list"][0]["angle"]["pitch"])) <= ConfigAppSetting.getConfigAppSetting("BD_roll") + 1 ? true : false)//角度正负度数
|
||||
{
|
||||
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["left_eye"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["right_eye"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["nose"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["mouth"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["left_cheek"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["right_cheek"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["occlusion"]["chin_contour"]) <= ConfigAppSetting.getConfigAppSetting("BD_occlusion") ? true : false)// 0为无遮挡,1是完全遮挡
|
||||
{
|
||||
|
||||
|
||||
if (Convert.ToDouble(lvresult["face_list"][0]["quality"]["blur"]) <= ConfigAppSetting.getConfigAppSetting("BD_blur") ? true : false)//模糊度,0---1,小于0.7
|
||||
{ isOK = true; }
|
||||
else message = "清晰度检测失败"; ;
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "遮挡检测失败";
|
||||
}
|
||||
else message = "角度检测失败";
|
||||
}
|
||||
else message = "角度检测失败";
|
||||
}
|
||||
else message = "角度检测失败";
|
||||
}
|
||||
else message = "宽高检测失败";
|
||||
}
|
||||
else message = "宽高检测失败";
|
||||
}
|
||||
else message = "人脸动态检测失败";
|
||||
}
|
||||
else message = "识别不到人脸";
|
||||
if (isOK)
|
||||
{
|
||||
var faceResult = FaceClass.add(person.WED_ID, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["CEMS_IMG_URL"].ToString() + person.PhotoUrl, AccessToken.getAccessToken());
|
||||
var face = JsonConvert.DeserializeObject<dynamic>(faceResult);
|
||||
// JsonConvert.DeserializeObject<dynamic>(myPunishItem);
|
||||
if (face.error_code == 0 || face.error_code == 223105)
|
||||
{
|
||||
message = "人脸库注册成功!";
|
||||
// face_token = face.result.face_token;
|
||||
//APIPersonService.SaveSitePerson(person);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "注册人脸库失败" + face.error_code + face.error_msg;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message += "注册人脸库失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
message = "注册人脸库失败";
|
||||
ErrLogInfo.WriteLog(ex, "PC-人员信息保存", "SitePerson.PersonListEdit");
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
#region 上传电子签名图片
|
||||
/// <summary>
|
||||
/// 上传照片
|
||||
|
@ -264,6 +387,27 @@
|
|||
filePhoto.Reset();
|
||||
}
|
||||
}
|
||||
protected void filePhoto1_FileSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (filePhoto1.HasFile)
|
||||
{
|
||||
string fileName = filePhoto1.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
filePhoto1.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
imgPhoto1.ImageUrl = "~/upload/" + fileName;
|
||||
// 清空文件上传组件
|
||||
filePhoto1.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
//protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
//{
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.common.WelderManage {
|
||||
|
||||
|
||||
public partial class WelderSave {
|
||||
|
||||
namespace FineUIPro.Web.common.WelderManage
|
||||
{
|
||||
|
||||
|
||||
public partial class WelderSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
|
@ -20,7 +22,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
|
@ -29,7 +31,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
|
@ -38,7 +40,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
|
@ -47,7 +49,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtRecordDate 控件。
|
||||
/// </summary>
|
||||
|
@ -56,7 +58,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtRecordDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtName 控件。
|
||||
/// </summary>
|
||||
|
@ -65,7 +67,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtCode 控件。
|
||||
/// </summary>
|
||||
|
@ -74,7 +76,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtBirthday 控件。
|
||||
/// </summary>
|
||||
|
@ -83,7 +85,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtBirthday;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpSex 控件。
|
||||
/// </summary>
|
||||
|
@ -92,7 +94,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList drpSex;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkCode 控件。
|
||||
/// </summary>
|
||||
|
@ -101,7 +103,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtLimitDate 控件。
|
||||
/// </summary>
|
||||
|
@ -110,7 +112,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtLimitDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtClass 控件。
|
||||
/// </summary>
|
||||
|
@ -119,7 +121,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClass;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpIfOnGuard 控件。
|
||||
/// </summary>
|
||||
|
@ -128,7 +130,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBox drpIfOnGuard;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentityCard 控件。
|
||||
/// </summary>
|
||||
|
@ -137,7 +139,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentityCard;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
|
@ -146,7 +148,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSee 控件。
|
||||
/// </summary>
|
||||
|
@ -155,7 +157,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSee;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
|
@ -164,7 +166,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtRemark;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// filePhoto 控件。
|
||||
/// </summary>
|
||||
|
@ -173,7 +175,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload filePhoto;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// imgPhoto 控件。
|
||||
/// </summary>
|
||||
|
@ -182,7 +184,25 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Image imgPhoto;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// filePhoto1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload filePhoto1;
|
||||
|
||||
/// <summary>
|
||||
/// imgPhoto1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Image imgPhoto1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
@ -191,7 +211,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lbWelderRead 控件。
|
||||
/// </summary>
|
||||
|
@ -200,7 +220,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button lbWelderRead;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnWelderFaceRead 控件。
|
||||
/// </summary>
|
||||
|
@ -209,7 +229,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnWelderFaceRead;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
|
@ -218,7 +238,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
|
@ -227,7 +247,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
|
@ -236,7 +256,7 @@ namespace FineUIPro.Web.common.WelderManage {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window3 控件。
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue