| | |
| | | { |
| | | [RoutePrefix(prefix: "api/ProductionManagement")] |
| | | [ControllerGroup("生产管理", "在线接口")] |
| | | //[ChannelActionFilter] |
| | | [ChannelActionFilter] |
| | | public class ProductionManagementController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | string relse_qty = obj["relse_qty"].ToString(); //已下单数量 |
| | | string saleOrderDeliveryDate = obj["saleOrderDeliveryDate"].ToString(); //交付时间 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erporderid,erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, saleOrderDeliveryDate, username); |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erporderid, erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, saleOrderDeliveryDate, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | //var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | var username = "Admin"; |
| | | mes = ProductionManagementBLL.ClosedErpOrder(erporderid,erpordercode, username); |
| | | mes = ProductionManagementBLL.ClosedErpOrder(erporderid, erpordercode, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderSearch")] |
| | | [HttpGet] |
| | | 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) |
| | | public HttpResponseMessage MesOrderSearch(int page, int rows, string prop, string order, 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 startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.MesOrderSearch(mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES报废补单工单查询] |
| | | /// <summary> |
| | | /// MES报废补单工单查询 |
| | | /// </summary> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</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: "MesBadOrderSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesBadOrderSearch(int page, int rows, string prop, string order, string mesordercode = null, string sourceorder = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.MesBadOrderSearch(mesordercode, sourceorder, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "SelectRouteOrWkshop")] |
| | | [HttpGet] |
| | | public HttpResponseMessage SelectRouteOrWkshop(string partcode,string routecode,string wkshopcode) |
| | | public HttpResponseMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode) |
| | | { |
| | | mes = ProductionManagementBLL.SelectRouteOrWkshop(partcode, routecode, wkshopcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单新增、获取工单号] |
| | | /// <summary> |
| | | /// MES工单新增、获取工单号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "AddMesOrderCodeSearch")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddMesOrderCodeSearch() |
| | | { |
| | | mes = ProductionManagementBLL.AddMesOrderCodeSearch(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | public HttpResponseMessage ClosedMesOrder(string wocode, string m_po) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.ClosedMesOrder(username,wocode, m_po); |
| | | mes = ProductionManagementBLL.ClosedMesOrder(username, wocode, m_po); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region[生产开报工扫码获取当前工序对应的设备(自制)] |
| | | /// <summary> |
| | | /// 生产开报工扫码获取当前工序对应的设备(自制) |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描的二维码信息</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepEqpSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepEqpSearch(string orderstepqrcode = null) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderStepEqpSearch(orderstepqrcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取当前工序对应的供方(外协)] |
| | | /// <summary> |
| | | /// 生产开报工扫码获取当前工序对应的供方(外协) |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描的二维码信息</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderWxStepEqpSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderWxStepEqpSearch(string orderstepqrcode = null) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderWxStepEqpSearch(orderstepqrcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(自制)] |
| | | /// <summary> |
| | |
| | | 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, reckway,usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, remarks, username); |
| | | mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, reckway, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, remarks, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | 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, checkqty, username,json); |
| | | mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(mesordercode, partcode, stepcode, checkstanedcode, checkusercode, checktypecode, checkresult, checkdescr, checkqty, username, json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | [HttpPost] |
| | | public HttpResponseMessage MesOrderBitchClosedSeave(DataTable dt) |
| | | { |
| | | |
| | | |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.MesOrderBitchClosedSeave(username, dt); |
| | | return TJson.toJson(mes); |
| | |
| | | /// <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) |
| | | 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 |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanSubmit")] |
| | | [HttpPost] |
| | | public HttpResponseMessage CapacityPlanSubmit(string wkshopcode, string capunitcode,string captplanid=null,string capsetupcode=null,string captplantype=null) |
| | | public HttpResponseMessage CapacityPlanSubmit(string wkshopcode, string capunitcode, string captplanid = null, string capsetupcode = null, string captplantype = null) |
| | | { |
| | | string type = ""; //提交类型 |
| | | if (captplanid == "" || captplanid == null) |
| | |
| | | type = "Update"; |
| | | } |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.CapacityPlanSubmit(type,captplanid,wkshopcode,capunitcode,capsetupcode, captplantype,username); |
| | | mes = ProductionManagementBLL.CapacityPlanSubmit(type, captplanid, wkshopcode, capunitcode, capsetupcode, captplantype, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningOnclickSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage CapacityPlanningOnclickSelect(string captplanid,string datetime) |
| | | public HttpResponseMessage CapacityPlanningOnclickSelect(string captplanid, string datetime) |
| | | { |
| | | mes = ProductionManagementBLL.CapacityPlanningOnclickSelect(captplanid, datetime); |
| | | return TJson.toJson(mes); |
| | |
| | | type = "Update"; |
| | | } |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.CapacityPlanningGivePlanSubmit(captplanid, wkshopcode, capunitcode, capsetupcode, captplantype, objs,type, username); |
| | | mes = ProductionManagementBLL.CapacityPlanningGivePlanSubmit(captplanid, wkshopcode, capunitcode, capsetupcode, captplantype, objs, type, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "AdvancedSchedulingSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage AdvancedSchedulingSearch(int page, int rows, string prop, string order, string workshop = null, string wocode = null, string partcode = null,string partname=null) |
| | | public HttpResponseMessage AdvancedSchedulingSearch(int page, int rows, string prop, string order, string workshop = null, string wocode = null, string partcode = null, string partname = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "OnclickAdvancedSchedulingDevice")] |
| | | [HttpGet] |
| | | public HttpResponseMessage OnclickAdvancedSchedulingDevice(string wocode,string wkshpcode,string partcode,string botproccode,string startdate,string enddate) |
| | | public HttpResponseMessage OnclickAdvancedSchedulingDevice(string wocode, string wkshpcode, string partcode, string botproccode, string startdate, string enddate) |
| | | { |
| | | List<AdvancedSchedulingDevice> list = new List<AdvancedSchedulingDevice>(); |
| | | List<AdvancedSchedAlready> list1 = new List<AdvancedSchedAlready>(); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[NEW高级排程点击工单任务带出瓶颈工序设备、已排程任务数据] |
| | | /// <summary> |
| | | /// NEW高级排程点击工单任务带出瓶颈工序设备、已排程任务数据 |
| | | /// </summary> |
| | | /// <param name="json">查询数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "NewOnclickAdvancedSchedulingDevice")] |
| | | [HttpPost] |
| | | public HttpResponseMessage NewOnclickAdvancedSchedulingDevice(List<ApsOrderSerch> json) |
| | | { |
| | | List<AdvancedSchedulingDevice> list = new List<AdvancedSchedulingDevice>(); |
| | | List<AdvancedSchedAlready> list1 = new List<AdvancedSchedAlready>(); |
| | | list = ProductionManagementBLL.NewOnclickAdvancedSchedulingDevice(json, ref mes); //排产设备信息 |
| | | List<DataTable> dt = ProductionManagementBLL.NewAlreadyScheduling(json); //设备已排程信息 |
| | | |
| | | Dictionary<object, object> dList = new Dictionary<object, object>(); |
| | | dList.Add("rus", mes); |
| | | dList.Add("rows", list); |
| | | dList.Add("Cont", dt); |
| | | return TJson.toJson(dList); |
| | | } |
| | | #endregion |
| | | |
| | | #region[排程数据提交] |
| | | /// <summary> |
| | | /// 排程数据提交 |