From 0d59b3fd8050b0f0766be47ed5527d96bd4bf2f7 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 07 四月 2025 09:38:43 +0800
Subject: [PATCH] 斯莫尔插件优化

---
 WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs |   56 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs b/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
index a3eccff..d6f430a 100644
--- a/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
+++ b/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
@@ -26,6 +26,8 @@
             this.cmbJYSelect.SelectedIndex = 0;
             this.cmbJYSelect.DropDownStyle = ComboBoxStyle.DropDownList;
 
+          
+
             //鎵规鐮佸彧璇�
             this.txtPcm.ReadOnly = true;
 
@@ -61,8 +63,8 @@
                         string selectedFolderPath = folderBrowserDialog.SelectedPath;
                         // 浣跨敤 selectedFolderPath 杩涜鍚庣画鎿嶄綔锛屼緥濡傛樉绀哄湪鏂囨湰妗嗕腑  
                         this.txtLj.Text = selectedFolderPath;
-                        //GetCSV_Read(selectedFolderPath);
-                        GetExcel_Read(selectedFolderPath);
+                        GetCSV_Read(selectedFolderPath);
+                        //GetExcel_Read(selectedFolderPath);
                     }
                 }
             }
@@ -174,15 +176,17 @@
                             if (nums == 1)
                             {
                                 dr["Characteristic"] = "FAI 3-16-3-" + (i + 1);
-                                dr["Actual"] = dt2.Rows[0][dt2.Columns[j]].ToString();
                             }
                             else
                             {
                                 dr["Characteristic"] = "FAI 3-16-1-" + (i + 1);
-                                dr["Actual"] = dt2.Rows[0][dt2.Columns[j]].ToString();
                             }
+                            dr["Actual"] = dt2.Rows[i][dt2.Columns[j]].ToString();
 
-                            dt.Rows.Add(dr);
+                            if (dt2.Rows[i][dt2.Columns[j]].ToString() != "") {
+                                dt.Rows.Add(dr);
+                            }
+                          
                             nums++;
 
                             if (nums == 2)
@@ -328,6 +332,7 @@
 
         //鎶婃暟鎹樉绀哄湪椤甸潰涓�
         public void ShowData(DataSet ds,string HNumber) {
+            string HProcID = this.cmbPro.SelectedValue.ToString();
             //娓呯┖缃戞牸鍐呭
             ListData.Items.Clear();
             //娓呯┖琛ㄦ牸鍐呭
@@ -353,7 +358,7 @@
 inner join Gy_InspectInstruMent men  with(nolock) on b.HInspectInstruMentID=men.HItemID   and men.HNumber='"+ HNumber + @"'  
 left join Gy_Material m with(nolock) on a.HMaterID=m.HItemID
 left join Gy_QCCheckItem ch with(nolock) on b.HQCCheckItemID=ch.HItemID  
-where pr.HBillNo='" + this.txtLzk.Text + "'", "Gy_QCCheckProjectMain");
+where pr.HBillNo='" + this.txtLzk.Text + "' and a.HProcID="+ HProcID, "Gy_QCCheckProjectMain");
 
                 if (dataSet.Tables[0].Rows.Count == 0)
                 {
@@ -502,7 +507,14 @@
                         ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'2'," + dataTable.Rows[i]["HInspectInstruMentID"].ToString() + ",'" + HLastResult + "'" +
                         ") ");
                     }
-                    
+
+                    DataSet SetData = oCN.RunProcReturn("select  HMakeDate from QC_TakeSampleCheckBillMain where HInterID =" + this.HTakeSampleCheckBillID.Text, "QC_TakeSampleCheckBillMain");
+                    string HMakeDate = "";
+                    if (SetData.Tables[0].Rows.Count > 0)
+                    {
+                        HMakeDate = SetData.Tables[0].Rows[0]["HMakeDate"].ToString();
+                    }
+                   
                     //涓昏〃
                     oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " +
                         "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -512,11 +524,11 @@
                         ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" +
                         ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID" +
                         ",HBatchNo) " +
-                        " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'" + this.txtHMaker.Text + "',getdate()" +
+                        " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,'"+ HMakeDate + "','" + this.txtHMaker.Text + "',getdate()" +
                         "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
                         "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID +
                         ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'"+this.labHMakerID.Text + "', " + HLastResults +
-                        "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" +
+                        "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + this.HShiftsID.Text + ",''" +
                         "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "'," + HProcID + "" +
                         ",'" + this.txtPcm.Text + "') ");
 
@@ -602,6 +614,12 @@
                         "," + HProcExchEntryID + ",'" + HProcExchBillNo + "','',0,0," + dataTable.Rows[i]["CharacteristicID"].ToString() + ",'" + dataTable.Rows[i]["HQCStd"].ToString() + "','','"+ dataTable.Rows[i]["HQCStd"].ToString() + "','" + HLastResult + "'" +
                         ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'2'," + dataTable.Rows[i]["HInspectInstruMentID"].ToString() + ",'" + HLastResult + "'" + ") ");
                     }
+                    DataSet SetData = oCN.RunProcReturn("select  HMakeDate from QC_TakeSampleCheckBillMain where HInterID =" + this.HTakeSampleCheckBillID.Text, "QC_TakeSampleCheckBillMain");
+                    string HMakeDate = "";
+                    if (SetData.Tables[0].Rows.Count > 0)
+                    {
+                        HMakeDate = SetData.Tables[0].Rows[0]["HMakeDate"].ToString();
+                    }
 
                     //涓昏〃
                     oCN.RunProc("Insert Into QC_PatrolProcCheckOtherBillMain " +
@@ -611,11 +629,11 @@
                         ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
                         ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" +
                         ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID,HBatchNo) " +
-                        " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'"+this.txtHMaker.Text + "',getdate()" +
+                        " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,'"+ HMakeDate + "','"+this.txtHMaker.Text + "',getdate()" +
                         "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
                         "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID +
                         ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'" + this.labHMakerID.Text + "', " + HLastResults +
-                        "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" +
+                        "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + this.HShiftsID.Text + ",''" +
                         "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ",'" + this.txtPcm.Text + "') ");
 
                     oCN.Commit();
@@ -701,6 +719,13 @@
                                 ",'"+ dataTable.Rows[i]["HQCStd"].ToString() + "') ");
                     }
 
+                    DataSet SetData = oCN.RunProcReturn("select  HMakeDate from QC_TakeSampleCheckBillMain where HInterID =" + this.HTakeSampleCheckBillID.Text, "QC_TakeSampleCheckBillMain");
+                    string HMakeDate = "";
+                    if (SetData.Tables[0].Rows.Count > 0)
+                    {
+                        HMakeDate = SetData.Tables[0].Rows[0]["HMakeDate"].ToString();
+                    }
+
                     //涓昏〃
                     oCN.RunProc("Insert Into QC_ProcessCheckBillMain " +
                     "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -714,15 +739,15 @@
                     ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty" +
                     ",HProcExchQty,HShiftsID,HErrTreatment" +
                     ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo" +
-                    ",HBatchNo) " +
-                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'" + this.txtHMaker.Text + "',getdate()" +
+                    ",HBatchNo,HCheckerResult) " +
+                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,'" + HMakeDate + "','" + this.txtHMaker.Text + "',getdate()" +
                     "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
                     "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "'" +
                     "," + HMaterID + "," + HProcID + "," + HSourceID + ",0,0,0,0,0," + this.labHMakerID.Text + ",'" + HLastResults + "'" +
                     ",'','',0,'',''" +
-                    ",0,0,'',0,0,0,0,'',0," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + HPlanQty + "," + HQty + ",0,''" +
+                    ",0,0,'',0,0,0,0,'',0," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + HPlanQty + "," + HQty + "," + this.HShiftsID.Text + ",''" +
                     "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "'" +
-                    ",'" + this.txtPcm.Text + "') ");
+                    ",'" + this.txtPcm.Text + "','" + HLastResults + "') ");
 
 
                     oCN.Commit();
@@ -772,6 +797,7 @@
                     this.txtLzk.Text = ds.Tables[0].Rows[0]["宸ュ簭娴佽浆鍗″彿"].ToString();
                     this.HTakeSampleCheckBillID.Text = ds.Tables[0].Rows[0]["hmainid"].ToString();
                     this.HTakeSampleCheckBillNo.Text = ds.Tables[0].Rows[0]["鍗曟嵁鍙�"].ToString();
+                    this.HShiftsID.Text = ds.Tables[0].Rows[0]["HShiftsID"].ToString();
                     this.txtLzk.ReadOnly = true;
                     this.label2.Text = "娴佽浆鍗�:";
                 }

--
Gitblit v1.9.1