| | |
| | | |
| | | namespace VueWebApi.Controllers |
| | | { |
| | | [RoutePrefix(prefix: "api/BasicSetting")] |
| | | [RoutePrefix(prefix: "api/ProductionManagement")] |
| | | [ControllerGroup("生产管理", "在线接口")] |
| | | public class ProductionManagementController : ApiController |
| | | { |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "ErpOrderSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage ErpOrderSearch(string erporderstus = null, string erpordercode = null, string partcode = null, string partname = null, string partspec = null,string paydate=null,string creatuser=null,string createdate=null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public HttpResponseMessage ErpOrderSearch(string erporderstus = null, string erpordercode = null, string partcode = null, string partname = null, string partspec = null, string paydate = null, string creatuser = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | string paydatestartdate = ""; //交付开始时间 |
| | | string paydateenddate = ""; //交付结束时间 |
| | |
| | | paydatestartdate = paydate.Split('~')[0].ToString(); |
| | | paydateenddate = paydate.Split('~')[1].ToString(); |
| | | } |
| | | if (createdate != "" && createdate != null) |
| | | if (createdate != "" && createdate != null) |
| | | { |
| | | createstartdate = paydate.Split('~')[0].ToString(); |
| | | createenddate = paydate.Split('~')[1].ToString(); |
| | |
| | | [HttpPost] |
| | | public HttpResponseMessage MarkSaveErpOrder([FromBody] JObject obj) |
| | | { |
| | | string erporderstus = obj["erporderstus"].ToString(); //订单状态码 |
| | | string erpordercode = obj["erpordercode"].ToString(); //订单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string wkshopcode = obj["wkshopcode"].ToString(); //车间编码 |
| | |
| | | string ordernum = obj["ordernum"].ToString(); //下单单数 |
| | | string relse_qty = obj["relse_qty"].ToString(); //已下单数量 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erporderstus, erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty,username); |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erpordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产品编码查找工艺路线下拉接口] |
| | | /// <summary> |
| | | /// 产品编码查找工艺路线下拉接口 |
| | | /// </summary> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "PartSelectRoute")] |
| | | [HttpGet] |
| | | public HttpResponseMessage PartSelectRoute(string partcode) |
| | | { |
| | | mes = ProductionManagementBLL.PartSelectRoute(partcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[产品+工艺路线查找车间下拉接口] |
| | | /// <summary> |
| | | /// 产品+工艺路线查找车间下拉接口 |
| | | /// </summary> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="routecode">工艺路线编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RouteSelectWkshop")] |
| | | [HttpGet] |
| | | public HttpResponseMessage RouteSelectWkshop(string partcode, string routecode) |
| | | { |
| | | mes = ProductionManagementBLL.RouteSelectWkshop(partcode, routecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[根据选择工艺路线查看工序接口] |
| | | /// <summary> |
| | | /// 根据选择工艺路线查看工序接口 |
| | | /// </summary> |
| | | /// <param name="routecode">工艺路线编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SelectRouteStep")] |
| | | [HttpGet] |
| | | public HttpResponseMessage SelectRouteStep(string routecode) |
| | | { |
| | | mes = ProductionManagementBLL.SelectRouteStep(routecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单新增、编辑提交] |
| | | /// <summary> |
| | | /// MES工单新增、编辑提交 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateMesOrder")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateMesOrder([FromBody] JObject obj) |
| | | { |
| | | string mesorderstus = obj["mesorderstus"].ToString(); //工单状态码 |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string mesqty = obj["mesqty"].ToString(); //工单数量 |
| | | string routecode = obj["routecode"].ToString(); //工艺路线编码 |
| | | string wkshopcode = obj["wkshopcode"].ToString();//生产车间编码 |
| | | string planstartdate = obj["planstartdate"].ToString(); //计划开始时间 |
| | | string planenddate = obj["planenddate"].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); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单删除] |
| | | /// <summary> |
| | | /// MES工单删除 |
| | | /// </summary> |
| | | /// <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) |
| | | { |
| | | mes = ProductionManagementBLL.DeleteMesOrder(wocode, m_po, orderqty); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单关闭] |
| | | /// <summary> |
| | | /// MES工单关闭 |
| | | /// </summary> |
| | | /// <param name="wocode">工单编号</param> |
| | | /// <param name="m_po">订单编号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "ClosedMesOrder")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ClosedMesOrder(string wocode, string m_po) |
| | | { |
| | | mes = ProductionManagementBLL.ClosedMesOrder(wocode, m_po); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工序任务] |
| | | /// <summary> |
| | | /// MES工单查看工序任务 |
| | | /// </summary> |
| | | /// <param name="wo_code">工单编号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SearchWorkStep")] |
| | | [HttpGet] |
| | | public HttpResponseMessage SearchWorkStep(string wo_code) |
| | | { |
| | | mes = ProductionManagementBLL.SearchWorkStep(wo_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(自制)] |
| | | /// <summary> |
| | | /// 生产开报工扫码获取工单对应工序任务(自制) |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描的二维码信息</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则(默认按照计划开工时间正序)</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepSearch(string orderstepqrcode = 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.MesOrderStepSearch(orderstepqrcode, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(外协)] |
| | | /// <summary> |
| | | /// 生产开报工扫码获取工单对应工序任务(外协) |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描的二维码信息</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则(默认按照计划开工时间正序)</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderWxStepSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderWxStepSearch(string orderstepqrcode = 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.MesOrderWxStepSearch(orderstepqrcode, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region [生产开报工:开工(开始/报工)/外协(发料/收料)时条件判断及数据返回接口] |
| | | /// <summary> |
| | | /// 生产开报工:开工(开始/报工)/外协(发料/收料)时条件判断及数据返回接口 |
| | | /// </summary> |
| | | /// <param name="OperType">操作类型:自制(ZZ)/外协(WX)</param> |
| | | /// <param name="SelectType">操作类型:外协发料标识(OUT)/外协收料标识(IN)</param> |
| | | /// <param name="orderstepqrcode">扫描二维码信息</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepStart")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepStart(string OperType, string SelectType, string orderstepqrcode) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderStepStart(OperType, SelectType, orderstepqrcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工:开工时获取设备下拉列表] |
| | | /// <summary> |
| | | /// 生产开报工:开工时获取设备下拉列表 |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描二维码信息</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepStartSelectEqp")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepStartSelectEqp(string orderstepqrcode) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderStepStartSelectEqp(orderstepqrcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工:报工时获取生产班组下拉框] |
| | | /// <summary> |
| | | /// 生产开报工:报工时获取生产班组下拉框 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepReportSelectUserGroup")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepReportSelectUserGroup() |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderStepReportSelectUserGroup(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工:根据生产班组查找人员列表] |
| | | /// <summary> |
| | | /// 生产开报工:开工时获取设备下拉列表 |
| | | /// </summary> |
| | | /// <param name="usergroupcode">班组编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderGroupSelectUser")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderGroupSelectUser(string usergroupcode) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderGroupSelectUser(usergroupcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产报工:报工/外协收料 获取不良原因下拉列表] |
| | | /// <summary> |
| | | /// 生产报工:报工/外协收料 获取不良原因下拉列表 |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描二维码信息</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepSelectCause")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MesOrderStepSelectCause(string orderstepqrcode) |
| | | { |
| | | mes = ProductionManagementBLL.MesOrderStepSelectCause(orderstepqrcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工,开工提交] |
| | | /// <summary> |
| | | /// 生产开报工,开工提交 |
| | | /// </summary> |
| | | /// <param name="obj">开工提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepStart")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SavaMesOrderStepStart([FromBody] JObject obj) |
| | | { |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string stepseq = obj["stepseq"].ToString(); //工序序号 |
| | | string stepcode = obj["stepcode"].ToString(); //工序编码 |
| | | string eqpcode = obj["eqpcode"].ToString(); //设备编码 |
| | | string taskqty = obj["taskqty"].ToString(); //任务数量 |
| | | string startqty = obj["startqty"].ToString(); //开工数量 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //开工人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepStart(mesordercode, partcode, stepseq, stepcode, eqpcode, taskqty, startqty, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工,报工提交] |
| | | /// <summary> |
| | | /// 生产开报工,报工提交 |
| | | /// </summary> |
| | | /// <param name="obj">报工提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepReport")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SavaMesOrderStepReport([FromBody] JObject obj) |
| | | { |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string stepseq = obj["stepseq"].ToString(); //工序序号 |
| | | string stepcode = obj["stepcode"].ToString(); //工序编码 |
| | | string eqpcode = obj["eqpcode"].ToString(); //设备编码 |
| | | string usergroupcode = obj["usergroupcode"].ToString(); //班组编码 |
| | | string reportuser = obj["reportuser"].ToString(); //报工人员 |
| | | string taskqty = obj["taskqty"].ToString(); //任务数量 |
| | | string startqty = obj["startqty"].ToString(); //开工数量 |
| | | string reportqty = obj["reportqty"].ToString(); //报工工数量 |
| | | string ngqty = obj["ngqty"].ToString(); //不良数量 |
| | | string badcode = obj["badcode"].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); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工,发料提交] |
| | | /// <summary> |
| | | /// 生产开报工,发料提交 |
| | | /// </summary> |
| | | /// <param name="obj">发料提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepOut")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SavaMesOrderStepOut([FromBody] JObject obj) |
| | | { |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string stepseq = obj["stepseq"].ToString(); //工序序号 |
| | | string stepcode = obj["stepcode"].ToString(); //工序编码 |
| | | string wxcode = obj["wxcode"].ToString(); //外协供应商编码 |
| | | string outuser = obj["outuser"].ToString(); //发料人员 |
| | | string taskqty = obj["taskqty"].ToString(); //任务数量 |
| | | string fqty = obj["fqty"].ToString(); //发料数量 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepOut(mesordercode, partcode, stepseq, stepcode, wxcode, outuser, taskqty, fqty, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工,收料提交] |
| | | /// <summary> |
| | | /// 生产开报工,收料提交 |
| | | /// </summary> |
| | | /// <param name="obj">收料提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepIn")] |
| | | [HttpPost] |
| | | public HttpResponseMessage SavaMesOrderStepIn([FromBody] JObject obj) |
| | | { |
| | | string mesordercode = obj["mesordercode"].ToString(); //工单编号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string stepseq = obj["stepseq"].ToString(); //工序序号 |
| | | string stepcode = obj["stepcode"].ToString(); //工序编码 |
| | | string wxcode = obj["wxcode"].ToString(); //外协供应商编码 |
| | | string inuser = obj["inuser"].ToString(); //收料人员 |
| | | string taskqty = obj["taskqty"].ToString(); //任务数量 |
| | | string sqty = obj["sqty"].ToString(); //收料数量 |
| | | string ngqty = obj["ngqty"].ToString(); //不良数量 |
| | | string badcode = obj["badcode"].ToString(); //不良原因编码 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inuser, taskqty, sqty, ngqty, badcode, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |