Browse Source

钜弘,欧度利方MES新增功能调整提交

caosy 5 năm trước cách đây
mục cha
commit
bddfa36088

+ 41 - 40
UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -34,7 +34,6 @@
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.sncode_label = new System.Windows.Forms.Label();
             this.label4 = 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();
@@ -47,6 +46,9 @@
             this.StartWatch = new System.Windows.Forms.Button();
             this.StopWatch = new System.Windows.Forms.Button();
             this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.ma_softversion = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.lockCheckBox1 = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.US_SKU = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -54,14 +56,12 @@
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.Printer = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.pr_code = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
-            this.lockCheckBox1 = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             this.SuspendLayout();
             // 
@@ -117,16 +117,6 @@
             this.label4.TabIndex = 167;
             this.label4.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(375, 84);
-            this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
-            this.mcd_remainqty_label.TabIndex = 166;
-            this.mcd_remainqty_label.Text = "剩余数";
-            // 
             // mcd_okqty_label
             // 
             this.mcd_okqty_label.AutoSize = true;
@@ -185,7 +175,7 @@
             // XmlWatcher
             // 
             this.XmlWatcher.EnableRaisingEvents = true;
-            this.XmlWatcher.Filter = "*.xml";
+            this.XmlWatcher.Filter = "*.txt";
             this.XmlWatcher.SynchronizingObject = this;
             this.XmlWatcher.Created += new System.IO.FileSystemEventHandler(this.XmlWatcher_Created);
             // 
@@ -258,6 +248,39 @@
             this.label5.TabIndex = 203;
             this.label5.Text = "SKU";
             // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(375, 84);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(74, 21);
+            this.label6.TabIndex = 206;
+            this.label6.Text = "软件版本";
+            // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.CutLength = null;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_softversion.Location = new System.Drawing.Point(463, 85);
+            this.ma_softversion.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 21);
+            this.ma_softversion.TabIndex = 207;
+            // 
+            // lockCheckBox1
+            // 
+            this.lockCheckBox1.AutoSize = true;
+            this.lockCheckBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lockCheckBox1.LeaveEvent = false;
+            this.lockCheckBox1.Location = new System.Drawing.Point(605, 450);
+            this.lockCheckBox1.Name = "lockCheckBox1";
+            this.lockCheckBox1.Size = new System.Drawing.Size(51, 21);
+            this.lockCheckBox1.TabIndex = 205;
+            this.lockCheckBox1.Text = "锁定";
+            this.lockCheckBox1.UseVisualStyleBackColor = true;
+            // 
             // US_SKU
             // 
             this.US_SKU.AllPower = null;
@@ -348,16 +371,6 @@
             this.Printer.Size = new System.Drawing.Size(134, 25);
             this.Printer.TabIndex = 178;
             // 
-            // 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(463, 84);
-            this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
-            this.mcd_remainqty.TabIndex = 177;
-            this.mcd_remainqty.Text = "0";
-            // 
             // mcd_okqty
             // 
             this.mcd_okqty.AutoSize = true;
@@ -435,23 +448,13 @@
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
-            // lockCheckBox1
-            // 
-            this.lockCheckBox1.AutoSize = true;
-            this.lockCheckBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lockCheckBox1.LeaveEvent = false;
-            this.lockCheckBox1.Location = new System.Drawing.Point(605, 450);
-            this.lockCheckBox1.Name = "lockCheckBox1";
-            this.lockCheckBox1.Size = new System.Drawing.Size(51, 21);
-            this.lockCheckBox1.TabIndex = 205;
-            this.lockCheckBox1.Text = "锁定";
-            this.lockCheckBox1.UseVisualStyleBackColor = true;
-            // 
             // Make_ColorBoxLabelPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(938, 480);
+            this.Controls.Add(this.ma_softversion);
+            this.Controls.Add(this.label6);
             this.Controls.Add(this.lockCheckBox1);
             this.Controls.Add(this.US_SKU);
             this.Controls.Add(this.label5);
@@ -470,7 +473,6 @@
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Printer);
-            this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_okqty);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.pr_detail);
@@ -480,7 +482,6 @@
             this.Controls.Add(this.sncode);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.label4);
-            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);
@@ -504,7 +505,6 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label1;
         private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
-        private CustomControl.ValueLabel.ValueNumLabel mcd_remainqty;
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueLabel pr_code;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
@@ -514,7 +514,6 @@
         private CustomControl.TextBoxWithIcon.SnCollectionBox sncode;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private System.Windows.Forms.Label label4;
-        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;
@@ -533,5 +532,7 @@
         private System.Windows.Forms.Label label5;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox US_SKU;
         private CustomControl.CustomCheckBox.LockCheckBox lockCheckBox1;
+        private System.Windows.Forms.Label label6;
+        private CustomControl.ValueLabel.ValueLabel ma_softversion;
     }
 }

+ 88 - 68
UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -28,6 +28,8 @@ namespace UAS_MES_NEW.Make
         //保存TSN编号
         string ms_id = null;
 
+        string version;
+
         string PR_CHECKCARTONW = "0";
 
         bool pr_change = false;
@@ -55,21 +57,21 @@ namespace UAS_MES_NEW.Make
             ma_code.SetLockCheckBox(LockMakeCode);
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称";
+            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,pr_detail # 产品名称,ma_softversion # 软件版本";
             ma_code.FormName = Name;
-            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail" };
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "pr_detail", "ma_softversion" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
 
             lockCheckBox1.GetMakeCodeCtl(US_SKU);
             US_SKU.SetLockCheckBox(lockCheckBox1);
-            US_SKU.TableName = "upcsku"; 
+            US_SKU.TableName = "upcsku";
             US_SKU.SelectField = "US_PRODUCTCOLOR # PRODUCT_COLOR,US_COLORCODE # 颜色号,US_SKU # SKU,US_UPC # UPC";
             US_SKU.FormName = Name;
             US_SKU.SetValueField = new string[] { "US_SKU" };
             US_SKU.Condition = "1=1";
             US_SKU.DbChange += US_SKU_DbChange;
-
+            version = "";
 
             OperateResult.AppendText(">>请输入SN\n", Color.Black);
             dh = SystemInf.dh;
@@ -93,7 +95,7 @@ namespace UAS_MES_NEW.Make
             BaseUtil.SetFormValue(this.Controls, Dbfind);
             //获取工单的其他信息
             sql.Clear();
-            sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+            sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,ma_softversion,");
             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='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -110,7 +112,7 @@ namespace UAS_MES_NEW.Make
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
-            catch (Exception )
+            catch (Exception)
             {
                 OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
             }
@@ -155,7 +157,7 @@ namespace UAS_MES_NEW.Make
                 if (CheckTSN.Checked == true && ms_id != null)
                 {
                     sql.Clear();
-                    sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '"+sncode.Text+"'");
+                    sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '" + sncode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                     {
@@ -180,7 +182,7 @@ namespace UAS_MES_NEW.Make
                     {
                         //获取工单的其他信息
                         sql.Clear();
-                        sql.Append("select ma_code,nvl(ma_unlimitin,0)ma_unlimitin,pr_code,pr_detail,pr_spec from  ");
+                        sql.Append("select ma_code,nvl(ma_unlimitin,0)ma_unlimitin,pr_code,ma_softversion,pr_detail,pr_spec from  ");
                         sql.Append("make left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
@@ -197,6 +199,14 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Black);
                             //提示用户“<< 序列号:XXXX”
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
+                            string softversion = dh.GetConfig("softversion", "sys").ToString();
+                            if (version != ma_softversion.Text && version != ""&& softversion !="0")
+                            {
+                                OperateResult.AppendText("<<序列号:" + sncode.Text + "对应软件版本" + version + "与工单维护软件版本" + ma_softversion.Text + "不一致\n", Color.Red);
+                                version = "";
+                                return;
+                            }
+
                             //if (pr_change)
                             //{
                             //    String dialog = MessageBox.Show("是否使用当前标签模板", "提示", MessageBoxButtons.OKCancel).ToString();
@@ -223,71 +233,80 @@ namespace UAS_MES_NEW.Make
                         //}
                         //else
                         //{
-                            //所选标签不为空
-                            if (PrintLabel.SelectedValue != null)
+                        //所选标签不为空
+                        if (PrintLabel.SelectedValue != null)
+                        {
+                            //如果打印张数为空,返回
+                            if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
                             {
-                                //如果打印张数为空,返回
-                                if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
+                                OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red, sncode);
+                                //清空输入框的值,聚焦
+                                sncode.Focus();
+                                //提示用户“>>请输入SN”
+                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                                return;
+                            }
+                            //更新至下一步工序
+                            if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage))
+                            {
+                                //提示正确返回时传递的信息
+                                if (ErrorMessage.Contains("AFTERSUCCESS"))
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n");
+                                // doc = lbl.Documents.Open(PrintLabel.Text);
+                                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
                                 {
-                                    OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red, sncode);
-                                    //清空输入框的值,聚焦
-                                    sncode.Focus();
-                                    //提示用户“>>请输入SN”
-                                    OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                                    return;
+                                    //提示用户打印成功
+                                    OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
                                 }
-                                //更新至下一步工序
-                                if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage))
+                                else
                                 {
-                                    //提示正确返回时传递的信息
-                                    if (ErrorMessage.Contains("AFTERSUCCESS"))
-                                        OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                                    // doc = lbl.Documents.Open(PrintLabel.Text);
-                                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
-                                    {
-                                        //提示用户打印成功
-                                        OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
-                                    }
-                                    if (US_SKU.Text != "")
-                                    {
-                                      dh.ExecuteSql("update makeserial set ms_sku = '"+US_SKU.Text+"' where ms_sncode = '"+sncode.Text+"' and ms_makecode = '"+ma_code.Text+"'","update");
-                                    }
-                                    if (CollectRemark.Checked && Remark.Text != "")
-                                    {
-                                        LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
-                                    }
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, US_SKU.Text);
-                                    //刷新打印数量和剩余数量
-                                    dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,mcd_okqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
-                                    BaseUtil.SetFormValue(Controls, dt);
-                                    sncode.Text = "";
-                                    ms_id = null;
-                                    sncode.Focus();
+                                    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                }
+                                if (US_SKU.Text != "")
+                                {
+                                    dh.ExecuteSql("update makeserial set ms_sku = '" + US_SKU.Text + "' where ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "'", "update");
+                                }
+                                if (version == "")
+                                {
+                                    dh.ExecuteSql("update makeserial set ms_softversion = '" + ma_softversion.Text + "' where ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "'", "update");
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
-                                    ms_id = null;
-                                    sncode.Focus();
+                                    dh.ExecuteSql("update makeserial set ms_softversion = '" + version + "' where ms_sncode = '" + sncode.Text + "' and ms_makecode = '" + ma_code.Text + "'", "update");
+                                }
+                                if (CollectRemark.Checked && Remark.Text != "")
+                                {
+                                    LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
                                 }
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, US_SKU.Text);
+                                //刷新打印数量和剩余数量
+                                dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty,mcd_okqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+                                BaseUtil.SetFormValue(Controls, dt);
+                                sncode.Text = "";
+                                version = "";
+                                ms_id = null;
+                                sncode.Focus();
                             }
                             else
                             {
-                                OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red, sncode);
-                                return;
-                            }
-                            if (CheckTSN.Checked == true)
-                            {
-                                OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                                 ms_id = null;
+                                sncode.Focus();
                             }
-                            else
-                                OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                      //  }
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red, sncode);
+                            return;
+                        }
+                        if (CheckTSN.Checked == true)
+                        {
+                            OperateResult.AppendText(">>请输入TSN\n", Color.Black);
+                            ms_id = null;
+                        }
+                        else
+                            OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                        //  }
                     }
                     else
                     {
@@ -347,7 +366,7 @@ namespace UAS_MES_NEW.Make
             {
                 //获取工单的其他信息
                 sql.Clear();
-                sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
+                sql.Append("select ma_code,ma_softversion,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,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='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -412,11 +431,12 @@ namespace UAS_MES_NEW.Make
             string imageurl = "";
             string oMSID = "";
             string oErrMessage = "";
-            XmlReader myReader = XmlReader.Create(FolderPath.Text + @"\" + e.Name);
-            OperateResult.AppendText("读取文件" + e.Name + "\n");
-            myReader.Close();
+            StreamReader _Sr = new StreamReader(FolderPath.Text + @"\" + e.Name, Encoding.UTF8);
+            version = _Sr.ReadLine();
+            OperateResult.AppendText("读取文件" + e.Name + ",软件版本" + version + "\n");
+            _Sr.Close();
             //获取文件名的序列号,如SA123456.xml,如果开头为-表示无条码需要自动获取
-            string sn_code =e.Name.Split('.')[0];
+            string sn_code = e.Name.Split('.')[0];
             sncode.Text = sn_code;
             sn_code_KeyDown(this, new KeyEventArgs(Keys.Enter));
             File.Delete(e.FullPath);
@@ -424,7 +444,7 @@ namespace UAS_MES_NEW.Make
 
         private void StartWatch_Click(object sender, EventArgs e)
         {
-            if (FolderPath.Text == "" )
+            if (FolderPath.Text == "")
             {
                 OperateResult.AppendText("请选择监控文件夹\n");
                 return;
@@ -438,7 +458,7 @@ namespace UAS_MES_NEW.Make
                 }
             }
             XmlWatcher.Path = FolderPath.Text;
-            XmlWatcher.Filter = "*.xml";
+            XmlWatcher.Filter = "*.txt";
             XmlWatcher.EnableRaisingEvents = true;
             //设置缓存数据
             BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
@@ -469,6 +489,6 @@ namespace UAS_MES_NEW.Make
             }
         }
 
-     
+
     }
 }

+ 1 - 1
UAS_MES_JH/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -257,7 +257,7 @@ namespace UAS_MES_NEW.Make
                         {
                             try
                             {
-                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value.Replace("kg","");
                             }
                             catch (Exception)
                             {

+ 33 - 8
UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.Designer.cs

@@ -114,6 +114,8 @@
             this.pa_colorcode = new System.Windows.Forms.Label();
             this.pa_sku = new System.Windows.Forms.Label();
             this.pa_productcolor = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.pa_softversion = new System.Windows.Forms.Label();
             this.groupBoxWithBorder2.SuspendLayout();
             this.groupBoxWithBorder1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -235,7 +237,7 @@
             // 
             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(435, 464);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(435, 451);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_remainqty_label.TabIndex = 196;
@@ -245,7 +247,7 @@
             // 
             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(520, 464);
+            this.mcd_remainqty.Location = new System.Drawing.Point(520, 451);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
             this.mcd_remainqty.TabIndex = 197;
@@ -1099,7 +1101,7 @@
             // 
             this.AAQ.AutoSize = true;
             this.AAQ.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AAQ.Location = new System.Drawing.Point(437, 487);
+            this.AAQ.Location = new System.Drawing.Point(437, 474);
             this.AAQ.Name = "AAQ";
             this.AAQ.Size = new System.Drawing.Size(58, 21);
             this.AAQ.TabIndex = 211;
@@ -1109,7 +1111,7 @@
             // 
             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(437, 519);
+            this.label4.Location = new System.Drawing.Point(437, 498);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(41, 21);
             this.label4.TabIndex = 212;
@@ -1119,7 +1121,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(437, 547);
+            this.label5.Location = new System.Drawing.Point(437, 521);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(147, 21);
             this.label5.TabIndex = 213;
@@ -1129,7 +1131,7 @@
             // 
             this.pa_colorcode.AutoSize = true;
             this.pa_colorcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_colorcode.Location = new System.Drawing.Point(609, 491);
+            this.pa_colorcode.Location = new System.Drawing.Point(609, 478);
             this.pa_colorcode.Name = "pa_colorcode";
             this.pa_colorcode.Size = new System.Drawing.Size(0, 21);
             this.pa_colorcode.TabIndex = 214;
@@ -1138,7 +1140,7 @@
             // 
             this.pa_sku.AutoSize = true;
             this.pa_sku.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_sku.Location = new System.Drawing.Point(609, 519);
+            this.pa_sku.Location = new System.Drawing.Point(609, 498);
             this.pa_sku.Name = "pa_sku";
             this.pa_sku.Size = new System.Drawing.Size(0, 21);
             this.pa_sku.TabIndex = 215;
@@ -1147,17 +1149,38 @@
             // 
             this.pa_productcolor.AutoSize = true;
             this.pa_productcolor.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_productcolor.Location = new System.Drawing.Point(609, 552);
+            this.pa_productcolor.Location = new System.Drawing.Point(609, 525);
             this.pa_productcolor.Name = "pa_productcolor";
             this.pa_productcolor.Size = new System.Drawing.Size(0, 21);
             this.pa_productcolor.TabIndex = 216;
             // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Location = new System.Drawing.Point(437, 544);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(74, 21);
+            this.label6.TabIndex = 217;
+            this.label6.Text = "软件版本";
+            // 
+            // pa_softversion
+            // 
+            this.pa_softversion.AutoSize = true;
+            this.pa_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_softversion.Location = new System.Drawing.Point(609, 544);
+            this.pa_softversion.Name = "pa_softversion";
+            this.pa_softversion.Size = new System.Drawing.Size(0, 21);
+            this.pa_softversion.TabIndex = 218;
+            // 
             // Packing_PackageCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.ClientSize = new System.Drawing.Size(879, 584);
+            this.Controls.Add(this.pa_softversion);
+            this.Controls.Add(this.label6);
             this.Controls.Add(this.pa_productcolor);
             this.Controls.Add(this.pa_sku);
             this.Controls.Add(this.pa_colorcode);
@@ -1301,5 +1324,7 @@
         private System.Windows.Forms.Label pa_colorcode;
         private System.Windows.Forms.Label pa_sku;
         private System.Windows.Forms.Label pa_productcolor;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label pa_softversion;
     }
 }

+ 23 - 2
UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -114,7 +114,7 @@ namespace UAS_MES_NEW.Packing
         {
             //加载表单数据
             sql.Clear();
-            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty,pa_colorcode,pa_sku,pa_productcolor from package left join product on pa_prodcode=");
+            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty,pa_colorcode,pa_sku,pa_productcolor,pa_softversion from package left join product on pa_prodcode=");
             sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
@@ -249,7 +249,7 @@ namespace UAS_MES_NEW.Packing
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code and cr_prodcode = ms_prodcode", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         //获取序列号信息
                         sql.Clear();
-                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
+                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,nvl(ms_netcode,' ') ms_netcode,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
                         sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -258,12 +258,14 @@ namespace UAS_MES_NEW.Packing
                         string ms_iostatus = "";
                         string ms_outno = "";
                         string ms_salecode_text = "";
+                        string ms_netcode = "";
                         if (dt.Rows.Count > 0)
                         {
                             StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                             ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
                             ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                             ms_iostatus = dt.Rows[0]["ms_iostatus"].ToString();
+                            ms_netcode = dt.Rows[0]["ms_netcode"].ToString();
                             ms_outno = dt.Rows[0]["ms_outno"].ToString();
                             ms_salecode_text = dt.Rows[0]["ms_salecode"].ToString();
                             if (locksalecode.Checked && ms_salecode.Text != "" && ms_salecode.Text != ms_salecode_text)
@@ -275,6 +277,25 @@ namespace UAS_MES_NEW.Packing
                                 }
                                 return;
                             }
+                            if (ms_netcode == " ")
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "WIFIBOX为空,无法采集,请检查\n", Color.Red, sn_code);
+                                if (md.IsOpen)
+                                {
+                                    md.SendOrder("M502_ON");
+                                }
+                                return;
+                            }
+
+                            if (dh.getFieldDataByCondition("stepproduct left join makeserial on sp_mothercode = ms_prodcode and sp_craftcode = ms_craftcode", "count(*)", "ms_sncode =  '"+ sn_code.Text + "'").ToString() != dh.getFieldDataByCondition("craftmaterial", "count(*)", "cm_sncode = '" + sn_code.Text + "' and cm_status = 0").ToString())
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "上料信息不完整,无法采集,请检查\n", Color.Red, sn_code);
+                                if (md.IsOpen)
+                                {
+                                    md.SendOrder("M502_ON");
+                                }
+                                return;
+                            }
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
                         if (dt.Rows[0]["ms_outno"].ToString() != "")

+ 43 - 3
UAS_MES_JH/FunctionCode/Packing/Packing_PalletCollection.Designer.cs

@@ -85,6 +85,9 @@
             this.pd_colorcode = new System.Windows.Forms.Label();
             this.pd_sku = new System.Windows.Forms.Label();
             this.pd_productcolor = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.pa_softversion = new System.Windows.Forms.Label();
+            this.pd_softversion = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).BeginInit();
             this.SuspendLayout();
             // 
@@ -132,11 +135,12 @@
             // 
             this.pa_salecode_label.AutoSize = true;
             this.pa_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode_label.Location = new System.Drawing.Point(753, 42);
+            this.pa_salecode_label.Location = new System.Drawing.Point(934, 514);
             this.pa_salecode_label.Name = "pa_salecode_label";
             this.pa_salecode_label.Size = new System.Drawing.Size(42, 21);
             this.pa_salecode_label.TabIndex = 157;
             this.pa_salecode_label.Text = "合同";
+            this.pa_salecode_label.Visible = false;
             // 
             // outboxcode_label
             // 
@@ -244,10 +248,11 @@
             // 
             this.pa_salecode.AutoSize = true;
             this.pa_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode.Location = new System.Drawing.Point(844, 42);
+            this.pa_salecode.Location = new System.Drawing.Point(1025, 514);
             this.pa_salecode.Name = "pa_salecode";
             this.pa_salecode.Size = new System.Drawing.Size(0, 21);
             this.pa_salecode.TabIndex = 187;
+            this.pa_salecode.Visible = false;
             // 
             // pd_makecode
             // 
@@ -448,7 +453,7 @@
             this.NewPalletCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.DownImage")));
             this.NewPalletCode.Image = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.Image")));
             this.NewPalletCode.IsShowBorder = true;
-            this.NewPalletCode.Location = new System.Drawing.Point(916, 16);
+            this.NewPalletCode.Location = new System.Drawing.Point(925, 536);
             this.NewPalletCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.MoveImage")));
             this.NewPalletCode.Name = "NewPalletCode";
             this.NewPalletCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.NormalImage")));
@@ -716,11 +721,43 @@
             this.pd_productcolor.TabIndex = 225;
             this.pd_productcolor.Visible = false;
             // 
+            // label1
+            // 
+            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(722, 44);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.TabIndex = 226;
+            this.label1.Text = "软件版本";
+            // 
+            // pa_softversion
+            // 
+            this.pa_softversion.AutoSize = true;
+            this.pa_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_softversion.Location = new System.Drawing.Point(822, 44);
+            this.pa_softversion.Name = "pa_softversion";
+            this.pa_softversion.Size = new System.Drawing.Size(0, 21);
+            this.pa_softversion.TabIndex = 227;
+            // 
+            // pd_softversion
+            // 
+            this.pd_softversion.AutoSize = true;
+            this.pd_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pd_softversion.Location = new System.Drawing.Point(498, 266);
+            this.pd_softversion.Name = "pd_softversion";
+            this.pd_softversion.Size = new System.Drawing.Size(0, 21);
+            this.pd_softversion.TabIndex = 228;
+            this.pd_softversion.Visible = false;
+            // 
             // Packing_PalletCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(997, 552);
+            this.Controls.Add(this.pd_softversion);
+            this.Controls.Add(this.pa_softversion);
+            this.Controls.Add(this.label1);
             this.Controls.Add(this.pd_productcolor);
             this.Controls.Add(this.pd_sku);
             this.Controls.Add(this.pd_colorcode);
@@ -840,5 +877,8 @@
         private System.Windows.Forms.Label pd_colorcode;
         private System.Windows.Forms.Label pd_sku;
         private System.Windows.Forms.Label pd_productcolor;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label pa_softversion;
+        private System.Windows.Forms.Label pd_softversion;
     }
 }

+ 10 - 4
UAS_MES_JH/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -92,7 +92,7 @@ namespace UAS_MES_NEW.Packing
             {
                 LoadGridData();
                 sql.Clear();
-                sql.Append("select pa_makecode,pa_id,pa_status,nvl(pa_standardqty,PR_PALLETQTY)pa_standardqty,pa_prodcode,pa_packageqty,pa_totalqty,pa_salecode,pa_currentqty,pr_code pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_colorcode,pa_sku,pa_productcolor ");
+                sql.Append("select pa_makecode,pa_id,pa_status,nvl(pa_standardqty,PR_PALLETQTY)pa_standardqty,pa_prodcode,pa_packageqty,pa_totalqty,pa_salecode,pa_currentqty,pr_code pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode,pa_colorcode,pa_sku,pa_productcolor,pa_softversion  ");
                 sql.Append("from package left join packagedetail on pa_id =pd_paid left join product on pr_code=pd_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type =3");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
@@ -123,7 +123,7 @@ namespace UAS_MES_NEW.Packing
                         return;
                     }
                     sql.Clear();
-                    sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_makecode pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,pr_packrule,pa_id,pa_prodcode pd_prodcode,pa_status,pa_mothercode,pa_nextstep,pa_colorcode pd_colorcode,pa_sku pd_sku,pa_productcolor pd_productcolor  ");
+                    sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_makecode pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,pr_packrule,pa_id,pa_prodcode pd_prodcode,pa_status,pa_mothercode,pa_nextstep,pa_colorcode pd_colorcode,pa_sku pd_sku,pa_productcolor pd_productcolor,pa_softversion pd_softversion  ");
                     sql.Append("from packagedetail left join package on pd_paid=pa_id left join product on pd_prodcode=pr_code where pd_outboxcode='" + outboxcode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
@@ -232,8 +232,8 @@ namespace UAS_MES_NEW.Packing
                         {
                             pa_id = dh.GetSEQ("package_seq");
                             sql.Clear();
-                            sql.Append("insert into package (pa_id,pa_outboxcode,PA_STANDARDQTY,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_sccode,pa_currentstep,pa_salecode,pa_colorcode,pa_sku,pa_productcolor)values");
-                            sql.Append("(" + pa_id + ",'" + pa_outboxcode.Text + "','" + pa_standardqty.Text + "','" + pd_makecode.Text + "',sysdate,'0',3,'" + pd_prodcode.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','" + pd_salecode.Text + "','" + pd_colorcode.Text + "','" + pd_sku.Text + "','" + pd_productcolor.Text + "')");
+                            sql.Append("insert into package (pa_id,pa_outboxcode,PA_STANDARDQTY,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_sccode,pa_currentstep,pa_salecode,pa_colorcode,pa_sku,pa_productcolor,pa_softversion)values");
+                            sql.Append("(" + pa_id + ",'" + pa_outboxcode.Text + "','" + pa_standardqty.Text + "','" + pd_makecode.Text + "',sysdate,'0',3,'" + pd_prodcode.Text + "',0,0,'" + User.UserSourceCode + "','" + User.CurrentStepCode + "','" + pd_salecode.Text + "','" + pd_colorcode.Text + "','" + pd_sku.Text + "','" + pd_productcolor.Text + "','"+ pd_softversion.Text + "')");
                             dh.ExecuteSql(sql.GetString(), "insert");
                         }
                         else
@@ -248,6 +248,7 @@ namespace UAS_MES_NEW.Packing
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, outboxcode);
                                 return;
                             }
+                            string packagemix =  dh.GetConfig("packagemix", "sys").ToString();
                             if (pa_colorcode.Text != pd_colorcode.Text)
                             {
                                 OperateResult.AppendText(">>栈板" + pa_outboxcode.Text + "对应颜色号"+ pa_colorcode.Text + "与箱"+ outboxcode.Text + "对应颜色号"+ pd_colorcode.Text + "不相同\n", Color.Red, outboxcode);
@@ -263,6 +264,11 @@ namespace UAS_MES_NEW.Packing
                                 OperateResult.AppendText(">>栈板" + pa_outboxcode.Text + "对应PRODUCT COLOR" + pa_productcolor.Text + "与箱" + outboxcode.Text + "对应PRODUCT COLOR" + pd_productcolor.Text + "不相同\n", Color.Red, outboxcode);
                                 return;
                             }
+                            if (pa_softversion.Text != pd_softversion.Text && packagemix == "0")
+                            {
+                                OperateResult.AppendText(">>栈板" + pa_outboxcode.Text + "对应软件版本" + pa_softversion.Text + "与箱" + outboxcode.Text + "对应软件版本" + pd_softversion.Text + "不相同\n", Color.Red, outboxcode);
+                                return;
+                            }
 
                         }
                         dt = (DataTable)dh.ExecuteSql("select pa_totalqty,pa_mothercode,nvl(pa_status,0) pa_status from package where pa_outboxcode='" + outboxcode.Text + "'", "select");

+ 261 - 0
UAS_MES_JH/FunctionCode/Special/Special_Collertion.Designer.cs

@@ -0,0 +1,261 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_Collertion
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Special_Collertion));
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.bigboxBtn = new System.Windows.Forms.RadioButton();
+            this.serBtn = new System.Windows.Forms.RadioButton();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.ms_prodcode_label = new System.Windows.Forms.Label();
+            this.WeighRecord = new System.Windows.Forms.ListView();
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.数据清空 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ms_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.ms_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.input = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.SuspendLayout();
+            // 
+            // Pallet_label
+            // 
+            this.Pallet_label.AutoSize = true;
+            this.Pallet_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Pallet_label.Location = new System.Drawing.Point(7, 41);
+            this.Pallet_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.Pallet_label.Name = "Pallet_label";
+            this.Pallet_label.Size = new System.Drawing.Size(58, 21);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "录入框";
+            // 
+            // bigboxBtn
+            // 
+            this.bigboxBtn.AutoSize = true;
+            this.bigboxBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bigboxBtn.Location = new System.Drawing.Point(11, 2);
+            this.bigboxBtn.Margin = new System.Windows.Forms.Padding(2);
+            this.bigboxBtn.Name = "bigboxBtn";
+            this.bigboxBtn.Size = new System.Drawing.Size(60, 25);
+            this.bigboxBtn.TabIndex = 234;
+            this.bigboxBtn.Text = "箱号";
+            this.bigboxBtn.UseVisualStyleBackColor = true;
+            this.bigboxBtn.Click += new System.EventHandler(this.bigboxBtn_Click);
+            // 
+            // serBtn
+            // 
+            this.serBtn.AutoSize = true;
+            this.serBtn.Checked = true;
+            this.serBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.serBtn.Location = new System.Drawing.Point(80, 2);
+            this.serBtn.Margin = new System.Windows.Forms.Padding(2);
+            this.serBtn.Name = "serBtn";
+            this.serBtn.Size = new System.Drawing.Size(108, 25);
+            this.serBtn.TabIndex = 233;
+            this.serBtn.TabStop = true;
+            this.serBtn.Text = "单台序列号";
+            this.serBtn.UseVisualStyleBackColor = true;
+            this.serBtn.Click += new System.EventHandler(this.bigboxBtn_Click);
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            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(7, 81);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
+            this.ms_makecode_label.TabIndex = 240;
+            this.ms_makecode_label.Text = "工单号";
+            // 
+            // ms_prodcode_label
+            // 
+            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_prodcode_label.AutoSize = true;
+            this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_prodcode_label.Location = new System.Drawing.Point(326, 81);
+            this.ms_prodcode_label.Name = "ms_prodcode_label";
+            this.ms_prodcode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_prodcode_label.TabIndex = 241;
+            this.ms_prodcode_label.Text = "产品编号";
+            // 
+            // WeighRecord
+            // 
+            this.WeighRecord.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader3});
+            this.WeighRecord.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.WeighRecord.Location = new System.Drawing.Point(11, 108);
+            this.WeighRecord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.WeighRecord.Name = "WeighRecord";
+            this.WeighRecord.Size = new System.Drawing.Size(421, 321);
+            this.WeighRecord.TabIndex = 243;
+            this.WeighRecord.UseCompatibleStateImageBehavior = false;
+            this.WeighRecord.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "录入项";
+            this.columnHeader3.Width = 300;
+            // 
+            // 数据清空
+            // 
+            this.数据清空.AllPower = null;
+            this.数据清空.BackColor = System.Drawing.Color.Transparent;
+            this.数据清空.DownImage = ((System.Drawing.Image)(resources.GetObject("数据清空.DownImage")));
+            this.数据清空.Image = null;
+            this.数据清空.IsShowBorder = true;
+            this.数据清空.Location = new System.Drawing.Point(473, 400);
+            this.数据清空.MoveImage = ((System.Drawing.Image)(resources.GetObject("数据清空.MoveImage")));
+            this.数据清空.Name = "数据清空";
+            this.数据清空.NormalImage = ((System.Drawing.Image)(resources.GetObject("数据清空.NormalImage")));
+            this.数据清空.Power = null;
+            this.数据清空.Size = new System.Drawing.Size(56, 28);
+            this.数据清空.TabIndex = 245;
+            this.数据清空.Text = "数据清空";
+            this.数据清空.UseVisualStyleBackColor = false;
+            this.数据清空.Click += new System.EventHandler(this.数据清空_Click);
+            // 
+            // ms_prodcode
+            // 
+            this.ms_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_prodcode.AutoSize = true;
+            this.ms_prodcode.CutLength = null;
+            this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_prodcode.Location = new System.Drawing.Point(422, 81);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ms_prodcode.Name = "ms_prodcode";
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ms_prodcode.TabIndex = 239;
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.CutLength = null;
+            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(87, 81);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(250, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_makecode.TabIndex = 242;
+            // 
+            // OperatResult
+            // 
+            this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperatResult.Location = new System.Drawing.Point(11, 433);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(777, 123);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // input
+            // 
+            this.input.AllPower = null;
+            this.input.BackColor = System.Drawing.Color.White;
+            this.input.ID = null;
+            this.input.Location = new System.Drawing.Point(80, 43);
+            this.input.Margin = new System.Windows.Forms.Padding(2);
+            this.input.Name = "input";
+            this.input.Power = null;
+            this.input.Size = new System.Drawing.Size(148, 21);
+            this.input.Str = null;
+            this.input.Str1 = null;
+            this.input.Str2 = null;
+            this.input.TabIndex = 2;
+            this.input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.input_KeyDown);
+            // 
+            // Split
+            // 
+            this.Split.AllPower = null;
+            this.Split.BackColor = System.Drawing.Color.Transparent;
+            this.Split.DownImage = ((System.Drawing.Image)(resources.GetObject("Split.DownImage")));
+            this.Split.Image = null;
+            this.Split.IsShowBorder = true;
+            this.Split.Location = new System.Drawing.Point(473, 108);
+            this.Split.Margin = new System.Windows.Forms.Padding(2);
+            this.Split.MoveImage = ((System.Drawing.Image)(resources.GetObject("Split.MoveImage")));
+            this.Split.Name = "Split";
+            this.Split.NormalImage = ((System.Drawing.Image)(resources.GetObject("Split.NormalImage")));
+            this.Split.Power = null;
+            this.Split.Size = new System.Drawing.Size(56, 22);
+            this.Split.TabIndex = 0;
+            this.Split.Text = "确认";
+            this.Split.UseVisualStyleBackColor = false;
+            this.Split.Click += new System.EventHandler(this.Split_Click);
+            // 
+            // Special_Collertion
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(805, 565);
+            this.Controls.Add(this.数据清空);
+            this.Controls.Add(this.WeighRecord);
+            this.Controls.Add(this.ms_makecode_label);
+            this.Controls.Add(this.ms_prodcode_label);
+            this.Controls.Add(this.ms_prodcode);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.bigboxBtn);
+            this.Controls.Add(this.serBtn);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.input);
+            this.Controls.Add(this.Pallet_label);
+            this.Controls.Add(this.Split);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Name = "Special_Collertion";
+            this.Tag = "Special!Collertion";
+            this.Text = "返工采集";
+            this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Split;
+        private System.Windows.Forms.Label Pallet_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox input;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private System.Windows.Forms.RadioButton bigboxBtn;
+        private System.Windows.Forms.RadioButton serBtn;
+        private System.Windows.Forms.Label ms_makecode_label;
+        private System.Windows.Forms.Label ms_prodcode_label;
+        private CustomControl.ValueLabel.ValueLabel ms_prodcode;
+        private CustomControl.ValueLabel.ValueLabel ms_makecode;
+        private System.Windows.Forms.ListView WeighRecord;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private CustomControl.ButtonUtil.NormalButton 数据清空;
+    }
+}

+ 203 - 0
UAS_MES_JH/FunctionCode/Special/Special_Collertion.cs

@@ -0,0 +1,203 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_Collertion : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        DataTable Dbfind;
+        DataTable dt;
+
+        List<String> sb = new List<string>();
+
+        public Special_Collertion()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+       
+            dh = SystemInf.dh;
+            asc.controllInitializeSize(this);
+        }
+
+        private void Cd_stepcode_DbChange(object sender, EventArgs e)
+        {
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+
+        private void ReSN(string sncode)
+        {
+            sql.Clear();
+            sql.Append("insert into RETURNSN select RETURNSN_seq.nextval,ms_sncode,ms_makecode,ms_prodcode,sysdate from makeserial where ms_sncode = '" + sncode + "'");
+            dh.ExecuteSql(sql.GetString(), "insert");
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "返工采集", "返工采集",  sncode, "");
+        }
+
+
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            string Delete = MessageBox.Show(this.ParentForm, "是否确认返工采集?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (Delete == "Yes")
+            {
+                if (serBtn.Checked)
+                {
+                    for (int i = 0; i < sb.Count; i++)
+                    {
+                     ReSN(sb[i].ToString());
+                     OperatResult.AppendText("SN:" + sb[i].ToString()+ "采集完成\n", Color.Green);
+                    }
+                    WeighRecord.Clear();
+                    sb.Clear();
+                }
+                else if(bigboxBtn.Checked)
+                {
+                    for (int i = 0; i < sb.Count; i++)
+                    {
+                        DataTable dt2 = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_outboxcode = '" + sb[i].ToString() + "'", "select");
+                        for (int k = 0; k < dt2.Rows.Count; k++)
+                        {
+                            ReSN(dt2.Rows[k]["ms_sncode"].ToString());
+                        }
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "返工采集", "返工采集", sb[i].ToString(), "");
+                        OperatResult.AppendText("卡通箱:" + sb[i].ToString() + "采集完成\n", Color.Green);
+                    }
+                    WeighRecord.Clear();
+                    sb.Clear();
+                }
+            }
+
+
+        }
+
+        private void bigboxBtn_Click(object sender, EventArgs e)
+        {
+            if (((RadioButton)sender).Checked == true)
+            {
+                if (WeighRecord.Items.Count > 0)
+                {
+                    string logout_confirm = MessageBox.Show(this.ParentForm, "是否更换采集项(已录入信息会清空)?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (logout_confirm == "Yes")
+                    {
+                        WeighRecord.Items.Clear();
+                        sb.Clear();
+                        ms_makecode.Text = "";
+                        ms_prodcode.Text = "";
+                    }
+                    else
+                    {
+                        serBtn.Checked = bigboxBtn.Checked;
+                        bigboxBtn.Checked = !serBtn.Checked;
+                    }
+                }
+                if (((RadioButton)sender).Name == "serBtn")
+                {
+                    input.Focus();
+                    OperatResult.AppendText("请输入序列号进行采集\n", Color.Black, input);
+                }
+                else if (((RadioButton)sender).Name == "bigboxBtn")
+                {
+                    input.Focus();
+                    OperatResult.AppendText("请输入箱号进行采集\n", Color.Black, input);
+                }
+
+            }
+        }
+
+        private void input_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (serBtn.Checked)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_prodcode,ms_sncode,ms_craftcode cr_code,ms_status,ms_outboxcode from makeserial where ms_sncode = '" + input.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        if (ms_makecode.Text != "" && dt.Rows[0]["ms_makecode"].ToString() != ms_makecode.Text)
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "所属工单" + dt.Rows[0]["ms_makecode"].ToString() + "与当前工单" + ms_makecode.Text + "不一致\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["ms_status"].ToString() == "3")
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "为不良品,不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "已装箱" + dt.Rows[0]["ms_outboxcode"].ToString() + ",不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        if (sb.Contains(dt.Rows[0]["ms_sncode"].ToString()))
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "已采集\n", Color.Red, input);
+                            return;
+                        }
+                        WeighRecord.Items.Add(dt.Rows[0]["ms_sncode"].ToString());
+                        sb.Add(dt.Rows[0]["ms_sncode"].ToString());
+                        OperatResult.AppendText("SN:" + input.Text + "采集\n", Color.Green, input);
+                    }
+                    else
+                    {
+                        OperatResult.AppendText("SN:" + input.Text + "不存在\n", Color.Red, input);
+                        return;
+                    }
+                }
+                else if (bigboxBtn.Checked)
+                {
+                    dt = (DataTable)dh.ExecuteSql("select pa_makecode ms_makecode,pa_prodcode ms_prodcode,pa_outboxcode,pa_mothercode,ma_craftcode cr_code from package left join make on pa_makecode = ma_code where pa_outboxcode = '"+input.Text+"' and pa_type = '1'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        if (ms_makecode.Text != "" && dt.Rows[0]["ms_makecode"].ToString() != ms_makecode.Text)
+                        {
+                            OperatResult.AppendText("SN:" + input.Text + "所属工单" + dt.Rows[0]["ms_makecode"].ToString() + "与当前工单" + ms_makecode.Text + "不一致\n", Color.Red, input);
+                            return;
+                        }
+                        if (dt.Rows[0]["pa_mothercode"].ToString() != "")
+                        {
+                            OperatResult.AppendText("卡通箱:" + input.Text + "已装栈板" + dt.Rows[0]["pa_mothercode"].ToString() + ",不允许采集\n", Color.Red, input);
+                            return;
+                        }
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        if (sb.Contains(dt.Rows[0]["pa_outboxcode"].ToString()))
+                        {
+                            OperatResult.AppendText("卡通箱:" + input.Text + "已采集\n", Color.Red, input);
+                            return;
+                        }
+                        WeighRecord.Items.Add(dt.Rows[0]["pa_outboxcode"].ToString());
+                        sb.Add(dt.Rows[0]["pa_outboxcode"].ToString());
+                        OperatResult.AppendText("卡通箱:" + input.Text + "采集\n", Color.Green, input);
+                    }
+                    else
+                    {
+                        OperatResult.AppendText("卡通箱:" + input.Text + "不存在\n", Color.Red, input);
+                        return;
+                    }
+                }
+            }
+        }
+
+        private void 数据清空_Click(object sender, EventArgs e)
+        {
+            BaseUtil.CleanControls(this.Controls);
+            WeighRecord.Items.Clear();
+            sb.Clear();
+        }
+    }
+}

+ 197 - 0
UAS_MES_JH/FunctionCode/Special/Special_Collertion.resx

@@ -0,0 +1,197 @@
+<?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="数据清空.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="数据清空.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="数据清空.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Split.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Split.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Split.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 8 - 2
UAS_MES_JH/FunctionCode/Special/Special_Reset.cs

@@ -104,7 +104,13 @@ namespace UAS_MES_NEW.Special
                     WeighRecord.Clear();
                     sb.Clear();
                 }
-                   
+                sql.Clear();
+                sql.Append("MERGE INTO makecraftdetail USING (select mcd_macode,mcd_detno,mcd_stepcode,mcd_stepname,nvl(count(distinct A.ms_sncode),0) n,nvl(count(distinct B.ms_sncode),0) bn,(select nvl(count(distinct sp_sncode),0) from STEPPASSED where SP_MAKECODE = mcd_macode AND SP_STEPCODE = mcd_stepcode) inqty from MAKECRAFTdetail");
+                sql.Append(" left join makeserial A on mcd_macode = A.ms_makecode and mcd_stepcode = A.ms_nextstepcode AND A.MS_STATUS = 1 LEFT JOIN MAKESERIAL B ON mcd_macode = B.ms_makecode AND MCD_STEPCODE = B.MS_STEPCODE AND B.MS_STATUS = 3 where mcd_macode = '"+ ms_makecode.Text + "'  group by mcd_macode,mcd_detno, mcd_stepcode, mcd_stepname order by mcd_detno asc) A");
+                sql.Append(" ON (makecraftdetail.MCD_MACODE = A.MCD_MACODE and makecraftdetail.mcd_stepcode = A.mcd_stepcode)  ");
+                sql.Append(" WHEN MATCHED THEN UPDATE SET makecraftdetail.mcd_inqty = A.inqty,makecraftdetail.mcd_outqty = A.inqty,makecraftdetail.mcd_okqty = A.inqty ");
+                dh.ExecuteSql(sql.GetString(), "update");
+
             }
 
 
@@ -229,7 +235,7 @@ namespace UAS_MES_NEW.Special
         private void 数据清空_Click(object sender, EventArgs e)
         {
             BaseUtil.CleanControls(this.Controls);
-            WeighRecord.Clear();
+            WeighRecord.Items.Clear();
             sb.Clear();
         }
     }

+ 1 - 1
UAS_MES_JH/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -77,7 +77,7 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             try
                             {
-                                Weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                Weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value.Replace("kg","");
                             }
                             catch (Exception)
                             {

+ 10 - 6
UAS_MES_JH/PublicMethod/Print.cs

@@ -121,12 +121,16 @@ namespace UAS_MES_NEW.PublicMethod
                 {
                     dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
                 }
-                ////如果已经打印过了,则不允许再打印
-                //if (dt.Rows.Count > 0)
-                //{
-                //    ErrorMessage = SnCode + LabelType + "已打印";
-                //    return false;
-                //}
+                if (dh.getFieldDataByCondition("employee", "em_type", "em_code = '" + User.UserCode + "'").ToString() != "admin")
+                {
+                    //如果已经打印过了,则不允许再打印
+                    if (dt.Rows.Count > 0&& LabelType == "栈板标")
+                    {
+                        ErrorMessage = SnCode + LabelType + "已打印";
+                        return false;
+                    }
+                }
+
             }
             string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
             FileInfo PrintFile = new FileInfo(LabelName);

+ 9 - 0
UAS_MES_JH/UAS_MES_JH.csproj

@@ -910,6 +910,12 @@
     <Compile Include="FunctionCode\Special\Special_GetBad.Designer.cs">
       <DependentUpon>Special_GetBad.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_Collertion.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_Collertion.Designer.cs">
+      <DependentUpon>Special_Collertion.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_Reset.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1454,6 +1460,9 @@
     <EmbeddedResource Include="FunctionCode\Special\Special_GetBad.resx">
       <DependentUpon>Special_GetBad.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_Collertion.resx">
+      <DependentUpon>Special_Collertion.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_Reset.resx">
       <DependentUpon>Special_Reset.cs</DependentUpon>
     </EmbeddedResource>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 310 - 691
UAS_MES_ODLF/FunctionCode/Query/Query_MakeInf.Designer.cs


+ 3 - 14
UAS_MES_ODLF/FunctionCode/Query/Query_MakeInf.cs

@@ -85,7 +85,6 @@ namespace UAS_MES_NEW.Query
                     rangeafter = dt.Rows[0]["aftersn_qty"].ToString();
                     BaseUtil.SetFormValue(this.Controls, dt);
                 }
-                rangesn_qty.Text = rangebefore + "/" + rangeafter;
                 sql.Clear();
                 sql.Append("select count(1) beforesn_qty from makesnlist where msl_makecode='" + MakeCode.Text + "' and msl_type='before'");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -102,25 +101,15 @@ namespace UAS_MES_NEW.Query
                     rangeafter = dt.Rows[0]["aftersn_qty"].ToString();
                     BaseUtil.SetFormValue(this.Controls, dt);
                 }
-                importsn_qty.Text = rangebefore + "/" + rangeafter;
-                //获取SN关联信息
-                Mac_Num.Text = dh.getFieldDataByCondition("Makeaddresslist", "count(1)", "mal_makecode='" + MakeCode.Text + "' and mal_mac is not null").ToString();
-                BT_Num.Text = dh.getFieldDataByCondition("Makeaddresslist", "count(1)", "mal_makecode='" + MakeCode.Text + "' and mal_bt is not null").ToString();
-                IMEI_Num.Text = dh.getFieldDataByCondition("Makeimeilist", "count(1)", "mil_makecode='" + MakeCode.Text + "' and mil_imei1 is not null").ToString();
                 sql.Clear();
-                sql.Append("select * from StepProduct left join product on pr_code=sp_soncode where sp_bomversion='" + ma_bomversion + "' and sp_mothercode='" + ma_prodcode + "' and sp_craftcode='" + ma_craftcode + "'");
+                sql.Append("select mcd_detno,mcd_stepcode,mcd_stepname,nvl(count(distinct A.ms_sncode),0) n,nvl(count(distinct B.ms_sncode),0) bn,(select nvl(count(distinct sp_sncode),0) from STEPPASSED where SP_MAKECODE = mcd_macode AND SP_STEPCODE = mcd_stepcode) inqty from MAKECRAFTdetail ");
+                sql.Append("left join makeserial A on mcd_macode = A.ms_makecode and mcd_stepcode = ");
+                sql.Append("A.ms_nextstepcode AND A.MS_STATUS = 1 LEFT JOIN MAKESERIAL B ON mcd_macode = B.ms_makecode AND MCD_STEPCODE = B.MS_STEPCODE AND B.MS_STATUS = 3 where mcd_macode = '" + MakeCode.Text + "'  group by mcd_macode,mcd_detno, mcd_stepcode, mcd_stepname order by mcd_detno asc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
                 {
                     BaseUtil.FillDgvWithDataTable(BOM, dt);
                 }
-                sql.Clear();
-                sql.Append("select * from label where la_prodcode='" + ma_prodcode + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    BaseUtil.FillDgvWithDataTable(Label, dt);
-                }
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, MakeCode.Text, User.UserLineCode, User.UserSourceCode, "查询工单综合信息", "查询成功", "", "");
             }
             else MessageBox.Show("工单号不存在");

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác