From 66350933608690dd01c29c2268c16a2b99835d97 Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期五, 02 七月 2021 14:28:12 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-API

---
 WebAPI/Controllers/BLL/Xt_BillTypeController.cs |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 189 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/BLL/Xt_BillTypeController.cs b/WebAPI/Controllers/BLL/Xt_BillTypeController.cs
index da26d8d..e65305a 100644
--- a/WebAPI/Controllers/BLL/Xt_BillTypeController.cs
+++ b/WebAPI/Controllers/BLL/Xt_BillTypeController.cs
@@ -67,6 +67,195 @@
         }
 
 
+        /// <summary>
+        /// 鍗曟嵁绫诲瀷鍒楄〃淇敼鏂规硶
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_BillType/xg")]
+        [HttpGet]
+        public object xg(long HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from Xt_BillType where HItemID=" + HInterID, "Xt_BillType");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_BillType/GetMAXBillID")]
+        [HttpGet]
+        public object GetMAXBillID()
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Xt_BillType", "Xt_BillType");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_BillType/AddBill1")]
+        [HttpPost]
+        public object AddBill1([FromBody] JObject oMain)
+        {
+
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                string msg3 = sArray[1].ToString();
+                string msg4 = sArray[2].ToString();
+                string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<BillType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BillType>>(msg2);
+
+                long HItemID = int.Parse(msg3);
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HTemplate = list[0].HTemplate;
+                string HHeadTable = list[0].HHeadTable;
+                string HEntryTable = list[0].HEntryTable;
+                string HViewName = list[0].HViewName;
+                string HRightName = list[0].HRightName;
+
+
+               
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Update Xt_BillType set " +
+                    " HNumber='" + HNumber + "'" +
+                    ",HName='" + HName + "'" +
+                    ",HTemplate='" + HTemplate + "'" +
+                    ",HHeadTable='" + HHeadTable + "'" +
+                    ",HEntryTable='" + HEntryTable + "'" +
+                    ",HViewName='" + HViewName + "'" +
+                    ",HRightName= '" + HRightName + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼瀛愰」鐩唬鐮�
+                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+                //灏嗕笂绾� 涓洪潪鏈骇
+                //
+                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.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+
+        /// <summary>
+        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_BillType/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject oMain)
+        {
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                //鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
+
+
+
+                List<BillType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BillType>>(msg1);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HTemplate = list[0].HTemplate;
+                string HHeadTable = list[0].HHeadTable;
+                string HEntryTable = list[0].HEntryTable;
+                string HViewName = list[0].HViewName;
+                string HRightName = list[0].HRightName;
+
+
+
+
+
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Insert Into Xt_BillType " +
+                "(HNumber,HName,HTemplate,HHeadTable" +
+                ",HEntryTable,HViewName,HRightName" +
+                ") " +
+                " values('" + HNumber + "','" + HName + "','" + HTemplate + "','" + HHeadTable + "'" +
+                ",'" + HEntryTable + "','" + HViewName + "','" + HRightName + "'" +
+              ") ");
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                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.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
 
         //
     }

--
Gitblit v1.9.1