From d971349f30f6a5faae97892a195c99d36465e7b5 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 11 六月 2024 23:40:54 +0800
Subject: [PATCH] 进站单新增优化  进站单保存 控制优化

---
 WebAPI/Controllers/Kf_EntrustInBillController.cs |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 96 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/Kf_EntrustInBillController.cs b/WebAPI/Controllers/Kf_EntrustInBillController.cs
index caf6c18..83ea244 100644
--- a/WebAPI/Controllers/Kf_EntrustInBillController.cs
+++ b/WebAPI/Controllers/Kf_EntrustInBillController.cs
@@ -447,6 +447,89 @@
             }
         }
 
+        #region 濮斿鍔犲伐鍏ュ簱鍗� 鍒犻櫎
+      
+        /// </summary>
+        [Route("Kf_EntrustInBill/DeleteKf_EntrustInBill")]
+        [HttpGet]
+        public object DeleteKf_EntrustInBill(string HInterID, string user)
+        {
+            try
+            {
+                string s = "";
+                DAL.ClsKf_OtherInBill oBill = new DAL.ClsKf_OtherInBill();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Kf_EntrustInBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (HInterID == null || HInterID.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (oBill.ShowBill(long.Parse(HInterID), ref s) == false)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                //鍒ゆ柇鏄惁鍙紪杈�
+                if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽鍒犻櫎锛�";
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }             
+
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                int sYear = 0;
+                int sPeriod = 0;
+                DateTime HDate = DateTime.Now;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.Message = s;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                oCN.RunProc("delete from Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("delete from Kf_ICStockBillSub where HInterID= " + HInterID);
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         #region 濮斿鍔犲伐鍏ュ簱鍗� 瀹℃牳/鍙嶅鏍�
         /// <summary>
@@ -478,6 +561,17 @@
                     objJsonResult.count = 0;
                     objJsonResult.Message = "HInterID涓虹┖锛�";
                     objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                string s = "";
+                int sYear = 0;
+                int sPeriod = 0;
+                DateTime HDate = DateTime.Now;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.Message = s;
                     return objJsonResult;
                 }
 
@@ -525,7 +619,7 @@
                             objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
                             objJsonResult.data = null;
                             return objJsonResult;
-                        }
+                        }                     
                         //瀹℃牳鍗曟嵁
                         if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                         {
@@ -569,6 +663,7 @@
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
+
                         //鍙嶅鏍稿崟鎹�
                         if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                         {

--
Gitblit v1.9.1