From 797e02f68d79c931233f25af1d39bc136ce6185d Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 21 四月 2025 15:47:05 +0800
Subject: [PATCH] 1
---
DAL/质检管理/ClsQC_FirstPieceCheckBill.cs | 136 ++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 126 insertions(+), 10 deletions(-)
diff --git "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs" "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs"
index 5b733e6..0717e5d 100644
--- "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs"
+++ "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs"
@@ -9,11 +9,12 @@
{
public Model.ClsQC_FirstPieceCheckBillMain omodel = new Model.ClsQC_FirstPieceCheckBillMain();
public List<Model.ClsQC_FirstPieceCheckBillSub> DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>();
+ public List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> DetailColl_Value = new List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid>();
//public List<Model.ClsQC_FirstPieceCheckBillSub_Item> DetailColl1 = new List<Model.ClsQC_FirstPieceCheckBillSub_Item>();
public ClsQC_FirstPieceCheckBill()
{
base.MvarItemKeySub = "QC_FirstPieceCheckBillSub";
- base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub2 = "QC_FirstPieceCheckBillSub_ValueGrid";
base.MvarItemKeySub3 = "";
base.MvarItemKeySub4 = "";
base.MvarItemKey="QC_FirstPieceCheckBillMain";
@@ -36,6 +37,22 @@
{
try
{
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ DataSet ds = oCn.RunProcReturn("Exec h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ return false;
+ }
+ //=========================================================
+
+
//
oCn.BeginTran();
//鏇存柊涓昏〃
@@ -65,6 +82,7 @@
//",HSupID=" + omodel.HSupID.ToString() +
//",HEmpID=" + omodel.HEmpID.ToString() +
",HSourceID=" + omodel.HSourceID.ToString() +
+ ",HQCSchemeID=" + omodel.HQCSchemeID.ToString() +
",HICMOInterID=" + omodel.HICMOInterID.ToString() +
",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
",HICMOQty=" + omodel.HICMOQty.ToString() +
@@ -72,9 +90,13 @@
",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() +
",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
",HProcExchQty=" + omodel.HProcExchQty.ToString() +
+ ",HProcID=" + omodel.HProcID.ToString() +
",HMaterID=" + omodel.HMaterID.ToString() +
",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
",HLastResult=" + DBUtility.ClsPub.BoolToString(omodel.HLastResult) +
+ ",HShiftsID=" + omodel.HShiftsID.ToString() +
+ ",HErrTreatment='" + omodel.HErrTreatment + "'" +
+ ",HBatchNo='" + omodel.HBatchNo + "'" +
" where HInterID=" + lngBillKey.ToString());
//鍒犻櫎鍏宠仈
DeleteRelation(ref sReturn, lngBillKey);
@@ -89,13 +111,13 @@
",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
- ",HMax,HMin,HAvg" +
+ ",HMax,HMin,HAvg,HInspectVal,HUpLimit,HDownLimit,HInspectInstruMentID" +
") values("
+ omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
",getdate()," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'," + oSub.HSourceInterID.ToString() +
"," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
"," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult +"'"+
- ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" +
+ ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "','"+ oSub.HInspectVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit + "','" + oSub.HInspectInstruMentID + "'" +
") ");
}
//foreach (Model.ClsQC_FirstPieceCheckBillSub_Item oSub2 in DetailColl1)
@@ -125,6 +147,25 @@
// return false;
// }
//}
+
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_QC_FirstPieceCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_FirstPieceCheckBill_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
+
sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
oCn.Commit();
return true;
@@ -142,8 +183,25 @@
try
{
//寰楀埌mainid
- omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ DataSet ds = oCn.RunProcReturn("Exec h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ return false;
+ }
+ //=========================================================
+
+
oCn.BeginTran();
//涓昏〃
oCn.RunProc("Insert Into QC_FirstPieceCheckBillMain " +
@@ -151,13 +209,15 @@
",HYear,HPeriod,HRemark" +
",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
- ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
+ ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment,HBatchNo" +
+ ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID" +
") " +
" values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
"," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + ", " + DBUtility.ClsPub.BoolToString(omodel.HLastResult) +
- "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
+ "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "','" + omodel.HBatchNo + "'" +
+ ","+ omodel.HTakeSampleCheckBillID + ",'"+ omodel.HTakeSampleCheckBillNo + "','" + omodel.HProcID + "'" +
") ");
//鎻掑叆瀛愯〃
foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in DetailColl)
@@ -167,15 +227,19 @@
",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
- ",HMax,HMin,HAvg" +
+ ",HMax,HMin,HAvg,HSampleSchemeID,HSampleQty,HSampleDamageQty,HAcceptQty" +
+ ",HRejectQty,HSampleUnRightQty,HStatus,HUnitID,HInspectVal,HTargetVal" +
+ ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" +
") values("
+ omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
",getdate()," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'," + oSub.HSourceInterID.ToString() +
"," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
"," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult + "'" +
- ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" +
- ") ");
- }
+ ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" + "," + oSub.HSampleSchemeID + "," + oSub.HSampleQty +
+ "," + oSub.HSampleDamageQty + "," + oSub.HAcceptQty + "," + oSub.HRejectQty + "," + oSub.HSampleUnRightQty + ",'" + oSub.HStatus +
+ "'," + oSub.HUnitID + ",'" + oSub.HInspectVal + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
+ "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
+ }
//foreach (Model.ClsQC_FirstPieceCheckBillSub_Item oSub2 in DetailColl1)
//{
// oCn.RunProc("Insert into QC_FirstPieceCheckBillSub_Item " +
@@ -204,6 +268,25 @@
// }
//}
//
+
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_QC_FirstPieceCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_FirstPieceCheckBill_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
+
sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
oCn.Commit();
return true;
@@ -215,6 +298,39 @@
throw (e);
}
}
+
+ //鏂板妫�楠屽��
+ public virtual bool AddValue(ref string sReturn,ref long HInterID, ref long HEntryID)
+ {
+ try
+ {
+ oCn.BeginTran();
+
+ oCn.RunProc("delete from QC_FirstPieceCheckBillSub_ValueGrid where HInterID = " + HInterID + " and HEntryID = " + HEntryID);
+
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsQC_FirstPieceCheckBillSub_ValueGrid value in DetailColl_Value)
+ {
+ oCn.RunProc("Insert into QC_FirstPieceCheckBillSub_ValueGrid " +
+ " (HInterID,HEntryID,HSEQ,HInSpectResult" +
+ ",HInSpectValue,HInSpectValueB,HInSpectValueT" +
+ ") values("
+ + HInterID + "," + HEntryID + "," + value.HSEQ + ",'" + value.HInSpectResult + "'," +
+ value.HInSpectValue + "," + value.HInSpectValueB + ",'" + value.HInSpectValueT + "'" +
+ ") ");
+ }
+ sReturn = "鏂板妫�楠屽�兼垚鍔燂紒";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
//鏄剧ず鍗曟嵁
public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
{
--
Gitblit v1.9.1