zrg
2025-05-08 428a4a5d860c121271c426015c08b646258b85d6
WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
@@ -26,6 +26,8 @@
            this.cmbJYSelect.SelectedIndex = 0;
            this.cmbJYSelect.DropDownStyle = ComboBoxStyle.DropDownList;
            //批次码只读
            this.txtPcm.ReadOnly = true;
@@ -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();
            //清空表格内容
@@ -345,7 +350,8 @@
            for (int i = 0; i < ds.Tables.Count; i++)
            {
                //修改是在哪个设备上进行的数据采集 b.HInspectInstruMentID=1  三坐标1    轮廓仪2
                //修改  是在哪个设备上进行的数据采集 b.HInspectInstruMentID=1  三坐标1    轮廓仪2
                //查询当前流转卡 以及 工序 对应的检验方案是否存在
                DataSet dataSet = oCN.RunProcReturn(@"select b.HInspectInstruMentID,a.HInterID HQCSchemeID,b.HQCCheckItemID, ch.HNumber HQCCheckItemNumber,m.HNumber,HUpLimit,HDownLimit,HTargetVal 
from Sc_ProcessExchangeBillMain pr with(nolock)
inner join Gy_QCCheckProjectMain a with(nolock) on pr.HMaterID=a.HMaterID
@@ -353,7 +359,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)
                {
@@ -445,6 +451,7 @@
                long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
                string HBillNo = oCN.CreateBillCode(BillType, ref sExeReturnInfo, true);
                //判断当前流转卡 当前工序 是否已经派过工
                DataSet ds = oCN.RunProcReturn(@"select    staus.HSourceID,a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HPlanQty,a.HInterID HProcExchInterID,
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID
from Sc_ProcessExchangeBillMain a with(nolock)
@@ -523,7 +530,7 @@
                        "," + 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 + "') ");
@@ -553,6 +560,7 @@
                long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
                string HBillNo = oCN.CreateBillCode(BillType, ref sExeReturnInfo, true);
                // 判断当前流转卡 当前工序 是否已经派过工
                DataSet ds = oCN.RunProcReturn(@"select    staus.HSourceID,a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HPlanQty,a.HInterID HProcExchInterID,
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID
from Sc_ProcessExchangeBillMain a with(nolock)
@@ -628,7 +636,7 @@
                        "," + 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();
@@ -654,6 +662,7 @@
                long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
                string HBillNo = oCN.CreateBillCode(BillType, ref sExeReturnInfo, true);
                // 判断当前流转卡 当前工序 是否已经派过工
                DataSet ds = oCN.RunProcReturn(@"select    staus.HSourceID,a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HPlanQty,a.HInterID HProcExchInterID,
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID,staus.HProcID
from Sc_ProcessExchangeBillMain a with(nolock)
@@ -735,14 +744,14 @@
                    ",HProcExchQty,HShiftsID,HErrTreatment" +
                    ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo" +
                    ",HBatchNo,HCheckerResult) " +
                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,'"+ HMakeDate + "','" + this.txtHMaker.Text + "',getdate()" +
                    " 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 + "','"+ HLastResults + "') ");
                    ",'" + this.txtPcm.Text + "','" + HLastResults + "') ");
                    oCN.Commit();
@@ -780,6 +789,7 @@
            {
                string cmbPro = this.cmbPro.SelectedValue.ToString();
                //查询取样单数据
               DataSet ds = oCN.RunProcReturn("select  * from h_v_QC_TakeSampleCheckBillList where 单据号='" + HBillNo + "' and  HProcID='" + cmbPro + "'", "h_v_QC_TakeSampleCheckBillList");
                if (ds.Tables[0].Rows.Count == 0)
                {
@@ -792,6 +802,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 = "流转卡:";
                }