| | |
| | | { |
| | | [RoutePrefix(prefix: "api/ProductionManagement")] |
| | | [ControllerGroup("生产管理", "在线接口")] |
| | | //[ChannelActionFilter] |
| | | [ChannelActionFilter] |
| | | public class ProductionManagementController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | string markqty = obj["markqty"].ToString(); //下单数量 |
| | | string ordernum = obj["ordernum"].ToString(); //下单单数 |
| | | 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, username); |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erporderid,erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, saleOrderDeliveryDate, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #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 |
| | | |
| | | #region[产品编码查找工艺路线下拉接口] |
| | | /// <summary> |
| | | /// 产品编码查找工艺路线下拉接口 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region【生产管理、工单新增、编辑时,选择排程是时获取物料清单版本号】 |
| | | /// <summary> |
| | | /// 生产管理、工单新增、编辑时,选择排程是时获取物料清单版本号 |
| | | /// </summary> |
| | | /// <param name="partnumber">产品编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "JobCreationSonAddVison")] |
| | | [HttpGet] |
| | | public HttpResponseMessage JobCreationSonAddVison(string partnumber) |
| | | { |
| | | mes = ProductionManagementBLL.JobCreationSonAddVison(partnumber); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[工单派发选择工艺路线或选择生产车间时判断绑定条件] |
| | | /// <summary> |
| | | /// 工单派发选择工艺路线或选择生产车间时判断绑定条件 |
| | | /// </summary> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="routecode">工艺路线编码</param> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SelectRouteOrWkshop")] |
| | | [HttpGet] |
| | | 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 |
| | | |
| | | #region[MES工单新增、编辑提交] |
| | | /// <summary> |
| | | /// MES工单新增、编辑提交 |
| | |
| | | string planstartdate = obj["planstartdate"].ToString(); //计划开始时间 |
| | | string planenddate = obj["planenddate"].ToString(); //计划完成时间 |
| | | string orderlev = obj["orderlev"].ToString(); //工单等级 |
| | | string is_aps = obj["is_aps"].ToString(); //是否排产 |
| | | string bom_id = obj["bom_id"].ToString(); //物料清单id |
| | | string opertype = obj["OperType"].ToString(); //操作类型 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.AddUpdateMesOrder(mesorderstus, sourceorder, ordertype, 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, is_aps, bom_id); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | string stepseq = obj["stepseq"].ToString(); //工序序号 |
| | | string stepcode = obj["stepcode"].ToString(); //工序编码 |
| | | string eqpcode = obj["eqpcode"].ToString(); //设备编码 |
| | | string reckway = obj["reckway"].ToString(); //计件方式(班组:group、个人:person) |
| | | string usergroupcode = obj["usergroupcode"].ToString(); //班组编码 |
| | | string reportuser = obj["reportuser"].ToString(); //报工人员 |
| | | string taskqty = obj["taskqty"].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, 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 |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[产能规划方案设置查询] |
| | | /// <summary> |
| | | /// 产能规划方案设置查询 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningSetupSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage CapacityPlanningSetupSearch() |
| | | { |
| | | mes = ProductionManagementBLL.CapacityPlanningSetupSearch(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划方案设置新增] |
| | | /// <summary> |
| | | /// 产能规划方案设置新增 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningSetupAddUpdate")] |
| | | [HttpPost] |
| | | public HttpResponseMessage CapacityPlanningSetupAddUpdate([FromBody] JObject obj) |
| | | { |
| | | string capacitylist = obj["capacitylist"].ToString(); //提交数据 |
| | | string username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | List<CapacityPlanningSetup> objs = Serializer.Deserialize<List<CapacityPlanningSetup>>(capacitylist); |
| | | mes = ProductionManagementBLL.CapacityPlanningSetupAddUpdate(username, objs); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划方案设置删除] |
| | | /// <summary> |
| | | /// 产能规划方案设置删除 |
| | | /// </summary> |
| | | /// <param name="CapSetupCode">方案编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "CapacityPlanningSetupDelete")] |
| | | [HttpPost] |
| | | public HttpResponseMessage CapacityPlanningSetupDelete(string capsetupcode) |
| | | { |
| | | string username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.CapacityPlanningSetupDelete(username, capsetupcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产能规划查询] |
| | | /// <summary> |
| | | /// 产能规划查询 |
| | |
| | | return TJson.toJson(mes); |
| | | } |
| | | #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="wocode">生产工单号</param> |
| | | /// <param name="partcode">物料编码</param> |
| | | /// <param name="partname">物料名称</param> |
| | | /// <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) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.AdvancedSchedulingSearch(workshop, wocode, partcode, partname, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[高级排程点击工单任务带出瓶颈工序设备、已排程任务数据] |
| | | /// <summary> |
| | | /// 高级排程点击工单任务带出瓶颈工序设备、已排程任务数据 |
| | | /// </summary> |
| | | /// <param name="wocode">工单编号</param> |
| | | /// <param name="wkshpcode">车间编码</param> |
| | | /// <param name="partcode">物料编码</param> |
| | | /// <param name="botproccode">瓶颈工序编码(首道工序)</param> |
| | | /// <param name="startdate">开始日期</param> |
| | | /// <param name="enddate">结束日期</param> |
| | | /// <returns></returns> |
| | | [Route(template: "OnclickAdvancedSchedulingDevice")] |
| | | [HttpGet] |
| | | 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>(); |
| | | list = ProductionManagementBLL.OnclickAdvancedSchedulingDevice(wocode, wkshpcode, partcode, startdate, enddate, ref mes); //排产设备信息 |
| | | DataTable dt = ProductionManagementBLL.AlreadyScheduling(wocode, wkshpcode, partcode, botproccode, startdate, enddate); //设备已排程信息 |
| | | |
| | | 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> |
| | | /// 排程数据提交 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "SubmitAlreadyScheduling")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SubmitAlreadyScheduling() |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | string wocode = HttpContext.Current.Request["wocode"].ToString();//工单编号 |
| | | string botprocecode = HttpContext.Current.Request["botprocecode"].ToString(); //瓶颈工序编码 |
| | | string json = HttpContext.Current.Request["json"].ToString(); //排程提交数据 |
| | | JavaScriptSerializer Serializer = new JavaScriptSerializer(); |
| | | List<AlreadyScheduling> objs = Serializer.Deserialize<List<AlreadyScheduling>>(json); |
| | | mes = ProductionManagementBLL.SubmitAlreadyScheduling(username, wocode, botprocecode, objs); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |