| | |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Web.Script.Serialization; |
| | | using VueWebApi.DLL.BLL; |
| | | using VueWebApi.Models; |
| | | using VueWebApi.Tools; |
| | |
| | | #endregion |
| | | |
| | | #region[MES工单批量关闭提交] |
| | | /// <summary> |
| | | /// MES工单批量关闭提交 |
| | | /// </summary> |
| | | /// <param name="dt">工单号数组对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderBitchClosedSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage MesOrderBitchClosedSeave(DataTable dt) |
| | |
| | | #endregion |
| | | |
| | | #region[MES工单批量反关闭] |
| | | /// <summary> |
| | | /// MES工单批量反关闭 |
| | | /// </summary> |
| | | /// <param name="dt">工单号数组对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderBitchAntiClosedSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage MesOrderBitchAntiClosedSeave(DataTable dt) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[产能规划查询] |
| | | /// <summary> |
| | | /// 产能规划查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">页数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <param name="workshop">车间编码</param> |
| | | /// <param name="devicetype">生产单元</param> |
| | | /// <param name="stustype">有效状态</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage CapacityPlanningSearch(int page, int rows, string prop, string order,string workshop = null, string devicetype = null, string stustype = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.CapacityPlanningSearch(workshop, devicetype, stustype, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划默认方案保存提交] |
| | | /// <summary> |
| | | /// 产能规划默认方案保存提交 |
| | | /// </summary> |
| | | /// <param name="captplanid">产能规划(生产资源)id</param> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="capunitcode">生产单元编码</param> |
| | | /// <param name="capsetupcode">默认方案编码</param> |
| | | /// <param name="captplantype">资源类型</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanSubmit")] |
| | | [HttpPost] |
| | | public HttpResponseMessage CapacityPlanSubmit(string wkshopcode, string capunitcode,string captplanid=null,string capsetupcode=null,string captplantype=null) |
| | | { |
| | | string type = ""; //提交类型 |
| | | if (captplanid == "" || captplanid == null) |
| | | { |
| | | type = "Add"; |
| | | } |
| | | else |
| | | { |
| | | type = "Update"; |
| | | } |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.CapacityPlanSubmit(type,captplanid,wkshopcode,capunitcode,capsetupcode, captplantype,username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划点击日历组件查找已关联的日期方案] |
| | | /// <summary> |
| | | /// 产能规划点击日历组件查找已关联的日期方案 |
| | | /// </summary> |
| | | /// <param name="captplanid">产能规划(生产资源)id</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningCalendar")] |
| | | [HttpGet] |
| | | public HttpResponseMessage CapacityPlanningCalendar(string captplanid) |
| | | { |
| | | mes = ProductionManagementBLL.CapacityPlanningCalendar(captplanid); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划日历双击时带出对应的方案] |
| | | /// <summary> |
| | | /// 产能规划日历双击时带出对应的方案 |
| | | /// </summary> |
| | | /// <param name="captplanid">产能规划(生产资源)id</param> |
| | | /// <param name="datetime">双击选中的日期</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningOnclickSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage CapacityPlanningOnclickSelect(string captplanid,string datetime) |
| | | { |
| | | mes = ProductionManagementBLL.CapacityPlanningOnclickSelect(captplanid, datetime); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划工作日历选择提交] |
| | | /// <summary> |
| | | /// 产能规划工作日历选择提交 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningGivePlanSubmit")] |
| | | [HttpPost] |
| | | public HttpResponseMessage CapacityPlanningGivePlanSubmit() |
| | | { |
| | | string wkshopcode = HttpContext.Current.Request["wkshopcode"].ToString();//车间编码 |
| | | string capunitcode = HttpContext.Current.Request["capunitcode"].ToString();//生产单元编码 |
| | | string captplanid = HttpContext.Current.Request["captplanid"].ToString(); //产能规划(生产资源)列表id |
| | | string capsetupcode = HttpContext.Current.Request["capsetupcode"].ToString(); //默认方案编码 |
| | | string captplantype = HttpContext.Current.Request["captplantype"].ToString(); //资源类型 |
| | | string worklist = HttpContext.Current.Request["worklist"].ToString(); //工作日历数据集 |
| | | JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | List<CapaPlan> objs = Serializer.Deserialize<List<CapaPlan>>(worklist); |
| | | string type = ""; //提交类型 |
| | | if (captplanid == "" || captplanid == null) |
| | | { |
| | | type = "Add"; |
| | | } |
| | | else |
| | | { |
| | | type = "Update"; |
| | | } |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.CapacityPlanningGivePlanSubmit(captplanid, wkshopcode, capunitcode, capsetupcode, captplantype, objs,type, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |