Browse Source

添加EAN核对功能

callm 9 months ago
parent
commit
af9d92deb7

+ 6 - 7
UAS_MES_LGDZ/CustomControl/ComBoxWithFocus/PrinterCombox.Designer.cs

@@ -37,21 +37,20 @@
             this.PrinterList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrinterList.FormattingEnabled = true;
             this.PrinterList.Location = new System.Drawing.Point(0, 0);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(252, 23);
+            this.PrinterList.Size = new System.Drawing.Size(378, 32);
             this.PrinterList.TabIndex = 0;
-            this.Load += PrinterCombox_Load;
             // 
             // PrinterCombox
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.PrinterList);
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "PrinterCombox";
-            this.Size = new System.Drawing.Size(252, 28);
-            this.ResumeLayout(true);
+            this.Size = new System.Drawing.Size(378, 45);
+            this.ResumeLayout(false);
 
         }
 

+ 1 - 1
UAS_MES_LGDZ/CustomControl/ComBoxWithFocus/SerialPortCombox.Designer.cs

@@ -51,7 +51,7 @@
             this.Name = "SerialPortCombox";
             this.Size = new System.Drawing.Size(279, 40);
             this.Load += new System.EventHandler(this.SerialPortCombox_Load);
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
 
         }
 

+ 1 - 1
UAS_MES_LGDZ/CustomControl/HeadBar/HeadBar.cs

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 if (logout_confirm == "Yes")
                 {
                     //注销的时候切换回默认数据库
-                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();

+ 2 - 2
UAS_MES_LGDZ/DataOperate/DataHelper.cs

@@ -10,11 +10,11 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     {
         //系统默认的的连接字符串 
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
         //public static readonly string ERPAddesss = "http://218.64.89.153:8099/mes/";
 
-        public static readonly string ERPAddesss = "http://172.16.30.253:8099/mes/";
+        public static readonly string ERPAddesss = "http://10.98.0.21:8099/mes/";
 
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -167,7 +167,7 @@ namespace UAS_MES_NEW.Make
                                             string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             WebClient wc = new WebClient();
-                                            wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                            wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                         }
                                     }
                                 }

+ 297 - 0
UAS_MES_LGDZ/FunctionCode/Make/Make_ImeiCheck_EAN.Designer.cs

