结果接口: 通过属性名与mes编码对应,不使用PLC相对地址

This commit is contained in:
liming 蔡
2026-07-20 11:02:43 +08:00
parent b297ef0add
commit 6d2e1f4873
9 changed files with 154 additions and 111 deletions
+18 -1
View File
@@ -17,6 +17,7 @@ using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@@ -499,10 +500,26 @@ namespace JY.Inspection.Frm
data.CCD14 = row.Cells["中ME4"].Value?.ToString();
data.CCD15 = row.Cells["极柱(POS/NEG)"].Value?.ToString();
data.CCD16 = row.Cells["防爆阀(PRO)"].Value?.ToString();
data.Result = row.Cells["综合结果"].Value?.ToString();
data.Result = row.Cells["综合结果"].Value?.ToString()?.Trim();
data.Remark = row.Cells["备注"].Value?.ToString();
data.Flag = Convert.ToInt32(row.Cells["状态"].Value);
//var cfgList = Global.systemConfig.CollectItemCfgList.Where(it => it.IsEnable && it.PLCRelAddress != null)
// .OrderBy(it => it.PLCRelAddress).ToList();
//for (int k = 0; k < cfgList.Count; k++)
//{
// var item = cfgList[k];
// var prop = data.GetType().GetProperty(item.HCPropName);
// if (prop != null)
// {
// var code = prop.GetValue(data)?.ToString();
// data.PLCValDic.Add((int)item.PLCRelAddress, code);
// }
//}
return data;
}
+16 -9
View File
@@ -19,8 +19,8 @@ namespace JY.Inspection.Frm
pLogin_card.Location = new System.Drawing.Point(81, 282);
chkIsSK.CheckedChanged += chkIsSK_CheckedChanged;
txtPassword2.KeyUp += txtPassWord_KeyUp;
txtPassword2.KeyDown += txtPassword2_KeyDown;
txtICCard.KeyUp += txtPassWord_KeyUp;
txtICCard.KeyDown += txtPassword2_KeyDown;
btLogin.Click += btLogin_Click;
}
@@ -43,26 +43,26 @@ namespace JY.Inspection.Frm
TimeSpan ts = _tempDt.Subtract(_dt);
if (ts.Milliseconds > 100)
{
txtPassword2.Text = "";//清空
txtICCard.Text = "";//清空
}
else
{
if (e.KeyCode == Keys.Enter)
{
if (txtPassword2.Text == string.Empty)
if (txtICCard.Text == string.Empty)
{
txtPassword2.Focus();
txtICCard.Focus();
MessageBox.Show("IC卡号为空", "系统提示");
return;
}
UserHelper helper = new UserHelper("");
string strErr = "";
var res = helper.CheckUserLogin("user.pt", "", txtPassword2.Text.Trim(), ref strErr);
var res = helper.CheckUserLogin("user.pt", "", txtICCard.Text.Trim(), ref strErr);
if (res == null)
{
txtPassword2.Text = "";
txtPassword2.Focus();
txtICCard.Text = "";
txtICCard.Focus();
MessageBox.Show("IC卡号不正确" + strErr, "系统提示");
return;
}
@@ -87,7 +87,14 @@ namespace JY.Inspection.Frm
if (check_isMesLogin.Checked)
{
res = helper.CheckMesUserLogin(txtUserID.Text.Trim(), txtPassWord.Text.Trim(), ref strErr);
if (chkIsSK.Checked)
{
res = helper.CheckMesUserLogin(string.Empty, string.Empty, txtICCard.Text.Trim(), ref strErr);
}
else
{
res = helper.CheckMesUserLogin(txtUserID.Text.Trim(), txtPassWord.Text.Trim(), string.Empty, ref strErr);
}
}
else
{
+32 -32
View File
@@ -41,7 +41,7 @@ namespace JY.Inspection.Frm
this.pLogin_pwd = new System.Windows.Forms.Panel();
this.pLogin_card = new System.Windows.Forms.Panel();
this.lblICCard = new MetroFramework.Controls.MetroLabel();
this.txtPassword2 = new MetroFramework.Controls.MetroTextBox();
this.txtICCard = new MetroFramework.Controls.MetroTextBox();
this.check_isMesLogin = new MetroFramework.Controls.MetroCheckBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.pLogin_pwd.SuspendLayout();
@@ -197,7 +197,7 @@ namespace JY.Inspection.Frm
// pLogin_card
//
this.pLogin_card.Controls.Add(this.lblICCard);
this.pLogin_card.Controls.Add(this.txtPassword2);
this.pLogin_card.Controls.Add(this.txtICCard);
this.pLogin_card.Location = new System.Drawing.Point(81, 207);
this.pLogin_card.Name = "pLogin_card";
this.pLogin_card.Size = new System.Drawing.Size(333, 50);
@@ -213,39 +213,39 @@ namespace JY.Inspection.Frm
this.lblICCard.TabIndex = 25;
this.lblICCard.Text = "IC卡:";
//
// txtPassword2
// txtICCard
//
//
//
//
this.txtPassword2.CustomButton.Image = null;
this.txtPassword2.CustomButton.Location = new System.Drawing.Point(177, 1);
this.txtPassword2.CustomButton.Margin = new System.Windows.Forms.Padding(4);
this.txtPassword2.CustomButton.Name = "";
this.txtPassword2.CustomButton.Size = new System.Drawing.Size(27, 27);
this.txtPassword2.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.txtPassword2.CustomButton.TabIndex = 1;
this.txtPassword2.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.txtPassword2.CustomButton.UseSelectable = true;
this.txtPassword2.CustomButton.Visible = false;
this.txtPassword2.Lines = new string[0];
this.txtPassword2.Location = new System.Drawing.Point(105, 17);
this.txtPassword2.Margin = new System.Windows.Forms.Padding(4);
this.txtPassword2.MaxLength = 32767;
this.txtPassword2.Name = "txtPassword2";
this.txtPassword2.PasswordChar = '*';
this.txtPassword2.PromptText = "请刷卡";
this.txtPassword2.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.txtPassword2.SelectedText = "";
this.txtPassword2.SelectionLength = 0;
this.txtPassword2.SelectionStart = 0;
this.txtPassword2.ShortcutsEnabled = true;
this.txtPassword2.Size = new System.Drawing.Size(205, 29);
this.txtPassword2.TabIndex = 24;
this.txtPassword2.UseSelectable = true;
this.txtPassword2.WaterMark = "请刷卡";
this.txtPassword2.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.txtPassword2.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.txtICCard.CustomButton.Image = null;
this.txtICCard.CustomButton.Location = new System.Drawing.Point(177, 1);
this.txtICCard.CustomButton.Margin = new System.Windows.Forms.Padding(4);
this.txtICCard.CustomButton.Name = "";
this.txtICCard.CustomButton.Size = new System.Drawing.Size(27, 27);
this.txtICCard.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.txtICCard.CustomButton.TabIndex = 1;
this.txtICCard.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.txtICCard.CustomButton.UseSelectable = true;
this.txtICCard.CustomButton.Visible = false;
this.txtICCard.Lines = new string[0];
this.txtICCard.Location = new System.Drawing.Point(105, 17);
this.txtICCard.Margin = new System.Windows.Forms.Padding(4);
this.txtICCard.MaxLength = 32767;
this.txtICCard.Name = "txtICCard";
this.txtICCard.PasswordChar = '*';
this.txtICCard.PromptText = "请刷卡";
this.txtICCard.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.txtICCard.SelectedText = "";
this.txtICCard.SelectionLength = 0;
this.txtICCard.SelectionStart = 0;
this.txtICCard.ShortcutsEnabled = true;
this.txtICCard.Size = new System.Drawing.Size(205, 29);
this.txtICCard.TabIndex = 24;
this.txtICCard.UseSelectable = true;
this.txtICCard.WaterMark = "请刷卡";
this.txtICCard.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.txtICCard.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
// check_isMesLogin
//
@@ -304,7 +304,7 @@ namespace JY.Inspection.Frm
private System.Windows.Forms.Panel pLogin_pwd;
private System.Windows.Forms.Panel pLogin_card;
private MetroFramework.Controls.MetroLabel lblICCard;
private MetroFramework.Controls.MetroTextBox txtPassword2;
private MetroFramework.Controls.MetroTextBox txtICCard;
private MetroFramework.Controls.MetroCheckBox check_isMesLogin;
}
}