yl
2022-06-18 73a6057fdbbd5f632e84ef85c799579ecacc0119
设备清单控制器接口定义
已添加3个文件
已修改3个文件
262 ■■■■■ 文件已修改
.vs/VueWebApi/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/Controllers/DeviceManagerController.cs 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/DLL/BLL/DeviceManagerBLL.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/DLL/DAL/DeviceManagerDAL.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/VueWebApi.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/VueWebApi.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/VueWebApi/v16/.suo
Binary files differ
VueWebApi/Controllers/DeviceManagerController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
using 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
    }
}
VueWebApi/DLL/BLL/DeviceManagerBLL.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
using 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
    }
}
VueWebApi/DLL/DAL/DeviceManagerDAL.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,55 @@
using 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
    }
}
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" />
VueWebApi/VueWebApi.csproj.user
@@ -8,7 +8,7 @@
    <IISExpressWindowsAuthentication />
    <IISExpressUseClassicPipelineMode />
    <UseGlobalApplicationHostFile />
    <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <NameOfLastUsedPublishProfile>D:\新凯迪MES\VueWebApi\VueWebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <ProjectView>ShowAllFiles</ProjectView>
    <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>