From ba927b1faad68ab38d053ee9ea9eeac4b1a5531b Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期一, 09 三月 2026 08:23:10 +0800
Subject: [PATCH] resolve merge conflicts: keep theirs for all binary files

---
 WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs |  203 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 187 insertions(+), 16 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
index bdf580d..839a384 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
@@ -19,13 +19,23 @@
         public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
         DataSet ds;
 
-        #region 宸ュ簭娲惧伐鍗曞垪琛�
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍒楄〃
         [Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillList")]
         [HttpGet]
         public object Sc_ProcExchSendWorkBillList(string sWhere, string user)
         {
             try
             {
+                //鍒ゆ柇鏄惁鏈夋潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 List<object> columnNameList = new List<object>();               
 
                 string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillList where 1 = 1  ";
@@ -59,7 +69,47 @@
         }
         #endregion
 
-        #region 宸ュ簭娲惧伐鍗曞垪琛�(鑱屽憳鏌ョ湅鑷繁浠诲姟)
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟缂栬緫鍥炴樉
+        [Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillEdit")]
+        [HttpGet]
+        public object Sc_ProcExchSendWorkBillEdit(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillEdit where 1 = 1  ";
+                string sql = sql1 + sWhere + " order by hmainid desc";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcExchSendWorkBillEdit");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍒楄〃(鑱屽憳鏌ョ湅鑷繁浠诲姟)
         [Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillListByEmp")]
         [HttpGet]
         public object Sc_ProcExchSendWorkBillListByEmp(string sWhere, string user,int HEmpID)
@@ -98,6 +148,110 @@
         }
         #endregion
 
+        #region 宸ュ簭娴佽浆鍗℃淳宸� 鍒犻櫎锛堝瓙琛級鐢ㄤ簬鍙栨秷娲惧崟
+        [Route("Sc_ProcExchSendWorkBill/DelProcessSendWork_Sec")]
+        [HttpGet]
+        public object DelProcessSendWork_Sec(string HInterID, string HEntryID, string User)
+        {
+            try
+            {
+    
+                ds = oCN.RunProcReturn("select a.* from Sc_ProcExchSendWorkBillMain a left join Sc_ProcExchSendWorkBillSub b on b.HInterID= a.HInterID where 1=1 and a.HInterID=" + HInterID, "Sc_ProcExchSendWorkBillMain");
+
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "1"&& ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍒犻櫎鍓嶆帶鍒�=========================================      
+                    string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+                    string sql1 = "exec h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + User + "'";
+                    DataSet ds1 = oCN.RunProcReturn(sql1, "h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl");
+                    if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //==================================================================================      
+                    oCN.BeginTran();//寮�鍚簨鍔�
+
+                    if (ds.Tables[0].Rows.Count == 1)
+                    {
+                        oCN.RunProc($"delete from Sc_ProcExchSendWorkBillMain where HInterID={HInterID}");
+                    }
+                    oCN.RunProc($"delete from Sc_ProcExchSendWorkBillSub where HInterID={HInterID} and HEntryID={HEntryID}");
+
+                    //鍒犻櫎鍚庢帶鍒�=========================================      
+                    string sql2 = "exec h_p_Sc_ProcExchSendWorkBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + User + "'";
+                    DataSet ds2 = oCN.RunProcReturn(sql2, "h_p_Sc_ProcExchSendWorkBill_AfterDelCtrl");
+                    if (ds2 == null || ds2.Tables.Count == 0 || ds2.Tables[0].Rows.Count == 0)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    if (ds2.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds2.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //==================================================================================  
+
+
+                    oCN.Commit();//缁撴潫浜嬪姟
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "褰撳墠鍗曟嵁涓嶅瓨鍦�,鏃犳硶鍒犻櫎锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();//鍥炴粴浜嬪姟
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
         #region 娲惧伐骞冲彴鏌ヨ宸ュ簭娴佽浆鍗℃暟鎹�
         [Route("Sc_ProcExchSendWorkBill/Sc_ProcessExchangeHEmpList")]
         [HttpGet]
@@ -110,7 +264,7 @@
                 List<object> columnNameList = new List<object>();
                 //寰楀埌淇℃伅锛堝澶栨爣璁颁负0鏃讹紝娴佽浆鏍囪涓�1鏃讹級
                 //ds = oCN.RunProcReturn("select  * from h_v_Sc_ProcessExchangeBillList_Sec  where 涓嬮亾娴佽浆宸ュ簭<>'杞�' and 濮斿鏍囪=0 and 娴佽浆鏍囪=1  and 宸ュ簭鍙�='" + sProcNo + "' and 搴忓垪鍙�='" + HSEQNumber + "'", "h_v_Sc_ProcessExchangeBillList_Sec");
-                ds = oCN.RunProcReturn("select  * from h_v_Sc_ProcessExchangeArrangementHEmpList  where 1=1 " + sWhere, "h_v_Sc_ProcessExchangeArrangementHEmpList");
+                ds = oCN.RunProcReturn("select Top 1000 * from h_v_Sc_ProcessExchangeArrangementHEmpList  where 1=1 " + sWhere, "h_v_Sc_ProcessExchangeArrangementHEmpList");
 
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -166,9 +320,9 @@
         }
         #endregion
 
-        #region 宸ュ簭娲惧伐鍗� 淇濆瓨/缂栬緫
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟 淇濆瓨/缂栬緫
         /// <summary>
-        /// 宸ュ簭娲惧伐鍗� 淇濆瓨
+        /// 宸ュ簭娴佽浆鍗℃淳宸ュ崟 淇濆瓨
         /// </summary>
         /// <param name="msg"></param>
         /// <returns></returns>
@@ -182,7 +336,17 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
 
+            //鍒ゆ柇鏄惁鏈夋潈闄�
+            if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Edit", 1, false, msg5))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳潈闄愪繚瀛�!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
 
             string UserName = "";
             ListModels oListModels = new ListModels();
@@ -231,10 +395,6 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = oItemSub.HSourceInterID;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = oItemSub.HSourceEntryID;   //婧愬崟瀛愬唴鐮�
-                    oItemSub.HSourceBillNo = oItemSub.HSourceBillNo;  //婧愬崟鍗曞彿
-                    oItemSub.HSourceBillType = oItemSub.HSourceBillType; //婧愬崟绫诲瀷
                     oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
             
                     oBill.DetailColl.Add(oItemSub);
@@ -280,13 +440,24 @@
         }
         #endregion
 
-        //#region 宸ュ簭娲惧伐鍗� 鍒犻櫎
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟 鍒犻櫎
         [Route("Sc_ProcExchSendWorkBill/DelProcessSendWork")]
         [HttpGet]
         public object DelProcessSendWork(string HInterID, string user)
         {
             Int64 lngBillKey = 0;
             lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+
+            //鍒ゆ柇鏄惁鏈夋潈闄�
+            if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Delete", 1, false, user))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳潈闄愬垹闄�!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
             if (lngBillKey == 0)
             {
                 objJsonResult.code = "0";
@@ -368,17 +539,17 @@
                 return objJsonResult;
             }
         }
-        //#endregion
+        #endregion
 
-        #region 宸ュ簭娲惧伐鍗曞鏍�/鍙嶅鏍稿姛鑳�
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟瀹℃牳/鍙嶅鏍稿姛鑳�
         [Route("Sc_ProcExchSendWorkBill/CheckSc_ProcExchSendWorkBill")]
         [HttpGet]
         public object CheckSc_ProcExchSendWorkBill(string HInterID, int Type, string user)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Check", 1, false, user))
+                //鍒ゆ柇鏄惁鏈夋潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Check", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -535,7 +706,7 @@
         }
         #endregion
 
-        #region 宸ュ簭娲惧伐鍗曞叧闂�/鍙嶅叧闂姛鑳�
+        #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍏抽棴/鍙嶅叧闂姛鑳�
         [Route("Sc_ProcExchSendWorkBill/CloseSc_ProcExchSendWorkBill")]
         [HttpGet]
         public object CloseSc_ProcExchSendWorkBill(string HInterID, int Type, string user)
@@ -543,7 +714,7 @@
             try
             {
                 //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Close", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Close", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;

--
Gitblit v1.9.1