From b8bcedc32e381883def90992175044e2dbb3a482 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 22 八月 2024 09:00:25 +0800
Subject: [PATCH] 收款单添加子表

---
 BLL/bin/Release/DAL.dll                                        |    0 
 LMES/obj/x86/Release/LMES.csproj.AssemblyReference.cache       |    0 
 WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs            |    8 ++++
 BLL/bin/Release/BLL.pdb                                        |    0 
 Model/obj/Release/Model.csproj.AssemblyReference.cache         |    0 
 DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache |    0 
 SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache |    0 
 WebAPI/Properties/PublishProfiles/FolderProfile21.pubxml.user  |   16 ++++----
 DAL/bin/Release/DAL.pdb                                        |    0 
 DAL/应收管理/ClsYS_ReceiveBill.cs                                  |   68 +++++++++++++++++++++++++++++++---
 BLL/bin/Release/BLL.dll                                        |    0 
 BLL/bin/Release/DAL.pdb                                        |    0 
 DAL/bin/Release/DAL.dll                                        |    0 
 13 files changed, 78 insertions(+), 14 deletions(-)

diff --git a/BLL/bin/Release/BLL.dll b/BLL/bin/Release/BLL.dll
index 076f4b8..ea7f802 100644
--- a/BLL/bin/Release/BLL.dll
+++ b/BLL/bin/Release/BLL.dll
Binary files differ
diff --git a/BLL/bin/Release/BLL.pdb b/BLL/bin/Release/BLL.pdb
index 3f1f166..5fcd952 100644
--- a/BLL/bin/Release/BLL.pdb
+++ b/BLL/bin/Release/BLL.pdb
Binary files differ
diff --git a/BLL/bin/Release/DAL.dll b/BLL/bin/Release/DAL.dll
index 82e96b1..7b8365e 100644
--- a/BLL/bin/Release/DAL.dll
+++ b/BLL/bin/Release/DAL.dll
Binary files differ
diff --git a/BLL/bin/Release/DAL.pdb b/BLL/bin/Release/DAL.pdb
index dec3f35..4a9622d 100644
--- a/BLL/bin/Release/DAL.pdb
+++ b/BLL/bin/Release/DAL.pdb
Binary files differ
diff --git a/DAL/bin/Release/DAL.dll b/DAL/bin/Release/DAL.dll
index 82e96b1..7b8365e 100644
--- a/DAL/bin/Release/DAL.dll
+++ b/DAL/bin/Release/DAL.dll
Binary files differ
diff --git a/DAL/bin/Release/DAL.pdb b/DAL/bin/Release/DAL.pdb
index dec3f35..4a9622d 100644
--- a/DAL/bin/Release/DAL.pdb
+++ b/DAL/bin/Release/DAL.pdb
Binary files differ
diff --git "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs" "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
index 4d3ea04..2f34b78 100644
--- "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
+++ "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
@@ -31,8 +31,50 @@
         {
             DetailColl = null;
         }
-       
+
         #endregion   鑷畾涔夋柟娉�
