| | |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using VueWebApi.DLL.BLL; |
| | | using VueWebApi.Models; |
| | | using VueWebApi.Tools; |
| | | |
| | | namespace VueWebApi.Controllers |
| | | { |
| | | [RoutePrefix(prefix: "api/BasicSetting")] |
| | | [RoutePrefix(prefix: "api/DeviceManager")] |
| | | [ControllerGroup("设备管理", "在线接口")] |
| | | [ChannelActionFilter] |
| | | public class DeviceManagerController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | /// <summary> |
| | | /// 设备类型新增 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据对象</param> |
| | | /// <param name="json">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceType([FromBody] JObject obj) |
| | | public HttpResponseMessage AddUpdateDeviceType(List<ObjectDataCont> json) |
| | | { |
| | | //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); |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = DeviceManagerBLL.AddUpdateDeviceType(json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 设备类型删除 |
| | | /// </summary> |
| | | /// <param name="devicetypeid">设备类型ID</param> |
| | | /// <param name="devicetypecode">设备类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceType(string devicetypeid) |
| | | public HttpResponseMessage DeleteDeviceType(string devicetypecode) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceType(devicetypeid); |
| | | mes = DeviceManagerBLL.DeleteDeviceType(devicetypecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备类型下拉框接口] |
| | | /// <summary> |
| | | /// 设备类型下拉框接口 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceTypeSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceTypeSelect() |
| | | { |
| | | try |
| | | { |
| | | mes = DeviceManagerBLL.DeviceTypeSelect(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.Message = e.Message; |
| | | } |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备组查询] |
| | | /// <summary> |
| | | /// 设备组查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceGroupSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceGroupSearch(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.DeviceGroupSearch(startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备组新增] |
| | | /// <summary> |
| | | /// 设备组新增 |
| | | /// </summary> |
| | | /// <param name="json">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceGroup")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceGroup(List<ObjectDataCont> json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = DeviceManagerBLL.AddUpdateDeviceGroup(json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备组删除] |
| | | /// <summary> |
| | | /// 设备组删除 |
| | | /// </summary> |
| | | /// <param name="devicegroupcode">设备组编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceGroup")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceGroup(string devicegroupcode) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceGroup(devicegroupcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备类型查找设备组] |
| | | /// <summary> |
| | | /// 设备类型查找设备组 |
| | | /// </summary> |
| | | /// <param name="eqptypecode">设备类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceTypeSelectGroup")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceTypeSelectGroup(string eqptypecode) |
| | | { |
| | | try |
| | | { |
| | | mes = DeviceManagerBLL.DeviceTypeSelectGroup(eqptypecode); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.Message = e.Message; |
| | | } |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[所属车间下拉接口] |
| | | /// <summary> |
| | | /// 所属车间下拉接口 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | |
| | | [Route(template: "WorkShopSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage WorkShopSelect() |
| | | { |
| | | mes = DeviceManagerBLL.WorkShopSelect(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[所属车间查找所属产线接口] |
| | | /// <summary> |
| | | /// 所属车间查找所属产线接口 |
| | | /// </summary> |
| | | /// <param name="workshopcode">车间编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "WorkShopSelectLine")] |
| | | [HttpGet] |
| | | public HttpResponseMessage WorkShopSelectLine(string workshopcode) |
| | | { |
| | | mes = DeviceManagerBLL.WorkShopSelectLine(workshopcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备清单查询] |
| | | /// <summary> |
| | |
| | | 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 devicetype = obj["devicetypecode"].ToString(); //设备类型编码 |
| | | string devicegroup = obj["devicegroupcode"].ToString(); //设备组编码 |
| | | string importdate = obj["importdate"].ToString(); //投入日期 |
| | | string workshop = obj["workshop"].ToString(); //所属车间 |
| | | string workshop = obj["workshopcode"].ToString(); //所属车间编码 |
| | | string linecode = obj["linecode"].ToString(); //所属产线编码 |
| | | string status = obj["status"].ToString(); //使用状态 |
| | | string ratio = obj["ratio"].ToString(); //稼动率 |
| | | var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString(); |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = DeviceManagerBLL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, status, ratio, usercode, OperType); |
| | | mes = DeviceManagerBLL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, linecode, status, ratio, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 设备清单删除 |
| | | /// </summary> |
| | | /// <param name="deviceid">设备ID</param> |
| | | /// <param name="devicecode">设备编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceManger")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceManger(string deviceid) |
| | | public HttpResponseMessage DeleteDeviceManger(string devicecode) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceManger(deviceid); |
| | | mes = DeviceManagerBLL.DeleteDeviceManger(devicecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[设备点检项列表查询] |
| | | /// <summary> |
| | | /// 设备点检项列表查询 |
| | | /// </summary> |
| | | /// <param name="checkitemcode">点检部位编码</param> |
| | | /// <param name="checkitemname">点检部位名称</param> |
| | | /// <param name="checkdescr">点检要求</param> |
| | | /// <param name="isqrcode">选中扫码</param> |
| | | /// <param name="cycle">点检周期</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckItemSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckItemSearch(int page, int rows, string prop,string order,string checkitemcode = null, string checkitemname = null, string checkdescr = null, string isqrcode = null,string cycle=null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceCheckItemSearch(checkitemcode, checkitemname, checkdescr, isqrcode, cycle, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检项新增编辑] |
| | | /// <summary> |
| | | /// 设备点检项新增编辑 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceCheckItem")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceCheckItem([FromBody] JObject obj) |
| | | { |
| | | string checkitemid = obj["id"].ToString(); //设备点检项id(主键) |
| | | string checkitemcode = obj["checkitemcode"].ToString(); //设备点检部位编码 |
| | | string checkitemname = obj["checkitemname"].ToString(); //设备点检部位名称 |
| | | string checkitemdescr = obj["checkitemdescr"].ToString(); //设备点检部位要求 |
| | | string cycle = obj["cycle"].ToString(); //设备点检部位周期 |
| | | string isqrcode = obj["isqrcode"].ToString(); //是否扫码 |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = DeviceManagerBLL.AddUpdateDeviceCheckItem(checkitemid, checkitemcode, checkitemname, checkitemdescr, cycle, isqrcode, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检项删除] |
| | | /// <summary> |
| | | /// 设备点检项删除 |
| | | /// </summary> |
| | | /// <param name="checkitemcode">设备点检项目(部位)编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceCheckItem")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceCheckItem(string checkitemcode) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceCheckItem(checkitemcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[设备保养项列表查询] |
| | | /// <summary> |
| | | /// 设备保养项列表查询 |
| | | /// </summary> |
| | | /// <param name="maiitemcode">保养部位编码</param> |
| | | /// <param name="maiitemname">保养部位名称</param> |
| | | /// <param name="maidescr">保养要求</param> |
| | | /// <param name="isqrcode">选中扫码</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceMaiItemSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceMaiItemSearch(int page, int rows, string prop, string order,string maiitemcode = null, string maiitemname = null, string maidescr = null, string isqrcode = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceMaiItemSearch(maiitemcode, maiitemname, maidescr, isqrcode, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养项新增编辑] |
| | | /// <summary> |
| | | /// 设备保养项新增编辑 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceMaiItem")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceMaiItem([FromBody] JObject obj) |
| | | { |
| | | string maiitemid = obj["id"].ToString(); //设备保养项id(主键) |
| | | string maiitemcode = obj["maiitemcode"].ToString(); //设备保养部位编码 |
| | | string maiitemname = obj["maiitemname"].ToString(); //设备保养部位名称 |
| | | string maiitemdescr = obj["maiitemdescr"].ToString(); //设备保养部位要求 |
| | | string isqrcode = obj["isqrcode"].ToString(); //是否扫码 |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = DeviceManagerBLL.AddUpdateDeviceMaiItem(maiitemid, maiitemcode, maiitemname, maiitemdescr, isqrcode, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养项删除] |
| | | /// <summary> |
| | | /// 设备保养项删除 |
| | | /// </summary> |
| | | /// <param name="maiitemcode">设备保养项目(部位)编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceMaiItem")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceMaiItem(string maiitemcode) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceMaiItem(maiitemcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备点检标准列表查询] |
| | | /// <summary> |
| | | /// 设备点检标准列表查询 |
| | | /// </summary> |
| | | /// <param name="checkstandcode">点检标准编码</param> |
| | | /// <param name="checkstandname">点检标准名称</param> |
| | | /// <param name="checkcontr">点检管控</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckStandArdSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckStandArdSearch(int page, int rows, string prop, string order,string checkstandcode = null, string checkstandname = null, string checkcontr = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceCheckStandArdSearch(checkstandcode, checkstandname, checkcontr, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检标准新增、编辑获取检验项目下拉列表] |
| | | /// <summary> |
| | | /// 设备点检标准新增、编辑获取检验项目下拉列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckItemSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckItemSelect() |
| | | { |
| | | mes = DeviceManagerBLL.DeviceCheckItemSelect(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检标准编辑/查看获取数据] |
| | | /// <summary> |
| | | /// 设备点检标准编辑/查看获取数据 |
| | | /// </summary> |
| | | /// <param name="checkstand_code">设备点检标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "ViewDeviceCheckStanedSearch")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ViewDeviceCheckStanedSearch(string checkstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.ViewDeviceCheckStanedSearch(checkstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检标准新增编辑] |
| | | /// <summary> |
| | | /// 设备点检标准新增编辑 |
| | | /// </summary> |
| | | /// <param name="opertype">操作类型</param> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceCheckStandArd")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceCheckStandArd(string opertype, RoutEdit json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = DeviceManagerBLL.AddUpdateDeviceCheckStandArd(opertype, json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检标准删除] |
| | | /// <summary> |
| | | /// 设备点检标准删除 |
| | | /// </summary> |
| | | /// <param name="checkstand_code">设备点检标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceCheckStaned")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceCheckStaned(string checkstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceCheckStaned(checkstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检标准关联工作站查询] |
| | | /// <summary> |
| | | /// 设备点检标准关联工作站查询 |
| | | /// </summary> |
| | | /// <param name="checkstand_code">设备点检标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckStanedAssociationEqp")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckStanedAssociationEqp(string checkstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.DeviceCheckStanedAssociationEqp(checkstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region [设备点检标准关联工作站提交] |
| | | /// <summary> |
| | | /// 设备点检标准关联工作站提交 |
| | | /// </summary> |
| | | /// <param name="checkstand_code">设备点检标准编码</param> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SaveDeviceCheckStanedAssociationEqp")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SaveDeviceCheckStanedAssociationEqp(string checkstand_code, List<ObjectData> json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = DeviceManagerBLL.SaveDeviceCheckStanedAssociationEqp(checkstand_code, username, json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[设备保养标准列表查询] |
| | | /// <summary> |
| | | /// 设备保养标准列表查询 |
| | | /// </summary> |
| | | /// <param name="repairstandcode">保养标准编码</param> |
| | | /// <param name="repairstandname">保养标准名称</param> |
| | | /// <param name="repairstanddescr">保养标准描述</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairStandArdSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairStandArdSearch(int page, int rows, string prop, string order,string repairstandcode = null, string repairstandname = null, string repairstanddescr = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceRepairStandArdSearch(repairstandcode, repairstandname, repairstanddescr, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养标准新增、编辑获取保养项目下拉列表] |
| | | /// <summary> |
| | | /// 设备保养标准新增、编辑获取保养项目下拉列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairItemSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairItemSelect() |
| | | { |
| | | mes = DeviceManagerBLL.DeviceRepairItemSelect(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养标准编辑/查看获取数据] |
| | | /// <summary> |
| | | /// 设备保养标准编辑/查看获取数据 |
| | | /// </summary> |
| | | /// <param name="repairstand_code">设备保养标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "ViewDeviceRepairStanedSearch")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ViewDeviceRepairStanedSearch(string repairstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.ViewDeviceRepairStanedSearch(repairstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养标准新增编辑] |
| | | /// <summary> |
| | | /// 设备保养标准新增编辑 |
| | | /// </summary> |
| | | /// <param name="opertype">操作类型</param> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceRepairStandArd")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceRepairStandArd(string opertype, EqpRepair json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = DeviceManagerBLL.AddUpdateDeviceRepairStandArd(opertype, json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养标准删除] |
| | | /// <summary> |
| | | /// 设备保养标准删除 |
| | | /// </summary> |
| | | /// <param name="repairstand_code">设备保养标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceRepairStaned")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceRepairStaned(string repairstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceRepairStaned(repairstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养标准关联工作站查询] |
| | | /// <summary> |
| | | /// 设备保养标准关联工作站查询 |
| | | /// </summary> |
| | | /// <param name="repairstand_code">设备保养标准编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairStanedAssociationEqp")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairStanedAssociationEqp(string repairstand_code) |
| | | { |
| | | mes = DeviceManagerBLL.DeviceRepairStanedAssociationEqp(repairstand_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region [设备保养标准关联工作站提交] |
| | | /// <summary> |
| | | /// 设备保养标准关联工作站提交 |
| | | /// </summary> |
| | | /// <param name="repairstand_code">设备保养标准编码</param> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SaveDeviceRepairStanedAssociationEqp")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SaveDeviceRepairStanedAssociationEqp(string repairstand_code, List<ObjectData> json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = DeviceManagerBLL.SaveDeviceRepairStanedAssociationEqp(repairstand_code, username, json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备点检记录查询] |
| | | /// <summary> |
| | | /// 设备点检记录查询 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="eqpcode">设备编号</param> |
| | | /// <param name="eqpname">设备名称</param> |
| | | /// <param name="stanedname">标准名称</param> |
| | | /// <param name="checkuser">点检人员</param> |
| | | /// <param name="checkdate">点检时间</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckTakeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckTakeSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = null, string eqpname = null,string stanedname=null,string checkuser=null,string checkdate=null) |
| | | { |
| | | string checkopendate = ""; //点检开始时间 |
| | | string checkclosedate = ""; //点检结束时间 |
| | | if (checkdate != "" && checkdate != null) |
| | | { |
| | | checkopendate = checkdate.Split('~')[0].ToString(); |
| | | checkclosedate = checkdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceCheckTakeSearch(wkshopcode, eqpcode, eqpname, stanedname, checkuser, checkopendate, checkclosedate, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检记录明细查询] |
| | | /// <summary> |
| | | /// 设备点检记录明细查询 |
| | | /// </summary> |
| | | /// <param name="djwo">设备点检单号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckSubTakeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckSubTakeSearch(string djwo) |
| | | { |
| | | mes = DeviceManagerBLL.DeviceCheckSubTakeSearch(djwo); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备点检记录导出] |
| | | /// <summary> |
| | | /// 设备点检记录导出 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="eqpcode">设备编号</param> |
| | | /// <param name="eqpname">设备名称</param> |
| | | /// <param name="stanedname">标准名称</param> |
| | | /// <param name="checkuser">点检人员</param> |
| | | /// <param name="checkdate">点检时间</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceCheckTakeOutExcel")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceCheckTakeOutExcel(string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string checkuser = null, string checkdate = null) |
| | | { |
| | | string checkopendate = ""; //点检开始时间 |
| | | string checkclosedate = ""; //点检结束时间 |
| | | if (checkdate != "" && checkdate != null) |
| | | { |
| | | checkopendate = checkdate.Split('~')[0].ToString(); |
| | | checkclosedate = checkdate.Split('~')[1].ToString(); |
| | | } |
| | | mes = DeviceManagerBLL.DeviceCheckTakeOutExcel(wkshopcode, eqpcode, eqpname, stanedname, checkuser, checkopendate, checkclosedate); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备保养记录查询] |
| | | /// <summary> |
| | | /// 设备保养记录查询 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="eqpcode">设备编号</param> |
| | | /// <param name="eqpname">设备名称</param> |
| | | /// <param name="stanedname">标准名称</param> |
| | | /// <param name="repairuser">保养人员</param> |
| | | /// <param name="repairdate">保养时间</param> |
| | | /// <param name="repairresult">保养结果</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairTakeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairTakeSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string repairuser = null, string repairdate = null,string repairresult=null) |
| | | { |
| | | string repairopendate = ""; //点检开始时间 |
| | | string repairclosedate = ""; //点检结束时间 |
| | | if (repairdate != "" && repairdate != null) |
| | | { |
| | | repairopendate = repairdate.Split('~')[0].ToString(); |
| | | repairclosedate = repairdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceRepairTakeSearch(wkshopcode, eqpcode, eqpname, stanedname, repairuser, repairopendate, repairclosedate, repairresult, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养记录明细查询] |
| | | /// <summary> |
| | | /// 设备保养记录明细查询 |
| | | /// </summary> |
| | | /// <param name="bywo">设备保养单号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairSubTakeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairSubTakeSearch(string bywo) |
| | | { |
| | | mes = DeviceManagerBLL.DeviceRepairSubTakeSearch(bywo); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备保养记录导出] |
| | | /// <summary> |
| | | /// 设备保养记录导出 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="eqpcode">设备编号</param> |
| | | /// <param name="eqpname">设备名称</param> |
| | | /// <param name="stanedname">标准名称</param> |
| | | /// <param name="repairuser">保养人员</param> |
| | | /// <param name="repairdate">保养时间</param> |
| | | /// <param name="repairresult">保养结果</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceRepairTakeOutExcel")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceRepairTakeOutExcel(string wkshopcode = null, string eqpcode = null, string eqpname = null, string stanedname = null, string repairuser = null, string repairdate = null, string repairresult = null) |
| | | { |
| | | string repairopendate = ""; //点检开始时间 |
| | | string repairclosedate = ""; //点检结束时间 |
| | | if (repairdate != "" && repairdate != null) |
| | | { |
| | | repairopendate = repairdate.Split('~')[0].ToString(); |
| | | repairclosedate = repairdate.Split('~')[1].ToString(); |
| | | } |
| | | mes = DeviceManagerBLL.DeviceRepairTakeOutExcel(wkshopcode, eqpcode, eqpname, stanedname, repairuser, repairopendate, repairclosedate, repairresult); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |