From dab190364a9c8b341cfa399ddc2e5d6cb76fb394 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 30 十一月 2022 15:32:26 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 111 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
index 11bf5be..95cceb9 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using Pub_Class;
 using System;
 using System.Collections;
@@ -372,6 +373,53 @@
         //}
         #endregion
 
+
+        #region 宸ュ簭娴佽浆鍗″垪琛ㄦ樉绀哄櫒鍏锋竻鍗曚俊鎭�
+        [Route("Sc_ProcessExchangeBillList/QJQD")]
+        [HttpGet]
+        public object QJQD(Int64 HProcExchHinteID)
+        {
+            try
+            {
+
+                //寰楀埌淇℃伅
+                ds = oCN.RunProcReturn("select  * from h_v_Sc_ProcessExchangeBillQuerySub_Mould  where hmainid= " + HProcExchHinteID , "h_v_Sc_ProcessExchangeBillQuerySub_Mould");
+                //鍐欏叆淇℃伅
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏈煡璇㈠埌鍑虹珯鍗曟槑缁嗕俊鎭紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region[杩斿洖鐢熶骇浠诲姟鍗曟槑缁嗚]
         /// <summary>
         /// 杩斿洖鐢熶骇浠诲姟鍗曟槑缁嗚
@@ -501,7 +549,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql = string.Format(@"select 娴佹按鍙� HProcNo,HProcID,宸ュ簭浠g爜 HProcNumber,宸ュ簭鍚嶇О HProcName,鍔犲伐璇存槑 HWorkRemark,HCenterID,宸ヤ綔涓績浠g爜 HCenterNumber,
                                                 宸ヤ綔涓績 HCenterName,HSupID,渚涘簲鍟嗕唬鐮� HSupNumber,渚涘簲鍟� HSupName,isEntrust,璁″垝鏁伴噺 HQty,鍔犲伐鍗曚环 HOutPrice, 琛ㄤ綋澶囨敞 HRemark,
-                                            杩涚珯鏁伴噺 HRelationQty_In,鍑虹珯鏁伴噺 HRelationQty_Out,濮斿宸ュ崟鏁伴噺 HRelationQty_WWOrder,涓嶅悎鏍兼暟閲� HRelationQty_Bad,瓒呴姣斾緥 HOverRate,
+                                            杩涚珯鍏宠仈鏁伴噺 HRelationQty_In,鍑虹珯鍏宠仈鏁伴噺 HRelationQty_Out,濮斿宸ュ崟鏁伴噺 HRelationQty_WWOrder,涓嶅悎鏍兼暟閲� HRelationQty_Bad,瓒呴姣斾緥 HOverRate,
                                             鑹巼 HPassRate,绱鑹巼 HSumPassRate,鍥剧焊缂栧彿 HPicNum,鏈伐搴忕‘璁よ褰� HProcCheckNote,宸ヨ壓鍙傛暟 HTechnologyParameter,HDeptID,
                                             鍔犲伐杞﹂棿浠g爜 HDeptNumber,鍔犲伐杞﹂棿 HDeptName
                                             from h_v_Sc_ProcessExchangeBillQuerySub");
@@ -529,7 +577,7 @@
         /// <returns></returns>
         [Route("Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID")]
         [HttpGet]
-        public object DeltetProcessExchangeBillByID(string HInterID, string user)
+        public object DeltetProcessExchangeBillByID(string HInterID,int HPRDORGID, string user)
         {
             //缂栬緫鏉冮檺
             if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Drop", 1, false, user))
@@ -552,7 +600,27 @@
                 objJsonResult.data = null;
                 return objJsonResult;
             }
+
+
+            //鍒犻櫎鍓嶅垽鏂叧鑱旀暟閲�
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            DataSet ds;
+            ds = oCn.RunProcReturn("select ct from (  " +
+                          "  select 1 ct from Sc_StationInBillMain Where HProcExchInterID=" + lngBillKey + " " +
+                          "  union all " +
+                          "  select 1 from Sc_StationOutBillMain Where HProcExchInterID=" + lngBillKey + " ) as a  ", "Sc_ProcExchReportSub");
+            if (ds.Tables[0].Rows.Count != 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娴佽浆鍗″凡缁忔湁涓嬫父杩涘嚭绔欏崟鍚庯紝涓嶅厑璁稿垹闄わ紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+
             DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
+            DBUtility.ClsPub.HOrgID = HPRDORGID;
             if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
             {
                 if (oBill.omodel.HBillStatus > 1)
@@ -601,5 +669,45 @@
             }
         }
         #endregion
+
+        #region[缂栬緫鏃惰幏鍙栬〃浣撴暟鎹�(宸ヨ壓鍙傛暟)]
+        [Route("Sc_ProcessExchangeBill/GetProcessExchangeBillSubTech")]
+        [HttpGet]
+        public object GetProcessExchangeBillSubTech(string HInterID)
+        {
+            DataSet ds;
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"exec h_p_Sc_GetProcessExchangeBillSubTech ");
+                ds = oCN.RunProcReturn(sql +  HInterID, "h_p_Sc_GetProcessExchangeBillSubTech");
+
+                //娣诲姞鍒楀悕
+                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 = "0";
+                objJsonResult.count = 1;
+                objJsonResult.list = columnNameList;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1