From d7b5be548fa11bb06aa98c5c9fb43c9702646298 Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期二, 16 十一月 2021 16:57:59 +0800
Subject: [PATCH] 新增采购入库单,销售订单

---
 WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs       |  112 ++++++++++++++++++++++
 WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs       |   30 ++++++
 WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs         |   68 +++++++++++++
 WebAPI/WebAPI.csproj                                        |    1 
 WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs |   74 +++++++-------
 5 files changed, 248 insertions(+), 37 deletions(-)

diff --git a/WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs b/WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
index 57200ba..ea8839f 100644
--- a/WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
@@ -234,6 +234,36 @@
                 return objJsonResult;
             }
         }
+        /// <summary>
+        ///鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("Cg_POInStockBill/DeltetPOInStockBill")]
+        [HttpGet]
+        public object DeltetPOInStockBill(string HInterID)
+        {
+            try
+            {
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Cg_POInStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Cg_POInStockBillSub 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;
+            }
+        }
 
 
         //
diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
new file mode 100644
index 0000000..1e37d71
--- /dev/null
+++ b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
@@ -0,0 +1,112 @@
+锘縰sing Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers
+{
+    //閲囪喘鍏ュ簱鍗旵ontroller
+    public class Kf_POStockInBillController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+        /// <summary>
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Kf_POStockInBill/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where HitemID=" + HInterID, "h_v_Kf_POStockInBillList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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>
+        /// 杩斿洖鏀舵枡閫氱煡鍗曞垪琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Kf_POStockInBill/list")]
+        [HttpGet]
+        public object list(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList " + sWhere, "h_v_Kf_POStockInBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Kf_POStockInBillList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Kf_POStockInBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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;
+            }
+        }
+
+        //
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
index b3372e0..4c75105 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
@@ -988,44 +988,44 @@
         #endregion
 
 
-        /// <summary>
-        /// 閲囪喘鍏ュ簱鍗曞垪琛�
-        /// </summary>
-        /// <returns></returns>
-        [Route("Kf_POStockInBill/GetPOStockInBill")]
-        [HttpGet]
-        public object GetPOStockInBill(string sWhere)
-        {
-            try
-            {
+        ///// <summary>
+        ///// 閲囪喘鍏ュ簱鍗曞垪琛�
+        ///// </summary>
+        ///// <returns></returns>
+        //[Route("Kf_POStockInBill/GetPOStockInBill")]
+        //[HttpGet]
+        //public object GetPOStockInBill(string sWhere)
+        //{
+        //    try
+        //    {
 
-                ds = Sc_GetPOStockInBill(sWhere);
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
-            }
-            catch (Exception ex)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
+        //        ds = Sc_GetPOStockInBill(sWhere);
+        //        if (ds == null || ds.Tables[0].Rows.Count <= 0)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "1";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+        //            objJsonResult.data = ds.Tables[0];
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
 
         #region sql璇彞
 
diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
index fda1b9d..266338f 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -19,7 +19,45 @@
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
 
+        /// <summary>
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xs_SeOrderBill/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
 
+                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 = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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>
         /// 杩斿洖閿�鍞鍗曞垪琛�
         ///鍙傛暟锛歴tring sql銆�
@@ -68,6 +106,36 @@
             }
         }
 
+        /// <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;
+            }
+        }
 
 
         //
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 0a09079..572e94a 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -319,6 +319,7 @@
     <Compile Include="Controllers\BLL\Xt_UserController.cs" />
     <Compile Include="Controllers\BLL\Xt_SystemLogController.cs" />
     <Compile Include="Controllers\CellWidthController.cs" />
+    <Compile Include="Controllers\CGGL\Kf_POStockInBillController.cs" />
     <Compile Include="Controllers\CGGL\Cg_POOrderBillController.cs" />
     <Compile Include="Controllers\CGGL\WW_EntrustOrderBillController.cs" />
     <Compile Include="Controllers\CGGL\Cg_POInStockBillController.cs" />

--
Gitblit v1.9.1