| | |
| | | { |
| | | [RoutePrefix(prefix: "api/ProductionManagement")] |
| | | [ControllerGroup("生产管理", "在线接口")] |
| | | //[ChannelActionFilter] |
| | | [ChannelActionFilter] |
| | | public class ProductionManagementController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | /// </summary> |
| | | /// <param name="erporderstus">订单状态码</param> |
| | | /// <param name="erpordercode">订单编号</param> |
| | | /// <param name="saleordercode">销售单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</param> |
| | |
| | | /// <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 paystartdate = null, string payenddate = null, string creatuser = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public HttpResponseMessage ErpOrderSearch(string erporderstus = null, string erpordercode = null,string saleordercode=null, string partcode = null, string partname = null, string partspec = null, string paystartdate = null, string payenddate = null, string creatuser = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //所属组织 |
| | | var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //所属组织类型 |
| | |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.ErpOrderSearch(stu_torgcode, stu_torgtypecode,erporderstus, erpordercode, partcode, partname, partspec, startNum, paydatestartdate, paydateenddate, paydatestartdate1, paydateenddate2, creatuser, endNum, prop, order); |
| | | mes = ProductionManagementBLL.ErpOrderSearch(stu_torgcode, stu_torgtypecode,erporderstus, erpordercode, saleordercode, partcode, partname, partspec, startNum, paydatestartdate, paydateenddate, paydatestartdate1, paydateenddate2, creatuser, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | string erporderid = obj["erporderid"].ToString(); //订单id |
| | | string erpordercode = obj["erpordercode"].ToString(); //订单编号 |
| | | string saleordercode = obj["saleordercode"].ToString(); //销售订单号 |
| | | string partcode = obj["partcode"].ToString(); //产品编码 |
| | | string wkshopcode = obj["wkshopcode"].ToString(); //车间编码 |
| | | string warehousecode = obj["warehousecode"].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, saleOrderDeliveryDate, username); |
| | | mes = ProductionManagementBLL.MarkSaveErpOrder(erporderid, erpordercode, saleordercode, partcode, wkshopcode, warehousecode, erpqty, markqty, ordernum, relse_qty, saleOrderDeliveryDate, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[ERP订单批量下达] |
| | | /// <summary> |
| | | /// ERP订单批量下达 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MarkBatchSaveErpOrder")] |
| | | [HttpPost] |
| | | public HttpResponseMessage MarkBatchSaveErpOrder(List<ErpOrderBatch> obj) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.MarkBatchSaveErpOrder(obj, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ERP订单删除] |
| | | /// <summary> |
| | | /// ERP订单删除 |
| | | /// </summary> |
| | | /// <param name="erporderid">订单id</param> |
| | | /// <param name="erpordercode">订单号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteErpOrder")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteErpOrder(string erporderid, string erpordercode) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.DeleteErpOrder(erporderid, erpordercode, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[MES工单查询] |
| | |
| | | /// <param name="mesorderstus">工单状态码</param> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</param> |
| | | /// <param name="saleordercode">销售单号</param> |
| | | /// <param name="ordertype">单据类型</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderSearch")] |
| | | [HttpGet] |
| | | 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) |
| | | public HttpResponseMessage MesOrderSearch(int page, int rows, string prop, string order, string mesorderstus = null, string mesordercode = null, string sourceorder = null,string saleordercode=null, string ordertype = null, string partcode = null, string partname = null, string partspec = null, string creatuser = null, string createdate = null) |
| | | { |
| | | var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //所属组织 |
| | | var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //所属组织类型 |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.MesOrderSearch(stu_torgcode, stu_torgtypecode,mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | mes = ProductionManagementBLL.MesOrderSearch(stu_torgcode, stu_torgtypecode,mesorderstus, mesordercode, sourceorder, saleordercode, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// </summary> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</param> |
| | | /// <param name="saleordercode">销售单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</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) |
| | | public HttpResponseMessage MesBadOrderSearch(int page, int rows, string prop, string order, string mesordercode = null, string sourceorder = null,string saleordercode=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); |
| | | mes = ProductionManagementBLL.MesBadOrderSearch(mesordercode, sourceorder, saleordercode, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="routecode">工艺路线编码</param> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="is_steprice">是否工价管控</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SelectRouteOrWkshop")] |
| | | [HttpGet] |
| | | public HttpResponseMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode) |
| | | public HttpResponseMessage SelectRouteOrWkshop(string partcode, string routecode, string wkshopcode,string is_steprice) |
| | | { |
| | | mes = ProductionManagementBLL.SelectRouteOrWkshop(partcode, routecode, wkshopcode); |
| | | mes = ProductionManagementBLL.SelectRouteOrWkshop(partcode, routecode, wkshopcode, is_steprice); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单打印更新打印次数] |
| | | /// <summary> |
| | | /// MES工单打印更新打印次数 |
| | | /// </summary> |
| | | /// <param name="wo_code">工单编号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "UpdateMesOrderPrintCount")] |
| | | [HttpPost] |
| | | public HttpResponseMessage UpdateMesOrderPrintCount(string wo_code) |
| | | { |
| | | mes = ProductionManagementBLL.UpdateMesOrderPrintCount(wo_code); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[生产开报工扫码获取当前工序对应的设备(自制)] |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 生产开报工扫码获取工单对应工序任务(自制) |
| | | /// </summary> |
| | | /// <param name="orderstepqrcode">扫描的二维码信息</param> |
| | | /// <param name="wocode">工单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">规格型号</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</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) |
| | | public HttpResponseMessage MesOrderStepSearch(string wocode = null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //所属组织 |
| | | var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //所属组织类型 |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.MesOrderStepSearch(stu_torgcode, stu_torgtypecode,orderstepqrcode, startNum, endNum, prop, order); |
| | | mes = ProductionManagementBLL.MesOrderStepSearch(stu_torgcode, stu_torgtypecode, wocode,partcode,partname,partspec, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// 生产开报工:开工(开始/报工)/外协(发料/收料)时条件判断及数据返回接口 |
| | | /// </summary> |
| | | /// <param name="OperType">操作类型:自制(ZZ)/外协(WX)</param> |
| | | /// <param name="SelectType">操作类型:外协发料标识(OUT)/外协收料标识(IN)</param> |
| | | /// <param name="SelectType">操作类型:自制(开工(START)/报工(REPORT))/外协(发料标识(OUT)/收料标识(IN))</param> |
| | | /// <param name="orderstepqrcode">扫描二维码信息</param> |
| | | /// <param name="stu_torgcode">所属组织编码</param> |
| | | /// <returns></returns> |
| | |
| | | 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(); //不良原因编码 |
| | | string defectlist= obj["defectlist"].ToString();//不良汇总 |
| | | string remarks = obj["remarks"].ToString(); //备注 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, inbarcode, reckway, usergroupcode, reportuser, taskqty, startqty, reportqty, ngqty, badcode, remarks, username); |
| | | List<ReportDefectList> defectobjs = JsonConvert.DeserializeObject<List<ReportDefectList>>(defectlist); |
| | | mes = ProductionManagementBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, eqpcode, inbarcode, reckway, usergroupcode, reportuser, taskqty, startqty, reportqty, defectobjs, remarks, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | 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(); //不良原因编码 |
| | | string defectlist = obj["defectlist"].ToString();//不良汇总 |
| | | string remarks = obj["remarks"].ToString(); //备注 |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inbarcode, inuser, taskqty, sqty, ngqty, badcode, remarks, username); |
| | | List<ReportDefectList> defectobjs = JsonConvert.DeserializeObject<List<ReportDefectList>>(defectlist); |
| | | mes = ProductionManagementBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inbarcode, inuser, taskqty, sqty, defectobjs, remarks, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="mesorderstus">工单状态码</param> |
| | | /// <param name="mesordercode">工单编号</param> |
| | | /// <param name="sourceorder">源单单号</param> |
| | | /// <param name="saleordercode">销售订单号</param> |
| | | /// <param name="ordertype">单据类型</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</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) |
| | | public HttpResponseMessage MesOrderBitchClosedSearch(string mesorderstus = null, string mesordercode = null, string sourceorder = null,string saleordercode=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) |
| | | { |
| | | var stu_torgcode = HttpContext.Current.Request.Cookies["stu_torgcode"].Value.ToString(); //所属组织 |
| | | var stu_torgtypecode = HttpContext.Current.Request.Cookies["description"].Value.ToString(); //所属组织类型 |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductionManagementBLL.MesOrderBitchClosedSearch(stu_torgcode, stu_torgtypecode,mesorderstus, mesordercode, sourceorder, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | mes = ProductionManagementBLL.MesOrderBitchClosedSearch(stu_torgcode, stu_torgtypecode,mesorderstus, mesordercode, sourceorder, saleordercode, ordertype, partcode, partname, partspec, startNum, creatuser, createdate, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |