Browse Source

修改测试的BUG

章政 8 years ago
parent
commit
77359945ce

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -437,7 +437,7 @@
             this.Load += new System.EventHandler(this.Make_ColorBoxLoadPrint_Load);
             this.SizeChanged += new System.EventHandler(this.Make_ColorBoxLoadPrint_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 13 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -256,6 +256,19 @@ namespace UAS_MES.Make
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
                             //更新半成品SN已被工单使用
                             dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code.Text + "')", new string[] { "sncode" }, TSN.ToArray());
+                            try
+                            {
+                                string Log = "";
+                                for (int i = 0; i < CollectDataSonCode.Count; i++)
+                                {
+                                    Log += CollectDataSonCode.ToArray()[i] + " " + CollectData.ToArray()[i] + " " + SPID.ToArray()[i];
+                                }
+                                LogManager.DoLog(Log);
+                            }
+                            catch (Exception)
+                            {
+
+                            }
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "上料成功", ms_sncode.Text, "");
                             RemainIndex = 0;

+ 13 - 0
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -402,6 +402,19 @@ namespace UAS_MES.Make
                 sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
                 sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
                 dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
+                try
+                {
+                    string Log = "";
+                    for (int i = 0; i < CollectDataSonCode.Count; i++)
+                    {
+                        Log += CollectDataSonCode.ToArray()[i] + " " + CollectData.ToArray()[i] + " " + SPID.ToArray()[i];
+                    }
+                    LogManager.DoLog(Log);
+                }
+                catch (Exception)
+                {
+
+                }
                 //更新序列号半成品已被使用
                 dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
                 if (ma_ecncode_label.Checked || ma_softversion_label.Checked)

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

@@ -102,11 +102,11 @@
             // 
             // ma_craftcode_label
             // 
-            this.ma_craftcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ma_craftcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ma_craftcode_label.AutoSize = true;
             this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode_label.Location = new System.Drawing.Point(20, 84);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(20, 82);
             this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
             this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
@@ -115,11 +115,11 @@
             // 
             // st_rstepcode_label
             // 
-            this.st_rstepcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.st_rstepcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.st_rstepcode_label.AutoSize = true;
             this.st_rstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.st_rstepcode_label.Location = new System.Drawing.Point(353, 84);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(353, 82);
             this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
             this.st_rstepcode_label.Size = new System.Drawing.Size(92, 27);
@@ -128,11 +128,11 @@
             // 
             // ms_prodcode_label
             // 
-            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_prodcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_prodcode_label.AutoSize = true;
             this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode_label.Location = new System.Drawing.Point(544, 37);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(544, 35);
             this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
             this.ms_prodcode_label.Size = new System.Drawing.Size(92, 27);
@@ -175,11 +175,11 @@
             // 
             // ms_sncode_label
             // 
-            this.ms_sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(20, 35);
+            this.ms_sncode_label.Location = new System.Drawing.Point(20, 33);
             this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
             this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -188,11 +188,11 @@
             // 
             // ms_makecode_label
             // 
-            this.ms_makecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_makecode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(271, 37);
+            this.ms_makecode_label.Location = new System.Drawing.Point(271, 35);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
@@ -285,7 +285,7 @@
             // 
             // GetSNCode_Label
             // 
-            this.GetSNCode_Label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.GetSNCode_Label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode_Label.AutoSize = true;
             this.GetSNCode_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -347,7 +347,7 @@
             this.nr_code.AutoSize = true;
             this.nr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_code.ForeColor = System.Drawing.Color.Black;
-            this.nr_code.Location = new System.Drawing.Point(1120, 75);
+            this.nr_code.Location = new System.Drawing.Point(1120, 73);
             this.nr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.nr_code.Name = "nr_code";
             this.nr_code.Size = new System.Drawing.Size(0, 27);
@@ -366,12 +366,12 @@
             // 
             // ms_sncode
             // 
-            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.CutLength = null;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(120, 37);
+            this.ms_sncode.Location = new System.Drawing.Point(120, 35);
             this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_sncode.Name = "ms_sncode";
@@ -496,7 +496,7 @@
             // GetSNCode
             // 
             this.GetSNCode.AllPower = null;
-            this.GetSNCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.GetSNCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
@@ -576,7 +576,7 @@
             // mbl_loc
             // 
             this.mbl_loc.AllPower = null;
-            this.mbl_loc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.mbl_loc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbl_loc.BackColor = System.Drawing.Color.White;
             this.mbl_loc.ID = null;
@@ -595,7 +595,7 @@
             // mbr_solutioncode
             // 
             this.mbr_solutioncode.AllPower = null;
-            this.mbr_solutioncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.mbr_solutioncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbr_solutioncode.BackColor = System.Drawing.Color.White;
             this.mbr_solutioncode.Enabled = false;
@@ -614,7 +614,7 @@
             // mbc_component
             // 
             this.mbc_component.AllPower = null;
-            this.mbc_component.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.mbc_component.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbc_component.BackColor = System.Drawing.Color.White;
             this.mbc_component.Enabled = false;
@@ -633,7 +633,7 @@
             // mbr_dutycode
             // 
             this.mbr_dutycode.AllPower = null;
-            this.mbr_dutycode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.mbr_dutycode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.mbr_dutycode.BackColor = System.Drawing.Color.White;
             this.mbr_dutycode.Enabled = false;
@@ -652,7 +652,7 @@
             // nr_name
             // 
             this.nr_name.AllPower = null;
-            this.nr_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.nr_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.nr_name.BackColor = System.Drawing.Color.White;
             this.nr_name.Enabled = false;
@@ -672,7 +672,7 @@
             // nrg_name
             // 
             this.nrg_name.AllPower = null;
-            this.nrg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.nrg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.nrg_name.BackColor = System.Drawing.Color.White;
             this.nrg_name.Enabled = false;
@@ -691,7 +691,7 @@
             // bc_name
             // 
             this.bc_name.AllPower = null;
-            this.bc_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.bc_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.bc_name.BackColor = System.Drawing.Color.White;
             this.bc_name.Enabled = false;
@@ -710,7 +710,7 @@
             // bg_name
             // 
             this.bg_name.AllPower = null;
-            this.bg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.bg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.bg_name.BackColor = System.Drawing.Color.White;
             this.bg_name.Enabled = false;
@@ -739,12 +739,12 @@
             // 
             // ms_makecode
             // 
-            this.ms_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_makecode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(377, 37);
+            this.ms_makecode.Location = new System.Drawing.Point(377, 35);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
@@ -753,12 +753,12 @@
             // 
             // ms_prodcode
             // 
-            this.ms_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_prodcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_prodcode.AutoSize = true;
             this.ms_prodcode.CutLength = null;
             this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode.Location = new System.Drawing.Point(672, 37);
+            this.ms_prodcode.Location = new System.Drawing.Point(672, 35);
             this.ms_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_prodcode.Name = "ms_prodcode";
@@ -768,12 +768,12 @@
             // 
             // pr_detail
             // 
-            this.pr_detail.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.pr_detail.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(977, 37);
+            this.pr_detail.Location = new System.Drawing.Point(977, 35);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
@@ -839,7 +839,7 @@
             this.cr_code.Size = new System.Drawing.Size(200, 29);
             this.cr_code.TabIndex = 67;
             this.cr_code.TableName = null;
-            this.cr_code.Tag = "ms_craftcode";
+            this.cr_code.Tag = "ma_craftcode";
             this.cr_code.TextBoxEnable = false;
             this.cr_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.cr_code_UserControlTextChanged);
             // 
@@ -928,11 +928,11 @@
             // 
             // pr_detail_label
             // 
-            this.pr_detail_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.pr_detail_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(849, 37);
+            this.pr_detail_label.Location = new System.Drawing.Point(849, 35);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -941,11 +941,11 @@
             // 
             // ms_checkno
             // 
