Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master'

章政 8 years ago
parent
commit
feed4ba690

+ 1 - 1
UAS-MES/CustomControl/RichText/RichTextAutoBottom.cs

@@ -9,7 +9,7 @@ namespace UAS_MES.CustomControl.RichText
     public partial class RichTextAutoBottom : RichTextBox
     {
         Thread thread;
-        string FileName = Application.StartupPath + @"\Resources\Sound\Windows Background.wav";
+        string FileName = Application.StartupPath + @"\Resources\Sound\3291.wav";
 
         public RichTextAutoBottom()
         {

+ 2 - 1
UAS-MES/CustomControl/TextBoxWithIcon/EnterTextBox.Designer.cs

@@ -32,8 +32,9 @@
             // 
             // EnterTextBox
             // 
-            this.Size = new System.Drawing.Size(196, 21);
+            this.Size = new System.Drawing.Size(196, 28);
             this.Enter += new System.EventHandler(this.EnterTextBox_Enter);
+            this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.EnterTextBox_KeyPress);
             this.Leave += new System.EventHandler(this.EnterTextBox_Leave);
             this.ResumeLayout(false);
 

+ 8 - 0
UAS-MES/CustomControl/TextBoxWithIcon/EnterTextBox.cs

@@ -76,5 +76,13 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             if (e.Modifiers.CompareTo(Keys.Control) == 0 && e.KeyCode == Keys.A)
                 this.SelectAll();
         }
+
+        private void EnterTextBox_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            if (e.KeyChar == System.Convert.ToChar(13))
+            {
+                e.Handled = true;
+            }
+        }
     }
 }

+ 1 - 1
UAS-MES/CustomControl/TextBoxWithIcon/MaCodeSearchTextBox.Designer.cs

@@ -57,7 +57,7 @@
             this.TextBox.Lock = false;
             this.TextBox.Name = "TextBox";
             this.TextBox.Power = null;
-            this.TextBox.Size = new System.Drawing.Size(178, 21);
+            this.TextBox.Size = new System.Drawing.Size(178, 25);
             this.TextBox.Str = null;
             this.TextBox.Str1 = null;
             this.TextBox.Str2 = null;

+ 259 - 0
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs

@@ -0,0 +1,259 @@
+namespace UAS_MES.Make
+{
+    partial class Make_CollectBTMAC
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_CollectBTMAC));
+            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.deleteButton1 = new UAS_MES.CustomControl.ButtonUtil.DeleteButton();
+            this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
+            this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
+            this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.sncode_label = new System.Windows.Forms.Label();
+            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.mcd_remainqty_label = new System.Windows.Forms.Label();
+            this.mcd_okqty_label = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(126, 17);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.TabIndex = 212;
+            // 
+            // deleteButton1
+            // 
+            this.deleteButton1.AllPower = null;
+            this.deleteButton1.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton1.Image")));
+            this.deleteButton1.Location = new System.Drawing.Point(498, 547);
+            this.deleteButton1.Name = "deleteButton1";
+            this.deleteButton1.Power = null;
+            this.deleteButton1.Size = new System.Drawing.Size(75, 23);
+            this.deleteButton1.TabIndex = 211;
+            this.deleteButton1.Text = "取消";
+            this.deleteButton1.UseVisualStyleBackColor = true;
+            this.deleteButton1.Click += new System.EventHandler(this.deleteButton1_Click);
+            // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty.Location = new System.Drawing.Point(412, 78);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_remainqty.TabIndex = 210;
+            this.mcd_remainqty.Text = "0";
+            // 
+            // mcd_okqty
+            // 
+            this.mcd_okqty.AutoSize = true;
+            this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_okqty.Location = new System.Drawing.Point(124, 78);
+            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(24, 27);
+            this.mcd_okqty.TabIndex = 209;
+            this.mcd_okqty.Text = "0";
+            // 
+            // ma_prodcode
+            // 
+            this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_prodcode.Location = new System.Drawing.Point(417, 21);
+            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, 27);
+            this.ma_prodcode.TabIndex = 208;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail.Location = new System.Drawing.Point(710, 17);
+            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, 27);
+            this.pr_detail.TabIndex = 207;
+            // 
+            // pr_detail_label
+            // 
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(597, 17);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.TabIndex = 206;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // sncode_label
+            // 
+            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode_label.AutoSize = true;
+            this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode_label.Location = new System.Drawing.Point(47, 545);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Name = "sncode_label";
+            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.TabIndex = 205;
+            this.sncode_label.Text = "录入框";
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = "ifall";
+            this.sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(157, 547);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(260, 25);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 204;
+            this.sncode.Tag = "ifwrite";
+            this.sncode.TextChanged += new System.EventHandler(this.sncode_TextChanged);
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(32, 139);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(940, 380);
+            this.OperateResult.TabIndex = 203;
+            this.OperateResult.Text = "";
+            // 
+            // mcd_remainqty_label
+            // 
+            this.mcd_remainqty_label.AutoSize = true;
+            this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(309, 78);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Name = "mcd_remainqty_label";
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
+            this.mcd_remainqty_label.TabIndex = 202;
+            this.mcd_remainqty_label.Text = "剩余数";
+            // 
+            // mcd_okqty_label
+            // 
+            this.mcd_okqty_label.AutoSize = true;
+            this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_okqty_label.Location = new System.Drawing.Point(27, 78);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Name = "mcd_okqty_label";
+            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_okqty_label.TabIndex = 201;
+            this.mcd_okqty_label.Text = "打印计数";
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(309, 17);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.TabIndex = 200;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.AutoSize = true;
+            this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_label.Location = new System.Drawing.Point(27, 17);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.TabIndex = 199;
+            this.ms_makecode_label.Text = "工单编号";
+            // 
+            // Make_CollectBTMAC
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1249, 602);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.deleteButton1);
+            this.Controls.Add(this.mcd_remainqty);
+            this.Controls.Add(this.mcd_okqty);
+            this.Controls.Add(this.ma_prodcode);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.pr_detail_label);
+            this.Controls.Add(this.sncode_label);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.mcd_remainqty_label);
+            this.Controls.Add(this.mcd_okqty_label);
+            this.Controls.Add(this.pr_code_label);
+            this.Controls.Add(this.ms_makecode_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_CollectBTMAC";
+            this.Tag = "Make!CollectBTMAC";
+            this.Text = "BT/MAC采集";
+            this.Activated += new System.EventHandler(this.Make_CollectBTMAC_Activated);
+            this.Load += new System.EventHandler(this.Make_CollectBTMAC_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_CollectBTMAC_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ValueLabel.ValueLabel ms_makecode;
+        private CustomControl.ButtonUtil.DeleteButton deleteButton1;
+        private CustomControl.ValueLabel.ValueNumLabel mcd_remainqty;
+        private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
+        private CustomControl.ValueLabel.ValueLabel ma_prodcode;
+        private CustomControl.ValueLabel.ValueLabel pr_detail;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label sncode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label mcd_remainqty_label;
+        private System.Windows.Forms.Label mcd_okqty_label;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label ms_makecode_label;
+    }
+}

+ 207 - 0
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -0,0 +1,207 @@
+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.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Make
+{
+    public partial class Make_CollectBTMAC : Form
+    {
+        DataHelper dh;
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        LogStringBuilder sql = new LogStringBuilder();
+        DataTable dt;
+        //当前序列号记录
+        string sn_code;
+        //制造单号
+        string macode;
+        //采集BT号
+        string ms_bt;
+        //采集MAC
+        string ms_mac;
+        //网标查询条件ms_id
+        string oMsID;
+        //判断是否输入BT
+        Boolean isBT = false;
+        //判断是否输入BT
+        Boolean isMAC = false;
+        //打印计数
+        int printcount = 0;
+
+        public Make_CollectBTMAC()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_CollectBTMAC_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper();
+            asc.controllInitializeSize(this);
+        }
+
+        private void Make_CollectBTMAC_Activated(object sender, EventArgs e)
+        {
+            sncode.Focus();
+        }
+
+        private void Make_CollectBTMAC_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void sncode_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void deleteButton1_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (!isMAC)
+                {
+                    if (!isBT)
+                    {
+                        //由序列号获取数据
+                        if (sncode.Text == "")
+                        {
+                            OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                            return;
+                        }
+                        OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                        string ErrorMessage2;
+                        string oMakeCode;
+                        // 获取工单归属工单下一工序是否正确
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                        {
+                            if (LogicHandler.GetMakeInfo(sncode.Text, out macode, out ErrorMessage2))
+                            {
+                                //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
+                                if (ms_makecode.Text != macode || macode == "")
+                                {
+                                    //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
+                                    if (macode != "" && ms_makecode.Text != "")
+                                    {
+                                        OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
+                                    }
+                                }
+                                sql.Clear();
+                                sql.Append("select  ma_code as ms_makecode,nvl(mcd_inqty,0),ma_prodcode,pr_detail,pr_spec, ");
+                                sql.Append("ma_qty-nvl(mcd_inqty,0)as mcd_remainqty from make left join makecraftdetail on mcd_maid=ma_id left join product on pr_code=ma_prodcode ");
+                                sql.Append("where ma_code=:ma_code");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", macode);
+                                if (dt.Rows.Count > 0)
+                                {
+                                    BaseUtil.SetFormValue(this.Controls, dt);
+                                    dh.UpdateByCondition("makeserial", "ms_currentstepcode = '" + User.CurrentStepCode + "'", "ms_id = '" + oMsID + "'");
+                                    OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                                    sn_code = sncode.Text;
+                                    sncode.Text = "";
+                                    isBT = true;
+                                    return;
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                                }
+
+                            }
+                            else
+                            {
+                                OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                            }
+                        }
+                        else
+                        {
+                            OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                        }
+
+                    }
+                    else
+                    //采集BT
+                    {
+                        if (sncode.Text == "")
+                        {
+                            OperateResult.AppendText(">>BT号不能为空\n", Color.Red);
+                            return;
+                        }
+                        OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                        string ErrorMessage = "";
+                        string result = "";
+                        //根据序列号获取此时BT号
+                        ms_bt = dh.getFieldDataByCondition("makeserial", "ms_bt", "ms_id = '" + oMsID + "'").ToString();
+                        if (sncode.Text == ms_bt)
+                        {
+                            OperateResult.AppendText(">>BT错误,重复\n", Color.Red);
+                            OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                            return;
+                        }
+                        else
+                        {
+                            ms_bt = sncode.Text;
+                            ErrorMessage = "工单" + sncode.Text + "BT采集完成>>>请输入SN";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            isBT = false;
+                            isMAC = true;
+                            ErrorMessage = ">>>请输入SN";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        }
+
+                    }
+                }
+                else
+                {
+                    //采集MAC
+                    if (sncode.Text == "")
+                    {
+                        OperateResult.AppendText(">>MAC号不能为空\n", Color.Red);
+                        return;
+                    }
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                    string ErrorMessage = "";
+                    string result = "";
+                    //根据序列号获取此时网标号
+                    ms_mac = dh.getFieldDataByCondition("makeserial", "ms_mac", "ms_id = '" + oMsID + "'").ToString();
+                    if (sncode.Text == ms_mac)
+                    {
+                        OperateResult.AppendText(">>MAC错误,重复\n", Color.Red);
+                        OperateResult.AppendText(">>请输入MAC\n", Color.Green);
+                        return;
+                    }
+                    else
+                    {
+                        if (LogicHandler.UpdateMakeMessage(sn_code, ms_makecode.Text, "BT/MAC采集", User.UserSourceCode, User.UserCode, "采集完成", out ErrorMessage))
+                        {
+                            dh.UpdateByCondition("makeserial", "ms_mac = '" + sncode.Text + "' ," + "ms_bt = '" + ms_bt + "'", "ms_id = '" + oMsID + "'");
+                            ErrorMessage = "BT/MAC采集完成,执行更新";
+                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            BaseUtil.CleanForm(this);
+                            printcount++;
+                            mcd_okqty.Text = printcount + "";
+                            mcd_remainqty.Text = 0 + "";
+                            isMAC = false;
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
+                        }
+                        ErrorMessage = ">>>请输入SN";
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                    }
+                }
+            }
+        }
+    }
+}

+ 214 - 0
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.resx

