From 8d606bb3fa760353e8a8ddd147085a355682ac51 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 29 三月 2021 17:16:35 +0800
Subject: [PATCH] 新增模治具控制器

---
 WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs |  590 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 WebAPI/WebAPI.csproj                                        |    1 
 2 files changed, 591 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
new file mode 100644
index 0000000..e0e865e
--- /dev/null
+++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
@@ -0,0 +1,590 @@
+锘縰sing Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Web.Http;
+using WebAPI.Models;
+namespace WebAPI.Controllers
+{
+    /**
+     * 鎵捐揣鍗曞崟
+     */
+    public class Sc_CheckToolsRepairWorkBillController : ApiController
+    {
+        private json objJsonResult = new json();
+        public DataSet ds = new DataSet();
+        public WebServer webserver = new WebServer();
+
+        /// <summary>
+        /// 鏍规嵁鍖呰鍗� 杩斿洖姝ゅ寘瑁呭崟鍐呯殑鐩稿叧淇℃伅
+        /// </summary>
+        /// <returns></returns>
+
+        /// <summary>
+        /// 妫�鍏风淮淇伐鍗曞垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_CheckToolsRepair/GetCheckToolsRepairWorkBillList")]
+        [HttpGet]
+        public object GetCheckToolsRepairWorkBillList(string sWhere)
+        {
+            try
+            {
+                
+                    ds = Sc_CheckToolsRepairWorkBillList_s(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璇彞
+
+      
+        public static DataSet Sc_CheckToolsRepairWorkBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsRepairWorkBillList ", "h_v_Sc_CheckToolsRepairWorkBillList");
+        }
+
+
+        /// <summary>
+        /// 妫�鍏风偣妫�璁″垝琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_CheckToolsDotCheckPlan/GetCheckToolsDotCheckPlanBillList")]
+        [HttpGet]
+        public object GetCheckToolsDotCheckPlanBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_CheckToolsDotCheckPlanBillList_s(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璇彞
+
+
+        public static DataSet Sc_CheckToolsDotCheckPlanBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsDotCheckPlanBillList ", "h_v_Sc_CheckToolsDotCheckPlanBillList");
+        }
+        #endregion
+
+        /// <summary>
+        /// 妫�鍏蜂繚鍏昏褰曡〃鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_CheckToolsMaintainBill/GetCheckToolsMaintainBillList")]
+        [HttpGet]
+        public object GetCheckToolsMaintainBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_CheckToolsMaintainBillList_s(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璇彞
+
+
+        public static DataSet Sc_CheckToolsMaintainBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsMaintainBillList ", "h_v_Sc_CheckToolsMaintainBillList");
+        }
+        #endregion
+
+        /// <summary>
+        /// 妯″叿淇濆吇璁板綍琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldMaintainBill/GetMouldMaintainBillList")]
+        [HttpGet]
+        public object GetMouldMaintainBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldMaintainBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldMaintainBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList");
+        }
+        #endregion
+
+
+
+        /// <summary>
+        /// 妯″叿鐐规璁″垝琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldDotCheckPlanBill/GetMouldDotCheckPlanBillList")]
+        [HttpGet]
+        public object GetMouldDotCheckPlanBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldDotCheckPlanBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldDotCheckPlanBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckPlanBillList ", "h_v_Sc_MouldDotCheckPlanBillList");
+        }
+        #endregion
+
+        /// <summary>
+        /// 妯″叿鐐规璁板綍琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldDotCheckBill/GetMouldDotCheckBillList")]
+        [HttpGet]
+        public object GetMouldDotCheckBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldDotCheckBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldDotCheckBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList ", "h_v_Sc_MouldDotCheckBillList");
+        }
+        #endregion
+
+
+        /// <summary>
+        /// 妫�鍏蜂繚鍏昏鍒掕〃鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_CheckToolsMaintainPlanBill/GetCheckToolsMaintainPlanBillList")]
+        [HttpGet]
+        public object GetCheckToolsMaintainPlanBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_CheckToolsMaintainPlanBillList_s(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璇彞
+
+
+        public static DataSet Sc_CheckToolsMaintainPlanBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsMaintainPlanBillList ", "h_v_Sc_CheckToolsMaintainPlanBillList");
+        }
+        #endregion
+
+
+        /// <summary>
+        /// 妯″叿淇濆吇璁″垝琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldMaintainPlanBill/GetMouldMaintainPlanBillList")]
+        [HttpGet]
+        public object GetMouldMaintainPlanBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldMaintainPlanBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList ", "h_v_Sc_MouldMaintainPlanBillList");
+        }
+        #endregion
+
+
+        /// <summary>
+        /// 妯″叿鏁呴殰鐧昏琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldConkBookBill/GetMouldConkBookBillList")]
+        [HttpGet]
+        public object GetMouldConkBookBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldConkBookBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldConkBookBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList ", "h_v_Sc_MouldConkBookBillList");
+        }
+        #endregion
+
+
+
+        /// <summary>
+        /// 妯″叿鏁呴殰鐧昏琛ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList")]
+        [HttpGet]
+        public object GetMouldRepairCheckBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_MouldRepairCheckBillList_s(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璇彞
+
+
+        public static DataSet Sc_MouldRepairCheckBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList ", "h_v_Sc_MouldRepairCheckBillList");
+        }
+        #endregion
+
+        /// <summary>
+        /// 妫�鍏风淮淇獙鏀跺崟鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_CheckToolsRepairCheckBill/GetCheckToolsRepairCheckBillList")]
+        [HttpGet]
+        public object GetCheckToolsRepairCheckBillList(string sWhere)
+        {
+            try
+            {
+
+                ds = Sc_CheckToolsRepairCheckBillList_s(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璇彞
+
+
+        public static DataSet Sc_CheckToolsRepairCheckBillList_s(string sWhere)
+        {
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsRepairCheckBillList ", "h_v_Sc_CheckToolsRepairCheckBillList");
+        }
+        #endregion
+
+
+        //娴嬭瘯涓撶敤鎺ュ彛
+        [Route("LookingFor/Test")]
+        [HttpGet]
+        public object Test(string HbillNo)//Sc_CheckToolsRepair/GetCheckToolsRepairWorkBillList
+        {
+            DataSet ds;
+            ds = new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_Xs_SellOutFindSP '" + HbillNo + "'", "h_p_Xs_SellOutFindSP");
+
+            if (Pub_Class.ClsPub.isLong(ds.Tables[0].Rows.Count) >= 0 )
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "true锛�";
+                objJsonResult.data = ds.Tables[0];//ds.Tables[0].Rows[1][0]
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "false锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+
+
+        #endregion
+
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 91ea893..b1a5a6e 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -331,6 +331,7 @@
     <Compile Include="Controllers\NewApiController.cs" />
     <Compile Include="Controllers\SCGL\Sc_ICMOReportBillController.cs" />
     <Compile Include="Controllers\SCGL\Sc_PPBomBillController.cs" />
+    <Compile Include="Controllers\Sc_CheckToolsRepairWorkBillController.cs" />
     <Compile Include="Dapper\SqlHelper.cs" />
     <Compile Include="Dapper\SqlPools.cs" />
     <Compile Include="DbUntil\DataFormatUntil.cs" />

--
Gitblit v1.9.1