-            this.ms_checkno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_checkno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_checkno.AutoSize = true;
             this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_checkno.Location = new System.Drawing.Point(1055, 35);
+            this.ms_checkno.Location = new System.Drawing.Point(1055, 33);
             this.ms_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_checkno.Name = "ms_checkno";
             this.ms_checkno.Size = new System.Drawing.Size(92, 27);
@@ -955,11 +955,11 @@
             // 
             // ms_reworkcheckno
             // 
-            this.ms_reworkcheckno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            this.ms_reworkcheckno.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_reworkcheckno.AutoSize = true;
             this.ms_reworkcheckno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_reworkcheckno.Location = new System.Drawing.Point(1057, 75);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(1057, 73);
             this.ms_reworkcheckno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
             this.ms_reworkcheckno.Size = new System.Drawing.Size(92, 27);

+ 10 - 10
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -202,10 +202,10 @@ namespace UAS_MES.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
-                        sql.Append("from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
-                        sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where ");
-                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_stepcode,ms_prodcode,ms_sncode,pr_detail,ms_firstsn,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ma_craftcode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
+                        sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and ms_sncode in(");
+                        sql.Append("select '" + GetSNCode.Text + "' from dual union select firstsn from makesnrelation where ");
+                        sql.Append("sn='" + GetSNCode.Text + "') group by ms_makecode,ms_stepcode,ms_prodcode,ma_craftcode,ms_sncode,pr_detail,ms_firstsn,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -218,7 +218,7 @@ namespace UAS_MES.Make
                             sql.Clear();
                             sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
                             sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
-                            sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "' union select '"+firstsn+"' from dual)) ");
+                            sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "' union select '" + firstsn + "' from dual)) ");
                             sql.Append("and cm_craftcode='" + cr_code.Text + "'and nvl(cm_lastdeco,0)<>0 group by cm_craftcode,cm_stepcode,cm_soncode having ");
                             sql.Append("sum(case when cm_status=-1 then 0 else 1 end)=0 order by cm_indate");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -254,7 +254,7 @@ namespace UAS_MES.Make
                                 sql.Append("nvl(cd_ifburnin,0)<>0 and cd_detno <='" + currentdetno + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
-                                {  
+                                {
                                     cdstepcode = dt.Rows[0][0].ToString();
                                 }
                             }
@@ -442,8 +442,8 @@ namespace UAS_MES.Make
             }
             //查询拆解的物料
             sql.Clear();
-            sql.Append("select distinct cm_soncode from craftmaterial where (cm_sncode='" + firstsn + "' or cm_sncode ");
-            sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "')) and cm_craftcode<>'" + cr_code.Text + "' and cm_status=-1 ");
+            sql.Append("select distinct cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
+            sql.Append("select sn from makesnrelation where firstsn='" + firstsn + "') and cm_craftcode<>'" + cr_code.Text + "' and cm_makecode<>'" + ms_makecode.Text + "' and cm_status=-1 ");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             //如果含有序列号物料有被拆解过
             if (dt.Rows.Count > 0)
@@ -455,8 +455,8 @@ namespace UAS_MES.Make
                 }
                 //查询对应的上料记录
                 sql.Clear();
-                sql.Append("select cm_soncode from craftmaterial where (cm_sncode='" + firstsn + "' or cm_sncode in (select sn from ");
-                sql.Append(" makesnrelation where firstsn='" + firstsn + "')) and cm_status=0 and cm_soncode in (" + soncode.Substring(0, soncode.Length - 1) + ")");
+                sql.Append("select cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union  select sn from ");
+                sql.Append(" makesnrelation where firstsn='" + firstsn + "') and cm_status=0 and cm_soncode in (" + soncode.Substring(0, soncode.Length - 1) + ")");
                 DataTable LoadSoncode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 //查询的结果不相等表示未完成上料
                 if (dt.Rows.Count != LoadSoncode.Rows.Count)