From 1948124877478db58b27841f9398aed97ef13053 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期日, 26 十月 2025 17:19:15 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DAL/质检管理/ClsQC_POStockInCheckBill.cs |  140 ++++++++++++++++++++++++++++++----------------
 1 files changed, 91 insertions(+), 49 deletions(-)

diff --git "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_POStockInCheckBill.cs" "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_POStockInCheckBill.cs"
index 18b8768..ffaa63e 100644
--- "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_POStockInCheckBill.cs"
+++ "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_POStockInCheckBill.cs"
@@ -9,11 +9,13 @@
     {
         public Model.ClsQC_POStockInCheckBillMain omodel = new Model.ClsQC_POStockInCheckBillMain();
         public List<Model.ClsQC_POStockInCheckBillSub> DetailColl = new List<Model.ClsQC_POStockInCheckBillSub>();
+        public List<Model.ClsQC_POStockInCheckBillSub_ValueGrid> DetailColl_Value = new List<Model.ClsQC_POStockInCheckBillSub_ValueGrid>();
+
         //public List<Model.ClsQC_POStockInCheckBillSub_Item> DetailColl1 = new List<Model.ClsQC_POStockInCheckBillSub_Item>();
         public ClsQC_POStockInCheckBill()
         {
             base.MvarItemKeySub = "QC_POStockInCheckBillSub";
-            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub2 = "QC_POStockInCheckBillSub_ValueGrid";
             base.MvarItemKeySub3 = "";
             base.MvarItemKeySub4 = "";
             base.MvarItemKey="QC_POStockInCheckBillMain";
@@ -60,22 +62,26 @@
                 //",HCloseType="+omodel.HCloseType.ToString()+
                 //",HDeleteMan='" + omodel.HDeleteMan + "'" +
                 //",HDeleteDate='" + omodel.HDeleteDate + "'" +
-                ",HPrintQty="+omodel.HPrintQty.ToString()+
+                ",HPrintQty=" + omodel.HPrintQty.ToString() +
                 //========================================
                 //",HSupID=" + omodel.HSupID.ToString() +
                 //",HEmpID=" + omodel.HEmpID.ToString() +
-                ",HSupID="+omodel.HSupID.ToString()+
+                ",HSourceID=" + omodel.HSourceID.ToString() +
+                ",HQCSchemeID=" + omodel.HQCSchemeID.ToString() +
+                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
+                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
+                ",HICMOQty=" + omodel.HICMOQty.ToString() +
+                ",HProcExchInterID=" + omodel.HProcExchInterID.ToString() +
+                ",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() +
+                ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
+                ",HProcExchQty=" + omodel.HProcExchQty.ToString() +
+                ",HProcID=" + omodel.HProcID.ToString() +
                 ",HMaterID=" + omodel.HMaterID.ToString() +
-                ",HInStockQty=" + omodel.HInStockQty.ToString() +
-                ",HCheckQty=" + omodel.HCheckQty.ToString() +
-                ",HRightQty=" + omodel.HRightQty.ToString() +
-                ",HBadQty=" + omodel.HBadQty.ToString() +
                 ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
-                ",HCheckerResult='" + omodel.HCheckerResult + "'" +
-                ",HSteelStoveNo='" + omodel.HSteelStoveNo + "'" +
-                ",HSteelCompReport='" + omodel.HSteelCompReport + "'" +
-                ",HAspect='" + omodel.HAspect + "'" +
-                ",HSize='" + omodel.HSize + "'" +
+                ",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,14 +95,14 @@
                       " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
                       ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
                       ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                      ",HQCCheckClassID,HQCCheckItemID,HQCStd,HResult" +
-                      ",HQCRelValue,HProcCheckEmp,HProcCheckTime" +
+                      ",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
+                      ",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.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HResult + "'" +
-                      ",'" + oSub.HQCRelValue + "'," + oSub.HProcCheckEmp.ToString() + ",'" + oSub.HProcCheckTime + "'" +
+                      "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult + "'" +
+                      ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "','" + oSub.HInspectVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit + "','" + oSub.HInspectInstruMentID + "'" +
                       ") ");
                 }
                 //foreach (Model.ClsQC_POStockInCheckBillSub_Item oSub2 in DetailColl1)
@@ -143,22 +149,24 @@
             try
             {
                 //寰楀埌mainid
-                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                // omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
                 oCn.RunProc("Insert Into QC_POStockInCheckBillMain " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                 ",HYear,HPeriod,HRemark" +
-                ",HSupID,HMaterID,HInStockQty,HCheckQty,HRightQty" +
-                ",HBadQty,HFirstCheckEmp,HCheckerResult" +
-                ",HSteelStoveNo,HSteelCompReport,HAspect,HSize" +
+                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
+                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
+                ",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 + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+                " 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.HSupID.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HInStockQty.ToString() + "," + omodel.HCheckQty.ToString() + "," + omodel.HRightQty.ToString() +
-                "," + omodel.HBadQty.ToString() + "," + omodel.HFirstCheckEmp.ToString() + ",'" + omodel.HCheckerResult + "'"+
-                ",'" + omodel.HSteelStoveNo + "','" + omodel.HSteelCompReport + "','" + omodel.HAspect + "','" + omodel.HSize + "'" +
+                "," + 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.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "','" + omodel.HBatchNo + "'" +
+                "," + omodel.HTakeSampleCheckBillID + ",'" + omodel.HTakeSampleCheckBillNo + "','" + omodel.HProcID + "'" +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsQC_POStockInCheckBillSub oSub in DetailColl)
@@ -167,15 +175,19 @@
                       " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
                       ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
                       ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                      ",HQCCheckClassID,HQCCheckItemID,HQCStd,HResult" +
-                      ",HQCRelValue,HProcCheckEmp,HProcCheckTime" +
+                      ",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
+                      ",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.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HResult + "'" +
-                      ",'" + oSub.HQCRelValue + "'," + oSub.HProcCheckEmp.ToString() + ",'" + oSub.HProcCheckTime + "'" +
-                      ") ");
+                      "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult + "'" +
+                      ",'" + 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_POStockInCheckBillSub_Item oSub2 in DetailColl1)
                 //{
@@ -230,9 +242,9 @@
                     return false;
                 }
                 //鍥哄畾璧嬪��===========================================
-                omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
+                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                 omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
-                omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
+                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                 omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                 omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                 omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
@@ -261,21 +273,18 @@
                 //omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                 //omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
                 //omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
-                omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
+                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
+                omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
+                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
+                omodel.HICMOQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOQty"]); ;
+                omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]);
+                omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]);
+                omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]);
+                omodel.HProcExchQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchQty"]);
                 omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
-                omodel.HInStockQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInStockQty"]);
-                omodel.HCheckQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckQty"]);
-                omodel.HRightQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRightQty"]);
-                omodel.HBadQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBadQty"]);
                 omodel.HFirstCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HFirstCheckEmp"]);
-                omodel.HCheckerResult = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckerResult"]);
-                omodel.HSteelStoveNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSteelStoveNo"]);
-                omodel.HSteelCompReport = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSteelCompReport"]);
-                omodel.HAspect = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HAspect"]);
-                omodel.HSize = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSize"]);
-                //omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]);
-                //
-                
+                omodel.HLastResult = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HLastResult"]);
+
                 //寰幆
                 DataSet DsSub ;
                 DsSub = oCn.RunProcReturn("Select * from QC_POStockInCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_POStockInCheckBillSub");
@@ -298,13 +307,14 @@
                     oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                     oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                     //===================================================
-                    oSub.HQCCheckClassID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckClassID"]);
                     oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckItemID"]);
                     oSub.HQCStd = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCStd"]);
-                    oSub.HQCRelValue = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCRelValue"]);
+                    oSub.HUnit = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUnit"]);
+                    oSub.HQCNote = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote"]);
                     oSub.HResult = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HResult"]);
-                    oSub.HProcCheckEmp = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcCheckEmp"]);
-                    oSub.HProcCheckTime = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HProcCheckTime"]); 
+                    oSub.HMax = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMax"]);
+                    oSub.HMin = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMin"]);
+                    oSub.HAvg = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HAvg"]);
                     //oSub.HDotCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HDotCheckItemID"]);
                     //oSub.HDotCheckItem = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckItem"]);
                     //oSub.HDotCheckPart = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckPart"]);
@@ -338,7 +348,7 @@
                     //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
                     //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
                     //oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim();
-                    
+
                     DetailColl.Add(oSub);
                 }
                 //DataSet DsSub2;
@@ -407,6 +417,38 @@
             }
         }
 
+        //鏂板妫�楠屽��
+        public virtual bool AddValue(ref string sReturn, ref long HInterID, ref long HEntryID)
+        {
+            try
+            {
+                oCn.BeginTran();
+
+                oCn.RunProc("delete from QC_POStockInCheckBillSub_ValueGrid where HInterID = " + HInterID + " and HEntryID = " + HEntryID);
+
+                //鎻掑叆瀛愯〃
+                foreach (Model.ClsQC_POStockInCheckBillSub_ValueGrid value in DetailColl_Value)
+                {
+                    oCn.RunProc("Insert into QC_POStockInCheckBillSub_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 bool CheckBill(Int64 lngBillKey, ref string sReturn)
         {

--
Gitblit v1.9.1