@@ -0,0 +1,297 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_ImeiCheck_EAN
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.showResult = new System.Windows.Forms.ListView();
+            this.label10 = new System.Windows.Forms.Label();
+            this.remain_qty = new System.Windows.Forms.Label();
+            this.mcd_okqty = new System.Windows.Forms.Label();
+            this.ma_prodcode = new System.Windows.Forms.Label();
+            this.ma_code = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
+            this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.SuspendLayout();
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "结果";
+            this.columnHeader4.Width = 96;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "时间";
+            this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader3.Width = 170;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Text = "SN";
+            this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.columnHeader2.Width = 136;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Text = "";
+            this.columnHeader1.Width = 50;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pr_detail.Location = new System.Drawing.Point(1258, 38);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 31;
+            // 
+            // showResult
+            // 
+            this.showResult.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+            this.showResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.showResult.HideSelection = false;
+            this.showResult.Location = new System.Drawing.Point(942, 234);
+            this.showResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.showResult.Name = "showResult";
+            this.showResult.Size = new System.Drawing.Size(778, 510);
+            this.showResult.TabIndex = 30;
+            this.showResult.UseCompatibleStateImageBehavior = false;
+            this.showResult.View = System.Windows.Forms.View.Details;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.Location = new System.Drawing.Point(64, 788);
+            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(53, 35);
+            this.label10.TabIndex = 28;
+            this.label10.Text = "SN";
+            // 
+            // remain_qty
+            // 
+            this.remain_qty.AutoSize = true;
+            this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.remain_qty.Location = new System.Drawing.Point(204, 130);
+            this.remain_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.remain_qty.Name = "remain_qty";
+            this.remain_qty.Size = new System.Drawing.Size(0, 41);
+            this.remain_qty.TabIndex = 26;
+            // 
+            // mcd_okqty
+            // 
+            this.mcd_okqty.AutoSize = true;
+            this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.mcd_okqty.Location = new System.Drawing.Point(724, 130);
+            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Name = "mcd_okqty";
+            this.mcd_okqty.Size = new System.Drawing.Size(0, 41);
+            this.mcd_okqty.TabIndex = 25;
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_prodcode.Location = new System.Drawing.Point(724, 38);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.Name = "ma_prodcode";
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ma_prodcode.TabIndex = 24;
+            // 
+            // ma_code
+            // 
+            this.ma_code.AutoSize = true;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_code.Location = new System.Drawing.Point(204, 38);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(0, 41);
+            this.ma_code.TabIndex = 23;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label5.Location = new System.Drawing.Point(574, 130);
+            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(210, 41);
+            this.label5.TabIndex = 22;
+            this.label5.Text = "当前工单计数";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label4.Location = new System.Drawing.Point(54, 130);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(114, 41);
+            this.label4.TabIndex = 21;
+            this.label4.Text = "剩余数";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(1102, 38);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(146, 41);
+            this.label3.TabIndex = 20;
+            this.label3.Text = "产品名称";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label2.Location = new System.Drawing.Point(570, 38);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 19;
+            this.label2.Text = "产品编号";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label1.Location = new System.Drawing.Point(50, 38);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.TabIndex = 18;
+            this.label1.Text = "工单编号";
+            // 
+            // StepCount
+            // 
+            this.StepCount.LineCode = null;
+            this.StepCount.Location = new System.Drawing.Point(1102, 130);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.StepCount.Name = "StepCount";
+            this.StepCount.Size = new System.Drawing.Size(176, 44);
+            this.StepCount.Source = null;
+            this.StepCount.StepCode = null;
+            this.StepCount.TabIndex = 32;
+            this.StepCount.Load += new System.EventHandler(this.StepCount_Load);
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = null;
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(144, 788);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(334, 35);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 29;
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(58, 234);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(802, 510);
+            this.OperateResult.TabIndex = 27;
+            this.OperateResult.Text = "";
+            // 
+            // Make_ImeiCheck
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1772, 866);
+            this.Controls.Add(this.StepCount);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.showResult);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.label10);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.remain_qty);
+            this.Controls.Add(this.mcd_okqty);
+            this.Controls.Add(this.ma_prodcode);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Name = "Make_ImeiCheck";
+            this.Tag = "Make!ImeiCheck";
+            this.Load += new System.EventHandler(this.Make_LabelCheck_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_LabelCheck_SizeChanged);
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.ColumnHeader columnHeader4;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.ListView showResult;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox sncode;
+        private System.Windows.Forms.Label label10;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label remain_qty;
+        private System.Windows.Forms.Label mcd_okqty;
+        private System.Windows.Forms.Label ma_prodcode;
+        private System.Windows.Forms.Label ma_code;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+    }
+}

+ 374 - 0
UAS_MES_LGDZ/FunctionCode/Make/Make_ImeiCheck_EAN.cs

