Переглянути джерело

添加易莱孚装大箱的功能

callm 1 день тому
батько
коміт
05c235fc39

+ 296 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ImeiCheck_ThreeLabelYLF.Designer.cs

@@ -0,0 +1,296 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_ImeiCheck_ThreeLabelYLF
+    {
+        /// <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;
+            // 
+            // 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;
+    }
+}

+ 285 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ImeiCheck_ThreeLabelYLF.cs

@@ -0,0 +1,285 @@
+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_ThreeLabelYLF : 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_ThreeLabelYLF()
+        {
+            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 = "";
+
+        string passsn = "";
+        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_code='" + sncode.Text + "' order by ms_id desc", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    sncode.Text = dt.Rows[0]["ms_sncode"].ToString();
+                }
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
+                {
+                    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);
+                }
+                //else
+                //{
+                //    OperateResult.AppendText("<<" + oErrorMessage + "\n", Color.Red, sncode);
+                //    return;
+                //}
+                //输入的是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 + "' or ms_code='" + 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,ms_code,ZD_D_SN from  makeserial left Join ztedata on ms_sncode=zd_sn and ms_makecode=zd_makecode  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]["ZD_D_SN"].ToString();
+                        passsn = 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);
+                    imei1 = sncode.Text;
+                    if (imei1.Contains(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
+                {
+                    if (imei1.Contains(checksn) && sncode.Text.Contains(checksn))
+                    {
+                        //说明输入的imei1对比一致
+                        //判断工序属性attribute
+                        if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out oErrorMessage))
+                        {
+                            //判断序列号下一工序(CHECKSTEPSNANDMACODE)   
+                            if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, passsn, 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, passsn, "标签核对", "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(passsn, DateTime.Now.ToString(), "成功");
+                                    //记录日志
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "标签核对", "标签核对成功", SN, "");
+                                    //SN核对成功
+                                    //>> 请输入SN
+                                    OperateResult.AppendText("<<条码2核对成功\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(">>SN核对失败,不一致\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 = "";
+        }
+    }
+}

+ 120 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_ImeiCheck_ThreeLabelYLF.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>

+ 2 - 2
UAS_MES_HYSX/FunctionCode/Make/Make_ListenSocket.Designer.cs

@@ -100,9 +100,9 @@
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_ListenSocket";
             this.Text = "Make_ListenSocket";
-            this.tableLayoutPanel1.ResumeLayout(false);
+            this.tableLayoutPanel1.ResumeLayout(true);
             this.tableLayoutPanel1.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 8 - 8
UAS_MES_HYSX/FunctionCode/Make/Make_WirelessThroughput.Designer.cs

@@ -709,18 +709,18 @@
             this.Name = "Make_WirelessThroughput";
             this.Text = "Make_WirelessThroughput";
             this.Load += new System.EventHandler(this.Make_WirelessThroughput_Load);
-            this.SNDetails.ResumeLayout(false);
-            this.tableLayoutPanel1.ResumeLayout(false);
+            this.SNDetails.ResumeLayout(true);
+            this.tableLayoutPanel1.ResumeLayout(true);
             this.tableLayoutPanel1.PerformLayout();
-            this.ProtDetails.ResumeLayout(false);
-            this.tableLayoutPanel2.ResumeLayout(false);
-            this.panel1.ResumeLayout(false);
+            this.ProtDetails.ResumeLayout(true);
+            this.tableLayoutPanel2.ResumeLayout(true);
+            this.panel1.ResumeLayout(true);
             this.panel1.PerformLayout();
-            this.panel2.ResumeLayout(false);
+            this.panel2.ResumeLayout(true);
             this.panel2.PerformLayout();
-            this.tableLayoutPanel3.ResumeLayout(false);
+            this.tableLayoutPanel3.ResumeLayout(true);
             this.tableLayoutPanel3.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
 
         }
 

+ 4 - 4
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionYLF.Designer.cs

@@ -1420,14 +1420,14 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PackCollection_FormClosing);
             this.Load += new System.EventHandler(this.PackCollection_Load);
             this.SizeChanged += new System.EventHandler(this.PackCollection_SizeChanged);
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
-            this.groupBoxWithBorder3.ResumeLayout(false);
+            this.groupBoxWithBorder3.ResumeLayout(true);
             this.groupBoxWithBorder3.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 8 - 5
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionYLF.cs

@@ -193,7 +193,10 @@ namespace UAS_MES_NEW.Packing
             //加载Grid数据
             dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pd_makecode,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
-            PackageDetail.FirstDisplayedScrollingRowIndex = PackageDetail.RowCount - 1;
+            if (PackageDetail.RowCount > 0) {
+                PackageDetail.FirstDisplayedScrollingRowIndex = PackageDetail.RowCount - 1;
+            }
+        
             if (dt.Rows.Count > 0)
             {
                 string choose_pd_barcode = dt.Rows[0]["pd_barcode"].ToString();
@@ -363,7 +366,7 @@ namespace UAS_MES_NEW.Packing
                                 //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCodeYLF("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);
@@ -471,7 +474,7 @@ namespace UAS_MES_NEW.Packing
                                     pa_outboxcode.Text = "";
                                     pa_status.Text = "0";
                                     BaseUtil.CleanDGVData(PackageDetail);
-                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCodeYLF("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
+                                    pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);
@@ -535,7 +538,7 @@ namespace UAS_MES_NEW.Packing
                                     {
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
-                                        HttpServer.GetOutBoxInfo(pa_outboxcode.Text);
+                                        HttpServer.GetOutBoxInfoYLF(pa_outboxcode.Text);
                                         pa_status.Text = "1";
                                         pa_standardqty.Text = "";
                                         if (AutoPrint.Checked)
@@ -675,7 +678,7 @@ namespace UAS_MES_NEW.Packing
                 string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (Seal == "Yes")
                 {
-                    HttpServer.GetOutBoxInfo(pa_outboxcode.Text);
+                    HttpServer.GetOutBoxInfoYLF(pa_outboxcode.Text);
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.Green);
                     dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     pa_status.Text = "1";

+ 4 - 1
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionZX.cs

@@ -193,7 +193,10 @@ namespace UAS_MES_NEW.Packing
             //加载Grid数据
             dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pd_makecode,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
-            PackageDetail.FirstDisplayedScrollingRowIndex = PackageDetail.RowCount - 1;
+            if (PackageDetail.RowCount > 0)
+            {
+                PackageDetail.FirstDisplayedScrollingRowIndex = PackageDetail.RowCount - 1;
+            }
             if (dt.Rows.Count > 0)
             {
                 string choose_pd_barcode = dt.Rows[0]["pd_barcode"].ToString();

+ 1 - 1
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.Designer.cs

@@ -820,7 +820,7 @@
             this.Load += new System.EventHandler(this.Make_PalletCollection_Load);
             this.SizeChanged += new System.EventHandler(this.Make_PalletCollection_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 61 - 0
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -508,6 +508,67 @@ namespace UAS_MES_NEW.PublicMethod
             dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + returnstr + "',sysdate,'GetOutBoxInfo')", "insert");
         }
 
+        public static void GetOutBoxInfoYLF(string iBox)
+        {
+            dynamic obj = new ExpandoObject();
+            var expandoDict = obj as IDictionary<string, object>;
+            DataTable dt = (DataTable)dh.ExecuteSql("select NOTYPE,po_sn,ma_custpo,pd_barcode,pd_makecode,ZD_D_SN from packagedetail left join ZTEDATA on zd_makecode=pd_makecode and pd_barcode=ZD_DEV_EN_NO left join make on ma_code=pd_makecode left join ZTE_ORDER on ma_custpo=BATCH_NO  where pd_outboxcode='" + iBox + "' and  RESERVE9='" + User.UserLineCode + "'", "select");
+            string makecode = "";
+            string po = "";
+            string notype = "";
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                string enNoKey = $"en_no{i}";
+                string enNoValue = dt.Rows[i]["ZD_D_SN"].ToString();
+                expandoDict[enNoKey] = enNoValue;
+                makecode = dt.Rows[i]["pd_makecode"].ToString();
+                po = dt.Rows[i]["po_sn"].ToString();
+                notype = dt.Rows[i]["NOTYPE"].ToString();
+            }
+            obj.request = "Q_wai_xiang";
+            obj.packing_num = dt.Rows.Count;
+            obj.User = "mes";
+            obj.po_sn = po;
+            obj.password = "258456";
+            obj.tool_name = "zte";
+            obj.noType = notype;
+            if (po == "")
+            {
+                BaseUtil.ShowError("工单未维护客户PO号,不允许执行该操作");
+            }
+            string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
+            string returnstr = ToServerReq(json);
+            dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + json + "',sysdate,'GetOutBoxInfo')", "insert");
+
+            var settings = new JsonSerializerSettings
+            {
+                Converters = new List<JsonConverter> { new DeviceInfoConverter() }
+            };
+
+            DeviceInfo deviceInfo = JsonConvert.DeserializeObject<DeviceInfo>(returnstr, settings);
+
+            //将返回的信息存入数据库
+            for (int i = 0; i < deviceInfo.DSN.Count; i++)
+            {
+                if (dh.CheckExist("ZTEDATA", "zd_sn='" + deviceInfo.DSN[i] + "' and zd_makecode='" + makecode + "' and zd_type='BOX'"))
+                {
+                    dh.ExecuteSql("delete from ZTEDATA where zd_sn='" + deviceInfo.DSN[i] + "' and zd_makecode='" + makecode + "' and zd_type='BOX'", "delete");
+                }
+                dh.ExecuteSql("insert into ZTEDATA(ZD_ID,ZD_SN, ZD_MAKECODE, ZD_TYPE, ZD_VALUE,ZD_product_mode, ZD_PRODUCTNAME, ZD_MATERIAL_CODE, ZD_BATCH_NO, ZD_SOFT_VERSION, ZD_HD_VERSION, " +
+                    "ZD_VOLTAGE, ZD_POWER, ZD_ORDER_NO, ZD_BIG_BOX_NO, ZD_D_SN, ZD_DEV_EN_NO, ZD_RESERVE3, ZD_DEVICEID, ZD_MAC_START, ZD_MAC_END,zd_production_date, ZD_INDATE)" +
+                    "values(ZTEDATA_seq.nextval,'" + deviceInfo.DSN[i] + "','" + makecode + "','BOX','" + deviceInfo.DSN[i] + "','" + deviceInfo.ProductMode + "','" + deviceInfo.ProductName + "','" + deviceInfo.MaterialCode + "','" + deviceInfo.BatchNo + "','" + deviceInfo.SoftVersion + "','" + deviceInfo.HdVersion + "'," +
+                    "'" + deviceInfo.Voltage + "','" + deviceInfo.Power + "','" + deviceInfo.OrderNo + "','" + deviceInfo.BigBoxNo + "','" + deviceInfo.DSN[i] + "'," +
+                    "'" + deviceInfo.DevEnNo[i] + "', '" + deviceInfo.Reserve3[i] + "','" + deviceInfo.DeviceId[i] + "','" + deviceInfo.MacStart[i] + "','" + deviceInfo.MacEnd[i] + "','" + deviceInfo.ProductionDate + "',sysdate)", "insert");
+            }
+            dh.ExecuteSql("update package set pa_zxcode ='" + deviceInfo.BigBoxNo + "' where pa_outboxcode='" + iBox + "'", "update");
+            if (returnstr.Length > 1000)
+            {
+                returnstr = returnstr.Substring(0, 1000);
+            }
+            dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + returnstr + "',sysdate,'GetOutBoxInfo')", "insert");
+        }
+
+
         //获取栈板信息
         public static void GetPalletInfo(string iBox)
         {

+ 9 - 0
UAS_MES_HYSX/UAS_MES_HYSX.csproj

@@ -635,6 +635,12 @@
     <Compile Include="FunctionCode\Make\Make_ImeiCheck_FourLabel.Designer.cs">
       <DependentUpon>Make_ImeiCheck_FourLabel.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabelYLF.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabelYLF.Designer.cs">
+      <DependentUpon>Make_ImeiCheck_ThreeLabelYLF.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1699,6 +1705,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_FourLabel.resx">
       <DependentUpon>Make_ImeiCheck_FourLabel.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabelYLF.resx">
+      <DependentUpon>Make_ImeiCheck_ThreeLabelYLF.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheck_ThreeLabel.resx">
       <DependentUpon>Make_ImeiCheck_ThreeLabel.cs</DependentUpon>
     </EmbeddedResource>