From 40d8d68aff0e4ffd4bd4b003d1a719db12b2838b Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 29 四月 2024 17:34:59 +0800
Subject: [PATCH] 仓库管理流程优化

---
 WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
index d20ec39..9091689 100644
--- a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
+++ b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
@@ -202,7 +202,7 @@
 	                    ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark
                         ,HInnerBillNo,HSTOCKORGID,HOWNERID,HMaker,HMakeDate,HProjectID,HInvoiceBillNo)
                         values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" +
-                    HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
+                    1201 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
                     "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + 
                     HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark
                     + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate(),"+ HProjectID + ",'"+ HInvoiceBillNo + "')";
@@ -211,6 +211,27 @@
                 }
                 else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                 { //淇敼
+
+                    DataSet dss;
+                    dss = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBillList");
+                    //鍒ゆ柇鏄惁鍙紪杈�
+                    if (dss.Tables[0].Rows[0]["瀹℃牳浜�"].ToString() != "" && dss.Tables[0].Rows[0]["瀹℃牳浜�"] != null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (dss.Tables[0].Rows[0]["鐘舵��"].ToString() != "鍒涘缓")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
                     String sql = $@"update Kf_ICStockBillMain  set " +
                                 "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
                                  ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID
@@ -218,6 +239,13 @@
                                  + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID="+ HProjectID + ",HInvoiceBillNo='"+ HInvoiceBillNo + "' where HInterID=" + HInterID;
 
                     oCN.RunProc(sql);
+
+                    //閲囪喘鍏ュ簱鍗�  缂栬緫 鎾ら攢鍥炲~  閲囪喘璁㈠崟  鍏宠仈鏁伴噺
+                    oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID);
+
+                    //閲囪喘鍏ュ簱鍗�  缂栬緫 鎾ら攢鍥炲~  鏀舵枡閫氱煡鍗�  鍏宠仈鏁伴噺
+                    oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID);
+
                     //鍒犻櫎瀛愯〃
                     oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'");
                 }
@@ -229,7 +257,7 @@
 
                 //閲囪喘鍏ュ簱鍗曟柊澧炲洖濉敹鏂欓�氱煡鍗曞叧鑱旀暟閲�
                 oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Add " + HInterID);
-                
+
 
                 if (objJsonResult.code == "0")
                 {
@@ -421,6 +449,13 @@
 
                 string sReturn = "";
                 oCN.BeginTran();
+
+                //閲囪喘鍏ュ簱鍗�  鍒犻櫎 鎾ら攢鍥炲~  閲囪喘璁㈠崟  鍏宠仈鏁伴噺
+                oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID);
+
+                //閲囪喘鍏ュ簱鍗�  鍒犻櫎 鎾ら攢鍥炲~  鏀舵枡閫氱煡鍗�  鍏宠仈鏁伴噺
+                oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID);
+
                 oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                 oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
                 oCN.Commit();
@@ -1175,7 +1210,7 @@
         #endregion
 
 
-        #region 閲囪喘鍏ュ簱鍗� 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栭噰璐叆搴撳崟鏁版嵁
+        #region 閲囪喘鍏ュ簱鍗�  鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栭噰璐叆搴撳崟鏁版嵁
         [Route("Kf_POStockInBill/loadKf_POStockInBill_Push")]
         [HttpGet]
         public object loadKf_POStockInBill_Push(long HInterID, long HSubID)

--
Gitblit v1.9.1