+
+
+        //鍒犻櫎鍏宠仈
+        public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
+        {
+            //搴旀敹鍗� 鍏宠仈鏁伴噺
+            try
+            {
+                if (DetailColl[0].HSourceBillType == "1114")                    //搴旀敹鍗�
+                {
+                    oCn.RunProc("exec h_p_Xs_UpDateRelation_ReceiveToReceivableIn_Del " + lngBillKey.ToString());
+                }
+                else
+                {
+                }
+            }
+            catch (Exception e)
+            {
+                throw (e);
+            }
+        }
+        //鏂板鍏宠仈
+        public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
+        {
+            //搴旀敹鍗� 鍏宠仈鏁伴噺
+            try
+            {
+                if (DetailColl[0].HSourceBillType == "1114")                    //搴旀敹鍗�
+                {
+                    oCn.RunProc("exec h_p_Xs_UpDateRelation_ReceiveToReceivableIn_Add " + lngBillKey.ToString());
+                }
+                else
+                {
+
+                }
+            }
+            catch (Exception e)
+            {
+                throw (e);
+            }
+        }
+
         //淇敼鍗曟嵁
         public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
         {
@@ -96,8 +138,11 @@
 
 
                 oCn.RunProc(mainSql);
-                //鍒犻櫎鍏宠仈
-                DeleteRelation(ref sReturn, lngBillKey);
+                if (DetailColl.Count != 0)
+                {
+                    //鍒犻櫎鍏宠仈
+                    DeleteRelation(ref sReturn, lngBillKey);
+                }
                 //鍒犻櫎瀛愯〃
                 DeleteBillSub(lngBillKey);
                 //鎻掑叆瀛愯〃
@@ -116,13 +161,17 @@
                       + 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.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() +
-                      ",'" + oSub.HReceiveBillNo + "'," + oSub.HReceiveBillInterID.ToString() + "," + oSub.HReceiveBillEntryID.ToString() + "," + oSub.HSourceDate.ToString() + "," + oSub.HSourceMoney.ToString() +
+                      ",'" + oSub.HReceiveBillNo + "'," + oSub.HReceiveBillInterID.ToString() + "," + oSub.HReceiveBillEntryID.ToString() + ",'" + oSub.HSourceDate.ToString() + "'," + oSub.HSourceMoney.ToString() +
                       "," + oSub.HSourceMoneyBB.ToString() + "," + oSub.HReadyCheckMoney.ToString() + "," + oSub.HUnCheckMoney.ToString() + "," + oSub.HCheckMoney.ToString() + "," + oSub.HCheckMoneyBB.ToString() + "," + oSub.HInovceExRate.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                       "," + oSub.HPOContractInterID.ToString() + "," + oSub.HPOContractEntryID.ToString() + ",'" + oSub.HPOContractBillNo + "'," + oSub.HSeContractInterID.ToString() + "," + oSub.HSeContractEntryID.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       ") ");
                 }
-
+                if (DetailColl.Count != 0)
+                {
+                    //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+                    AddNewRelation(ref sReturn, omodel.HInterID);
+                }
                 //=========================淇濆瓨鍚庢帶鍒�  
                 DataSet ds2 = oCn.RunProcReturn("h_p_YS_ReceiveBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_YS_ReceiveBill_AfterSaveCtrl");
                 if (ds2 == null)
@@ -268,7 +317,7 @@
                       + 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.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() +
-                      ",'" + oSub.HReceiveBillNo + "'," + oSub.HReceiveBillInterID.ToString() + "," + oSub.HReceiveBillEntryID.ToString() + "," + oSub.HSourceDate.ToString() + "," + oSub.HSourceMoney.ToString() +
+                      ",'" + oSub.HReceiveBillNo + "'," + oSub.HReceiveBillInterID.ToString() + "," + oSub.HReceiveBillEntryID.ToString() + ",'" + oSub.HSourceDate.ToString() + "'," + oSub.HSourceMoney.ToString() +
                       "," + oSub.HSourceMoneyBB.ToString() + "," + oSub.HReadyCheckMoney.ToString() + "," + oSub.HUnCheckMoney.ToString() + "," + oSub.HCheckMoney.ToString() + "," + oSub.HCheckMoneyBB.ToString() + "," + oSub.HInovceExRate.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       "," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                       "," + oSub.HPOContractInterID.ToString() + "," + oSub.HPOContractEntryID.ToString() + ",'" + oSub.HPOContractBillNo + "'," + oSub.HSeContractInterID.ToString() + "," + oSub.HSeContractEntryID.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
@@ -276,6 +325,13 @@
                     oCn.RunProc(subSql);
                 }
 
+                if (DetailColl.Count != 0)
+                {
+                //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+                AddNewRelation(ref sReturn, omodel.HInterID);
+                }
+                
+
                 //=========================淇濆瓨鍚庢帶鍒�  
                 DataSet ds2 = oCn.RunProcReturn("h_p_YS_ReceiveBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_YS_ReceiveBill_AfterSaveCtrl");
                 if (ds2 == null)
diff --git a/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache b/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
index ed9b29c..b0afd37 100644
--- a/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
+++ b/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
Binary files differ
diff --git a/LMES/obj/x86/Release/LMES.csproj.AssemblyReference.cache b/LMES/obj/x86/Release/LMES.csproj.AssemblyReference.cache
index 0c23372..fd1ac89 100644
--- a/LMES/obj/x86/Release/LMES.csproj.AssemblyReference.cache
+++ b/LMES/obj/x86/Release/LMES.csproj.AssemblyReference.cache
Binary files differ
diff --git a/Model/obj/Release/Model.csproj.AssemblyReference.cache b/Model/obj/Release/Model.csproj.AssemblyReference.cache
index 50d073a..d62b907 100644
--- a/Model/obj/Release/Model.csproj.AssemblyReference.cache
+++ b/Model/obj/Release/Model.csproj.AssemblyReference.cache
Binary files differ
diff --git a/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache b/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
index bc0d19c..8cd56b9 100644
--- a/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
+++ b/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
Binary files differ
diff --git a/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs b/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs
index 26eae8e..be4b46e 100644
--- a/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs
+++ b/WebAPI/Controllers/XSGL/YS_ReceiveBillController.cs
@@ -393,6 +393,14 @@
 
                 oCN.BeginTran();
 
+                ds = oCN.RunProcReturn("select * from h_v_YS_ReceiveBillList where hmainid=" + HInterID, "h_v_YS_ReceiveBillList");
+                string hSourceBillType = ds.Tables[0].Rows[0]["婧愬崟绫诲瀷"].ToString();
+                if (hSourceBillType == "1426")
+                {
+                    //鏀舵鍗� 鍒犻櫎鍥炲~ 搴斾粯鍗曞叧鑱旀暟閲�
+                    oCN.RunProc("exec h_p_Xs_UpDateRelation_ReceiveToReceivableIn_Del " + HInterID);
+                }
+
                 oCN.RunProc("delete from YS_ReceiveBillMain where HInterID = " + HInterID);
                 oCN.RunProc("delete from YS_ReceiveBillSub where HInterID= " + HInterID);
 
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile21.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile21.pubxml.user
index e58c7f8..7d0681f 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile21.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile21.pubxml.user
@@ -5,7 +5,7 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <_PublishTargetUrl>G:\issWeb\缃戠珯鍙戝竷\API</_PublishTargetUrl>
-    <History>True|2024-08-21T02:38:36.4128047Z;True|2024-08-21T08:14:03.4933362+08:00;</History>
+    <History>True|2024-08-22T00:47:36.3625451Z;True|2024-08-21T16:51:37.2382964+08:00;True|2024-08-21T16:25:44.7030554+08:00;True|2024-08-21T16:21:11.7076342+08:00;False|2024-08-21T16:20:13.4190052+08:00;True|2024-08-21T16:00:41.9895716+08:00;True|2024-08-21T14:57:09.3460834+08:00;True|2024-08-21T10:38:36.4128047+08:00;True|2024-08-21T08:14:03.4933362+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
@@ -45,19 +45,19 @@
       <publishTime>02/22/2013 16:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>08/21/2024 10:38:03</publishTime>
+      <publishTime>08/22/2024 08:47:16</publishTime>
     </File>
     <File Include="bin/BLL.pdb">
-      <publishTime>08/21/2024 10:38:03</publishTime>
+      <publishTime>08/22/2024 08:47:16</publishTime>
     </File>
     <File Include="bin/BouncyCastle.Crypto.dll">
       <publishTime>12/18/2020 05:32:28</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>08/21/2024 10:38:00</publishTime>
+      <publishTime>08/22/2024 08:47:13</publishTime>
     </File>
     <File Include="bin/DAL.pdb">
-      <publishTime>08/21/2024 10:38:00</publishTime>
+      <publishTime>08/22/2024 08:47:13</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 22:52:40</publishTime>
@@ -288,13 +288,13 @@
       <publishTime>11/24/2014 19:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>08/21/2024 10:38:12</publishTime>
+      <publishTime>08/22/2024 08:47:23</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>08/21/2024 10:38:12</publishTime>
+      <publishTime>08/22/2024 08:47:23</publishTime>
     </File>
     <File Include="bin/WebAPI.XmlSerializers.dll">
-      <publishTime>08/21/2024 10:38:30</publishTime>
+      <publishTime>08/22/2024 08:47:32</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
       <publishTime>07/18/2013 01:03:52</publishTime>

--
Gitblit v1.9.1