Browse Source

冻结栈板,箱号

callm 1 year ago
parent
commit
e43f6ed5d1

+ 4 - 5
UAS_MES_LGDZ/FunctionCode/Packing/Packing_BigBoxCollection.Designer.cs

@@ -119,7 +119,7 @@
             this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.AutoPrint.Location = new System.Drawing.Point(1506, 318);
-            this.AutoPrint.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(6);
             this.AutoPrint.Name = "AutoPrint";
             this.AutoPrint.Size = new System.Drawing.Size(242, 45);
             this.AutoPrint.TabIndex = 153;
@@ -210,7 +210,7 @@
             this.AutoOutBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.AutoOutBoxCode.Location = new System.Drawing.Point(6, 28);
-            this.AutoOutBoxCode.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.AutoOutBoxCode.Margin = new System.Windows.Forms.Padding(6);
             this.AutoOutBoxCode.Name = "AutoOutBoxCode";
             this.AutoOutBoxCode.Size = new System.Drawing.Size(155, 39);
             this.AutoOutBoxCode.TabIndex = 179;
@@ -235,7 +235,7 @@
             this.Cancel.AutoSize = true;
             this.Cancel.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.Cancel.Location = new System.Drawing.Point(1804, 526);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(6);
             this.Cancel.Name = "Cancel";
             this.Cancel.Size = new System.Drawing.Size(155, 39);
             this.Cancel.TabIndex = 182;
@@ -377,7 +377,6 @@
             // 
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
-            this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
             this.PrintNum.Location = new System.Drawing.Point(1676, 238);
             this.PrintNum.Margin = new System.Windows.Forms.Padding(6);
@@ -712,7 +711,7 @@
             this.Controls.Add(this.pa_totalqty_label);
             this.Controls.Add(this.pa_outboxcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Packing_BigBoxCollection";
             this.Tag = "Packing!BigBoxCollection";
             this.Text = "栈板采集";

+ 0 - 15
UAS_MES_LGDZ/FunctionCode/Packing/Packing_BigBoxCollection.resx

@@ -323,19 +323,4 @@
   <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_outboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -284,7 +284,7 @@ namespace UAS_MES_NEW.Packing
                             ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                             ms_iostatus = dt.Rows[0]["ms_iostatus"].ToString();
                             ms_outno = dt.Rows[0]["ms_outno"].ToString();
-                            ms_salecode_text = dt.Rows[0]["ms_salecode"].ToString();
+                            ms_salecode_text = dt.Rows[0]["ms_makecode"].ToString();
                             if (locksalecode.Checked && ms_salecode.Text != "" && ms_salecode.Text != ms_salecode_text)
                             {
                                 OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号" + ms_salecode_text + "与界面订单号" + ms_salecode.Text + "不同,无法采集\n", Color.Red, sn_code);

+ 1 - 0
UAS_MES_LGDZ/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -147,6 +147,7 @@ namespace UAS_MES_NEW.Packing
                     if (dt.Rows.Count > 0)
                     {
                         BaseUtil.SetFormValue(this.Controls, dt);
+
                         if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
                         {
                             OperateResult.AppendText(">>箱号" + outboxcode.Text + "下地状态不允许采集\n", Color.Red, outboxcode);

+ 53 - 24
UAS_MES_LGDZ/FunctionCode/Special/Special_CancelImei.Designer.cs

@@ -34,20 +34,22 @@
             this.nr_name_label = new System.Windows.Forms.Label();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.IMEI = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.barcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Reason = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Down = new System.Windows.Forms.RadioButton();
+            this.Up = new System.Windows.Forms.RadioButton();
             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(253, 266);
+            this.Pallet_label.Location = new System.Drawing.Point(156, 272);
             this.Pallet_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Pallet_label.Name = "Pallet_label";
-            this.Pallet_label.Size = new System.Drawing.Size(85, 41);
+            this.Pallet_label.Size = new System.Drawing.Size(192, 41);
             this.Pallet_label.TabIndex = 1;
-            this.Pallet_label.Text = "IMEI";
+            this.Pallet_label.Text = "箱号/栈板号";
             // 
             // bc_code
             // 
@@ -66,7 +68,7 @@
             this.nr_name_label.AutoSize = true;
             this.nr_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_name_label.ForeColor = System.Drawing.Color.Black;
-            this.nr_name_label.Location = new System.Drawing.Point(255, 347);
+            this.nr_name_label.Location = new System.Drawing.Point(255, 354);
             this.nr_name_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.nr_name_label.Name = "nr_name_label";
             this.nr_name_label.Size = new System.Drawing.Size(82, 41);
@@ -90,7 +92,7 @@
             this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
             this.SaveRepairInf.Image = null;
             this.SaveRepairInf.IsShowBorder = true;
-            this.SaveRepairInf.Location = new System.Drawing.Point(443, 500);
+            this.SaveRepairInf.Location = new System.Drawing.Point(388, 540);
             this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(6);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
@@ -99,31 +101,32 @@
             this.SaveRepairInf.Size = new System.Drawing.Size(172, 48);
             this.SaveRepairInf.TabIndex = 145;
             this.SaveRepairInf.Tag = "IfRead";
-            this.SaveRepairInf.Text = "确认取消";
+            this.SaveRepairInf.Text = "确认";
             this.SaveRepairInf.UseVisualStyleBackColor = true;
             this.SaveRepairInf.Click += new System.EventHandler(this.SaveRepairInf_Click);
             // 
-            // IMEI
-            // 
-            this.IMEI.AllPower = null;
-            this.IMEI.BackColor = System.Drawing.Color.White;
-            this.IMEI.ID = null;
-            this.IMEI.Location = new System.Drawing.Point(375, 272);
-            this.IMEI.Margin = new System.Windows.Forms.Padding(4);
-            this.IMEI.Name = "IMEI";
-            this.IMEI.Power = null;
-            this.IMEI.Size = new System.Drawing.Size(318, 35);
-            this.IMEI.Str = null;
-            this.IMEI.Str1 = null;
-            this.IMEI.Str2 = null;
-            this.IMEI.TabIndex = 2;
+            // barcode
+            // 
+            this.barcode.AllPower = null;
+            this.barcode.BackColor = System.Drawing.Color.White;
+            this.barcode.ID = null;
+            this.barcode.Location = new System.Drawing.Point(375, 272);
+            this.barcode.Margin = new System.Windows.Forms.Padding(4);
+            this.barcode.Name = "barcode";
+            this.barcode.Power = null;
+            this.barcode.Size = new System.Drawing.Size(318, 35);
+            this.barcode.Str = null;
+            this.barcode.Str1 = null;
+            this.barcode.Str2 = null;
+            this.barcode.TabIndex = 2;
+            this.barcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
             // 
             // Reason
             // 
             this.Reason.AllPower = null;
             this.Reason.BackColor = System.Drawing.Color.White;
             this.Reason.ID = null;
-            this.Reason.Location = new System.Drawing.Point(375, 356);
+            this.Reason.Location = new System.Drawing.Point(375, 354);
             this.Reason.Margin = new System.Windows.Forms.Padding(4);
             this.Reason.Name = "Reason";
             this.Reason.Power = null;
@@ -133,17 +136,41 @@
             this.Reason.Str2 = null;
             this.Reason.TabIndex = 151;
             // 
+            // Down
+            // 
+            this.Down.AutoSize = true;
+            this.Down.Checked = true;
+            this.Down.Location = new System.Drawing.Point(375, 443);
+            this.Down.Name = "Down";
+            this.Down.Size = new System.Drawing.Size(89, 28);
+            this.Down.TabIndex = 152;
+            this.Down.TabStop = true;
+            this.Down.Text = "冻结";
+            this.Down.UseVisualStyleBackColor = true;
+            // 
+            // Up
+            // 
+            this.Up.AutoSize = true;
+            this.Up.Location = new System.Drawing.Point(494, 443);
+            this.Up.Name = "Up";
+            this.Up.Size = new System.Drawing.Size(137, 28);
+            this.Up.TabIndex = 153;
+            this.Up.Text = "取消冻结";
+            this.Up.UseVisualStyleBackColor = true;
+            // 
             // Special_CancelImei
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1384, 1054);
+            this.Controls.Add(this.Up);
+            this.Controls.Add(this.Down);
             this.Controls.Add(this.Reason);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.bc_code);
             this.Controls.Add(this.SaveRepairInf);
             this.Controls.Add(this.nr_name_label);
-            this.Controls.Add(this.IMEI);
+            this.Controls.Add(this.barcode);
             this.Controls.Add(this.Pallet_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
@@ -158,11 +185,13 @@
 
         #endregion
         private System.Windows.Forms.Label Pallet_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox IMEI;
+        private CustomControl.TextBoxWithIcon.EnterTextBox barcode;
         private System.Windows.Forms.Label bc_code;
         private CustomControl.ButtonUtil.NormalButton SaveRepairInf;
         private System.Windows.Forms.Label nr_name_label;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.TextBoxWithIcon.EnterTextBox Reason;
+        private System.Windows.Forms.RadioButton Down;
+        private System.Windows.Forms.RadioButton Up;
     }
 }

+ 32 - 34
UAS_MES_LGDZ/FunctionCode/Special/Special_CancelImei.cs

@@ -30,52 +30,50 @@ namespace UAS_MES_NEW.Special
 
         private void SaveRepairInf_Click(object sender, EventArgs e)
         {
-            if (Reason.Text == "")
-            {
-                MessageBox.Show("必须填写原因");
-                return;
-            }
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei1 ='" + IMEI.Text + "'", "select");
-            if (dt.Rows.Count > 0)
+            barcode_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+        }
+
+        private void barcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
             {
-                dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei1='" + IMEI.Text + "'", "select");
-                if (dt.Rows.Count > 0)
+                if (Reason.Text == "")
                 {
-                    string sn = dt.Rows[0]["ms_sncode"].ToString();
-                    string pr_detail = dt.Rows[0]["pr_detail"].ToString();
-                    dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei1='' where ms_imei1='" + IMEI.Text + "'", "update");
-                    dh.ExecuteSql("update sninfo set si_imei1='' where si_imei1='" + IMEI.Text + "'", "update");
-                    LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
-                    OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
+                    MessageBox.Show("必须填写原因");
+                    return;
                 }
-                else
-                {
-                    OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
-                }
-            }
-            else
-            {
-                dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei2 ='" + IMEI.Text + "'", "select");
+
+                DataTable dt = (DataTable)dh.ExecuteSql("select pa_id,nvl(pa_downstatus,0)pa_downstatus from pacakge where pa_outboxcode='" + barcode.Text + "'", "select");
                 if (dt.Rows.Count > 0)
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei2='" + IMEI.Text + "'", "select");
-                    if (dt.Rows.Count > 0)
+                    if (Down.Checked)
                     {
-                        string sn = dt.Rows[0]["ms_sncode"].ToString();
-                        string pr_detail = dt.Rows[0]["pr_detail"].ToString();
-                        dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei2='' where ms_imei2='" + IMEI.Text + "'", "update");
-                        dh.ExecuteSql("update sninfo set si_imei2='' where si_imei2='" + IMEI.Text + "'", "update");
-                        LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
-                        OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
+                        string pa_downstatus = dt.Rows[0]["pa_downstatus"].ToString();
+                        if (pa_downstatus == "-1")
+                        {
+                            OperateResult.AppendText(barcode.Text + "已被冻结", System.Drawing.Color.Red);
+                            return;
+                        }
+                        dh.ExecuteSql("update package set pa_downstatus=-1 where pa_outboxcode='" + barcode.Text + "'", "update");
+                        LogicHandler.DoCommandLog("DownPackage", User.UserName, "", User.UserLineCode, User.UserSourceCode, "箱号冻结", "冻结成功" + Reason.Text, barcode.Text, "");
+                        OperateResult.AppendText(barcode.Text + "冻结成功", System.Drawing.Color.Green);
                     }
-                    else
+                    if (Up.Checked)
                     {
-                        OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
+                        string pa_downstatus = dt.Rows[0]["pa_downstatus"].ToString();
+                        if (pa_downstatus != "-1")
+                        {
+                            OperateResult.AppendText(barcode.Text + "未被冻结", System.Drawing.Color.Red);
+                            return;
+                        }
+                        dh.ExecuteSql("update package set pa_downstatus=-1 where pa_outboxcode='" + barcode.Text + "'", "update");
+                        LogicHandler.DoCommandLog("DownPackage", User.UserName, "", User.UserLineCode, User.UserSourceCode, "箱号冻结", "取消冻结成功" + Reason.Text, barcode.Text, "");
+                        OperateResult.AppendText(barcode.Text + "取消冻结成功", System.Drawing.Color.Green);
                     }
                 }
                 else
                 {
-                    OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
+                    OperateResult.AppendText(barcode.Text + "不存在", System.Drawing.Color.Red);
                 }
             }
         }

+ 1 - 0
UAS_MES_LGDZ/FunctionCode/Special/Special_CancelOQC.cs

@@ -96,6 +96,7 @@ namespace UAS_MES_NEW.Special
                 }
                 BaseUtil.SetFormValue(this.Controls, dt);
                 string ms_id = dt.Rows[0]["ms_id"].ToString();
+                SN.Text = dt.Rows[0]["ms_sncode"].ToString();
                 if (OK.Checked)
                 {
                     dh.ExecuteSql("update makeserial set ms_iftest=-1 where ms_id=" + ms_id, "update");

+ 2 - 2
UAS_MES_LGDZ/FunctionCode/Special/Special_ChangeMakeCode.cs

@@ -77,12 +77,12 @@ namespace UAS_MES_NEW.Special
                 OperateResult.AppendText("工单号不允许为空\n");
                 return;
             }
-            if (dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
+            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
             {
                 OperateResult.AppendText("工单号" + ma_code.Text + "不存在\n");
                 return;
             }
-            if (dh.CheckExist("make", "ma_code='" + ma_code1.Text + "'"))
+            if (!dh.CheckExist("make", "ma_code='" + ma_code1.Text + "'"))
             {
                 OperateResult.AppendText("工单号" + ma_code1.Text + "不存在\n");
                 return;

+ 56 - 41
UAS_MES_LGDZ/FunctionCode/Special/Special_Delete.Designer.cs

@@ -43,13 +43,15 @@
             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.groupBox1 = new System.Windows.Forms.GroupBox();
             this.DeleteALLSN = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.label2 = new System.Windows.Forms.Label();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.RemainSN = new System.Windows.Forms.Label();
             this.TotalSN = new System.Windows.Forms.Label();
-            this.PassWord = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.PassWord = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
             // Pallet_label
@@ -225,18 +227,34 @@
             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(895, 216);
+            this.Split.Location = new System.Drawing.Point(494, 32);
             this.Split.Margin = new System.Windows.Forms.Padding(4);
             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(164, 44);
+            this.Split.Size = new System.Drawing.Size(223, 92);
             this.Split.TabIndex = 0;
             this.Split.Text = "解绑录入工单";
             this.Split.UseVisualStyleBackColor = false;
             this.Split.Click += new System.EventHandler(this.Split_Click);
             // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.PassWord);
+            this.groupBox1.Controls.Add(this.DeleteALLSN);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.TotalSN);
+            this.groupBox1.Controls.Add(this.ma_code);
+            this.groupBox1.Controls.Add(this.RemainSN);
+            this.groupBox1.Location = new System.Drawing.Point(917, 384);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(640, 289);
+            this.groupBox1.TabIndex = 253;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "工单解绑";
+            // 
             // DeleteALLSN
             // 
             this.DeleteALLSN.AllPower = null;
@@ -244,7 +262,7 @@
             this.DeleteALLSN.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteALLSN.DownImage")));
             this.DeleteALLSN.Image = null;
             this.DeleteALLSN.IsShowBorder = true;
-            this.DeleteALLSN.Location = new System.Drawing.Point(1332, 593);
+            this.DeleteALLSN.Location = new System.Drawing.Point(413, 213);
             this.DeleteALLSN.Margin = new System.Windows.Forms.Padding(4);
             this.DeleteALLSN.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteALLSN.MoveImage")));
             this.DeleteALLSN.Name = "DeleteALLSN";
@@ -256,6 +274,17 @@
             this.DeleteALLSN.UseVisualStyleBackColor = false;
             this.DeleteALLSN.Click += new System.EventHandler(this.DeleteALLSN_Click);
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(22, 66);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(146, 41);
+            this.label2.TabIndex = 247;
+            this.label2.Text = "工单编号";
+            // 
             // ma_code
             // 
             this.ma_code.AllPower = "IFALL";
@@ -264,7 +293,7 @@
             this.ma_code.DBTitle = "";
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(1126, 446);
+            this.ma_code.Location = new System.Drawing.Point(207, 66);
             this.ma_code.Margin = new System.Windows.Forms.Padding(6);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = "";
@@ -277,22 +306,11 @@
             this.ma_code.Tag = "makecode";
             this.ma_code.TextBoxEnable = true;
             // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(941, 446);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(146, 41);
-            this.label2.TabIndex = 247;
-            this.label2.Text = "工单编号";
-            // 
             // RemainSN
             // 
             this.RemainSN.AutoSize = true;
             this.RemainSN.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.RemainSN.Location = new System.Drawing.Point(1141, 606);
+            this.RemainSN.Location = new System.Drawing.Point(222, 226);
             this.RemainSN.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.RemainSN.Name = "RemainSN";
             this.RemainSN.Size = new System.Drawing.Size(0, 41);
@@ -302,18 +320,29 @@
             // 
             this.TotalSN.AutoSize = true;
             this.TotalSN.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.TotalSN.Location = new System.Drawing.Point(1325, 606);
+            this.TotalSN.Location = new System.Drawing.Point(406, 226);
             this.TotalSN.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.TotalSN.Name = "TotalSN";
             this.TotalSN.Size = new System.Drawing.Size(0, 41);
             this.TotalSN.TabIndex = 250;
             // 
+            // 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(60, 141);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.TabIndex = 251;
+            this.label1.Text = "密码";
+            // 
             // PassWord
             // 
             this.PassWord.AllPower = null;
             this.PassWord.BackColor = System.Drawing.Color.White;
             this.PassWord.ID = null;
-            this.PassWord.Location = new System.Drawing.Point(1126, 523);
+            this.PassWord.Location = new System.Drawing.Point(207, 143);
             this.PassWord.Margin = new System.Windows.Forms.Padding(4);
             this.PassWord.Name = "PassWord";
             this.PassWord.Power = null;
@@ -323,29 +352,12 @@
             this.PassWord.Str2 = null;
             this.PassWord.TabIndex = 252;
             // 
-            // 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(979, 521);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(82, 41);
-            this.label1.TabIndex = 251;
-            this.label1.Text = "密码";
-            // 
             // Special_Delete
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1611, 1131);
-            this.Controls.Add(this.PassWord);
-            this.Controls.Add(this.label1);
-            this.Controls.Add(this.TotalSN);
-            this.Controls.Add(this.RemainSN);
-            this.Controls.Add(this.ma_code);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.DeleteALLSN);
+            this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.数据清空);
             this.Controls.Add(this.cd_stepno);
             this.Controls.Add(this.WeighRecord);
@@ -366,7 +378,9 @@
             this.Text = "重置站点";
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.SizeChanged += new System.EventHandler(this.Special_Reset_SizeChanged);
-            this.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(true);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -387,12 +401,13 @@
         private System.Windows.Forms.ColumnHeader columnHeader3;
         private System.Windows.Forms.Label cd_stepno;
         private CustomControl.ButtonUtil.NormalButton 数据清空;
+        private System.Windows.Forms.GroupBox groupBox1;
         private CustomControl.ButtonUtil.NormalButton DeleteALLSN;
-        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
         private System.Windows.Forms.Label label2;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
         private System.Windows.Forms.Label RemainSN;
         private System.Windows.Forms.Label TotalSN;
-        private CustomControl.TextBoxWithIcon.EnterTextBox PassWord;
         private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox PassWord;
     }
 }

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Special/Special_Delete.cs

@@ -265,7 +265,7 @@ namespace UAS_MES_NEW.Special
         }
 
         private void DeleteALLSN_Click(object sender, EventArgs e)
-        {   
+        {
             if (PassWord.Text == dh.getFieldDataByCondition("configs", "data", "code='Password' and caller='MESSetting'").ToString())
             {
                 DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_makecode from makeserial where ms_makecode ='" + ma_code.Text + "'", "select");

+ 1 - 0
UAS_MES_LGDZ/FunctionCode/Special/Special_QCRecheck.cs

@@ -36,6 +36,7 @@ namespace UAS_MES_NEW.Special
                     OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于QC判定状态\n", Color.Red, sn_code);
                     return;
                 }
+                dh.ExecuteSql("update makeserial set ms_qccheck=0 where ms_sncode='"+sn_code.Text+"'","update");
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "维修品判定", "维修品判定为良品", sn_code.Text, "");
                 OperateResult.AppendText(">>序列号" + sn_code.Text + "QC确认良品\n", Color.Green, sn_code);
             }

+ 63 - 6
UAS_MES_LGDZ/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -52,6 +52,10 @@
             this.Setting = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.PrintTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.OneColumn = new System.Windows.Forms.RadioButton();
+            this.TwoColumn = new System.Windows.Forms.RadioButton();
+            this.ThreeColumn = new System.Windows.Forms.RadioButton();
+            this.FourColumn = new System.Windows.Forms.RadioButton();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
             this.SuspendLayout();
             // 
@@ -73,7 +77,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(171, 706);
+            this.label3.Location = new System.Drawing.Point(171, 767);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(146, 41);
@@ -95,7 +99,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(223, 547);
+            this.label1.Location = new System.Drawing.Point(223, 608);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(82, 41);
@@ -113,7 +117,7 @@
             // 
             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(171, 628);
+            this.label6.Location = new System.Drawing.Point(171, 689);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(146, 41);
@@ -122,7 +126,7 @@
             // 
             // numericUpDown1
             // 
-            this.numericUpDown1.Location = new System.Drawing.Point(356, 634);
+            this.numericUpDown1.Location = new System.Drawing.Point(356, 695);
             this.numericUpDown1.Name = "numericUpDown1";
             this.numericUpDown1.Size = new System.Drawing.Size(120, 35);
             this.numericUpDown1.TabIndex = 37;
