From 73a6057fdbbd5f632e84ef85c799579ecacc0119 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期六, 18 六月 2022 23:08:19 +0800
Subject: [PATCH] 设备清单控制器接口定义

---
 VueWebApi/VueWebApi.csproj                       |    3 
 VueWebApi/VueWebApi.csproj.user                  |    2 
 VueWebApi/Controllers/DeviceManagerController.cs |  146 +++++++++++++++++++++++++++++
 VueWebApi/DLL/BLL/DeviceManagerBLL.cs            |   56 +++++++++++
 .vs/VueWebApi/v16/.suo                           |    0 
 VueWebApi/DLL/DAL/DeviceManagerDAL.cs            |   55 +++++++++++
 6 files changed, 261 insertions(+), 1 deletions(-)

diff --git a/.vs/VueWebApi/v16/.suo b/.vs/VueWebApi/v16/.suo
index c907b1d..46b28f2 100644
--- a/.vs/VueWebApi/v16/.suo
+++ b/.vs/VueWebApi/v16/.suo
Binary files differ
diff --git a/VueWebApi/Controllers/DeviceManagerController.cs b/VueWebApi/Controllers/DeviceManagerController.cs
new file mode 100644
index 0000000..bd92ed0
--- /dev/null
+++ b/VueWebApi/Controllers/DeviceManagerController.cs
@@ -0,0 +1,146 @@
+锘縰sing Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web;
+using System.Web.Http;
+using VueWebApi.DLL.BLL;
+using VueWebApi.Tools;
+
+namespace VueWebApi.Controllers
+{
+    [RoutePrefix(prefix: "api/BasicSetting")]
+    [ControllerGroup("璁惧绠$悊", "鍦ㄧ嚎鎺ュ彛")]
+    public class DeviceManagerController : ApiController
+    {
+        //瀹氫箟鍏ㄥ眬淇℃伅杩斿洖鍙橀噺
+        ToMessage mes = new ToMessage();
+        RedisHelper redis = new RedisHelper();
+
+        #region[璁惧绫诲瀷鏌ヨ]
+        /// <summary>
+        /// 璁惧绫诲瀷鏌ヨ
+        /// </summary>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "DeviceTypeSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceTypeSearch(int page = 0, int rows = 0, string prop = null, string order = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = DeviceManagerBLL.DeviceTypeSearch(startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鏂板]
+        /// <summary>
+        /// 璁惧绫诲瀷鏂板
+        /// </summary>
+        /// <param name="obj">鎻愪氦鏁版嵁瀵硅薄</param>
+        /// <returns></returns>
+        [Route(template: "AddUpdateDeviceType")]
+        [HttpPost]
+        public HttpResponseMessage AddUpdateDeviceType([FromBody] JObject obj)
+        {
+            //string deviceid = obj["id"].ToString();    //璁惧绫诲瀷id(涓婚敭)
+            string devicetypecode = obj["devicetypecode"].ToString(); //璁惧绫诲瀷缂栫爜
+            string devicetypename = obj["devicetypename"].ToString(); //璁惧绫诲瀷鍚嶇О
+            string devicetypedescipt = obj["devicetypedescipt"].ToString(); //璁惧绫诲瀷鎻忚堪
+            var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString();
+            mes = DeviceManagerBLL.AddUpdateDeviceType(devicetypecode, devicetypename, devicetypedescipt, usercode);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鍒犻櫎]
+        /// <summary>
+        /// 璁惧绫诲瀷鍒犻櫎
+        /// </summary>
+        /// <param name="devicetypeid">璁惧绫诲瀷ID</param>
+        /// <returns></returns>
+        [Route(template: "DeleteDeviceType")]
+        [HttpPost]
+        public HttpResponseMessage DeleteDeviceType(string devicetypeid)
+        {
+            mes = DeviceManagerBLL.DeleteDeviceType(devicetypeid);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+
+
+        #region[璁惧娓呭崟鏌ヨ]
+        /// <summary>
+        /// 璁惧娓呭崟鏌ヨ
+        /// </summary>
+        /// <param name="DeviceCode">璁惧缂栫爜</param>
+        /// <param name="DeviceName">璁惧鍚嶇О</param>
+        /// <param name="Status">浣跨敤鐘舵��</param>
+        /// <param name="WorkShop">鎵�灞炶溅闂�</param>
+        /// <param name="DeviceType">璁惧绫诲瀷</param>
+        /// <param name="DeviceGroup">璁惧缁�</param>
+        /// <param name="page">椤电爜</param>
+        /// <param name="rows">姣忛〉鏄剧ず鏉℃暟</param>
+        /// <param name="prop">鎺掑簭瀛楁</param>
+        /// <param name="order">鎺掑簭瑙勫垯</param>
+        /// <returns></returns>
+        [Route(template: "DeviceMangerSearch")]
+        [HttpGet]
+        public HttpResponseMessage DeviceMangerSearch(string DeviceCode = null, string DeviceName = null, string Status = null, string WorkShop = null,string DeviceType=null,string DeviceGroup=null,int page = 0, int rows = 0, string prop = null, string order = null)
+        {
+            int startNum = rows * (page - 1) + 1;  //璧峰璁板綍rowNum
+            int endNum = rows * page;   //缁撴潫璁板綍 rowNum
+            mes = DeviceManagerBLL.DeviceMangerSearch(DeviceCode, DeviceName, Status, WorkShop, DeviceType, DeviceGroup, startNum, endNum, prop, order);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鏂板缂栬緫]
+        /// <summary>
+        /// 璁惧娓呭崟鏂板缂栬緫
+        /// </summary>
+        /// <param name="obj">鎻愪氦鏁版嵁瀵硅薄</param>
+        /// <returns></returns>
+        [Route(template: "AddUpdateDeviceManger")]
+        [HttpPost]
+        public HttpResponseMessage AddUpdateDeviceManger([FromBody] JObject obj)
+        {
+            string deviceid = obj["id"].ToString();    //璁惧娓呭崟id(涓婚敭)
+            string devicecode = obj["devicecode"].ToString(); //璁惧缂栫爜
+            string devicename = obj["devicename"].ToString(); //璁惧鍚嶇О
+            string devicetype = obj["devicetype"].ToString(); //璁惧绫诲瀷
+            string devicegroup = obj["devicegroup"].ToString(); //璁惧缁�
+            string importdate = obj["importdate"].ToString(); //鎶曞叆鏃ユ湡
+            string workshop = obj["workshop"].ToString(); //鎵�灞炶溅闂�
+            string status = obj["status"].ToString(); //浣跨敤鐘舵��
+            string ratio = obj["ratio"].ToString(); //绋煎姩鐜�
+            var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString();
+            string OperType = obj["OperType"].ToString();  //鎿嶄綔绫诲瀷
+            mes = DeviceManagerBLL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, status, ratio, usercode, OperType);
+            return TJson.toJson(mes);
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鍒犻櫎]
+        /// <summary>
+        /// 璁惧娓呭崟鍒犻櫎
+        /// </summary>
+        /// <param name="deviceid">璁惧ID</param>
+        /// <returns></returns>
+        [Route(template: "DeleteDeviceManger")]
+        [HttpPost]
+        public HttpResponseMessage DeleteDeviceManger(string deviceid)
+        {
+            mes = DeviceManagerBLL.DeleteDeviceManger(deviceid);
+            return TJson.toJson(mes);
+        }
+        #endregion
+    }
+}
diff --git a/VueWebApi/DLL/BLL/DeviceManagerBLL.cs b/VueWebApi/DLL/BLL/DeviceManagerBLL.cs
new file mode 100644
index 0000000..75fd244
--- /dev/null
+++ b/VueWebApi/DLL/BLL/DeviceManagerBLL.cs
@@ -0,0 +1,56 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using VueWebApi.DLL.DAL;
+using VueWebApi.Tools;
+
+namespace VueWebApi.DLL.BLL
+{
+    public class DeviceManagerBLL
+    {
+        #region[璁惧绫诲瀷鏌ヨ]
+        public static ToMessage DeviceTypeSearch(int startNum, int endNum, string prop, string order)
+        {
+            return DeviceManagerDAL.DeviceTypeSearch(startNum, endNum, prop, order);
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鏂板]
+        public static ToMessage AddUpdateDeviceType(string devicetypecode, string devicetypename, string devicetypedescipt, string usercode)
+        {
+            return DeviceManagerDAL.AddUpdateDeviceType(devicetypecode, devicetypename, devicetypedescipt, usercode);
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鍒犻櫎]
+        public static ToMessage DeleteDeviceType(string devicetypeid)
+        {
+            return DeviceManagerDAL.DeleteDeviceType(devicetypeid);
+        }
+        #endregion
+
+
+
+        #region [璁惧娓呭崟鏌ヨ]
+        public static ToMessage DeviceMangerSearch(string deviceCode, string deviceName, string status, string workShop, string deviceType, string deviceGroup, int startNum, int endNum, string prop, string order)
+        {
+            return DeviceManagerDAL.DeviceMangerSearch(deviceCode, deviceName, status, workShop, deviceType, deviceGroup, startNum, endNum, prop, order);
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鏂板缂栬緫]
+        public static ToMessage AddUpdateDeviceManger(string deviceid, string devicecode, string devicename, string devicetype, string devicegroup, string importdate, string workshop, string status, string ratio, string usercode, string operType)
+        {
+            return DeviceManagerDAL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, status, ratio, usercode, operType);
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鍒犻櫎]
+        public static ToMessage DeleteDeviceManger(string deviceid)
+        {
+            return DeviceManagerDAL.DeleteDeviceManger(deviceid);
+        }
+        #endregion
+    }
+}
\ No newline at end of file
diff --git a/VueWebApi/DLL/DAL/DeviceManagerDAL.cs b/VueWebApi/DLL/DAL/DeviceManagerDAL.cs
new file mode 100644
index 0000000..2dce225
--- /dev/null
+++ b/VueWebApi/DLL/DAL/DeviceManagerDAL.cs
@@ -0,0 +1,55 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using VueWebApi.Tools;
+
+namespace VueWebApi.DLL.DAL
+{
+    public class DeviceManagerDAL
+    {
+        #region[璁惧绫诲瀷鏌ヨ]
+        public static ToMessage DeviceTypeSearch(int startNum, int endNum, string prop, string order)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鏂板]
+        public static ToMessage AddUpdateDeviceType(string devicetypecode, string devicetypename, string devicetypedescipt, string usercode)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+
+        #region[璁惧绫诲瀷鍒犻櫎]
+        public static ToMessage DeleteDeviceType(string devicetypeid)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+
+
+
+        #region [璁惧娓呭崟鏌ヨ]
+        public static ToMessage DeviceMangerSearch(string deviceCode, string deviceName, string status, string workShop, string deviceType, string deviceGroup, int startNum, int endNum, string prop, string order)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鏂板缂栬緫]
+        public static ToMessage AddUpdateDeviceManger(string deviceid, string devicecode, string devicename, string devicetype, string devicegroup, string importdate, string workshop, string status, string ratio, string usercode, string operType)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+
+        #region[璁惧娓呭崟鍒犻櫎]
+        public static ToMessage DeleteDeviceManger(string deviceid)
+        {
+            throw new NotImplementedException();
+        }
+        #endregion
+    }
+}
\ No newline at end of file
diff --git a/VueWebApi/VueWebApi.csproj b/VueWebApi/VueWebApi.csproj
index 2894723..a45c8e2 100644
--- a/VueWebApi/VueWebApi.csproj
+++ b/VueWebApi/VueWebApi.csproj
@@ -252,16 +252,19 @@
     <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
     <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
     <Compile Include="Controllers\BasicSettingController.cs" />
