From b129762a4bb5ec2cde5edf16bc9cbda57c73587d Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期三, 24 五月 2023 09:33:10 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs | 62 +++++++++++++++++++++++++++--- 1 files changed, 55 insertions(+), 7 deletions(-) diff --git a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs index 548ecf9..b6f38de 100644 --- a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs +++ b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs @@ -9,6 +9,7 @@ { public Models.ClsSb_EquipRepairWorkBillMain omodel = new Models.ClsSb_EquipRepairWorkBillMain(); public List<Models.ClsSb_EquipRepairWorkBillSub> DetailColl = new List<Models.ClsSb_EquipRepairWorkBillSub>(); + public List<Model.ClsSb_EquipRepairWorkBillSub_Mater> DetailColl_Mater = new List<Model.ClsSb_EquipRepairWorkBillSub_Mater>(); public ClsSb_EquipRepairWorkBill() { @@ -17,9 +18,9 @@ base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey="Sb_EquipRepairWorkBillMain"; - base.MvarReportTitle = "妯″叿缁翠慨鍗�"; - base.BillType="3793"; - base.HBillSubType = "3793"; + base.MvarReportTitle = "璁惧缁翠慨鍗�"; + base.BillType="3910"; + base.HBillSubType = "3910"; } @@ -61,6 +62,9 @@ ",HExplanation='" + omodel.HExplanation + "'" + ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + ",HRepairContent='" + omodel.HRepairContent + "'" + + ",HMainSourceBillType='"+ omodel.HMainSourceBillType+"'"+ + ",HMainSourceInterID="+ omodel.HMainSourceInterID.ToString()+ + ",HMainSourceEntryID="+ omodel.HMainSourceEntryID.ToString()+ ",HCycleUnit='" + omodel.HCycleUnit + "'" + " where HInterID=" + lngBillKey.ToString()); @@ -68,6 +72,8 @@ DeleteRelation(ref sReturn, lngBillKey); //鍒犻櫎瀛愯〃 DeleteBillSub(lngBillKey); + //鍒犻櫎閰嶄欢鏁版嵁 + oCn.RunProc("delete from Sb_EquipRepairWorkBillSub_Mater where HInterID="+ lngBillKey); //鎻掑叆瀛愯〃 omodel.HInterID = lngBillKey; foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) @@ -79,9 +85,25 @@ ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HRepairID1.ToString() + ",'"+ oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + "," + oSub.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + ") "); } + + foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) + { + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + + " (HInterID,HEntryID," + + "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + + "HQty,HMaterID,HUnitID,HQtyMust," + + "HManagerID ) values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HManagerID.ToString() + ") "); + } + // //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) //{ @@ -114,21 +136,32 @@ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCn.BeginTran(); + //涓昏〃 oCn.RunProc("Insert Into Sb_EquipRepairWorkBillMain " + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + ",HEquipID,HRepairID,HPlanTimes,HEmpID,HManagerID,HTimes" + - ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit" + + ",HDeptID,HExplanation,HInnerBillNo,HRepairBeginDate,HRepairEndDate,HRepairContent,HCycleUnit,HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + ", " + omodel.HEquipID.ToString() + "," + omodel.HRepairID.ToString() + "," + omodel.HPlanTimes.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HTimes.ToString() + - ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "'" + + ", " + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HRepairBeginDate.ToShortDateString() + "','" + omodel.HRepairEndDate.ToShortDateString() + "','" + omodel.HRepairContent + "','" + omodel.HCycleUnit + "','" + + omodel.HMainSourceBillType+"',"+ omodel.HMainSourceInterID.ToString()+","+ omodel.HMainSourceEntryID.ToString() + ") "); //鎻掑叆瀛愯〃 foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) { + string sql1 = string.Format(@"Insert into Sb_EquipRepairWorkBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HRepairID,HManagerID,HRepairExplanation,HEmpID" + + ") values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + ")"); oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + @@ -136,9 +169,24 @@ ") values(" + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HRepairID1.ToString() + ",'"+ oSub.HManagerID1.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + + "," + oSub.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() + ") "); } + + foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater) + { + oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " + + " (HInterID,HEntryID," + + "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + + "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + + "HQty,HMaterID,HUnitID,HQtyMust," + + "HManagerID ) values(" + + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + + "," + oSub.HManagerID.ToString() + ") "); + } // //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl) //{ -- Gitblit v1.9.1