Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
f9b7ddaefb

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

@@ -15,7 +15,6 @@ namespace UAS_MES.CustomControl.RichText
         {
         {
             InitializeComponent();
             InitializeComponent();
             TextChanged += RichTextBox_TextChange;
             TextChanged += RichTextBox_TextChange;
-
         }
         }
 
 
         private void RichTextBox_TextChange(object sender, EventArgs e)
         private void RichTextBox_TextChange(object sender, EventArgs e)
@@ -41,6 +40,25 @@ namespace UAS_MES.CustomControl.RichText
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// 提示错误信息清楚指定控件的值
+        /// </summary>
+        /// <param name="str"></param>
+        /// <param name="color"></param>
+        /// <param name="ctl"></param>
+        public void AppendText(string str, Color color,Control ctl)
+        {
+            SelectionColor = color;
+            base.AppendText(str);
+            ctl.Text = "";
+            //如果颜色是红色则进行提示音
+            if (color == Color.Red && Entity.SystemInf.CheckAudioEnable)
+            {
+                thread = new Thread(PlaySound);
+                thread.Start();
+            }
+        }
+
         private void PlaySound()
         private void PlaySound()
         {
         {
             //要加载COM组件:Microsoft speech object Library    
             //要加载COM组件:Microsoft speech object Library    

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -315,7 +315,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetSNCode_Label.Location = new System.Drawing.Point(185, 542);
+            this.GetSNCode_Label.Location = new System.Drawing.Point(176, 543);
             this.GetSNCode_Label.Name = "GetSNCode_Label";
             this.GetSNCode_Label.Name = "GetSNCode_Label";
             this.GetSNCode_Label.Size = new System.Drawing.Size(58, 21);
             this.GetSNCode_Label.Size = new System.Drawing.Size(58, 21);
             this.GetSNCode_Label.TabIndex = 113;
             this.GetSNCode_Label.TabIndex = 113;
@@ -501,7 +501,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
             this.GetSNCode.ID = null;
-            this.GetSNCode.Location = new System.Drawing.Point(266, 543);
+            this.GetSNCode.Location = new System.Drawing.Point(257, 544);
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Power = null;
             this.GetSNCode.Power = null;
             this.GetSNCode.Size = new System.Drawing.Size(188, 21);
             this.GetSNCode.Size = new System.Drawing.Size(188, 21);
@@ -519,7 +519,7 @@
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.Image")));
             this.NewRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.Image")));
             this.NewRepairInf.IsShowBorder = true;
             this.NewRepairInf.IsShowBorder = true;
-            this.NewRepairInf.Location = new System.Drawing.Point(298, 502);
+            this.NewRepairInf.Location = new System.Drawing.Point(289, 503);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
@@ -538,7 +538,7 @@
             this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
             this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
             this.SaveRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.Image")));
             this.SaveRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.Image")));
             this.SaveRepairInf.IsShowBorder = true;
             this.SaveRepairInf.IsShowBorder = true;
-            this.SaveRepairInf.Location = new System.Drawing.Point(411, 502);
+            this.SaveRepairInf.Location = new System.Drawing.Point(402, 503);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
             this.SaveRepairInf.Name = "SaveRepairInf";
             this.SaveRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.NormalImage")));
             this.SaveRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.NormalImage")));
@@ -557,7 +557,7 @@
             this.DeleteRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.DownImage")));
             this.DeleteRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.DownImage")));
             this.DeleteRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.Image")));
             this.DeleteRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.Image")));
             this.DeleteRepairInf.IsShowBorder = true;
             this.DeleteRepairInf.IsShowBorder = true;
-            this.DeleteRepairInf.Location = new System.Drawing.Point(525, 502);
+            this.DeleteRepairInf.Location = new System.Drawing.Point(516, 503);
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.Name = "DeleteRepairInf";
             this.DeleteRepairInf.Name = "DeleteRepairInf";
             this.DeleteRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.NormalImage")));
             this.DeleteRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.NormalImage")));
@@ -765,7 +765,7 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(858, 558);
+            this.Clean.Location = new System.Drawing.Point(859, 558);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -824,7 +824,7 @@
             this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
             this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
             this.NewBadCode.Image = ((System.Drawing.Image)(resources.GetObject("NewBadCode.Image")));
             this.NewBadCode.Image = ((System.Drawing.Image)(resources.GetObject("NewBadCode.Image")));
             this.NewBadCode.IsShowBorder = true;
             this.NewBadCode.IsShowBorder = true;
-            this.NewBadCode.Location = new System.Drawing.Point(186, 502);
+            this.NewBadCode.Location = new System.Drawing.Point(177, 503);
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.Name = "NewBadCode";
             this.NewBadCode.Name = "NewBadCode";
             this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
             this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));

+ 50 - 32
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -234,27 +234,39 @@ namespace UAS_MES.Make
 
 
         private void RepairComplete_Click(object sender, EventArgs e)
         private void RepairComplete_Click(object sender, EventArgs e)
         {
         {
-            int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
-            if (RejectNum > 0)
-                OperatResult.AppendText(">>维修结果必须为已维修或无不良\n", Color.Red);
+            if (ms_sncode.Text == "")
+            {
+                OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
+                return;
+            }
+            //判断是否所有的不良信息都有维护不良原因
+            DataTable dt = (DataTable)dh.ExecuteSql("select mb_id,bc_name,mbr_mbid from makebad left join makebadreason on mbr_mbid=mb_id left join badcode on mb_badcode=bc_code where mb_sncode='" + ms_sncode.Text + "'", "select");
+            string ErrorMessage = "";
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (dt.Rows[i]["mb_id"].ToString() != dt.Rows[i]["mbr_mbid"].ToString())
+                    ErrorMessage += "【" + dt.Rows[i]["bc_name"].ToString() + "】";
+            }
+            if (ErrorMessage != "")
+            {
+                OperatResult.AppendText(">>" + ErrorMessage + "未维护不良原因\n", Color.Red);
+                return;
+            }
+            dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
+            if (dt.Rows.Count == 0)
+                OperatResult.AppendText(">>回流工序不存在\n", Color.Red);
             else
             else
             {
             {
-                dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
+                string cr_id = dt.Rows[0]["cr_id"].ToString();
+                dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
                 if (dt.Rows.Count == 0)
                 if (dt.Rows.Count == 0)
-                    OperatResult.AppendText(">>回流工序不存在\n", Color.Red);
+                    OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
                 else
                 else
                 {
                 {
-                    string cr_id = dt.Rows[0]["cr_id"].ToString();
-                    dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
-                    if (dt.Rows.Count == 0)
-                        OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
-                    else
-                    {
-                        dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
-                        dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
-                        OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
-                        GetSNCode.Clear();
-                    }
+                    dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
+                    dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
+                    OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
+                    GetSNCode.Clear();
                 }
                 }
             }
             }
         }
         }
@@ -306,13 +318,16 @@ namespace UAS_MES.Make
                 if (dt.Rows[i]["mbp_id"].ToString() == "")
                 if (dt.Rows[i]["mbp_id"].ToString() == "")
                     prodcode.Add(dt.Rows[i]["mbp_part"].ToString());
                     prodcode.Add(dt.Rows[i]["mbp_part"].ToString());
             }
             }
-            sql.Clear();
-            sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
-            sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
-            sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:prodcode,");
-            sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
-            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-            dh.BatchInsert(sql.GetString(), new string[] { "prodcode" }, prodcode.ToArray());
+            if (prodcode.Count > 0)
+            {
+                sql.Clear();
+                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",:prodcode,");
+                sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                dh.BatchInsert(sql.GetString(), new string[] { "prodcode" }, prodcode.ToArray());
+            }
             //保存不良位置
             //保存不良位置
             dt = (DataTable)mbl_locdgv.DataSource;
             dt = (DataTable)mbl_locdgv.DataSource;
             List<string> location = new List<string>();
             List<string> location = new List<string>();
@@ -321,13 +336,16 @@ namespace UAS_MES.Make
                 if (dt.Rows[i]["mbl_id"].ToString() == "")
                 if (dt.Rows[i]["mbl_id"].ToString() == "")
                     location.Add(dt.Rows[i]["mbl_loc"].ToString());
                     location.Add(dt.Rows[i]["mbl_loc"].ToString());
             }
             }
-            sql.Clear();
-            sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
-            sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
-            sql.Append(",:location,'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
-            sql.Append("sysdate,'" + User.UserCode + "' from dual");
-            dh.BatchInsert(sql.GetString(), new string[] { "location" }, location.ToArray());
-            OperatResult.AppendText(">>保存成功\n", Color.Red);
+            if (location.Count > 0)
+            {
+                sql.Clear();
+                sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
+                sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
+                sql.Append(",:location,'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                dh.BatchInsert(sql.GetString(), new string[] { "location" }, location.ToArray());
+            }
+            OperatResult.AppendText(">>保存成功\n", Color.Green);
         }
         }
 
 
         private void DeleteRepairInf_Click(object sender, EventArgs e)
         private void DeleteRepairInf_Click(object sender, EventArgs e)
@@ -352,7 +370,7 @@ namespace UAS_MES.Make
                 }
                 }
                 else OperatResult.AppendText(">>必须选择不良原因\n", Color.Red);
                 else OperatResult.AppendText(">>必须选择不良原因\n", Color.Red);
             }
             }
-            else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
+            else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
         }
 
 
         private void SaveBadLocation_Click(object sender, EventArgs e)
         private void SaveBadLocation_Click(object sender, EventArgs e)
@@ -373,7 +391,7 @@ namespace UAS_MES.Make
                 }
                 }
                 else OperatResult.AppendText(">>不良位置不能为空\n", Color.Red);
                 else OperatResult.AppendText(">>不良位置不能为空\n", Color.Red);
             }
             }
-            else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
+            else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
         }
 
 
         private void mbl_loc_TextChanged(object sender, EventArgs e)
         private void mbl_loc_TextChanged(object sender, EventArgs e)

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -126,6 +126,9 @@
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>

+ 8 - 8
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -309,7 +309,7 @@
             // 
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode_label.Location = new System.Drawing.Point(328, 47);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(335, 47);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
             this.ma_prodcode_label.Name = "ma_prodcode_label";
             this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_prodcode_label.TabIndex = 7;
             this.ma_prodcode_label.TabIndex = 7;
@@ -339,7 +339,7 @@
             // 
             // 
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty_label.Location = new System.Drawing.Point(328, 87);
+            this.mcd_inqty_label.Location = new System.Drawing.Point(335, 87);
             this.mcd_inqty_label.Name = "mcd_inqty_label";
             this.mcd_inqty_label.Name = "mcd_inqty_label";
             this.mcd_inqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_inqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_inqty_label.TabIndex = 14;
             this.mcd_inqty_label.TabIndex = 14;
@@ -412,7 +412,7 @@
             // 
             // 
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LockMakeCode.Location = new System.Drawing.Point(271, 50);
+            this.LockMakeCode.Location = new System.Drawing.Point(271, 48);
             this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
             this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
@@ -443,7 +443,7 @@
             // 
             // 
             this.ma_qty.AutoSize = true;
             this.ma_qty.AutoSize = true;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(107, 87);
+            this.ma_qty.Location = new System.Drawing.Point(112, 87);
             this.ma_qty.Name = "ma_qty";
             this.ma_qty.Name = "ma_qty";
             this.ma_qty.Size = new System.Drawing.Size(0, 21);
             this.ma_qty.Size = new System.Drawing.Size(0, 21);
             this.ma_qty.TabIndex = 55;
             this.ma_qty.TabIndex = 55;
@@ -452,7 +452,7 @@
             // 
             // 
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(421, 87);
+            this.mcd_inqty.Location = new System.Drawing.Point(428, 87);
             this.mcd_inqty.Name = "mcd_inqty";
             this.mcd_inqty.Name = "mcd_inqty";
             this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
             this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
             this.mcd_inqty.TabIndex = 54;
             this.mcd_inqty.TabIndex = 54;
@@ -462,7 +462,7 @@
             // 
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(421, 47);
+            this.ma_prodcode.Location = new System.Drawing.Point(428, 47);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 53;
             this.ma_prodcode.TabIndex = 53;
@@ -498,7 +498,7 @@
             // ChooseedReject
             // ChooseedReject
             // 
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(339, 417);
+            this.ChooseedReject.Location = new System.Drawing.Point(338, 417);
             this.ChooseedReject.Name = "ChooseedReject";
             this.ChooseedReject.Name = "ChooseedReject";
             this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.TabIndex = 45;
             this.ChooseedReject.TabIndex = 45;
@@ -508,7 +508,7 @@
             // WaitReject
             // WaitReject
             // 
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(339, 353);
+            this.WaitReject.Location = new System.Drawing.Point(338, 353);
             this.WaitReject.Name = "WaitReject";
             this.WaitReject.Name = "WaitReject";
             this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.TabIndex = 44;
             this.WaitReject.TabIndex = 44;

+ 13 - 19
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -33,6 +33,9 @@ namespace UAS_MES.Make
         //用于保存是否之前输入的ms_sncode
         //用于保存是否之前输入的ms_sncode
         string ms_sncode1;
         string ms_sncode1;
 
 
+        string oMakeCode = "";
+        string oMSID = "";
+
         LogStringBuilder sql = new LogStringBuilder();
         LogStringBuilder sql = new LogStringBuilder();
 
 
         AutoSizeFormClass asc = new AutoSizeFormClass();
         AutoSizeFormClass asc = new AutoSizeFormClass();
@@ -164,8 +167,6 @@ namespace UAS_MES.Make
                 bool ifFirst;
                 bool ifFirst;
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                 {
-                    string oMakeCode = "";
-                    string oMSID = "";
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
                     {
                     {
                         dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
                         dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
@@ -182,18 +183,15 @@ namespace UAS_MES.Make
                             string stepcode = dt.Rows[0]["ms_stepcode"].ToString();
                             string stepcode = dt.Rows[0]["ms_stepcode"].ToString();
                             if (stepcode == User.CurrentStepCode && (status == "1" || status == "2"))
                             if (stepcode == User.CurrentStepCode && (status == "1" || status == "2"))
                             {
                             {
-                                OperateResult.AppendText(">>"+ ms_sncode.Text+ " 序列号已执行过" + User.CurrentStepCode + "工序,采集结果为良品\n", Color.Red);
+                                OperateResult.AppendText(">>" + ms_sncode.Text + " 序列号已执行过" + User.CurrentStepCode + "工序,采集结果为良品\n", Color.Red, ms_sncode);
                                 return;
                                 return;
                             }
                             }
                         }
                         }
                         SetCollectResult();
                         SetCollectResult();
                     }
                     }
-                    else
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                 }
                 }
-                else
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                ms_sncode.Text = "";
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
             }
             }
         }
         }
 
 
@@ -229,6 +227,7 @@ namespace UAS_MES.Make
             }
             }
         }
         }
 
 
+
         /// <summary>
         /// <summary>
         /// 加载不良代码的ListView的信息
         /// 加载不良代码的ListView的信息
         /// </summary>
         /// </summary>
@@ -320,11 +319,10 @@ namespace UAS_MES.Make
             {
             {
                 //良品信息采集
                 //良品信息采集
                 if (LogicHandler.UpdateMakeMessage(ms_sncode.Text, ma_code.Text, "良品采集", User.UserSourceCode, User.UserCode, "检测合格", out ErrorMessage))
                 if (LogicHandler.UpdateMakeMessage(ms_sncode.Text, ma_code.Text, "良品采集", User.UserSourceCode, User.UserCode, "检测合格", out ErrorMessage))
-                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为良品\n", Color.Green);
+                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为良品\n", Color.Green, ms_sncode);
                 else
                 else
-                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
             }
             }
