From 0f0d1ce8057cf705bac051b7cc7108b4075659d0 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 15 八月 2024 13:38:21 +0800
Subject: [PATCH] 注塑车间数据采集
---
WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs | 77 +++++++++++++++++++++++++++++++-------
1 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs b/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
index 4aaf1c9..5085ee1 100644
--- a/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
+++ b/WFormSynchronizeData_SMR/WFormReadData_SMR/ReadCoordinateExcelFrom.cs
@@ -30,8 +30,7 @@
//璺緞鍙
this.txtLj.ReadOnly = true;
this.txtPcm.ReadOnly = true;
-
-
+ SelectHProList();
}
private void btnLj_Click(object sender, EventArgs e)
@@ -431,6 +430,7 @@
{
try
{
+ string HProcID = this.cmbPro.SelectedValue.ToString();
string sExeReturnInfo = "";
string BillType = "7505";
long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
@@ -440,7 +440,7 @@
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID
from Sc_ProcessExchangeBillMain a with(nolock)
inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID
-where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain");
+where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID="+ HProcID, "Sc_ProcessExchangeBillMain");
if (ds.Tables[0].Rows.Count == 0)
{
@@ -490,7 +490,8 @@
",getdate(),0,''," + HProcExchInterID +
"," + 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,'1',0,'"+ 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,'1',0,'"+ HLastResult + "'" +
+ ") ");
}
//涓昏〃
@@ -500,13 +501,14 @@
",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" +
+ ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID" +
") " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" +
"," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
"," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID +
",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults +
"," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" +
- ") ");
+ "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") ");
oCN.Commit();
@@ -517,6 +519,8 @@
catch (Exception e)
{
oCN.RollBack();
+ //淇濆瓨鎸夐挳鐏版帀
+ this.btnSave.Enabled = true;
MessageBox.Show("淇濆瓨澶辫触!" + e.Message);
}
}
@@ -526,6 +530,7 @@
{
try
{
+ string HProcID = this.cmbPro.SelectedValue.ToString();
string sExeReturnInfo = "";
string BillType = "7520";
long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
@@ -535,7 +540,7 @@
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID
from Sc_ProcessExchangeBillMain a with(nolock)
inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID
-where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain");
+where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=" + HProcID, "Sc_ProcessExchangeBillMain");
if (ds.Tables[0].Rows.Count == 0)
{
@@ -595,13 +600,13 @@
",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" +
- ") " +
+ ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID) " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" +
"," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
"," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID +
",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults +
"," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" +
- ") ");
+ "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") ");
oCN.Commit();
@@ -620,6 +625,7 @@
{
try
{
+ string HProcID = this.cmbPro.SelectedValue.ToString();
string sExeReturnInfo = "";
string BillType = "7507";
long HInterID = oCN.CreateBillID_Prod(BillType, ref sExeReturnInfo);
@@ -629,7 +635,7 @@
staus.HSourceEntryID HProcExchEntryID,a.HBillNo HProcExchBillNo,a.HQty,a.HMaterID,staus.HProcID
from Sc_ProcessExchangeBillMain a with(nolock)
inner join Sc_ICMOBillStatus_Tmp staus with(nolock) on a.HInterID=staus.HSourceInterID
-where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=186 ", "Sc_ProcessExchangeBillMain");
+where a.HBillNo='" + this.txtLzk.Text + "' and staus.HProcID=" + HProcID, "Sc_ProcessExchangeBillMain");
if (ds.Tables[0].Rows.Count == 0)
{
@@ -646,7 +652,7 @@
string HProcExchBillNo = ds.Tables[0].Rows[0]["HProcExchBillNo"].ToString();
string HQty = ds.Tables[0].Rows[0]["HQty"].ToString();
string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString();
- string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
string HQCSchemeID = dataTable.Rows[0]["HQCSchemeID"].ToString();
int HLastResults = 1;
@@ -695,7 +701,9 @@
",HBarCode,HLBatchNo,HCusID,HSortBillNo,HContrctBatchNo" +
",HProdAreaID,HProdTypeID,HProdStoveNo,HRecipeID,HDiameter1" +
",HDiameter2,HRoutingInterID,HDrawingDireID,HPackTypeID" +
-",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty,HShiftsID,HErrTreatment" +
+ ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty" +
+ ",HProcExchQty,HShiftsID,HErrTreatment" +
+ ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo" +
") " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" +
"," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" +
@@ -703,7 +711,7 @@
"," + HMaterID + "," + HProcID + "," + HSourceID + ",0,0,0,0,0,0,'" + HLastResults + "'" +
",'','',0,'',''" +
",0,0,'',0,0,0,0,'',0," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + HPlanQty + "," + HQty + ",0,''" +
- ") ");
+ "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "') ");
oCN.Commit();
@@ -732,15 +740,31 @@
{
try
{
- DataSet ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HBillNo='" + HBillNo + "' ", "Sc_ProcessExchangeBillMain");
+ string cmbPro = this.cmbPro.SelectedValue.ToString();
+ DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub where 鍗曟嵁鍙�='" + HBillNo + "' and HProcID='"+ cmbPro + "'", "h_v_Sc_ProcessExchangeBillQuerySub");
if (ds.Tables[0].Rows.Count == 0)
{
- MessageBox.Show("鏌ユ棤鏁版嵁!");
+ 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)
+ {
+ MessageBox.Show("褰撳墠宸ュ簭瀵瑰簲鐨勫崟鎹�,鏌ユ棤鏁版嵁!");
+ }
+ else
+ {
+ string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString();
+ this.txtPcm.Text = HProjectNum.Split('-')[0];
+ 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.txtLzk.ReadOnly = true;
+ }
}
else
{
string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString();
this.txtPcm.Text = HProjectNum.Split('-')[0];
+ this.HTakeSampleCheckBillID.Text = "0";
+ this.HTakeSampleCheckBillNo.Text = "";
this.txtLzk.ReadOnly = true;
}
}
@@ -750,6 +774,31 @@
}
}
+ //鏌ヨ宸ュ簭
+ public void SelectHProList()
+ {
+ try
+ {
+ DataSet ds = oCN.RunProcReturn("select * from Gy_Process ", "Sc_ProcessExchangeBillMain");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ MessageBox.Show("宸ュ簭鏌ユ棤鏁版嵁!");
+ }
+ else
+ {
+ this.cmbPro.DataSource = ds.Tables[0];
+ this.cmbPro.DisplayMember = "HName";
+ this.cmbPro.ValueMember = "HItemID";
+ this.cmbPro.SelectedIndex = 0;
+ this.cmbPro.DropDownStyle = ComboBoxStyle.DropDownList;
+ }
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(this, e.Message, "鎻愮ず");
+ }
+ }
+
private void ReadCoordinateExcelFrom_Activated(object sender, EventArgs e)
{
//鍏夋爣閫変腑娴佽浆鍗�
--
Gitblit v1.9.1