@@ -276,7 +280,7 @@
             this.Rn.AllPower = null;
             this.Rn.BackColor = System.Drawing.Color.White;
             this.Rn.ID = null;
-            this.Rn.Location = new System.Drawing.Point(356, 712);
+            this.Rn.Location = new System.Drawing.Point(356, 773);
             this.Rn.Margin = new System.Windows.Forms.Padding(6);
             this.Rn.Name = "Rn";
             this.Rn.Power = null;
@@ -292,7 +296,7 @@
             this.Num.AllPower = null;
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
-            this.Num.Location = new System.Drawing.Point(356, 553);
+            this.Num.Location = new System.Drawing.Point(356, 614);
             this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
@@ -351,11 +355,60 @@
             this.PrintTest.UseVisualStyleBackColor = true;
             this.PrintTest.Click += new System.EventHandler(this.PrintTest_Click);
             // 
+            // OneColumn
+            // 
+            this.OneColumn.AutoSize = true;
+            this.OneColumn.Location = new System.Drawing.Point(356, 553);
+            this.OneColumn.Name = "OneColumn";
+            this.OneColumn.Size = new System.Drawing.Size(89, 28);
+            this.OneColumn.TabIndex = 242;
+            this.OneColumn.TabStop = true;
+            this.OneColumn.Text = "单排";
+            this.OneColumn.UseVisualStyleBackColor = true;
+            // 
+            // TwoColumn
+            // 
+            this.TwoColumn.AutoSize = true;
+            this.TwoColumn.Location = new System.Drawing.Point(465, 553);
+            this.TwoColumn.Name = "TwoColumn";
+            this.TwoColumn.Size = new System.Drawing.Size(89, 28);
+            this.TwoColumn.TabIndex = 243;
+            this.TwoColumn.TabStop = true;
+            this.TwoColumn.Text = "双排";
+            this.TwoColumn.UseVisualStyleBackColor = true;
+            // 
+            // ThreeColumn
+            // 
+            this.ThreeColumn.AutoSize = true;
+            this.ThreeColumn.Checked = true;
+            this.ThreeColumn.Location = new System.Drawing.Point(583, 553);
+            this.ThreeColumn.Name = "ThreeColumn";
+            this.ThreeColumn.Size = new System.Drawing.Size(89, 28);
+            this.ThreeColumn.TabIndex = 244;
+            this.ThreeColumn.TabStop = true;
+            this.ThreeColumn.Text = "三排";
+            this.ThreeColumn.UseVisualStyleBackColor = true;
+            // 
+            // FourColumn
+            // 
+            this.FourColumn.AutoSize = true;
+            this.FourColumn.Location = new System.Drawing.Point(693, 553);
+            this.FourColumn.Name = "FourColumn";
+            this.FourColumn.Size = new System.Drawing.Size(89, 28);
+            this.FourColumn.TabIndex = 245;
+            this.FourColumn.TabStop = true;
+            this.FourColumn.Text = "四排";
+            this.FourColumn.UseVisualStyleBackColor = true;
+            // 
             // SystemSetting_PrinterTest
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.FourColumn);
+            this.Controls.Add(this.ThreeColumn);
+            this.Controls.Add(this.TwoColumn);
+            this.Controls.Add(this.OneColumn);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.pr_code);
@@ -415,5 +468,9 @@
         private System.Windows.Forms.Label label4;
         private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
         private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.RadioButton OneColumn;
+        private System.Windows.Forms.RadioButton TwoColumn;
+        private System.Windows.Forms.RadioButton ThreeColumn;
+        private System.Windows.Forms.RadioButton FourColumn;
     }
 }

+ 154 - 31
UAS_MES_LGDZ/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -73,43 +73,166 @@ namespace UAS_MES_NEW.SystemSetting
                     return;
                 }
             }*/
-            for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 3)
+            if (OneColumn.Checked)
             {
-                int temp = i;
-                for (int j = 0; j < format.SubStrings.Count; j++)
+                format = engine.Documents.Open(Application.StartupPath + "/单排.btw");
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 1)
                 {
-                    switch (format.SubStrings[j].Name)
+                    int temp = i;
+                    for (int j = 0; j < format.SubStrings.Count; j++)
                     {
-                        case "SN":
-                            format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
-                            if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
-                                dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
-                            break;
-                        case "SN2":
-                            format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
-                            if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
-                                dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
-                            break;
-                        case "SN3":
-                            format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
-                            if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
-                                dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
-                            break;
-                        default:
-                            break;
+                        switch (format.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    format.PrintSetup.PrinterName = PrinterList.Text;
+                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format.Print();
+
+                    DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                        ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                        ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                        pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                    }
+                }
+            }
+            if (TwoColumn.Checked)
+            {
+                format = engine.Documents.Open(Application.StartupPath + "/双排.btw");
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 2)
+                {
+                    int temp = i;
+                    for (int j = 0; j < format.SubStrings.Count; j++)
+                    {
+                        switch (format.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN2":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    format.PrintSetup.PrinterName = PrinterList.Text;
+                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format.Print();
+
+                    DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                        ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                        ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                        pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
                     }
                 }
-                format.PrintSetup.PrinterName = PrinterList.Text;
-                format.PrintSetup.IdenticalCopiesOfLabel = 1;
-                format.Print();
+            }
+            if (ThreeColumn.Checked)
+            {
+                format = engine.Documents.Open(Application.StartupPath + "/Label.btw");
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 3)
+                {
+                    int temp = i;
+                    for (int j = 0; j < format.SubStrings.Count; j++)
+                    {
+                        switch (format.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN2":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN3":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    format.PrintSetup.PrinterName = PrinterList.Text;
+                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format.Print();
 
-                DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
-                if (dt.Rows.Count > 0)
+                    DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                        ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                        ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                        pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                    }
+                }
+            }
+            if (FourColumn.Checked)
+            {
+                format = engine.Documents.Open(Application.StartupPath + "/四排.btw");
+                for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 4)
                 {
-                    pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
-                    ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
-                    ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
-                    pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                    int temp = i;
+                    for (int j = 0; j < format.SubStrings.Count; j++)
+                    {
+                        switch (format.SubStrings[j].Name)
+                        {
+                            case "SN":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN2":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 1).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN3":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 2).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            case "SN4":
+                                format.SubStrings[j].Value = (ma_code.Text + Date.Value.ToString("yyyyMMdd") + lpad(int.Parse(numericUpDown1.Value.ToString()), (temp + 3).ToString()));
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + format.SubStrings[j].Value + "' and msl_makecode='" + ma_code.Text + "'"))
+                                    dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type,msl_printstatus)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before',-1)", "insert");
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    format.PrintSetup.PrinterName = PrinterList.Text;
+                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    format.Print();
+
+                    DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                        ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
+                        ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
+                        pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                    }
                 }
             }
         }
@@ -127,7 +250,7 @@ namespace UAS_MES_NEW.SystemSetting
         private void SystemSetting_PrinterTest_Load(object sender, EventArgs e)
         {
             engine.Start();
-            format = engine.Documents.Open(Application.StartupPath + "/Label.btw");
+
 
             ma_code.TableName = " make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";

+ 2 - 2
UAS_MES_LGDZ/FunctionCode/SystemSetting/SystemSetting_PrinterTest.resx

@@ -215,7 +215,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDQAACw0B7QfALAAACfBJREFUeF7t3dtuFFcC
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACfBJREFUeF7t3dtuFFcC
         heFc5VWQRsrL5T0iRcrDkJAjJOADNjbdbvD5iE9tu302RIq0Z6+ynWkmS6oZrlys/+KT8FJX3f2bcmPa
         X5RSAISyI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCD
         HQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0B
@@ -346,7 +346,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDQAACw0B7QfALAAACfBJREFUeF7t3dtuFFcC
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDAAACwwBP0AiyAAACfBJREFUeF7t3dtuFFcC
         heFc5VWQRsrL5T0iRcrDkJAjJOADNjbdbvD5iE9tu302RIq0Z6+ynWkmS6oZrlys/+KT8FJX3f2bcmPa
         X5RSAISyI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCD
         HQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0B

+ 3 - 3
UAS_MES_LGDZ/PublicMethod/LogicHandler.cs

@@ -159,7 +159,7 @@ namespace UAS_MES_NEW.PublicMethod
             iSourceCode = iSourceCode.ToUpper();
             string SQL = "select em_code,em_type from employee where upper(em_code)=:UserName or em_mobile=:UserName";
             DataTable dt;
-            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iUserCode);
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode.ToUpper(), iUserCode.ToUpper());
             if (dt.Rows.Count > 0)
             {
                 iUserCode = dt.Rows[0]["em_code"].ToString();
@@ -781,7 +781,7 @@ namespace UAS_MES_NEW.PublicMethod
             bool result = CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
             if (result)
             {
-                
+
             }
             else
             {
@@ -790,7 +790,7 @@ namespace UAS_MES_NEW.PublicMethod
                 set.ShowDialog();
             }
             return result;
-        }   
+        }
 
         public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
         {