@@ -0,0 +1,374 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicForm;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_ImeiCheck_EAN : Form
+    {
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataHelper dh;
+
+        LogStringBuilder sql;
+
+        DataTable dt;
+
+        DataTable info;
+
+        string imei1 = "";
+
+        string imei2 = "";
+
+        bool isImei1 = false;
+
+        bool isImei2 = false;
+
+        string oErrorMessage = "";
+
+        string SN = "";
+
+        string omakeCode = "";
+
+        string oMsid = "";
+        public Make_ImeiCheck_EAN()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_LabelCheck_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            //聚焦SN号
+            sncode.Focus();
+            //打开界面提示用户:请输入SN 
+            OperateResult.AppendText(">>请输入SN\n", Color.Black);
+            sql = new LogStringBuilder();
+            dh = SystemInf.dh;
+            StepCount.StepCode = User.CurrentStepCode;
+            StepCount.Source = User.UserSourceCode;
+            StepCount.LineCode = User.UserLineCode;
+            StepCount.Dh = dh;
+            StepCount.Start();
+        }
+        string checksn = "";
+        private void Make_LabelCheck_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //判断是enter事件
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (sncode.Text == "")
+                {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei1='" + sncode.Text + "' order by ms_id desc", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    sncode.Text = dt.Rows[0]["ms_sncode"].ToString();
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_imei2='" + sncode.Text + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sncode.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    }
+                    else
+                    {
+                        dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei1='" + sncode.Text + "' order by mil_id desc", "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            sncode.Text = dt.Rows[0]["mil_sncode"].ToString();
+                        }
+                        else
+                        {
+                            dt = (DataTable)dh.ExecuteSql("select mil_sncode from makeimeilist where mil_imei2='" + sncode.Text + "' order by mil_id desc", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                sncode.Text = dt.Rows[0]["mil_sncode"].ToString();
+                            }
+                        }
+                    }
+                }
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
+                {
+
+                }
+                //输入的是SN
+                if (!isImei1 && !isImei2)
+                {
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                    sql.Clear();
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                    {
+                        sql.Clear();
+                        sql.Append("select max(ms_id) ms_id from makeserial where ms_imei1 ='" + sncode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                        {
+                            sql.Clear();
+                            sql.Append("select max(ms_id) ms_id from makeserial where ms_imei2 ='" + sncode.Text + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                            {
+                                sql.Clear();
+                                sql.Append("select max(ms_id) ms_id from makeimeilist left join makeserial on mil_makecode=ms_makecode and mil_sncode=ms_sncode where mil_imei1 ='" + sncode.Text + "'");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                                {
+                                    sql.Clear();
+                                    sql.Append("select max(ms_id) ms_id from makeimeilist left join makeserial on mil_makecode=ms_makecode and mil_sncode=ms_sncode where mil_imei2 ='" + sncode.Text + "'");
+                                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                                    {
+                                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red, sncode);
+                                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    //存在该SN号
+                    //根据该ms_id查询ms_imei1,ms_makecode信息
+                    sql.Clear();
+                    sql.Append("select ms_sncode from  makeserial  where ms_id='" + dt.Rows[0]["ms_id"].ToString() + "'");
+                    info = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (info.Rows.Count > 0)
+                    {
+                        //用变量记录imei1和makecode
+                        checksn = info.Rows[0]["ms_sncode"].ToString();
+                        SN = sncode.Text;
+                        //>> 请输入彩盒上的SN
+                        OperateResult.AppendText("<<条码" + sncode.Text + "对应的SN号为:" + checksn + "\n", Color.Green);
+                        OperateResult.AppendText(">>请输入需要核对的条码1\n", Color.Black, sncode);
+                        //设定要输入imei1
+                        isImei1 = true;
+                    }
+                    else
+                    {
+                        OperateResult.AppendText("<<SN:" + sncode.Text + "对应的SN不存在\n", Color.Red, sncode);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        SetCheck set = new SetCheck("NG", Color.Red);
+                        BaseUtil.SetFormCenter(set);
+                        set.ShowDialog();
+                    }
+                }
+                else if (isImei1)
+                {
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                    sql.Clear();
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='" + sncode.Text + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                    {
+                        sql.Clear();
+                        sql.Append("select max(ms_id) ms_id from makeserial where ms_imei1 ='" + sncode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                        {
+                            sql.Clear();
+                            sql.Append("select max(ms_id) ms_id from makeserial where ms_imei2 ='" + sncode.Text + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                            {
+                                sql.Clear();
+                                sql.Append("select max(ms_id) ms_id from makeimeilist left join makeserial on mil_makecode=ms_makecode and mil_sncode=ms_sncode where mil_imei1 ='" + sncode.Text + "'");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                                {
+                                    sql.Clear();
+                                    sql.Append("select max(ms_id) ms_id from makeimeilist left join makeserial on mil_makecode=ms_makecode and mil_sncode=ms_sncode where mil_imei2 ='" + sncode.Text + "'");
+                                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
+                                    {
+                                        OperateResult.AppendText("<<SN错误,序列号" + sncode.Text + "不存在\n", Color.Red, sncode);
+                                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                        SetCheck set = new SetCheck("NG", Color.Red);
+                                        BaseUtil.SetFormCenter(set);
+                                        set.ShowDialog();
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    sql.Clear();
+                    sql.Append("select ms_sncode from  makeserial  where ms_id='" + dt.Rows[0]["ms_id"].ToString() + "'");
+                    info = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (info.Rows.Count > 0)
+                    {
+                        imei1 = info.Rows[0]["ms_sncode"].ToString();
+                    }
+                    if (imei1 == checksn)
+                    {
+                        OperateResult.AppendText("<<条码1核对成功\n", Color.Green, sncode);
+                        OperateResult.AppendText(">>请输入需要核对的条码2\n", Color.Black);
+                        isImei2 = true;
+                        isImei1 = false;
+                    }
+                    else
+                    {
+                        //清空imei1变量的值
+                        imei1 = "";
+                        imei2 = "";
+                        checksn = "";
+                        //SN核对失败
+                        //>> 请输入SN
+                        OperateResult.AppendText(">>SN核对失败,不一致\n", Color.Red, sncode);
+                        SetCheck set = new SetCheck("NG", Color.Red);
+                        BaseUtil.SetFormCenter(set);
+                        set.ShowDialog();
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        isImei1 = false;
+                        isImei2 = false;
+                    }
+                }
+                //输入的是imei1
+                else
+                {
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                    sql.Clear();
+                    sql.Append("select ma_ean from  makeserial left join make on ma_code=ms_makecode  where ms_sncode='" + imei1 + "' order by ms_id desc");
+                    info = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (info.Rows.Count > 0)
+                    {
+                        imei2 = info.Rows[0]["ma_ean"].ToString();
+                    }
+                    if (imei1 == checksn && imei2 == sncode.Text)
+                    {
+                        //说明输入的imei1对比一致
+                        //判断工序属性attribute
+                        if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out oErrorMessage))
+                        {
+                            //判断序列号下一工序(CHECKSTEPSNANDMACODE)   
+                            if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, checksn, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
+                            {
+                                string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsid + "'").ToString();
+                                if (nextstepcode != User.CurrentStepCode)
+                                {
+                                    string stname = dh.getFieldDataByCondition("step", "st_name", "st_code='" + nextstepcode + "'").ToString();
+                                    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, sncode);
+                                    imei1 = "";
+                                    imei2 = "";
+                                    checksn = "";
+                                    isImei1 = false;
+                                    isImei2 = false;
+                                    return;
+                                }
+                                //调用  SETSTEPRESULT ,获取返回的工单号,
+                                if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, checksn, "标签核对", "OK", User.UserCode, out oErrorMessage))
+                                {
+
+                                    //提示正确返回时传递的信息
+                                    if (oErrorMessage.Contains("AFTERSUCCESS"))
+                                        OperateResult.AppendText(">>" + oErrorMessage + "\n");
+                                    //根据工单号查询makecraftdetail 表中的 mcd_okqty 计数,剩余数为ma_qty - nvl(mcd_inqty,0),刷新页面中工单信息的显示
+                                    sql.Clear();
+                                    sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode,pr_detail,");
+                                    sql.Append("ma_qty - nvl(mcd_okqty, 0) remain_qty from make left join makecraftdetail on ");
+                                    sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + omakeCode + "'  and mcd_stepcode='" + User.CurrentStepCode + "'");
+                                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    BaseUtil.SetFormValue(Controls, dt);
+                                    //将SN,时间,结果记录在页面
+                                    recordResult(checksn, DateTime.Now.ToString(), "成功");
+                                    //记录日志
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "标签核对", "标签核对成功", SN, "");
+                                    //SN核对成功
+                                    //>> 请输入SN
+                                    OperateResult.AppendText("<<EAN核对成功\n", Color.Green, sncode);
+                                    OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                }
+                                else
+                                {
+                                    //setstepresult不通过
+                                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
+                                    recordResult(checksn, DateTime.Now.ToString(), "失败");
+                                    SetCheck set = new SetCheck("NG", Color.Red);
+                                    BaseUtil.SetFormCenter(set);
+                                    set.ShowDialog();
+                                }
+                            }
+                            else
+                            {
+                                //判定序列号下一工序不通过
+                                OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
+                                recordResult(checksn, DateTime.Now.ToString(), "失败");
+                                SetCheck set = new SetCheck("NG", Color.Red);
+                                BaseUtil.SetFormCenter(set);
+                                set.ShowDialog();
+                            }
+                        }
+                        else
+                        {
+                            //判定工序属性不通过
+                            OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
+                            SetCheck set = new SetCheck("NG", Color.Red);
+                            BaseUtil.SetFormCenter(set);
+                            set.ShowDialog();
+                            recordResult(checksn, DateTime.Now.ToString(), "失败");
+                        }
+                    }
+                    //说明比对不一致
+                    else
+                    {
+                        //清空imei1变量的值
+                        imei1 = "";
+                        imei2 = "";
+                        checksn = "";
+                        //SN核对失败
+                        //>> 请输入SN
+                        OperateResult.AppendText(">>EAN核对失败,不一致\n", Color.Red, sncode);
+                        SetCheck set = new SetCheck("NG", Color.Red);
+                        BaseUtil.SetFormCenter(set);
+                        set.ShowDialog();
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                    }
+                    //imei1校对结束,下次输入的是SN
+                    isImei1 = false;
+                    isImei2 = false;
+                }
+            }
+        }
+        private void recordResult(string SN, string time, string result)
+        {
+            ListViewItem lvi = new ListViewItem();
+            //分条赋值
+            lvi.SubItems.Add(SN);
+            lvi.SubItems.Add(time);
+            lvi.SubItems.Add(result);
+            //添加结果的信息进去
+            showResult.Items.Add(lvi);
+        }
+        private void clear()
+        {
+            //清空变量的值
+            omakeCode = "";
+            oMsid = "";
+            SN = "";
+            imei1 = "";
+            imei2 = "";
+            checksn = "";
+        }
+
+        private void StepCount_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
UAS_MES_LGDZ/FunctionCode/Make/Make_ImeiCheck_EAN.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
UAS_MES_LGDZ/Login.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW
         {
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
-            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);

+ 1 - 1
UAS_MES_LGDZ/Main.cs

@@ -357,7 +357,7 @@ namespace UAS_MES_NEW
             if (logout_confirm == "Yes")
             {
                 //注销的时候切换回默认数据库
-                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.30.253)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();

+ 2 - 2
UAS_MES_LGDZ/PublicMethod/Print.cs

@@ -285,7 +285,7 @@ namespace UAS_MES_NEW.PublicMethod
                                 string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 WebClient wc = new WebClient();
-                                wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                             }
                         }
                     }
@@ -314,7 +314,7 @@ namespace UAS_MES_NEW.PublicMethod
                                     string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     WebClient wc = new WebClient();
-                                    wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                    wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                 }

+ 9 - 0
UAS_MES_LGDZ/UAS_MES_LGDZ.csproj

@@ -611,6 +611,12 @@
     <Compile Include="FunctionCode\Make\Make_GetTestFileData.Designer.cs">
       <DependentUpon>Make_GetTestFileData.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ImeiCheck_EAN.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ImeiCheck_EAN.Designer.cs">
+      <DependentUpon>Make_ImeiCheck_EAN.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1566,6 +1572,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_GetTestFileData.resx">
       <DependentUpon>Make_GetTestFileData.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_EAN.resx">
+      <DependentUpon>Make_ImeiCheck_EAN.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.resx">
       <DependentUpon>Make_ImeiCheck_ThreeLabel.cs</DependentUpon>
     </EmbeddedResource>