@@ -0,0 +1,214 @@
+<?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>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="deleteButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+</value>
+  </data>
+</root>

+ 30 - 31
UAS-MES/FunctionCode/Make/Make_CollectNetCode.Designer.cs

@@ -30,31 +30,22 @@
         {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_CollectNetCode));
-            this.ms_makecode = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.sncode_label = new System.Windows.Forms.Label();
             this.mcd_remainqty_label = new System.Windows.Forms.Label();
             this.mcd_okqty_label = new System.Windows.Forms.Label();
             this.pr_code_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.deleteButton1 = new UAS_MES.CustomControl.ButtonUtil.DeleteButton();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.deleteButton1 = new UAS_MES.CustomControl.ButtonUtil.DeleteButton();
             this.SuspendLayout();
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(187, 37);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 196;
-            // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
@@ -123,11 +114,33 @@
             this.ms_makecode_label.TabIndex = 184;
             this.ms_makecode_label.Text = "工单编号";
             // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(161, 37);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.TabIndex = 198;
+            // 
+            // deleteButton1
+            // 
+            this.deleteButton1.AllPower = null;
+            this.deleteButton1.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton1.Image")));
+            this.deleteButton1.Location = new System.Drawing.Point(533, 567);
+            this.deleteButton1.Name = "deleteButton1";
+            this.deleteButton1.Power = null;
+            this.deleteButton1.Size = new System.Drawing.Size(75, 23);
+            this.deleteButton1.TabIndex = 197;
+            this.deleteButton1.Text = "取消";
+            this.deleteButton1.UseVisualStyleBackColor = true;
+            this.deleteButton1.Click += new System.EventHandler(this.deleteButton1_Click);
+            // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(471, 98);
+            this.mcd_remainqty.Location = new System.Drawing.Point(447, 98);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -138,7 +151,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(187, 98);
+            this.mcd_okqty.Location = new System.Drawing.Point(159, 98);
             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(24, 27);
@@ -149,7 +162,7 @@
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(471, 37);
+            this.ma_prodcode.Location = new System.Drawing.Point(452, 41);
             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, 27);
@@ -194,26 +207,13 @@
             this.OperateResult.TabIndex = 188;
             this.OperateResult.Text = "";
             // 
-            // deleteButton1
-            // 
-            this.deleteButton1.AllPower = null;
-            this.deleteButton1.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton1.Image")));
-            this.deleteButton1.Location = new System.Drawing.Point(533, 567);
-            this.deleteButton1.Name = "deleteButton1";
-            this.deleteButton1.Power = null;
-            this.deleteButton1.Size = new System.Drawing.Size(75, 23);
-            this.deleteButton1.TabIndex = 197;
-            this.deleteButton1.Text = "取消";
-            this.deleteButton1.UseVisualStyleBackColor = true;
-            this.deleteButton1.Click += new System.EventHandler(this.deleteButton1_Click);
-            // 
             // Make_CollectNetCode
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1249, 602);
-            this.Controls.Add(this.deleteButton1);
             this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.deleteButton1);
             this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.ma_prodcode);
@@ -228,7 +228,7 @@
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Name = "Make_CollectNetCode";
-            this.Tag = "Make!CheckNoRelpace";
+            this.Tag = "Make!CollectNetCode";
             this.Text = "网标采集";
             this.Activated += new System.EventHandler(this.Make_CollectNetCode_Activated);
             this.Load += new System.EventHandler(this.Make_CollectNetCode_Load);
@@ -239,8 +239,6 @@
         }
 
         #endregion
-
-        private System.Windows.Forms.Label ms_makecode;
         private CustomControl.ValueLabel.ValueNumLabel mcd_remainqty;
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueLabel ma_prodcode;
@@ -254,5 +252,6 @@
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label ms_makecode_label;
         private CustomControl.ButtonUtil.DeleteButton deleteButton1;
+        private CustomControl.ValueLabel.ValueLabel ms_makecode;
     }
 }

+ 99 - 62
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -18,10 +18,19 @@ namespace UAS_MES.Make
         AutoSizeFormClass asc = new AutoSizeFormClass();
         LogStringBuilder sql = new LogStringBuilder();
         DataTable dt;
+        //当前序列号记录
+        string sn_code;
         //制造单号
         string macode;
