Преглед изворни кода

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

Hcsy пре 8 година
родитељ
комит
85e12e018d

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

@@ -393,7 +393,7 @@ namespace UAS_MES.Make
             //如果岗位资源对应工序的版面不为空的时候
             //如果岗位资源对应工序的版面不为空的时候
             if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid+ "'").ToString() != "")
             if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid+ "'").ToString() != "")
             {
             {
-                if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' mbl_makecode='"+ms_makecode.Text+"' and mbl_sncode='" + GetSNCode.Text + "' "))
+                if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='"+ms_makecode.Text+"' and mbl_sncode='" + GetSNCode.Text + "' "))
                 {
                 {
                     OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
                     OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
                     return;
                     return;
@@ -461,7 +461,7 @@ namespace UAS_MES.Make
                     dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
                     dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
-                    OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
+                    OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);
                     BaseUtil.CleanForm(this);
                     BaseUtil.CleanForm(this);
                     BadCodeTree.Nodes.Clear();
                     BadCodeTree.Nodes.Clear();
                     GetSNCode.Clear();
                     GetSNCode.Clear();

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -269,7 +269,7 @@ namespace UAS_MES.Make
         private void LoadChoosedBadListView()
         private void LoadChoosedBadListView()
         {
         {
             sql.Clear();
             sql.Clear();
-            sql.Append("select nvl(bg_code,mb_bgcode)||':'||nvl(bg_name,mb_badcode) bg_code,nvl(mb_badcode,bc_code) bc_code,bc_name from makebad  ");
+            sql.Append("select nvl(bg_code,mb_bgcode)||':'||nvl(bg_name,mb_badcode) bg_code,nvl(mb_badcode,bc_code) bc_code,bc_name,mb_badremark from makebad  ");
             sql.Append("left join badgroup on mb_bgcode=bg_code left join badcode on mb_badcode=bc_code ");
             sql.Append("left join badgroup on mb_bgcode=bg_code left join badcode on mb_badcode=bc_code ");
             sql.Append(" where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and mb_status=0");
             sql.Append(" where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "' and mb_status=0");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");

+ 2 - 0
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.Designer.cs

@@ -133,6 +133,8 @@
             // ReworkRequire
             // ReworkRequire
             // 
             // 
             this.ReworkRequire.AutoSize = true;
             this.ReworkRequire.AutoSize = true;
+            this.ReworkRequire.Checked = true;
+            this.ReworkRequire.CheckState = System.Windows.Forms.CheckState.Checked;
             this.ReworkRequire.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ReworkRequire.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ReworkRequire.Location = new System.Drawing.Point(163, 656);
             this.ReworkRequire.Location = new System.Drawing.Point(163, 656);
             this.ReworkRequire.Margin = new System.Windows.Forms.Padding(4);
             this.ReworkRequire.Margin = new System.Windows.Forms.Padding(4);

+ 8 - 0
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -277,5 +277,13 @@ namespace UAS_MES.OQC
         {
         {
             dh.Dispose();
             dh.Dispose();
         }
         }
+
+        private void CheckTypeDGV_DataSourceChanged(object sender, EventArgs e)
+        {
+            for (int i = 0; i < CheckTypeDGV.Rows.Count; i++)
+            {
+                CheckTypeDGV.Rows[i].Cells["Choose"].Value = true;
+            }
+        }
     }
     }
 }
 }

+ 1 - 0
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -442,6 +442,7 @@
             this.CheckTypeDGV.RowTemplate.Height = 23;
             this.CheckTypeDGV.RowTemplate.Height = 23;
             this.CheckTypeDGV.Size = new System.Drawing.Size(993, 398);
             this.CheckTypeDGV.Size = new System.Drawing.Size(993, 398);
             this.CheckTypeDGV.TabIndex = 167;
             this.CheckTypeDGV.TabIndex = 167;
+            this.CheckTypeDGV.DataSourceChanged += new System.EventHandler(this.CheckTypeDGV_DataSourceChanged);
             // 
             // 
             // Choose
             // Choose
             // 
             // 

+ 13 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.cs

@@ -168,6 +168,11 @@ namespace UAS_MES.Packing
             //验证mothercode是否为空,有没有装大箱
             //验证mothercode是否为空,有没有装大箱
             if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "")
             if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "")
             {
             {
+                if (flag)
+                {
+                    MessageBox.Show("<<卡通箱:" + pa_outboxcode.Text + "已装箱,不允许拆箱\n");
+                    return false;
+                }
                 OperateResult.AppendText("<<卡通箱:" + pa_outboxcode.Text + "已装箱,不允许拆箱\n", Color.Red, sncode);
                 OperateResult.AppendText("<<卡通箱:" + pa_outboxcode.Text + "已装箱,不允许拆箱\n", Color.Red, sncode);
                 return false;
                 return false;
             }
             }
@@ -241,5 +246,13 @@ namespace UAS_MES.Packing
             sncode.Focus();
             sncode.Focus();
             return true;
             return true;
         }
         }
+
+        private void pa_outboxcode_Leave(object sender, EventArgs e)
+        {
+            if (pa_outboxcode.Text != "")
+            {
+                lKeyDown(true);
+            }
+        }
     }
     }
 }
 }

+ 9 - 9
UAS_AutoPass/AutoAnalysisXml.Designer.cs

@@ -44,7 +44,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.Master = new System.Windows.Forms.ComboBox();
             this.Master = new System.Windows.Forms.ComboBox();
             this.AutoStart = new System.Windows.Forms.CheckBox();
             this.AutoStart = new System.Windows.Forms.CheckBox();
-            this.MakeCode = new System.Windows.Forms.TextBox();
+            this.ma_code = new System.Windows.Forms.TextBox();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -204,20 +204,20 @@
             this.AutoStart.UseVisualStyleBackColor = true;
             this.AutoStart.UseVisualStyleBackColor = true;
             this.AutoStart.CheckedChanged += new System.EventHandler(this.AutoStart_CheckedChanged);
             this.AutoStart.CheckedChanged += new System.EventHandler(this.AutoStart_CheckedChanged);
             // 
             // 
-            // MakeCode
+            // ma_code
             // 
             // 
-            this.MakeCode.Location = new System.Drawing.Point(149, 100);
-            this.MakeCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.MakeCode.Name = "MakeCode";
-            this.MakeCode.Size = new System.Drawing.Size(292, 25);
-            this.MakeCode.TabIndex = 17;
+            this.ma_code.Location = new System.Drawing.Point(149, 100);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(292, 25);
+            this.ma_code.TabIndex = 17;
             // 
             // 
             // AutoAnalysisXml
             // AutoAnalysisXml
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(887, 395);
             this.ClientSize = new System.Drawing.Size(887, 395);
-            this.Controls.Add(this.MakeCode);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.AutoStart);
             this.Controls.Add(this.AutoStart);
             this.Controls.Add(this.Master);
             this.Controls.Add(this.Master);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.label4);
@@ -262,7 +262,7 @@
         private System.Windows.Forms.ComboBox Master;
         private System.Windows.Forms.ComboBox Master;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.CheckBox AutoStart;
         private System.Windows.Forms.CheckBox AutoStart;
-        private System.Windows.Forms.TextBox MakeCode;
+        private System.Windows.Forms.TextBox ma_code;
     }
     }
 }
 }
 
 

+ 58 - 52
UAS_AutoPass/AutoAnalysisXml.cs

@@ -37,6 +37,10 @@ namespace UAS_AutoPass
         /// </summary>
         /// </summary>
         string ilinecode;
         string ilinecode;
         /// <summary>
         /// <summary>
+        /// 不良代码组
+        /// </summary>
+        string ibadgroup;
+        /// <summary>
         /// 当前工序
         /// 当前工序
         /// </summary>
         /// </summary>
         string istepcode;
         string istepcode;
@@ -88,12 +92,21 @@ namespace UAS_AutoPass
                 AutoStart.Checked = (bool)BaseUtil.GetCacheData("AutoStart");
                 AutoStart.Checked = (bool)BaseUtil.GetCacheData("AutoStart");
             }
             }
             catch (Exception ex) { Console.WriteLine(ex.Message); }
             catch (Exception ex) { Console.WriteLine(ex.Message); }
+            for (int i = 0; i < DB.Rows.Count; i++)
+            {
+                if (Master.Text == DB.Rows[i]["ma_user"].ToString())
+                {
+                    DataHelper.DBConnectionString = "Data Source=" + DB.Rows[i]["ma_address"] + ";User ID=" + DB.Rows[i]["ma_user"] + ";PassWord=" + DB.Rows[i]["ms_pwd"]; ;
+                    dh = new DataHelper();
+                }
+            }
             //获取岗位资源相关信息
             //获取岗位资源相关信息
-            dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode from source where sc_code='" + isource + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
             if (dt.Rows.Count > 0)
             if (dt.Rows.Count > 0)
             {
             {
                 ilinecode = dt.Rows[0]["sc_linecode"].ToString();
                 ilinecode = dt.Rows[0]["sc_linecode"].ToString();
                 istepcode = dt.Rows[0]["sc_stepcode"].ToString();
                 istepcode = dt.Rows[0]["sc_stepcode"].ToString();
+                ibadgroup = dt.Rows[0]["st_badgroupcode"].ToString();
             }
             }
         }
         }
 
 
@@ -135,12 +148,12 @@ namespace UAS_AutoPass
                     dh = new DataHelper();
                     dh = new DataHelper();
                 }
                 }
             }
             }
-            //暂时不用归属工单
-            //if (!dh.CheckExist("make", "ma_statuscode='STARTED' and ma_code='" + MakeCode.Text + "'"))
-            //{
-            //    OperateResult.AppendText("工单不存在或者未下放\n");
-            //    return;
-            //}
+            //存在工单必须是已下放状态
+            if (!dh.CheckExist("make", "ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'") && ma_code.Text != "")
+            {
+                OperateResult.AppendText("工单不存在或者未下放\n");
+                return;
+            }
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Filter = "*.xml";
             XmlWatcher.Filter = "*.xml";
             XmlWatcher.EnableRaisingEvents = true;
             XmlWatcher.EnableRaisingEvents = true;
@@ -152,7 +165,7 @@ namespace UAS_AutoPass
             //设置按钮不可点击
             //设置按钮不可点击
             StartWatch.Enabled = false;
             StartWatch.Enabled = false;
             ChooseFolder.Enabled = false;
             ChooseFolder.Enabled = false;
-            MakeCode.Enabled = false;
+            ma_code.Enabled = false;
             ChooseBackUpFolder.Enabled = false;
             ChooseBackUpFolder.Enabled = false;
             StopWatch.Enabled = true;
             StopWatch.Enabled = true;
             OperateResult.AppendText("开始执行监控\n");
             OperateResult.AppendText("开始执行监控\n");
@@ -223,9 +236,8 @@ namespace UAS_AutoPass
             //获取文件名的序列号,如SA123456.xml,如果开头为-表示无条码需要自动获取
             //获取文件名的序列号,如SA123456.xml,如果开头为-表示无条码需要自动获取
             string sncode = e.Name.Substring(0, 1) == "-" ? "" : e.Name.Split('.')[0];
             string sncode = e.Name.Substring(0, 1) == "-" ? "" : e.Name.Split('.')[0];
             string makecode = "";
             string makecode = "";
-            string ErrMessage = "";
-            //获取序列号ID最大的工单号,测试良品时才进行分配
-            if (sncode == "" && test_result == "OK")
+            //获取序列号ID最大的工单号,所有序列号都测试为良品
+            if (sncode == "")
             {
             {
                 //获取资源,线别,工序相等,并且状态在线的序列号进行分配
                 //获取资源,线别,工序相等,并且状态在线的序列号进行分配
                 sql.Clear();
                 sql.Clear();
@@ -239,82 +251,63 @@ namespace UAS_AutoPass
                 }
                 }
                 //-2-NG2017/10/2514:46:29.xml取第二位版号
                 //-2-NG2017/10/2514:46:29.xml取第二位版号
                 string combinecode = e.Name.Substring(1, 1);
                 string combinecode = e.Name.Substring(1, 1);
-                if (LogicHandler.CheckStepSNAndMacode(makecode, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? makecode : ma_code.Text, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
                 {
                 {
-                    LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "0");
-                    if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                    //插入日志
+                    LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, test_result == "NG" ? "1" : "0");
+                    //如果是不良品记录日志,用于测试采集判负
+                    if (test_result == "NG")
+                    {
+                        RecordBadInfo(sncode, makecode, e.Name, combinecode, badcode.ToArray(), badlocation.ToArray());
+                    }
+                    if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", "OK", iusercode, out oErrMessage))
                     {
                     {
-                        OperateResult.AppendText(ErrMessage + "\n");
+                        OperateResult.AppendText(oErrMessage + "\n");
                         return;
                         return;
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
-                    OperateResult.AppendText(ErrMessage + "\n");
+                    OperateResult.AppendText(oErrMessage + "\n");
                     return;
                     return;
                 }
                 }
             }
             }
-            //没有条码并且不良进行记录
-            else if (sncode == "" && test_result == "NG")
-            {
-                LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "1");
-            }
-            else if (sncode != "")
+            else
             {
             {
-                if (LogicHandler.CheckStepSNAndMacode(makecode, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? makecode : ma_code.Text, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
                 {
                 {
                     //获取序列号ID最大的工单
                     //获取序列号ID最大的工单
-                    string msid = "";
                     dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + sncode + "' order by ms_id desc", "select");
                     dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + sncode + "' order by ms_id desc", "select");
                     if (dt.Rows.Count > 0)
                     if (dt.Rows.Count > 0)
                     {
                     {
-                        msid = dt.Rows[0]["ms_id"].ToString();
                         makecode = dt.Rows[0]["ms_makecode"].ToString();
                         makecode = dt.Rows[0]["ms_makecode"].ToString();
                         switch (test_result)
                         switch (test_result)
                         {
                         {
                             case "OK":
                             case "OK":
-                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out oErrMessage))
                                 {
                                 {
-                                    OperateResult.AppendText(ErrMessage + "\n");
+                                    OperateResult.AppendText(oErrMessage + "\n");
                                     return;
                                     return;
                                 }
                                 }
                                 break;
                                 break;
                             case "NG":
                             case "NG":
-                                sql.Clear();
-                                sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
-                                sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status) select makebad_seq.nextval");
-                                sql.Append(",ma_code,ms_code,ms_sncode,'" + iusercode + "',sysdate,'" + istepcode + "','" + isource + "',:bc_code,'',");
-                                sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on sp_mothercode");
-                                sql.Append("=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'");
-                                dh.BatchInsert(sql.ToString(), new string[] { "bc_code" }, badcode.ToArray());
-                                //更新序列号不良状态
-                                dh.UpdateByCondition("makeserial", "ms_status=3", "ms_id='" + msid + "'");
-                                for (int i = 0; i < badcode.Count; i++)
+                                RecordBadInfo(sncode, makecode, e.Name, "", badcode.ToArray(), badlocation.ToArray());
+                                //所有的序列号均采集为良品
+                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", "OK", iusercode, out oErrMessage))
                                 {
                                 {
-                                    //保存不良位置
-                                    string[] location = badlocation[i].Split(',');
-                                    sql.Clear();
-                                    sql.Append("insert into makebadrsloc(mbl_id,mbl_loc,mbl_badcode,mbl_sncode,mbl_makecode,");
-                                    sql.Append("mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval,");
-                                    sql.Append(":location,'" + badcode[i] + "','" + sncode + "','" + makecode + "',");
-                                    sql.Append("sysdate,'" + iusercode + "' from dual");
-                                    dh.BatchInsert(sql.ToString(), new string[] { "location" }, location);
-                                }
-                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
-                                {
-                                    OperateResult.AppendText(ErrMessage + "\n");
+                                    OperateResult.AppendText(oErrMessage + "\n");
                                     return;
                                     return;
                                 }
                                 }
                                 break;
                                 break;
                             default:
                             default:
                                 break;
                                 break;
                         }
                         }
-                        LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "0");
+                        LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, test_result == "NG" ? "1" : "0");
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
-                    OperateResult.AppendText(ErrMessage + "\n");
+                    OperateResult.AppendText(oErrMessage + "\n");
                     return;
                     return;
                 }
                 }
             }
             }
@@ -346,11 +339,24 @@ namespace UAS_AutoPass
             }
             }
         }
         }
 
 
+        private void RecordBadInfo(string sncode, string makecode, string filename, string combine, string[] badcode, string[] badlocation)
+        {
+            sql.Clear();
+            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
+            sql.Append(",mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_status,mb_badremark) select makebad_seq.nextval");
+            sql.Append(",ma_code,ms_code,ms_sncode,'" + iusercode + "',sysdate,'" + istepcode + "','" + isource + "',");
+            sql.Append(":bc_code,'" + ibadgroup + "','','0',:location from make left join makeSerial on ms_makecode=ma_code ");
+            sql.Append("where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'");
+            dh.BatchInsert(sql.ToString(), new string[] { "bc_code", "location" }, badcode, badlocation);
+            //记录判断日志
+            LogicHandler.AutoPassJudge(sncode, makecode, isource, filename, ilinecode, combine);
+        }
+
         private void StopWatch_Click(object sender, EventArgs e)
         private void StopWatch_Click(object sender, EventArgs e)
         {
         {
             XmlWatcher.EnableRaisingEvents = false;
             XmlWatcher.EnableRaisingEvents = false;
             StartWatch.Enabled = true;
             StartWatch.Enabled = true;
-            MakeCode.Enabled = true;
+            ma_code.Enabled = true;
             ChooseFolder.Enabled = true;
             ChooseFolder.Enabled = true;
             ChooseBackUpFolder.Enabled = true;
             ChooseBackUpFolder.Enabled = true;
             StopWatch.Enabled = false;
             StopWatch.Enabled = false;

+ 13 - 3
UAS_AutoPass/ToolClass/LogicHandler.cs

@@ -29,16 +29,26 @@ namespace UAS_AutoPass.ToolClass
                 return false;
                 return false;
         }
         }
 
 
-        public static void AutoPassLog(string iSN,string iSource,string iMakeCode,string iDate,string iStepCode,string iLineCode,string iFileName,string iIFNG)
+        public static void AutoPassLog(string iSN, string iSource, string iMakeCode, string iDate, string iStepCode, string iLineCode, string iFileName, string iIFNG)
         {
         {
             sql.Clear();
             sql.Clear();
             sql.Append("insert into AUTOSCANLOG(as_id,as_indate,as_testdate,as_sourcecode,as_stepcode,");
             sql.Append("insert into AUTOSCANLOG(as_id,as_indate,as_testdate,as_sourcecode,as_stepcode,");
             sql.Append("as_linecode,as_makecode,as_sncode,as_filename,as_ifng)values(AUTOSCANLOG_seq.nextval,");
             sql.Append("as_linecode,as_makecode,as_sncode,as_filename,as_ifng)values(AUTOSCANLOG_seq.nextval,");
-            sql.Append("sysdate,to_date('"+ iDate + "','yyyy-mm-dd,hh24:mi:ss'),'" + iSource+"','"+iStepCode+"','"+iLineCode+"','"+iMakeCode+"',");
-            sql.Append("'"+iSN+"','"+ iFileName + "','"+ iIFNG + "')");
+            sql.Append("sysdate,to_date('" + iDate + "','yyyy-mm-dd,hh24:mi:ss'),'" + iSource + "','" + iStepCode + "','" + iLineCode + "','" + iMakeCode + "',");
+            sql.Append("'" + iSN + "','" + iFileName + "','" + iIFNG + "')");
             dh.ExecuteSql(sql.ToString(), "select");
             dh.ExecuteSql(sql.ToString(), "select");
         }
         }
 
 
+        public static void AutoPassJudge(string iSN, string iMakeCode, string iSource, string iFileName, string iLineCode, string iCombine)
+        {
+            //插入不良判断记录
+            sql.Clear();
+            sql.Append("insert into AUTOSCAN_REJUDGE(asr_id,asr_indate,asr_filename,asr_combinecode,asr_sourcecode,");
+            sql.Append("asr_linecode,asr_makecode,asr_sncode) values(AUTOSCAN_REJUDGE_seq.nextval,sysdate,");
+            sql.Append("'" + iFileName + "','" + iCombine + "','" + iSource + "','" + iLineCode + "','" + iMakeCode + "','" + iSN + "')");
+            dh.ExecuteSql(sql.ToString(), "insert");
+        }
+
         public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
         {
             return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
             return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);