Browse Source

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

callm 5 years ago
parent
commit
70805a5d2a
29 changed files with 2039 additions and 990 deletions
  1. 41 40
      UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs
  2. 88 68
      UAS_MES_JH/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  3. 1 1
      UAS_MES_JH/FunctionCode/Make/Make_ColorBoxWeigh.cs
  4. 33 8
      UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.Designer.cs
  5. 23 2
      UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.cs
  6. 43 3
      UAS_MES_JH/FunctionCode/Packing/Packing_PalletCollection.Designer.cs
  7. 10 4
      UAS_MES_JH/FunctionCode/Packing/Packing_PalletCollection.cs
  8. 261 0
      UAS_MES_JH/FunctionCode/Special/Special_Collertion.Designer.cs
  9. 203 0
      UAS_MES_JH/FunctionCode/Special/Special_Collertion.cs
  10. 197 0
      UAS_MES_JH/FunctionCode/Special/Special_Collertion.resx
  11. 8 2
      UAS_MES_JH/FunctionCode/Special/Special_Reset.cs
  12. 1 1
      UAS_MES_JH/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs
  13. 10 6
      UAS_MES_JH/PublicMethod/Print.cs
  14. 9 0
      UAS_MES_JH/UAS_MES_JH.csproj
  15. 84 78
      UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs
  16. 37 10
      UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs
  17. 32 2
      UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.cs
  18. 1 1
      UAS_MES_NEW/FunctionCode/Make/Make_Decompose.cs
  19. 56 29
      UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.Designer.cs
  20. 27 7
      UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs
  21. 32 5
      UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.Designer.cs
  22. 33 6
      UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.cs
  23. 176 0
      UAS_MES_NEW/FunctionCode/Special/Special_GetBad.Designer.cs
  24. 110 0
      UAS_MES_NEW/FunctionCode/Special/Special_GetBad.cs
  25. 197 0
      UAS_MES_NEW/FunctionCode/Special/Special_GetBad.resx
  26. 7 6
      UAS_MES_NEW/PublicMethod/LogicHandler.cs
  27. 6 6
      UAS_MES_NEW/PublicMethod/Print.cs
  28. 310 691
      UAS_MES_ODLF/FunctionCode/Query/Query_MakeInf.Designer.cs
  29. 3 14
      UAS_MES_ODLF/FunctionCode/Query/Query_MakeInf.cs

+ 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>

+ 84 - 78
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
@@ -53,16 +53,18 @@
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
             this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // PrintLabel
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1052, 244);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(790, 227);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(177, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(134, 20);
             this.PrintLabel.TabIndex = 181;
             this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             // 
@@ -70,10 +72,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(967, 180);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(726, 176);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(72, 27);
+            this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 180;
             this.label2.Text = "打印机";
             // 
@@ -81,10 +82,9 @@
             // 
             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(967, 244);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(726, 227);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 27);
+            this.label1.Size = new System.Drawing.Size(42, 21);
             this.label1.TabIndex = 179;
             this.label1.Text = "标签";
             // 
@@ -92,10 +92,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(861, 53);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(646, 42);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 171;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -105,10 +104,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(349, 558);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(262, 446);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(88, 27);
+            this.sncode_label.Size = new System.Drawing.Size(70, 21);
             this.sncode_label.TabIndex = 170;
             this.sncode_label.Text = "TSN/SN";
             // 
@@ -116,10 +114,9 @@
             // 
             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(861, 111);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(646, 89);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 167;
             this.label4.Text = "打印张数";
             // 
@@ -127,10 +124,9 @@
             // 
             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(500, 105);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            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(72, 27);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
             this.mcd_remainqty_label.TabIndex = 166;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -138,10 +134,9 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(16, 105);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(12, 84);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_okqty_label.TabIndex = 165;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -149,10 +144,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(500, 52);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(375, 42);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 164;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -160,10 +154,9 @@
             // 
             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(13, 52);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(10, 42);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 163;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -173,10 +166,9 @@
             this.CheckTSN.Checked = true;
             this.CheckTSN.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CheckTSN.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CheckTSN.Location = new System.Drawing.Point(43, 556);
-            this.CheckTSN.Margin = new System.Windows.Forms.Padding(4);
+            this.CheckTSN.Location = new System.Drawing.Point(32, 445);
             this.CheckTSN.Name = "CheckTSN";
-            this.CheckTSN.Size = new System.Drawing.Size(153, 31);
+            this.CheckTSN.Size = new System.Drawing.Size(124, 25);
             this.CheckTSN.TabIndex = 186;
             this.CheckTSN.Text = "是否检查TSN";
             this.CheckTSN.UseVisualStyleBackColor = true;
@@ -185,9 +177,10 @@
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(972, 307);
+            this.StepCount.Location = new System.Drawing.Point(729, 246);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(106, 28);
+            this.StepCount.Size = new System.Drawing.Size(80, 22);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 189;
@@ -197,10 +190,9 @@
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
-            this.LockMakeCode.Location = new System.Drawing.Point(332, 52);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
+            this.LockMakeCode.Location = new System.Drawing.Point(249, 42);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(61, 24);
+            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 185;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -212,14 +204,13 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(120, 52);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_code.Location = new System.Drawing.Point(90, 42);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(199, 26);
+            this.ma_code.Size = new System.Drawing.Size(149, 21);
             this.ma_code.TabIndex = 184;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
@@ -227,20 +218,19 @@
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1052, 180);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5);
+            this.Printer.Location = new System.Drawing.Point(790, 176);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(179, 31);
+            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(617, 105);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(463, 84);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_remainqty.TabIndex = 177;
             this.mcd_remainqty.Text = "0";
             // 
@@ -248,10 +238,9 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(115, 105);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(86, 84);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_okqty.TabIndex = 176;
             this.mcd_okqty.Text = "0";
             // 
@@ -260,11 +249,10 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(617, 53);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Location = new System.Drawing.Point(463, 42);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
             this.pr_code.TabIndex = 175;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -273,11 +261,10 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(979, 52);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_detail.Location = new System.Drawing.Point(734, 42);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 174;
             // 
             // PrintNum
@@ -286,12 +273,11 @@
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(979, 111);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Location = new System.Drawing.Point(734, 89);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(199, 25);
+            this.PrintNum.Size = new System.Drawing.Size(150, 21);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
@@ -305,11 +291,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(468, 559);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Location = new System.Drawing.Point(351, 447);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(260, 25);
+            this.sncode.Size = new System.Drawing.Size(196, 21);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -320,10 +305,9 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(19, 161);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(14, 129);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(940, 380);
+            this.OperateResult.Size = new System.Drawing.Size(706, 305);
             this.OperateResult.TabIndex = 168;
             this.OperateResult.Text = "";
             // 
@@ -333,10 +317,9 @@
             this.CollectRemark.Checked = true;
             this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(972, 361);
-            this.CollectRemark.Margin = new System.Windows.Forms.Padding(4);
+            this.CollectRemark.Location = new System.Drawing.Point(729, 289);
             this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(100, 27);
+            this.CollectRemark.Size = new System.Drawing.Size(84, 24);
             this.CollectRemark.TabIndex = 197;
             this.CollectRemark.Text = "采集备注";
             this.CollectRemark.UseVisualStyleBackColor = true;
@@ -344,18 +327,40 @@
             // Remark
             // 
             this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(967, 395);
-            this.Remark.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.Remark.Location = new System.Drawing.Point(725, 316);
+            this.Remark.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(271, 99);
+            this.Remark.Size = new System.Drawing.Size(204, 80);
             this.Remark.TabIndex = 196;
             this.Remark.Text = "";
             // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "CODESOFT",
+            "BARTENDER"});
+            this.comboBox1.Location = new System.Drawing.Point(790, 129);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(134, 20);
+            this.comboBox1.TabIndex = 198;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(729, 136);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 199;
+            this.label3.Text = "打印程序";
+            // 
             // Make_ColorBoxLabelPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1251, 600);
+            this.ClientSize = new System.Drawing.Size(938, 480);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.Remark);
             this.Controls.Add(this.StepCount);
@@ -381,7 +386,6 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_ColorBoxLabelPrint";
             this.Tag = "Make!ColorBoxLabelPrint";
             this.Text = "标签打印";
@@ -389,7 +393,7 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_ColorBoxLabelPrint_FormClosing);
             this.Load += new System.EventHandler(this.Make_ColorBoxLabelPrint_Load);
             this.SizeChanged += new System.EventHandler(this.Make_ColorBoxLabelPrint_SizeChanged);
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -420,5 +424,7 @@
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
         private System.Windows.Forms.CheckBox CollectRemark;
         private CustomControl.RichText.RichTextAutoBottom Remark;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.Label label3;
     }
 }

+ 37 - 10
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -87,6 +87,8 @@
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
             this.panel4.SuspendLayout();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
@@ -212,7 +214,7 @@
             // 
             this.Printer_label.AutoSize = true;
             this.Printer_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Printer_label.Location = new System.Drawing.Point(770, 86);
+            this.Printer_label.Location = new System.Drawing.Point(770, 121);
             this.Printer_label.Name = "Printer_label";
             this.Printer_label.Size = new System.Drawing.Size(84, 20);
             this.Printer_label.TabIndex = 162;
@@ -222,7 +224,7 @@
             // 
             this.PrintLabel_label.AutoSize = true;
             this.PrintLabel_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintLabel_label.Location = new System.Drawing.Point(770, 118);
+            this.PrintLabel_label.Location = new System.Drawing.Point(770, 153);
             this.PrintLabel_label.Name = "PrintLabel_label";
             this.PrintLabel_label.Size = new System.Drawing.Size(69, 20);
             this.PrintLabel_label.TabIndex = 163;
@@ -232,7 +234,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(770, 58);
+            this.label1.Location = new System.Drawing.Point(770, 93);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(69, 20);
             this.label1.TabIndex = 170;
@@ -268,10 +270,10 @@
             this.columnHeader3,
             this.columnHeader4});
             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(377, 218);
+            this.WeighRecord.Location = new System.Drawing.Point(377, 261);
             this.WeighRecord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.WeighRecord.Name = "WeighRecord";
-            this.WeighRecord.Size = new System.Drawing.Size(381, 334);
+            this.WeighRecord.Size = new System.Drawing.Size(381, 291);
             this.WeighRecord.TabIndex = 173;
             this.WeighRecord.UseCompatibleStateImageBehavior = false;
             this.WeighRecord.View = System.Windows.Forms.View.Details;
@@ -387,7 +389,7 @@
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(773, 146);
+            this.StepCount.Location = new System.Drawing.Point(377, 221);
             this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(80, 22);
@@ -420,7 +422,7 @@
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(878, 58);
+            this.PrintNum.Location = new System.Drawing.Point(858, 94);
             this.PrintNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Power = null;
@@ -567,7 +569,7 @@
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(878, 86);
+            this.PrinterList.Location = new System.Drawing.Point(858, 121);
             this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
             this.PrinterList.Name = "PrinterList";
             this.PrinterList.Size = new System.Drawing.Size(118, 20);
@@ -577,7 +579,7 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(878, 118);
+            this.PrintLabel.Location = new System.Drawing.Point(856, 154);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(120, 20);
@@ -629,7 +631,7 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(878, 146);
+            this.Confirm.Location = new System.Drawing.Point(878, 174);
             this.Confirm.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
@@ -768,11 +770,34 @@
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(777, 75);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 208;
+            this.label3.Text = "打印程序";
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "CODESOFT",
+            "BARTENDER"});
+            this.comboBox1.Location = new System.Drawing.Point(858, 68);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(134, 20);
+            this.comboBox1.TabIndex = 207;
+            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1013, 584);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.locksalecode);
@@ -891,5 +916,7 @@
         public System.Windows.Forms.Label ob_checkno;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ComboBox comboBox1;
     }
 }

+ 32 - 2
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -19,6 +19,8 @@ namespace UAS_MES_NEW.Make
     public partial class Make_ColorBoxWeigh : Form
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        public BarTender.Application engine;
         ApplicationClass lbl;
         Document doc;
         DataHelper dh;
@@ -76,6 +78,7 @@ namespace UAS_MES_NEW.Make
             ma_code.DbChange += Ma_code_DbChange;
             StartWeight.PerformClick();
             dh = SystemInf.dh;
+            comboBox1.SelectedIndex = 0;
             StepCount.StepCode = User.CurrentStepCode;
             StepCount.Source = User.UserSourceCode;
             StepCount.LineCode = User.UserLineCode;
@@ -103,6 +106,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -282,6 +286,8 @@ namespace UAS_MES_NEW.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
             StopWeight.PerformClick();
             InitPrint.Abort();
@@ -301,9 +307,33 @@ namespace UAS_MES_NEW.Make
             {
                 //doc = lbl.Documents.Open(PrintLabel.Text);
                 string oErrorMessage;
-                if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+
+                if (comboBox1.Text == "CODESOFT")
+                {
+                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                    {
+                        OperateResult.AppendText(">>打印彩盒" + sncode.Text + "\n", Color.Black);
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                    }
+                }
+                else if (comboBox1.Text == "BARTENDER")
+                {
+                    if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                    {
+                        OperateResult.AppendText(">>打印彩盒" + sncode.Text + "\n", Color.Black);
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                    }
+                }
+                else if (comboBox1.Text == "")
                 {
-                    OperateResult.AppendText(oErrorMessage + "\n", Color.Red);
+                    OperateResult.AppendText("未选择打印方式\n", Color.Red);
+                    return;
                 }
             }
             else

+ 1 - 1
UAS_MES_NEW/FunctionCode/Make/Make_Decompose.cs

@@ -347,7 +347,7 @@ namespace UAS_MES_NEW.Make
                             {
                                 //判断生产信息
                                 sql.Clear();
-                                sql.Append("select ms_id,ms_sncode,cm_barcode from craftmaterial left join makeserial on cm_barcode = ms_sncode and cm_soncode = ms_prodcode where cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "' and cm_materialtype ='1' and ms_id>'0' and ms_nextmacode = '" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "'");
+                                sql.Append("select ms_id,ms_sncode,cm_barcode from craftmaterial left join makeserial on cm_barcode = ms_sncode and cm_soncode = ms_prodcode where cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'  and ms_id>'0' and ms_nextmacode = '" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 //制造件
                                 if (dt.Rows.Count > 0)

+ 56 - 29
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.Designer.cs

@@ -58,6 +58,8 @@
             this.IP = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pa_remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.groupBoxWithBorder2 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.label4 = new System.Windows.Forms.Label();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
             this.PrintNum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
@@ -427,6 +429,8 @@
             // groupBoxWithBorder2
             // 
             this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.label4);
+            this.groupBoxWithBorder2.Controls.Add(this.comboBox1);
             this.groupBoxWithBorder2.Controls.Add(this.PrintNum);
             this.groupBoxWithBorder2.Controls.Add(this.label1);
             this.groupBoxWithBorder2.Controls.Add(this.StepCount);
@@ -456,6 +460,27 @@
             this.groupBoxWithBorder2.Text = "打印";
             this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
             // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(41, 21);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.TabIndex = 210;
+            this.label4.Text = "打印程序";
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "CODESOFT",
+            "BARTENDER"});
+            this.comboBox1.Location = new System.Drawing.Point(122, 14);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(134, 29);
+            this.comboBox1.TabIndex = 209;
+            // 
             // PrintNum
             // 
             this.PrintNum.AllPower = null;
@@ -476,7 +501,7 @@
             // 
             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(264, 15);
+            this.label1.Location = new System.Drawing.Point(263, 14);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 181;
@@ -498,7 +523,7 @@
             this.checkweightlabel.AutoSize = true;
             this.checkweightlabel.CutLength = null;
             this.checkweightlabel.ForeColor = System.Drawing.Color.Red;
-            this.checkweightlabel.Location = new System.Drawing.Point(27, 23);
+            this.checkweightlabel.Location = new System.Drawing.Point(26, 22);
             this.checkweightlabel.MaximumSize = new System.Drawing.Size(200, 0);
             this.checkweightlabel.Name = "checkweightlabel";
             this.checkweightlabel.Size = new System.Drawing.Size(0, 21);
@@ -508,7 +533,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(345, 87);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(344, 86);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
             this.ob_nowcheckqty.TabIndex = 178;
@@ -517,7 +542,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.Location = new System.Drawing.Point(345, 49);
+            this.ob_batchqty.Location = new System.Drawing.Point(344, 48);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
             this.ob_batchqty.TabIndex = 177;
@@ -526,7 +551,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(264, 87);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(263, 86);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_nowcheckqty_label.TabIndex = 176;
@@ -536,7 +561,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(264, 51);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(263, 50);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(74, 21);
             this.ob_batchqty_label.TabIndex = 175;
@@ -546,7 +571,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno.Location = new System.Drawing.Point(345, 15);
+            this.ob_checkno.Location = new System.Drawing.Point(344, 14);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 21);
             this.ob_checkno.TabIndex = 175;
@@ -608,7 +633,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(7, 88);
+            this.label3.Location = new System.Drawing.Point(6, 87);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 160;
@@ -656,7 +681,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(7, 48);
+            this.PrintList_label.Location = new System.Drawing.Point(6, 47);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
@@ -666,7 +691,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum_label.Location = new System.Drawing.Point(207, 129);
+            this.PrintNum_label.Location = new System.Drawing.Point(206, 128);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 124;
@@ -714,7 +739,7 @@
             this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(291, 16);
+            this.locksalecode.Location = new System.Drawing.Point(290, 15);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(96, 16);
             this.locksalecode.TabIndex = 196;
@@ -725,7 +750,7 @@
             // 
             this.PreFix_label.AutoSize = true;
             this.PreFix_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PreFix_label.Location = new System.Drawing.Point(178, 14);
+            this.PreFix_label.Location = new System.Drawing.Point(177, 13);
             this.PreFix_label.Name = "PreFix_label";
             this.PreFix_label.Size = new System.Drawing.Size(37, 20);
             this.PreFix_label.TabIndex = 195;
@@ -752,7 +777,7 @@
             // 
             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(209, 136);
+            this.pa_salecode_label.Location = new System.Drawing.Point(208, 135);
             this.pa_salecode_label.Name = "pa_salecode_label";
             this.pa_salecode_label.Size = new System.Drawing.Size(74, 21);
             this.pa_salecode_label.TabIndex = 185;
@@ -762,7 +787,7 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(5, 136);
+            this.ma_code_label.Location = new System.Drawing.Point(4, 135);
             this.ma_code_label.Name = "ma_code_label";
             this.ma_code_label.Size = new System.Drawing.Size(58, 21);
             this.ma_code_label.TabIndex = 186;
@@ -772,7 +797,7 @@
             // 
             this.ms_salecode.AutoSize = true;
             this.ms_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_salecode.Location = new System.Drawing.Point(290, 136);
+            this.ms_salecode.Location = new System.Drawing.Point(289, 135);
             this.ms_salecode.Name = "ms_salecode";
             this.ms_salecode.Size = new System.Drawing.Size(0, 21);
             this.ms_salecode.TabIndex = 188;
@@ -781,7 +806,7 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(91, 136);
+            this.ms_makecode.Location = new System.Drawing.Point(90, 135);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 21);
@@ -791,7 +816,7 @@
             // 
             this.OutBoxLength_label.AutoSize = true;
             this.OutBoxLength_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLength_label.Location = new System.Drawing.Point(80, 14);