-        //当前工单的序列号
-        string sn_code;
+        //采集网标号
+        string net_code;
+        //网标查询条件ms_id
+        string oMsID;
+        //判断是否输入网标
+        Boolean isnetcode = false;
+        //打印计数
+        int printcount = 0;
+
         public Make_CollectNetCode()
         {
             InitializeComponent();
@@ -31,88 +40,111 @@ namespace UAS_MES.Make
         {
             dh = new DataHelper();
             asc.controllInitializeSize(this);
+
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (sncode.Text == "")
-                {
-                    OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
-                    return;
-                }
-                string oMsID;
-                string ErrorMessage2;
-                string oMakeCode;
-                // 获取工单归属工单下一工序是否正确
-                if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                if (!isnetcode)
                 {
-                    if (LogicHandler.GetMakeInfo(sncode.Text, out macode, out ErrorMessage2))
+                    if (sncode.Text == "")
+                    {
+                        OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                        return;
+                    }
+                    OperateResult.AppendText("<<"+sncode.Text+"\n", Color.Green);
+                    string ErrorMessage2;
+                    string oMakeCode;
+                    // 获取工单归属工单下一工序是否正确
+                    if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                     {
-                        //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                        //  macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
-                        if (ms_makecode.Text != macode || macode == "")
+                        if (LogicHandler.GetMakeInfo(sncode.Text, out macode, out ErrorMessage2))
                         {
-                            //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
-                            if (macode != "" && ms_makecode.Text != "")
+                            //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
+                            if (ms_makecode.Text != macode || macode == "")
                             {
-                                OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
+                                //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
+                                if (macode != "" && ms_makecode.Text != "")
+                                {
+                                    OperateResult.AppendText(">>切换工单至工单号" + macode + "\n", Color.Red);
+                                }
                             }
-                        }
-                        sql.Clear();
-                        sql.Append("select  ma_code as ms_makecode,nvl(mcd_inqty,0),ma_prodcode,pr_detail,pr_spec, ");
-                        sql.Append("ma_qty-nvl(mcd_inqty,0)as mcd_remainqty from make left join makecraftdetail on mcd_maid=ma_id left join product on pr_code=ma_prodcode ");
-                        sql.Append("where ma_code=:ma_code");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", macode);
-                        if (dt.Rows.Count > 0)
-                        {
-                            BaseUtil.SetFormValue(this.Controls, dt);
-                            sn_code = sncode.Text;
-                            dh.UpdateByCondition("makeserial", "ms_currentstepcode = '"+User.CurrentStepCode+"'", "ms_id = '"+oMsID+"'");
+                            sql.Clear();
+                            sql.Append("select  ma_code as ms_makecode,nvl(mcd_inqty,0),ma_prodcode,pr_detail,pr_spec, ");
+                            sql.Append("ma_qty-nvl(mcd_inqty,0)as mcd_remainqty from make left join makecraftdetail on mcd_maid=ma_id left join product on pr_code=ma_prodcode ");
+                            sql.Append("where ma_code=:ma_code");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", macode);
+                            if (dt.Rows.Count > 0)
+                            {
+                                BaseUtil.SetFormValue(this.Controls, dt);
+                                dh.UpdateByCondition("makeserial", "ms_currentstepcode = '" + User.CurrentStepCode + "'", "ms_id = '" + oMsID + "'");
+                                OperateResult.AppendText(">>请输入网标\n", Color.Green);
+                                sn_code = sncode.Text;
+                                sncode.Text = "";
+                                isnetcode = true;
+                                return;
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                            }
+
                         }
                         else
                         {
-                            OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                            OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
                         }
-                        string ErrorMessage = "";
-                        string result = "";
-                        if (int.Parse(mcd_remainqty.Text) <= 0)
+                    }
+                    else {
+                        OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                    }
+                }
+                else
+                {
+                    if (sncode.Text == "")
+                    {
+                        OperateResult.AppendText(">>网标号不能为空\n", Color.Red);
+                        return;
+                    }
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                    string ErrorMessage = "";
+                    string result = "";
+                    //根据序列号获取此时网标号
+                    net_code = dh.getFieldDataByCondition("makeserial", "ms_netcode", "ms_id = '" + oMsID + "'").ToString();
+                    if (int.Parse(mcd_remainqty.Text) <= 0)
+                    {
+                        ErrorMessage = "工单" + sncode.Text + "剩余采集数不足>>>请输入SN";
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        return;
+                    }
+                    else if (sncode.Text == net_code) {
+                        OperateResult.AppendText(">>网标错误,重复\n", Color.Red);
+                        OperateResult.AppendText(">>请输入网标\n", Color.Green);
+                        return;
+                    }
+                    else
+                    {
+                        if (LogicHandler.UpdateMakeMessage(sn_code, ms_makecode.Text, "网标采集", User.UserSourceCode, User.UserCode, "采集完成", out ErrorMessage))
                         {
-                            macode = ms_makecode.Text;
-                            ErrorMessage = "工单" + macode + "打印完成>>>请输入SN";
+                            dh.UpdateByCondition("makeserial", "ms_netcode = '" + sncode.Text + "'", "ms_id = '" + oMsID + "'");
+                            ErrorMessage = "网标采集完成,执行更新";
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            return;
+                            BaseUtil.CleanForm(this);
+                            printcount++;
+                            mcd_okqty.Text = printcount + "";
+                            mcd_remainqty.Text = 0+ "";
+                            isnetcode = false;
                         }
                         else
                         {
-                            //if (LogicHandler.UpdateMakeMessage(sncode.Text, ms_makecode.Text, "colorbox", User.UserSourceCode, User.UserName, result, out ErrorMessage))
-                            //{
-                            //    ErrorMessage = "打印完成,执行更新";
-                            //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            //    mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
-                            //    mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
-                            //    sncode.Text = "";
-                            //}
-                            //else
-                            //{
-                            //    OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
-                            //}
-
-
-                            ErrorMessage = ">>>请输入SN";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            OperateResult.AppendText(">>更新错误" + ErrorMessage + "\n", Color.Red);
                         }
-                    }
-                    else
-                    {
-                        OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                        ErrorMessage = ">>>请输入SN";
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
                     }
                 }
-                else
-                {
-                    OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
-                }
             }
         }
 
@@ -128,7 +160,12 @@ namespace UAS_MES.Make
 
         private void deleteButton1_Click(object sender, EventArgs e)
         {
-            BaseUtil.CleanForm(this);
+            if (isnetcode) {
+                BaseUtil.CleanForm(this);
+                mcd_remainqty.Text = 0+ "";
+                OperateResult.AppendText(">>清除完成,清重新输入SN号\n", Color.Green);
+                isnetcode = false;
+            }
         }
     }
 }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -103,7 +103,7 @@ namespace UAS_MES.Make
                             if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
                             {
                                 Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text));
-                                if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserName, "彩盒打印成功", out ErrorMessage))
+                                if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserCode, "彩盒打印成功", out ErrorMessage))
                                 {
                                     ErrorMessage = "打印完成,执行更新";
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);

+ 134 - 70
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -36,7 +36,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.sncode_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
+            this.sncode = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
@@ -46,17 +46,22 @@
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.label3 = new System.Windows.Forms.Label();
+            this.load = new System.Windows.Forms.RadioButton();
+            this.unload = new System.Windows.Forms.RadioButton();
+            this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.code_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // ms_makecode_label
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(33, 41);
+            this.ms_makecode_label.Location = new System.Drawing.Point(50, 62);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(110, 31);
             this.ms_makecode_label.TabIndex = 125;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -64,9 +69,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(252, 41);
+            this.pr_code_label.Location = new System.Drawing.Point(378, 62);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.Size = new System.Drawing.Size(110, 31);
             this.pr_code_label.TabIndex = 126;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -74,9 +80,10 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(33, 90);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(378, 130);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(110, 31);
             this.mcd_okqty_label.TabIndex = 127;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -84,9 +91,10 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(252, 90);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(706, 130);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(86, 31);
             this.mcd_remainqty_label.TabIndex = 128;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -94,9 +102,10 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(471, 90);
+            this.label4.Location = new System.Drawing.Point(1121, 222);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.Size = new System.Drawing.Size(110, 31);
             this.label4.TabIndex = 129;
             this.label4.Text = "打印张数";
             // 
@@ -106,9 +115,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(33, 448);
+            this.sncode_label.Location = new System.Drawing.Point(50, 128);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.sncode_label.Size = new System.Drawing.Size(86, 31);
             this.sncode_label.TabIndex = 145;
             this.sncode_label.Text = "序列号";
             // 
@@ -116,29 +126,32 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(471, 41);
+            this.pr_detail_label.Location = new System.Drawing.Point(706, 62);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 146;
             this.pr_detail_label.Text = "产品名称";
             // 
-            // label1
+            // sncode
             // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(745, 90);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(42, 21);
-            this.label1.TabIndex = 160;
-            this.label1.Text = "标签";
+            this.sncode.AutoSize = true;
+            this.sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode.Location = new System.Drawing.Point(1118, 135);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode.Name = "sncode";
+            this.sncode.Size = new System.Drawing.Size(62, 31);
+            this.sncode.TabIndex = 160;
+            this.sncode.Text = "标签";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(745, 39);
+            this.label2.Location = new System.Drawing.Point(1118, 58);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(58, 21);
+            this.label2.Size = new System.Drawing.Size(86, 31);
             this.label2.TabIndex = 161;
             this.label2.Text = "打印机";
             // 
@@ -146,27 +159,27 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(822, 90);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.PrintLabel.Location = new System.Drawing.Point(1233, 135);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(152, 20);
+            this.PrintLabel.Size = new System.Drawing.Size(226, 26);
             this.PrintLabel.TabIndex = 162;
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(822, 39);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4);
+            this.Printer.Location = new System.Drawing.Point(1233, 58);
+            this.Printer.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(152, 25);
+            this.Printer.Size = new System.Drawing.Size(228, 38);
             this.Printer.TabIndex = 159;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(347, 90);
+            this.mcd_remainqty.Location = new System.Drawing.Point(848, 130);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
+            this.mcd_remainqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_remainqty.TabIndex = 158;
             this.mcd_remainqty.Text = "0";
             // 
@@ -174,9 +187,10 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(127, 90);
+            this.mcd_okqty.Location = new System.Drawing.Point(518, 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(19, 21);
+            this.mcd_okqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_okqty.TabIndex = 157;
             this.mcd_okqty.Text = "0";
             // 
@@ -184,9 +198,10 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(347, 41);
+            this.pr_code.Location = new System.Drawing.Point(520, 62);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 21);
+            this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 156;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -194,18 +209,20 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(568, 41);
+            this.pr_detail.Location = new System.Drawing.Point(852, 62);
+            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, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 154;
             // 
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(127, 41);
+            this.ms_makecode.Location = new System.Drawing.Point(190, 62);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 31);
             this.ms_makecode.TabIndex = 152;
             // 
             // PrintNum
@@ -213,51 +230,94 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(566, 90);
+            this.PrintNum.Location = new System.Drawing.Point(1264, 222);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(165, 21);
+            this.PrintNum.Size = new System.Drawing.Size(197, 28);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
             this.PrintNum.TabIndex = 151;
             // 
-            // sncode
-            // 
-            this.sncode.AllPower = "ifall";
-            this.sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.sncode.BackColor = System.Drawing.Color.White;
-            this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(122, 449);
-            this.sncode.Name = "sncode";
-            this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(196, 21);
-            this.sncode.Str = null;
-            this.sncode.Str1 = null;
-            this.sncode.Str2 = null;
-            this.sncode.TabIndex = 144;
-            this.sncode.Tag = "ifwrite";
-            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
-            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(37, 130);
+            this.OperateResult.Location = new System.Drawing.Point(56, 195);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(706, 305);
+            this.OperateResult.Size = new System.Drawing.Size(1057, 456);
             this.OperateResult.TabIndex = 143;
             this.OperateResult.Text = "";
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(174, 128);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(0, 31);
+            this.label3.TabIndex = 163;
+            // 
+            // load
+            // 
+            this.load.AutoSize = true;
+            this.load.Location = new System.Drawing.Point(72, 679);
+            this.load.Name = "load";
+            this.load.Size = new System.Drawing.Size(69, 22);
+            this.load.TabIndex = 164;
+            this.load.TabStop = true;
+            this.load.Text = "上料";
+            this.load.UseVisualStyleBackColor = true;
+            // 
+            // unload
+            // 
+            this.unload.AutoSize = true;
+            this.unload.Location = new System.Drawing.Point(247, 679);
+            this.unload.Name = "unload";
+            this.unload.Size = new System.Drawing.Size(69, 22);
+            this.unload.TabIndex = 165;
+            this.unload.TabStop = true;
+            this.unload.Text = "下料";
+            this.unload.UseVisualStyleBackColor = true;
+            // 
+            // code
+            // 
+            this.code.AllPower = null;
+            this.code.BackColor = System.Drawing.Color.White;
+            this.code.ID = null;
+            this.code.Location = new System.Drawing.Point(566, 678);
+            this.code.Name = "code";
+            this.code.Power = null;
+            this.code.Size = new System.Drawing.Size(196, 28);
+            this.code.Str = null;
+            this.code.Str1 = null;
+            this.code.Str2 = null;
+            this.code.TabIndex = 166;
+            // 
+            // code_label
+            // 
+            this.code_label.AutoSize = true;
+            this.code_label.Location = new System.Drawing.Point(458, 683);
+            this.code_label.Name = "code_label";
+            this.code_label.Size = new System.Drawing.Size(62, 18);
+            this.code_label.TabIndex = 167;
+            this.code_label.Text = "录入框";
+            // 
             // Make_ColorBoxLoadPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1012, 483);
+            this.ClientSize = new System.Drawing.Size(1518, 724);
+            this.Controls.Add(this.code_label);
+            this.Controls.Add(this.code);
+            this.Controls.Add(this.unload);
+            this.Controls.Add(this.load);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.label1);
+            this.Controls.Add(this.sncode);
             this.Controls.Add(this.Printer);
             this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_okqty);
@@ -267,7 +327,6 @@
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.sncode_label);
-            this.Controls.Add(this.sncode);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.mcd_remainqty_label);
@@ -275,6 +334,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Make_ColorBoxLoadPrint";
             this.Tag = "Make!ColorBoxLoadPrint";
             this.Text = "标签打印";
@@ -294,7 +354,6 @@
         private System.Windows.Forms.Label mcd_remainqty_label;
         private System.Windows.Forms.Label label4;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private System.Windows.Forms.Label sncode_label;
         private System.Windows.Forms.Label pr_detail_label;
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
@@ -304,8 +363,13 @@
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueNumLabel mcd_remainqty;
         private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
-        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label sncode;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.ComboBox PrintLabel;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.RadioButton load;
+        private System.Windows.Forms.RadioButton unload;
+        private CustomControl.TextBoxWithIcon.EnterTextBox code;
+        private System.Windows.Forms.Label code_label;
     }
 }

+ 34 - 32
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -19,7 +19,7 @@ namespace UAS_MES.Make
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
-        // DataTable ListB;
+        DataTable mapB;
         //保存ProductLabel数据
         DataTable ListC;
         //工序编号
@@ -31,24 +31,26 @@ namespace UAS_MES.Make
         //制造单号
         string ma_code;
         //当前工单的序列号
-        string sn_code;
+        //string sn_code;
         //当前提示的索引
         int RemainIndex = 0;
 
-        string Step = "Loading";
+        //string Step = "Loading";
 
         ApplicationClass lbl;
 
         public Make_ColorBoxLoadPrint()
         {
             InitializeComponent();
+            //默认选中上料
+            load.Checked = true;
         }
 
         private void 标签打印_Load(object sender, EventArgs e)
         {
             dh = new DataHelper();
             lbl = new ApplicationClass();
-            sncode.Focus();
+            code.Focus();
             asc.controllInitializeSize(this);
         }
 
@@ -56,28 +58,26 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (sncode.Text == "")
+                if (code.Text == "")
                 {
-                    OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                    OperateResult.AppendText(">>输入内容不能为空\n", Color.Red);
                     return;
                 }
+                //string Omakecode;
+                //string Omsid;
+                //string Oerrormessage;
+                //LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out Omakecode, out Omsid, out Oerrormessage)
                 //通过输入指定字符来设置当前执行的步骤
-                if (sncode.Text == "L")
+                if (load.Checked=true)
                 {
-                    Step = " ";
                     OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
                 }
-                else if (sncode.Text == "R")
+                else if (unload.Checked=true)
                 {
-                    Step = "UnLoading";
                     OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
                 }
                 //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
+                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + code.Text + "'").ToString();
                 if (ms_makecode.Text != ma_code || ma_code == "")
                 {
                     //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
@@ -86,41 +86,43 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>切换工单至工单号" + ma_code + "\n", Color.Red);
                     }
                     sql.Clear();
-                    sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
+                    sql.Append("select ma_code as ms_makecode,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
                     sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                     sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text);
                     if (dt.Rows.Count > 0)
                     {
                         BaseUtil.SetFormValue(this.Controls, dt);
-                        sn_code = sncode.Text;
+                        sncode.Text = code.Text;
                     }
                     else
                     {
-                        OperateResult.AppendText(">>序列号" + sncode.Text + "不存在\n", Color.Red);
+                        OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red);
                         return;
                     }
 
                     //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                    if (Step == "Loading")
+                    if (load.Checked=true)
                     {
                         sql.Clear();
                         sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
                         sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text, code.Text);
                         //记录一些变量
                         stepcode = dt.Rows[0]["ms_stepcode"].ToString();
                         nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
                         craftcode = dt.Rows[0]["ma_craftcode"].ToString();
                         string ErrorMessage;
-                        bool ifFirst;
+                        string Omakecode;
+                        string Omsid;
+                        //string Oerrormessage;
                         //检测当前序列号和岗位资源是否对应
-                        if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out Omakecode, out Omsid, out ErrorMessage))
                         {
                             //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
                             sql.Clear();
                             sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
-                            sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
+                            sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + code.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -155,17 +157,17 @@ namespace UAS_MES.Make
                         }
                         else
                         {
-                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
+                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, code.Text);
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         }
                     }
                     //如果执行的是下料操作
-                    else if (Step == "UnLoading")
+                    else if (unload.Checked=true)
                     {
                         string ErrorMessage1 = "";
-                        if (LogicHandler.SetMaterialDown(sn_code, sncode.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
+                        if (LogicHandler.SetMaterialDown(sncode.Text, code.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
                         {
-                            OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
+                            OperateResult.AppendText(">>条码" + code.Text + "下料成功\n", Color.Green);
                         }
                         else
                         {
@@ -187,7 +189,7 @@ namespace UAS_MES.Make
                         if (RemainIndex == ListA.Rows.Count - 1)
                         {
                             OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                            sn_code = "";
+                            sncode.Text = "";
                             return;
                         }
                         string ErrorMessage;
@@ -195,7 +197,7 @@ namespace UAS_MES.Make
                         string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
                         string sonID = ListA.Rows[RemainIndex]["sp_id"].ToString();
                         //执行上料
-                        if (LogicHandler.SetMaterialUp(sn_code, ms_makecode.Text, sncode.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
+                        if (LogicHandler.SetMaterialUp(sncode.Text, ms_makecode.Text, code.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
                         {
                             RemainIndex = RemainIndex + 1;
                             OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
@@ -220,7 +222,7 @@ namespace UAS_MES.Make
             //局部变量ErrorMessage1
             string ErrorMessage1;
             //由于打印驱动暂时不可用,暂时注释打印方法
-            if (LogicHandler.SetCollectionFinish(sncode.Text, ms_makecode.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
+            if (LogicHandler.SetCollectionFinish(code.Text, ms_makecode.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
             {
                 sncode.Text = "";
                 //如果值为空默认设置为0
@@ -255,7 +257,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";

+ 10 - 10
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.Designer.cs

@@ -39,6 +39,7 @@
             this.mcd_okqty_label = new System.Windows.Forms.Label();
             this.pr_code_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ma_code = new System.Windows.Forms.Label();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
@@ -47,7 +48,6 @@
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.ma_code = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // PrintLabel
@@ -161,6 +161,15 @@
             this.ms_makecode_label.TabIndex = 163;
             this.ms_makecode_label.Text = "归属工单";
             // 
+            // ma_code
+            // 
+            this.ma_code.AutoSize = true;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_code.Location = new System.Drawing.Point(157, 67);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(0, 31);
+            this.ma_code.TabIndex = 182;
+            // 
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(1213, 65);
@@ -259,15 +268,6 @@
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
-            // ma_code
-            // 
-            this.ma_code.AutoSize = true;
-            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_code.Location = new System.Drawing.Point(157, 67);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 31);
-            this.ma_code.TabIndex = 182;
-            // 
             // Make_FuselageLabelPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);

+ 39 - 210
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -17,29 +17,29 @@ namespace UAS_MES.Make
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
         //保存StepProduct查询出来的数据
-        DataTable ListA = new DataTable();
+        //        DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
         // DataTable ListB;
         DataTable mapB;
         //保存ProductLabel数据
         DataTable ListC;
         //工序编号
-        string stepcode;
+        //        string stepcode;
         //下一工序编号
-        string nextstepcode;
+        //        string nextstepcode;
         //工艺路线编号
-        string craftcode;
+        //        string craftcode;
         //制造单号
-        string make_code;
+        //        string make_code;
         //当前工单的序列号
-        string sn_code;
+        //        tring sn_code;
         //当前提示的索引
-        int RemainIndex = 0;
+        //        int RemainIndex = 0;
 
-        string Step = "Loading";
+        //        string Step = "Loading";
 
         ApplicationClass lbl;
-        
+
         string oErrorMessage = "";
 
         public Make_FuselageLabelPrint()
@@ -70,7 +70,8 @@ namespace UAS_MES.Make
                 string oMakeCode = "";
                 string oMsId = "";
                 //调用公共方法CheckStepSNAndMacode判断工序是否正确
-                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text,User.UserCode,out oMakeCode,out oMsId, out oErrorMessage)) {
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
+                {
                     //IF (如果ma_code 为空)THEN
                     if (ma_code.Text == "")
                     {
@@ -78,20 +79,22 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");
                         sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty 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+"'");
-                        mapB = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                        //将工单的其他信息赋值到对应的控件
-                        if (mapB.Rows.Count>0) {
-                            BaseUtil.SetFormValue(this.Controls,mapB);
+                        sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                        mapB = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        //如果有数据的话
+                        if (mapB.Rows.Count > 0)
+                        {
+                            //将工单的其他信息赋值到对应的控件
+                            BaseUtil.SetFormValue(this.Controls, mapB);
+                            //提示用户“<<工单号:取ma_makecode”
+                            OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Green);
+                            //提示用户“<< 序列号:XXXX”
+                            OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Green);
                         }
-
-                        //获取对应 产品的机身标的打印模板
-                        sql.Clear();
-                        sql.Append("select * from productlabel where pl_prodcode='"+ma_prodcode.Text+"' and PL_LABELTYPE='彩盒标',");
-                        ListC = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                        //查询没有结果就提示
-                        if (ListC.Rows.Count==0) {
-                            OperateResult.AppendText(">>该序列号对应的产品未维护机身标标签模板\n", Color.Red);
+                        //没有数据
+                        else
+                        {
+                            OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
                         }
 
                         //所选标签不为空
@@ -111,17 +114,18 @@ namespace UAS_MES.Make
                                 sncode.Text = "";
                                 sncode.Focus();
                                 //刷新打印数量和剩余数量
-                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - int.Parse(PrintNum.Text) + "";
-                                mcd_okqty.Text = int.Parse(PrintNum.Text)+"";
+                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
+                                mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
 
                                 //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
                                 if (int.Parse(mcd_remainqty.Text) == 0)
                                 {
                                     BaseUtil.CleanForm(this);
-                                    OperateResult.AppendText(">>工单:"+ma_code.Text+"打印完成,>>请输入SN\n", Color.Green);
+                                    OperateResult.AppendText(">>工单:" + ma_code.Text + "打印完成,>>请输入SN\n", Color.Green);
                                 }
                                 //剩余数量不为0
-                                else {
+                                else
+                                {
                                     //提示用户“>>请输入SN”
                                     OperateResult.AppendText(">>请输入SN\n", Color.Green);
                                 }
@@ -133,200 +137,25 @@ namespace UAS_MES.Make
                             }
                         }
                         //标签为空
-                        else {
+                        else
+                        {
                             OperateResult.AppendText(">>无可用标签\n", Color.Red);
                         }
                     }
                 }
-                else {
-                    OperateResult.AppendText(">>"+oErrorMessage+"\n", Color.Red);
-                }
-
-                //    //通过输入指定字符来设置当前执行的步骤
-                //    if (sncode.Text == "L")
-                //    {
-                //        Step = " ";
-                //        OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                //        sncode.Text = "";
-                //        return;
-                //    }
-                //    else if (sncode.Text == "R")
-                //    {
-                //        Step = "UnLoading";
-                //        OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
-                //        sncode.Text = "";
-                //        return;
-                //    }
-                //    //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                //    ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
-                //    if (ms_makecode.Text != ma_code || ma_code == "")
-                //    {
-                //        //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
-                //        if (ma_code != "" && ms_makecode.Text != "")
-                //        {
-                //            OperateResult.AppendText(">>切换工单至工单号" + ma_code + "\n", Color.Red);
-                //        }
-                //        sql.Clear();
-                //        sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
-                //        sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
-                //        sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
-                //        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
-                //        if (dt.Rows.Count > 0)
-                //        {
-                //            BaseUtil.SetFormValue(this.Controls, dt);
-                //            sn_code = sncode.Text;
-                //        }
-                //        else
-                //        {
-                //            OperateResult.AppendText(">>序列号" + sncode.Text + "不存在\n", Color.Red);
-                //            return;
-                //        }
-
-                //        //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                //        if (Step == "Loading")
-                //        {
-                //            sql.Clear();
-                //            sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
-                //            sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                //            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
-                //            //记录一些变量
-                //            stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                //            nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                //            craftcode = dt.Rows[0]["ma_craftcode"].ToString();
-                //            string ErrorMessage;
-                //            bool ifFirst;
-                //            //检测当前序列号和岗位资源是否对应
-                //            if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
-                //            {
-                //                //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
-                //                sql.Clear();
-                //                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
-                //                sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
-                //                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                //                if (dt.Rows.Count > 0)
-                //                {
-                //                    //如果是上料工序
-                //                    if (dt.Rows[0]["cd_ifinput"].ToString() != "0")
-                //                    {
-                //                        // 查询没有结果,提示该上料工序没有需要上料的数据,请先维护对应的数据
-                //                        sql.Clear();
-                //                        sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
-                //                        sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                //                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cd_ifinput"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
-                //                        sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
-                //                        sql.Append("order by SP_DETNO asc");
-                //                        ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                //                        //获取对应 产品的机身标的打印模板
-                //                        if (ListA.Rows.Count > 0)
-                //                        {
-                //                            OperateResult.AppendText(">>请采集" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                //                        }
-                //                        //未查询到数据时标识是测试工序
-                //                        else
-                //                        {
-                //                            DoTestProcedure();
-                //                        }
-                //                    }
-                //                    //同上,如果,iftest不等于0也进入测试工序
-                //                    else if (dt.Rows[0]["cd_iftest"].ToString() != "0")
-                //                    {
-                //                        DoTestProcedure();
-                //                    }
-                //                }
-                //            }
-                //            else
-                //            {
-                //                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
-                //                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                //            }
-                //        }
-                //        //如果执行的是下料操作
-                //        else if (Step == "UnLoading")
-                //        {
-                //            string ErrorMessage1 = "";
-                //            if (LogicHandler.SetMaterialDown(sn_code, sncode.Text, User.CurrentStepCode, User.UserName, out ErrorMessage1))
-                //            {
-                //                OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
-                //            }
-                //            else
-                //            {
-                //                OperateResult.AppendText(">>" + ErrorMessage1 + "\n", Color.Red);
-                //            }
-                //        }
-                //    }
-                //    else
-                //    {
-                //        //如果ListA中没有数据执行的是测试工序
-                //        if (ListA.Rows.Count == 0)
-                //        {
-                //            DoTestProcedure();
-                //        }
-                //        //存在数据执行的是上料采集
-                //        else
-                //        {
-                //            //如果当前的索引和长度相等则表示采集完成
-                //            if (RemainIndex == ListA.Rows.Count - 1)
-                //            {
-                //                OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                //                sn_code = "";
-                //                return;
-                //            }
-                //            string ErrorMessage;
-                //            //获取上料需要传递的参数,sp_soncode,sp_id
-                //            string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
-                //            string sonID = ListA.Rows[RemainIndex]["sp_id"].ToString();
-                //            //执行上料
-                //            if (LogicHandler.SetMaterialUp(sn_code, ms_makecode.Text, sncode.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
-                //            {
-                //                RemainIndex = RemainIndex + 1;
-                //                OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                //            }
-                //            else
-                //            {
-                //                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                //            }
-                //        }
-                //    }
-            }
-        }
-
-        //执行测试工序
-        private void DoTestProcedure()
-        {
-            //局部变量ErrorMessage1
-            string ErrorMessage1;
-            //由于打印驱动暂时不可用,暂时注释打印方法
-            if (LogicHandler.SetCollectionFinish(sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
-            {
-                sncode.Text = "";
-                //如果值为空默认设置为0
-                if (int.Parse(mcd_remainqty.Text) > 0)
-                {
-                    dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty+1,mcd_inqty=mcd_inqty+1", "mcd_macode='" + ma_code.Text + "'");
-                    sql.Clear();
-                    sql.Append("select mcd_okqty,ma_qty-mcd_inqty mcd_remainqty from makecraftdetail left join make on ");
-                    sql.Append("ma_code=mcd_macode where mcd_macode='" + ma_code.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    if (mcd_remainqty.Text == "0")
-                    {
-                        OperateResult.AppendText(">>工单" + ma_code.Text + "采集完成\n", Color.Green);
-                        BaseUtil.CleanForm(this);
-                    }
-                }
                 else
                 {
-                    BaseUtil.CleanForm(this);
-                    OperateResult.AppendText(">>该序列号所属工单" + ma_code.Text + "已全部采集完成\n", Color.Green);
+                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
                 }
             }
-            else
-                MessageBox.Show(ErrorMessage1);
         }
-
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + ma_prodcode.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
+            if (dt.Rows.Count == 0)
+            {
+                OperateResult.AppendText(">>该序列号对应的产品未维护机身标标签模板\n", Color.Red);
+            }
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";

+ 3 - 2
UAS-MES/PublicMethod/LogicHandler.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Data;
 using System.Text;
+using System.Windows;
 using UAS_MES.DataOperate;
 
 namespace UAS_MES.PublicMethod
@@ -1300,9 +1301,9 @@ namespace UAS_MES.PublicMethod
         /// <param name="iResult"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserName, string iResult, out string oErrorMessage)
+        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
         {
-            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iMPKind, iResult, iUserName, out oErrorMessage);
+            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iMPKind, iResult, iUserCode, out oErrorMessage);
         }
 
         /// <summary>

BIN
UAS-MES/Resources/Sound/3291.wav


+ 10 - 0
UAS-MES/UAS-MES.csproj

@@ -407,6 +407,12 @@
     <Compile Include="Form1.Designer.cs">
       <DependentUpon>Form1.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_CollectBTMAC.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_CollectBTMAC.Designer.cs">
+      <DependentUpon>Make_CollectBTMAC.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_CollectNetCode.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -875,6 +881,9 @@
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_CollectBTMAC.resx">
+      <DependentUpon>Make_CollectBTMAC.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_CollectNetCode.resx">
       <DependentUpon>Make_CollectNetCode.cs</DependentUpon>
     </EmbeddedResource>
@@ -1085,6 +1094,7 @@
     <None Include="Resources\mailattachment.zip" />
   </ItemGroup>
   <ItemGroup>
+    <Content Include="Resources\Sound\3291.wav" />
     <Content Include="U_Icon.ico" />
     <None Include="Resources\timg.jpg" />
     <None Include="Resources\matte_white_square_icon_business_tool_hammer_128px_571061_easyicon.net.ico" />