| | |
| | | { |
| | | [RoutePrefix(prefix: "api/DeviceManager")] |
| | | [ControllerGroup("设备管理", "在线接口")] |
| | | [ChannelActionFilter] |
| | | public class DeviceManagerController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | } |
| | | #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(string checkitemcode = null, string checkitemname = null, string checkdescr = null, string isqrcode = null,string cycle=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.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="cycle">保养周期</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(string maiitemcode = null, string maiitemname = null, string maidescr = null, string isqrcode = null, string cycle = 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.DeviceMaiItemSearch(maiitemcode, maiitemname, maidescr, isqrcode, cycle, 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 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.AddUpdateDeviceMaiItem(maiitemid, maiitemcode, maiitemname, maiitemdescr, cycle, 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(string checkstandcode = null, string checkstandname = null, string checkcontr = 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.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(string repairstandcode = null, string repairstandname = null, string repairstanddescr = 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.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, RoutEdit 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 |
| | | |
| | | } |
| | | } |