+            this.OutBoxLength_label.Location = new System.Drawing.Point(79, 13);
             this.OutBoxLength_label.Name = "OutBoxLength_label";
             this.OutBoxLength_label.Size = new System.Drawing.Size(37, 20);
             this.OutBoxLength_label.TabIndex = 184;
@@ -852,7 +877,7 @@
             // AutoGenBoxCode
             // 
             this.AutoGenBoxCode.AutoSize = true;
-            this.AutoGenBoxCode.Location = new System.Drawing.Point(247, 44);
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(246, 43);
             this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(2);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(93, 25);
@@ -865,7 +890,7 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(211, 76);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(210, 75);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_currentqty_label.TabIndex = 95;
@@ -875,7 +900,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(209, 104);
+            this.pr_detail_label.Location = new System.Drawing.Point(208, 103);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 80;
@@ -903,7 +928,7 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty.Location = new System.Drawing.Point(289, 74);
+            this.pa_currentqty.Location = new System.Drawing.Point(288, 73);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
             this.pa_currentqty.TabIndex = 169;
@@ -912,7 +937,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(5, 104);
+            this.pr_code_label.Location = new System.Drawing.Point(4, 103);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 81;
@@ -922,7 +947,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(290, 104);
+            this.pr_detail.Location = new System.Drawing.Point(289, 103);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 168;
@@ -931,7 +956,7 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(5, 73);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(4, 72);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(74, 21);
             this.pr_outboxinnerqty_label.TabIndex = 97;
@@ -941,7 +966,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(91, 104);
+            this.pr_code.Location = new System.Drawing.Point(90, 103);
             this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 21);
@@ -952,7 +977,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(5, 43);
+            this.pa_code_label.Location = new System.Drawing.Point(4, 42);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(42, 21);
             this.pa_code_label.TabIndex = 113;
@@ -1124,12 +1149,12 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PackCollection_FormClosing);
             this.Load += new System.EventHandler(this.PackCollection_Load);
             this.SizeChanged += new System.EventHandler(this.PackCollection_SizeChanged);
-            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.ResumeLayout(false);
             this.groupBoxWithBorder2.PerformLayout();
-            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -1214,5 +1239,7 @@
         private System.Windows.Forms.CheckBox AllowRepeat;
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.SnCollectionBox Remark_PreFix;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.ComboBox comboBox1;
     }
 }

+ 27 - 7
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -47,8 +47,8 @@ namespace UAS_MES_NEW.Packing
             try
             {
                 engine = new BarTender.Application();
-              //  lbl = new ApplicationClass();
-             //   BaseUtil.WriteLbl();
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl();
             }
             catch (Exception ex)
             {
@@ -88,6 +88,7 @@ namespace UAS_MES_NEW.Packing
             catch (Exception) { }
             sn_code.Focus();
             dh = SystemInf.dh;
+            comboBox1.SelectedIndex = 0;
             StepCount.StepCode = User.CurrentStepCode;
             StepCount.Source = User.UserSourceCode;
             StepCount.LineCode = User.UserLineCode;
@@ -158,13 +159,32 @@ namespace UAS_MES_NEW.Packing
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (comboBox1.Text == "CODESOFT")
                     {
-                        OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
+                        if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                        {
+                            OperateResult.AppendText(">>打印卡通箱" + pa_outboxcode.Text + "\n", Color.Black);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        }
                     }
-                    else
+                    else if (comboBox1.Text == "BARTENDER")
+                    {
+                        if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                        {
+                            OperateResult.AppendText(">>打印卡通箱" + pa_outboxcode.Text + "\n", Color.Black);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        }
+                    }
+                    else if (comboBox1.Text == "")
                     {
-                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        OperateResult.AppendText("未选择打印方式\n", Color.Red);
+                        return;
                     }
                     if (!AutoGenBoxCode.Checked)
                     {
@@ -566,7 +586,7 @@ namespace UAS_MES_NEW.Packing
 
         private void PackCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-            //  BaseUtil.ClosePrint(lbl);
+              BaseUtil.ClosePrint(lbl);
             if (engine != null)
                 engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();

+ 32 - 5
UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.Designer.cs

@@ -76,6 +76,8 @@
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.PalletPreFix_label = new System.Windows.Forms.Label();
             this.PalletPreFix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
             ((System.ComponentModel.ISupportInitialize)(this.PackageInf)).BeginInit();
             this.SuspendLayout();
             // 
@@ -273,7 +275,7 @@
             this.pa_standardqty.BackColor = System.Drawing.Color.White;
             this.pa_standardqty.ID = null;
             this.pa_standardqty.Location = new System.Drawing.Point(85, 84);
-            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(2);
             this.pa_standardqty.Name = "pa_standardqty";
             this.pa_standardqty.Power = null;
             this.pa_standardqty.Size = new System.Drawing.Size(114, 21);
@@ -319,7 +321,7 @@
             // PrinterList
             // 
             this.PrinterList.Location = new System.Drawing.Point(592, 83);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
             this.PrinterList.Name = "PrinterList";
             this.PrinterList.Size = new System.Drawing.Size(132, 20);
             this.PrinterList.TabIndex = 171;
@@ -552,10 +554,10 @@
             // AutoPrint
             // 
             this.AutoPrint.Checked = false;
-            this.AutoPrint.Location = new System.Drawing.Point(757, 174);
+            this.AutoPrint.Location = new System.Drawing.Point(757, 186);
             this.AutoPrint.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(84, 22);
+            this.AutoPrint.Size = new System.Drawing.Size(111, 22);
             this.AutoPrint.TabIndex = 191;
             // 
             // OutBoxLength_label
@@ -589,7 +591,7 @@
             // 
             this.StepCount.LineCode = null;
             this.StepCount.Location = new System.Drawing.Point(482, 11);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;
@@ -623,11 +625,34 @@
             this.PalletPreFix.TabIndex = 195;
             this.PalletPreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PalletPreFix_KeyDown);
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(761, 163);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 210;
+            this.label3.Text = "打印程序";
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Items.AddRange(new object[] {
+            "CODESOFT",
+            "BARTENDER"});
+            this.comboBox1.Location = new System.Drawing.Point(842, 156);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(134, 20);
+            this.comboBox1.TabIndex = 209;
+            // 
             // 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.label3);
+            this.Controls.Add(this.comboBox1);
             this.Controls.Add(this.PalletPreFix_label);
             this.Controls.Add(this.PalletPreFix);
             this.Controls.Add(this.StepCount);
@@ -729,5 +754,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ComboBox comboBox1;
     }
 }

+ 33 - 6
UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -25,6 +25,8 @@ namespace UAS_MES_NEW.Packing
 
         Packing_NewPallet NewPallet;
 
+        public BarTender.Application engine;
+
         string pa_nextstep = "";
         //箱类型
         string pa_type;
@@ -51,6 +53,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -67,6 +70,7 @@ namespace UAS_MES_NEW.Packing
             SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();
+            comboBox1.SelectedIndex = 0;
             OutBoxLength.Text = BaseUtil.GetCacheData("PalletLength").ToString();
             PalletPreFix.Text = BaseUtil.GetCacheData("PalletPreFix").ToString();
             dh = SystemInf.dh;
@@ -152,7 +156,7 @@ namespace UAS_MES_NEW.Packing
                         pa_nextstep = dt.Rows[0]["pa_nextstep"].ToString();
                         if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "" && (unfinpack == "0" || unfinpack == ""))
                         {
-                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "的下一工序不是当前岗位资源对应工序\n", Color.Red, outboxcode);
+                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "的下一工序为" + pa_nextstep + ",不是当前岗位资源对应工序\\n", Color.Red, outboxcode);
                             return;
                         }
                         sql.Clear();
@@ -207,6 +211,7 @@ namespace UAS_MES_NEW.Packing
                             else
                             {
                                 pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                                pa_standardqty.Text = dh.getFieldDataByCondition("product", "pr_palletqty", "pr_code = '" + pd_prodcode.Text + "'").ToString();
                             }
                         }
                         else if (pa_outboxcode.Text != "" && pa_status.Text == "1" && AutoOutBoxCode.Checked)
@@ -423,15 +428,34 @@ namespace UAS_MES_NEW.Packing
                         outboxcode.SelectAll();
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+
+                    if (comboBox1.Text == "CODESOFT")
                     {
-                        OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
+                        if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                        {
+                            OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        }
                     }
-                    else
+                    else if (comboBox1.Text == "BARTENDER")
                     {
-                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                        {
+                            OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                        }
+                    }
+                    else if (comboBox1.Text == "")
+                    {
+                        OperateResult.AppendText("未选择打印方式\n", Color.Red);
+                        return;
                     }
-
                 }
                 else OperateResult.AppendText(">>必须封栈板才能进行打印\n", Color.Red);
             }
@@ -472,6 +496,7 @@ namespace UAS_MES_NEW.Packing
                         SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + pa_outboxcode.Text + "'");
                         dh.ExecuteSQLTran(SQLS.ToArray());
                     }
+                    dh.ExecuteSql("delete package where pa_outboxcode = '" + pa_outboxcode.Text + "'", "select");
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "解除栈板" + pa_outboxcode.Text + "成功", pa_outboxcode.Text, "");
                     OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "解除成功\n", Color.Green);
                     palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
@@ -482,6 +507,8 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PalletCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
         }
 

+ 176 - 0
UAS_MES_NEW/FunctionCode/Special/Special_GetBad.Designer.cs

@@ -0,0 +1,176 @@
+namespace UAS_MES_NEW.Special
+{
+    partial class Special_GetBad
+    {
+        /// <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_GetBad));
+            this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Pallet_label = new System.Windows.Forms.Label();
+            this.SN = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.OperatResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.NewBadCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.makecode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // 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(267, 133);
+            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);
+            // 
+            // 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(18, 131);
+            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(32, 21);
+            this.Pallet_label.TabIndex = 1;
+            this.Pallet_label.Text = "SN";
+            // 
+            // SN
+            // 
+            this.SN.AllPower = null;
+            this.SN.BackColor = System.Drawing.Color.White;
+            this.SN.ID = null;
+            this.SN.Location = new System.Drawing.Point(91, 133);
+            this.SN.Margin = new System.Windows.Forms.Padding(2);
+            this.SN.Name = "SN";
+            this.SN.Power = null;
+            this.SN.Size = new System.Drawing.Size(148, 21);
+            this.SN.Str = null;
+            this.SN.Str1 = null;
+            this.SN.Str2 = null;
+            this.SN.TabIndex = 2;
+            this.SN.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SN_KeyDown);
+            // 
+            // 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(408, 59);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperatResult.Name = "OperatResult";
+            this.OperatResult.Size = new System.Drawing.Size(204, 310);
+            this.OperatResult.TabIndex = 3;
+            this.OperatResult.Text = "";
+            // 
+            // NewBadCode
+            // 
+            this.NewBadCode.AllPower = "ifall";
+            this.NewBadCode.BackColor = System.Drawing.Color.Transparent;
+            this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
+            this.NewBadCode.Image = null;
+            this.NewBadCode.IsShowBorder = true;
+            this.NewBadCode.Location = new System.Drawing.Point(91, 215);
+            this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
+            this.NewBadCode.Name = "NewBadCode";
+            this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
+            this.NewBadCode.Power = null;
+            this.NewBadCode.Size = new System.Drawing.Size(86, 24);
+            this.NewBadCode.TabIndex = 61;
+            this.NewBadCode.Tag = "IfRead";
+            this.NewBadCode.Text = "新增不良代码";
+            this.NewBadCode.UseVisualStyleBackColor = true;
+            this.NewBadCode.Click += new System.EventHandler(this.NewBadCode_Click);
+            // 
+            // makecode
+            // 
+            this.makecode.AllPower = null;
+            this.makecode.BackColor = System.Drawing.Color.White;
+            this.makecode.ID = null;
+            this.makecode.Location = new System.Drawing.Point(91, 177);
+            this.makecode.Margin = new System.Windows.Forms.Padding(2);
+            this.makecode.Name = "makecode";
+            this.makecode.Power = null;
+            this.makecode.ReadOnly = true;
+            this.makecode.Size = new System.Drawing.Size(148, 21);
+            this.makecode.Str = null;
+            this.makecode.Str1 = null;
+            this.makecode.Str2 = null;
+            this.makecode.TabIndex = 63;
+            // 
+            // 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(18, 175);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(42, 21);
+            this.label1.TabIndex = 62;
+            this.label1.Text = "工单";
+            // 
+            // Special_GetBad
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(692, 527);
+            this.Controls.Add(this.makecode);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.NewBadCode);
+            this.Controls.Add(this.OperatResult);
+            this.Controls.Add(this.SN);
+            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_GetBad";
+            this.Tag = "Special!GetBad";
+            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 SN;
+        private CustomControl.RichText.RichTextAutoBottom OperatResult;
+        private CustomControl.ButtonUtil.NormalButton NewBadCode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox makecode;
+        private System.Windows.Forms.Label label1;
+    }
+}

+ 110 - 0
UAS_MES_NEW/FunctionCode/Special/Special_GetBad.cs

@@ -0,0 +1,110 @@
+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.Make;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Special
+{
+    public partial class Special_GetBad : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        DataTable dt;
+
+        public Special_GetBad()
+        {
+            InitializeComponent();
+        }
+
+        private void Special_BoxSplit_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+        }
+
+        private void Split_Click(object sender, EventArgs e)
+        {
+            if (SN.Text == "" || makecode.Text == null || makecode.Text == "")
+            {
+                OperatResult.AppendText(">>序列号和工单号不允许为空\n", Color.Red);
+            }
+            else
+            {
+                //如果存在送检批号则进行删除
+                if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" + SN.Text + "'"))
+                {
+                    string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" + SN.Text + "'").ToString();
+                    string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" + SN.Text + "'").ToString();
+                    if (ifng == "-1")
+                    {
+                        dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + SN.Text + "'", "select");
+                        dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
+                    }
+                    dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + SN.Text + "'", "delete");
+                }
+                //之前保存的不良就不再调用
+                DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                    string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                    string ms_status = dt.Rows[0]["ms_status"].ToString();
+                    if (ms_status == "2")
+                    {
+                        dh.UpdateByCondition("make", "ma_madeqty=nvl(ma_madeqty,0)-1", "ma_code='" + makecode.Text + "'");
+                    }
+                    dh.UpdateByCondition("makeserial", "ms_nextstepcode='',ms_status=3", "ms_sncode='" + SN.Text + "' and ms_makecode='" + makecode.Text + "' ");
+                }
+
+                LogicHandler.InsertMakeProcess(SN.Text, makecode.Text, User.UserSourceCode, "采集成不良", "特殊测试不良", User.UserCode);
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, makecode.Text, User.UserLineCode, User.UserSourceCode, "采集成不良", "特殊采集不良", SN.Text,"");
+                OperatResult.AppendText(">>序列号:" + SN.Text + "不良采集成功\n", Color.Green);
+                BaseUtil.CleanControls(this.Controls);
+            }
+        }
+
+        private void SN_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                sql.Clear();
+                sql.Append("select ms_makecode makecode  from makeserial left join make ");
+                sql.Append("on ms_makecode=ma_code where ms_sncode = '" + SN.Text + "' order by ms_id desc");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                BaseUtil.SetFormValue(this.Controls, dt);
+                string ms_paststep = "";
+                if (!(dt.Rows.Count > 0))
+                {
+                    OperatResult.AppendText(">>序列号:" + SN.Text + "不存在\n", Color.Red);
+                    BaseUtil.CleanForm(this);
+                    return;
+                }
+
+            }
+        }
+
+        private void NewBadCode_Click(object sender, EventArgs e)
+        {
+            if (SN.Text == "" || makecode.Text == null || makecode.Text == "")
+            {
+                OperatResult.AppendText(">>序列号和工单号不允许为空\n", Color.Red);
+            }
+            else
+            {
+                Make_NewBadCode badcode = new Make_NewBadCode(SN.Text, makecode.Text);
+               // badcode.FormClosed += LoadBadInfTree;
+                BaseUtil.SetFormCenter(badcode);
+                badcode.ShowDialog();
+            }
+        }
+    }
+}

+ 197 - 0
UAS_MES_NEW/FunctionCode/Special/Special_GetBad.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="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>
+  <data name="NewBadCode.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="NewBadCode.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="NewBadCode.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>

+ 7 - 6
UAS_MES_NEW/PublicMethod/LogicHandler.cs

@@ -498,23 +498,24 @@ namespace UAS_MES_NEW.PublicMethod
             {
                 sql.Clear();
                 sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='" + iOutBoxCode + "' and ms_sncode=");
-                sql.Append("v_barcode and ms_makecode=v_makecode and ms_status=2) when matched then update set ms_nextstepcode=ms_stepcode");
+                sql.Append("v_barcode and ms_makecode=v_makecode ) when matched then update set ms_nextstepcode=ms_stepcode");
                 sql.Append(",ms_status=1,ms_sccode='" + iSourceCode + "' ");
             }
             ExeSQL.Add(sql.ToString());
             //更新完工数量
             ExeSQL.Add("update make set ma_madeqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
             //删除StepPassed数据
-            sql.Clear();
-            sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
-            sql.Append("and sp_makecode='" + iMakeCode + "' and sp_stepcode='" + CurrentStep + "'");
-            ExeSQL.Add(sql.ToString());
+            //sql.Clear();
+            //sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
+            //sql.Append("and sp_makecode='" + iMakeCode + "' and sp_stepcode='" + CurrentStep + "'");
+            //ExeSQL.Add(sql.ToString());
             //更新大箱或栈板的母箱编号为空
             ExeSQL.Add("update package set pa_mothercode='' where pa_outboxcode in(select PD_INNERBOXCODE from package left join packagedetail on pa_id=pd_paid where pa_outboxcode='" + iOutBoxCode + "')");
             //删除从表明细
             ExeSQL.Add("delete from packagedetail where pd_paid=(select pa_id from package where pa_outboxcode='" + iOutBoxCode + "')");
             //设置大箱或栈板的已装数量为0
-            ExeSQL.Add("update package set pa_totalqty=0,pa_status=0,pa_currentqty=0,pa_packageqty=0 where pa_outboxcode='" + iOutBoxCode + "'");
+            //ExeSQL.Add("update package set pa_totalqty=0,pa_status=0,pa_currentqty=0,pa_packageqty=0 where pa_outboxcode='" + iOutBoxCode + "'");
+            ExeSQL.Add("delete package  where pa_outboxcode='" + iOutBoxCode + "'");
             dh.ExecuteSQLTran(ExeSQL.ToArray());
         }
 

+ 6 - 6
UAS_MES_NEW/PublicMethod/Print.cs

@@ -122,11 +122,11 @@ 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 (dt.Rows.Count > 0)
+                //{
+                //    ErrorMessage = SnCode + LabelType + "已打印";
+                //    return false;
+                //}
             }
             string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
             FileInfo PrintFile = new FileInfo(LabelName);
@@ -183,7 +183,7 @@ namespace UAS_MES_NEW.PublicMethod
                                     doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[0][0].ToString();
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if (doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                                if (j != 0&&doc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
                                 {
                                     doc.Variables.FormVariables.Item(k + 1).Value = Param.Rows[j][0].ToString();
                                 }

File diff suppressed because it is too large
+ 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("工单号不存在");

Some files were not shown because too many files changed in this diff