+    <Compile Include="Controllers\DeviceManagerController.cs" />
     <Compile Include="Controllers\ImportExcelController.cs" />
     <Compile Include="Controllers\LoginController.cs" />
     <Compile Include="Controllers\SystemSettingController.cs" />
     <Compile Include="Controllers\ValuesController.cs" />
     <Compile Include="DLL\BLL\BasicSettingBLL.cs" />
+    <Compile Include="DLL\BLL\DeviceManagerBLL.cs" />
     <Compile Include="DLL\BLL\ExcelCheckBLL.cs" />
     <Compile Include="DLL\BLL\LoginBLL.cs" />
     <Compile Include="DLL\BLL\SystemSettingBLL.cs" />
     <Compile Include="DLL\BLL\UserDataBLL.cs" />
     <Compile Include="DLL\DAL\BasicSettingDAL.cs" />
+    <Compile Include="DLL\DAL\DeviceManagerDAL.cs" />
     <Compile Include="DLL\DAL\ExcelCheckDAL.cs" />
     <Compile Include="DLL\DAL\LoginDAL.cs" />
     <Compile Include="DLL\DAL\SystemSettingDAL.cs" />
diff --git a/VueWebApi/VueWebApi.csproj.user b/VueWebApi/VueWebApi.csproj.user
index 6fa7a36..554daf6 100644
--- a/VueWebApi/VueWebApi.csproj.user
+++ b/VueWebApi/VueWebApi.csproj.user
@@ -8,7 +8,7 @@
     <IISExpressWindowsAuthentication />
     <IISExpressUseClassicPipelineMode />
     <UseGlobalApplicationHostFile />
-    <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
+    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <NameOfLastUsedPublishProfile>D:\鏂板嚡杩狹ES\VueWebApi\VueWebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
     <ProjectView>ShowAllFiles</ProjectView>
     <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>

--
Gitblit v1.9.3