From 16bb2f7b48cf2c3cfbb6a026c265d4e52d22eca4 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期六, 29 十月 2022 17:11:14 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs |  150 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 134 insertions(+), 16 deletions(-)

diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
index fda1b9d..826c8ef 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using Pub_Class;
 using System;
 using System.Collections;
@@ -19,33 +20,24 @@
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
 
-
         /// <summary>
-        /// 杩斿洖閿�鍞鍗曞垪琛�
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
         ///鍙傛暟锛歴tring sql銆�
         ///杩斿洖鍊硷細object銆�
         /// </summary>
-        [Route("Xs_SeOrderBill/list")]
+        [Route("Xs_SeOrderBill/cx")]
         [HttpGet]
-        public object list(string sWhere)
+        public object cx(long HInterID)
         {
             try
             {
-                if (sWhere == null || sWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList " + sWhere, "h_v_IF_SeOrderBillList");
-                }
-                else
-                {
-                    string sql1 = "select * from h_v_IF_SeOrderBillList where 1 = 1 ";
-                    string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_IF_SeOrderBillList");
-                }
+
+                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where HitemID=" + HInterID, "h_v_IF_SeOrderBillList");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.Message = "false锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -67,7 +59,133 @@
                 return objJsonResult;
             }
         }
+        /// <summary>
+        /// 杩斿洖閿�鍞鍗曞垪琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xs_SeOrderBill/list")]
+        [HttpGet]
+        public object list(string sWhere,string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏌ヨ鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList order by hmainid desc", "h_v_IF_SeOrderBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_IF_SeOrderBillList where 1 = 1 ";
+                    string sql = sql1 + sWhere+ " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_IF_SeOrderBillList");
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                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>
+        /// 杩斿洖閿�鍞鍗曞姩鎬佸垪琛�
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        [Route("Xs_SeOrderBill/DyColList")]
+        [HttpGet]
+        public object DyColList(string sWhere, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏌ヨ鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_IF_SeOrderBillList");
+                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 = "1";
+                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;
+            }
+        }
+
+        /// <summary>
+        ///鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("Xs_SeOrderBill/DeltetSeOrderBill")]
+        [HttpGet]
+        public object DeltetSeOrderBill(string HInterID)
+        {
+            try
+            {
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Xs_SeOrderBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Xs_SeOrderBillSub 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;
+            }
+        }
 
 
         //

--
Gitblit v1.9.1