| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | |
| | | /// </summary> |
| | | /// <param name="mesorderstus">工单状态码</param> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</param> |
| | | /// <param name="ordertype">单据类型</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderSearch(string mesorderstus = null, string mesordercode = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public HttpResponseMessage MesOrderSearch(string mesorderstus = null, string mesordercode = null,string sourceorder=null,string ordertype=null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = 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 = ProductionManagementBLL.MesOrderSearch(mesorderstus, mesordercode, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | mes = ProductionManagementBLL.MesOrderSearch(mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | public HttpResponseMessage AddUpdateMesOrder([FromBody] JObject obj) |
| | | { |
| | | string mesorderstus = obj["mesorderstus"].ToString(); //工单状态码 |
| | | string sourceorder = obj["sourceorder"].ToString(); //源单编号 |
| | | string ordertype = obj["ordertype"].ToString(); //工单类型 |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string mesqty = obj["mesqty"].ToString(); //工单数量 |
| | |
| | | string orderlev = obj["orderlev"].ToString(); //工单等级 |
| | | string opertype = obj["OperType"].ToString(); //操作类型 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.AddUpdateMesOrder(mesorderstus, mesordercode, partcode, mesqty, routecode, wkshopcode, planstartdate, planenddate, orderlev, username, opertype); |
| | | mes = ProductionManagementBLL.AddUpdateMesOrder(mesorderstus, sourceorder, ordertype, mesordercode, partcode, mesqty, routecode, wkshopcode, planstartdate, planenddate, orderlev, username, opertype); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// MES工单删除 |
| | | /// </summary> |
| | | /// <param name="souceid">源单工单</param> |
| | | /// <param name="wocode">工单编号</param> |
| | | /// <param name="m_po">订单编号</param> |
| | | /// <param name="orderqty">工单数量</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteMesOrder")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteMesOrder(string wocode, string m_po, string orderqty) |
| | | public HttpResponseMessage DeleteMesOrder(string souceid, string wocode, string m_po, string orderqty) |
| | | { |
| | | mes = ProductionManagementBLL.DeleteMesOrder(wocode, m_po, orderqty); |
| | | mes = ProductionManagementBLL.DeleteMesOrder(souceid, wocode, m_po, orderqty); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | [HttpPost] |
| | | public HttpResponseMessage ClosedMesOrder(string wocode, string m_po) |
| | | { |
| | | mes = ProductionManagementBLL.ClosedMesOrder(wocode, m_po); |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.ClosedMesOrder(username,wocode, m_po); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | string reportqty = obj["reportqty"].ToString(); //报工工数量 |
| | | string ngqty = obj["ngqty"].ToString(); //不良数量 |
| | | string badcode = obj["badcode"].ToString(); //不良原因编码 |
| | | string remarks = obj["remarks"].ToString(); //备注 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, username); |
| | | mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, remarks, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | string sqty = obj["sqty"].ToString(); //收料数量 |
| | | string ngqty = obj["ngqty"].ToString(); //不良数量 |
| | | string badcode = obj["badcode"].ToString(); //不良原因编码 |
| | | string remarks = obj["remarks"].ToString(); //备注 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inuser, taskqty, sqty, ngqty, badcode, username); |
| | | mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inuser, taskqty, sqty, ngqty, badcode, remarks, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 不良处理,提交 |
| | | /// </summary> |
| | | /// <param name="username">处理人员编码</param> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "EditOrderNgStepSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage EditOrderNgStepSeave(ReportDefectHandle json) |
| | | public HttpResponseMessage EditOrderNgStepSeave(string username, ReportDefectHandle json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.EditOrderNgStepSeave(json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | |
| | | string checktypecode = obj["checktypecode"].ToString(); //检验类型编码 |
| | | string checkresult = obj["checkresult"].ToString(); //检验结果 |
| | | string checkdescr = obj["checkdescr"].ToString(); //检验描述 |
| | | string checkqty = obj["checkqty"].ToString(); //检验数量 |
| | | string data = obj["data"].ToString(); |
| | | List<StepCheck> json = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StepCheck>>(data); |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(mesordercode, partcode, stepcode, checkstanedcode, checkusercode, checktypecode, checkresult, checkdescr, username,json); |
| | | mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(mesordercode, partcode, stepcode, checkstanedcode, checkusercode, checktypecode, checkresult, checkdescr, checkqty, username,json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[MES工单批量关闭查询] |
| | | /// <summary> |
| | | /// MES工单查询 |
| | | /// </summary> |
| | | /// <param name="mesorderstus">工单状态码</param> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</param> |
| | | /// <param name="ordertype">单据类型</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</param> |
| | | /// <param name="creatuser">创建人员</param> |
| | | /// <param name="createdate">创建时间</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderBitchClosedSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderBitchClosedSearch(string mesorderstus = null, string mesordercode = null, string sourceorder = null, string ordertype = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = 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 = ProductionManagementBLL.MesOrderBitchClosedSearch(mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单批量关闭提交] |
| | | [Route(template: "MesOrderBitchClosedSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage MesOrderBitchClosedSeave(DataTable dt) |
| | | { |
| | | |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.MesOrderBitchClosedSeave(username, dt); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |