1.ERP订单关闭增加单据id
2.MES工单关闭增加源单id关联
| | |
| | | /// <summary> |
| | | /// 生产执行,报工审核列表数据查询接口 |
| | | /// </summary> |
| | | /// <param name="reviewstatus">审核状态</param> |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wo_code">工单编号</param> |
| | | /// <param name="partnumber">产品编码</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepReportVerifySearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderStepReportVerifySearch(string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null,string stepname=null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderStepReportVerifySearch(string reviewstatus=null, string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null,string stepname=null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | string reportdateopendate = ""; //报工开始时间 |
| | | string reportdateclosedate = ""; //报工结束时间 |
| | |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = WorkOrderBLL.MesOrderStepReportVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec,stepname,reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderStepReportVerifySearch(reviewstatus,wkshopcode, wo_code, partnumber, partname, partspec,stepname,reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | |
| | | |
| | | #region[生产执行,报工审核列表数据查询接口] |
| | | public static ToMessage MesOrderStepReportVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderStepReportVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, stepname, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderStepReportVerifySearch(reviewstatus,wkshopcode, wo_code, partnumber, partname, partspec, stepname, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | sql = @"select * from TK_Wrk_Man where m_po=@erpordercode and status<> 'CLOSED'"; |
| | | sql = @"select * from TK_Wrk_Man where m_po=@erpordercode and sourceid=@sourceid and status<> 'CLOSED'"; |
| | | dynamicParams.Add("@erpordercode", erpordercode); |
| | | dynamicParams.Add("@sourceid", erporderid); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "当前订单有下达未关闭的MES工单,订单不允许关闭,请先删除或关闭相关工单!"; |
| | | mes.message = "当前订单产品有下达未关闭的MES工单,订单不允许关闭,请先删除或关闭相关工单!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | else |
| | | { |
| | |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.torg_name as wkshp_name, |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date,A.data_sources |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | | left join TOrganization C on A.wkshp_code=C.torg_code |
| | | left join TSecStck D on A.stck_code=D.code |
| | |
| | | |
| | | |
| | | #region[生产执行,报工审核列表数据查询接口] |
| | | public static ToMessage MesOrderStepReportVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (reviewstatus != "" && reviewstatus != null) |
| | | { |
| | | search += "and AA.verify=@reviewstatus "; |
| | | dynamicParams.Add("@reviewstatus", reviewstatus); |
| | | } |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and AA.wkshp_code=@wkshopcode "; |
| | |
| | | left join TCustomer E on A.wx_code = E.code |
| | | left join TCustomer C on A.wx_code=C.code |
| | | where A.style = 'S' and B.style = 'S' and M.status<>'CLOSED' |
| | | ) as AA where" + search; |
| | | ) as AA where " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.message = "查询成功!"; |