-            ms_sncode.Text = "";
         }
         }
 
 
         private void Save_Click(object sender, EventArgs e)
         private void Save_Click(object sender, EventArgs e)
@@ -335,10 +333,7 @@ namespace UAS_MES.Make
                 return;
                 return;
             }
             }
             if (GoodProduct.Checked)
             if (GoodProduct.Checked)
-            {
-                SetTestPass();
-                LoadCollectedNum();
-            }
+                ms_code_KeyDown(sender, new KeyEventArgs(Keys.Enter));
             else if (Reject.Checked)
             else if (Reject.Checked)
             {
             {
                 int RejectCount = ChoosedRejectList.Items.Count;
                 int RejectCount = ChoosedRejectList.Items.Count;
@@ -404,14 +399,13 @@ namespace UAS_MES.Make
                 dh.ExecuteSql("delete from makebad where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "'", "delete");
                 dh.ExecuteSql("delete from makebad where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "'", "delete");
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
                 {
                 {
-                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green);
+                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green,ms_sncode);
                     //清除不良信息
                     //清除不良信息
                     bc_groupcode.DataSource = null;
                     bc_groupcode.DataSource = null;
                     bc_groupcode.Text = "";
                     bc_groupcode.Text = "";
                     bc_code.Text = "";
                     bc_code.Text = "";
                     WaitRejectList.Items.Clear();
                     WaitRejectList.Items.Clear();
                     ChoosedRejectList.Items.Clear();
                     ChoosedRejectList.Items.Clear();
-                    ms_sncode.Text = "";
                     LoadCollectedNum();
                     LoadCollectedNum();
                     WaitList.Clear();
                     WaitList.Clear();
                     ChoosedList.Clear();
                     ChoosedList.Clear();
@@ -432,7 +426,7 @@ namespace UAS_MES.Make
                     {
                     {
                         if (ChoosedRejectList.Items[i].ListView.Items[i].SubItems[2].Text == bc_code.Text)
                         if (ChoosedRejectList.Items[i].ListView.Items[i].SubItems[2].Text == bc_code.Text)
                         {
                         {
-                            OperateResult.AppendText(">>已添加过不良代码"+bc_code.Text+"\n", Color.Red);
+                            OperateResult.AppendText(">>已添加过不良代码" + bc_code.Text + "\n", Color.Red,bc_code);
                             return;
                             return;
                         }
                         }
                     }
                     }
@@ -442,7 +436,7 @@ namespace UAS_MES.Make
                         lvi.SubItems.Add(dt.Rows[0][j].ToString());
                         lvi.SubItems.Add(dt.Rows[0][j].ToString());
                     ChoosedRejectList.Items.Add(lvi);
                     ChoosedRejectList.Items.Add(lvi);
                 }
                 }
-                else OperateResult.AppendText(">>不良代码"+bc_code.Text+"不存在\n", Color.Red);
+                else OperateResult.AppendText(">>不良代码" + bc_code.Text + "不存在\n", Color.Red, bc_code);
             }
             }
         }
         }
 
 

+ 2 - 2
UAS-MES/PublicMethod/Print.cs

@@ -19,7 +19,7 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// </summary>
         /// <param name="Url"></param>
         /// <param name="Url"></param>
         /// <param name="LabelCode"></param>
         /// <param name="LabelCode"></param>
-        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode)
+        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode,int PrintNum)
         {
         {
             //打开模板路径
             //打开模板路径
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + LabelName);
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + LabelName);
@@ -41,7 +41,7 @@ namespace UAS_MES.PublicMethod
             //保存本次赋值进行打印
             //保存本次赋值进行打印
             doc.Save();
             doc.Save();
             doc.Printer.SwitchTo(PrinterName);
             doc.Printer.SwitchTo(PrinterName);
-            doc.PrintDocument();
+            doc.PrintDocument(PrintNum);
             doc.Close();
             doc.Close();
         }
         }
     }
     }

+ 1 - 1
UAS-MES/UAS-MES.csproj

@@ -41,7 +41,7 @@
     <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>203</ApplicationRevision>
+    <ApplicationRevision>205</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>