1.生产报工自制、外协、不良 增加:销售单号
2.报工调整、报工审核 增加:销售单号
3.工序质检方案修改注释掉判断条件
4.设备清单增加 设备履历接口:DeviceManager/DeviceResumeSearch
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备清单查看履历] |
| | | /// <summary> |
| | | /// 设备清单查看履历 |
| | | /// </summary> |
| | | /// <param name="eqpcode">设备编码</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: "DeviceResumeSearch")] |
| | | [HttpGet] |
| | | public JsonResult DeviceResumeSearch(string eqpcode, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | string opendate = ""; //开始时间 |
| | | string closedate = ""; //结束时间 |
| | | if (createdate != "" && createdate != null) |
| | | { |
| | | opendate = createdate.Split('~')[0].ToString(); |
| | | closedate = createdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = DeviceManagerBLL.DeviceResumeSearch(eqpcode, opendate, closedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[设备点检项列表查询] |
| | |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wocode">工单号</param> |
| | | /// <param name="orderno">订单号</param> |
| | | /// <param name="saorderno">销售单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">规格型号</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepSearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderStepSearch(string wkshopcode=null, string wocode = null,string orderno = null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderStepSearch(string wkshopcode=null, string wocode = null,string orderno = null,string saorderno=null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = WorkOrderBLL.MesOrderStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wocode">工单号</param> |
| | | /// <param name="orderno">订单号</param> |
| | | /// <param name="saorderno">销售单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">规格型号</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderWxStepSearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderWxStepSearch(string wkshopcode, string wocode = null, string orderno = null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderWxStepSearch(string wkshopcode, string wocode = null, string orderno = null,string saorderno=null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = WorkOrderBLL.MesOrderWxStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderWxStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wocode">工单号</param> |
| | | /// <param name="orderno">订单号</param> |
| | | /// <param name="saorderno">销售单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">规格型号</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderNgStepSearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderNgStepSearch(string wkshopcode=null, string wocode = null, string orderno = null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderNgStepSearch(string wkshopcode=null, string wocode = null, string orderno = null,string saorderno=null, string partcode = null, string partname = null, string partspec = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = WorkOrderBLL.MesOrderNgStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderNgStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wo_code">工单编号</param> |
| | | /// <param name="orderno">订单号</param> |
| | | /// <param name="saorderno">销售单号</param> |
| | | /// <param name="partnumber">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepVerifySearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null,string orderno=null, string partnumber = null, string partname = null, string partspec = null,string stepcode=null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null,string orderno=null,string saorderno=null, string partnumber = null, string partname = null, string partspec = null,string stepcode=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.MesOrderStepVerifySearch(wkshopcode,wo_code, orderno, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderStepVerifySearch(wkshopcode,wo_code, orderno,saorderno, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <param name="wkshopcode">车间编码</param> |
| | | /// <param name="wo_code">工单编号</param> |
| | | /// <param name="orderno">订单号</param> |
| | | /// <param name="saorderno">销售单号</param> |
| | | /// <param name="partnumber">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="partspec">产品规格</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepReportVerifySearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderStepReportVerifySearch(string reviewstatus=null, string wkshopcode=null, string wo_code = null,string orderno=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 orderno=null,string saorderno=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(reviewstatus,wkshopcode, wo_code, orderno, partnumber, partname, partspec,stepname,reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderStepReportVerifySearch(reviewstatus,wkshopcode, wo_code, orderno,saorderno, partnumber, partname, partspec,stepname,reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备清单查看履历] |
| | | public static ToMessage DeviceResumeSearch(string eqpcode, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return DeviceManagerDAL.DeviceResumeSearch(eqpcode, opendate, closedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备点检项列表查询] |
| | | public static ToMessage DeviceCheckItemSearch(string checkitemcode, string checkitemname, string checkdescr, string isqrcode, string cycle, int startNum, int endNum, string prop, string order) |
| | |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(自制)] |
| | | public static ToMessage MesOrderStepSearch(string wkshopcode, string wocode,string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepSearch(string wkshopcode, string wocode,string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(外协)] |
| | | public static ToMessage MesOrderWxStepSearch(string wkshopcode, string wocode,string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderWxStepSearch(string wkshopcode, string wocode,string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderWxStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderWxStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(不良)] |
| | | public static ToMessage MesOrderNgStepSearch(string wkshopcode, string wocode,string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderNgStepSearch(string wkshopcode, string wocode,string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderNgStepSearch(wkshopcode,wocode, orderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderNgStepSearch(wkshopcode,wocode, orderno, saorderno, partcode, partname, partspec, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | |
| | | #region[生产执行,报工调整数据查询接口] |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code,string orderno, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code,string orderno,string saorderno, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, orderno, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, orderno, saorderno, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | |
| | | |
| | | #region[生产执行,报工审核列表数据查询接口] |
| | | public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code,string orderno, 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 orderno,string saorderno, 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(reviewstatus,wkshopcode, wo_code, orderno, partnumber, partname, partspec, stepname, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderStepReportVerifySearch(reviewstatus,wkshopcode, wo_code, orderno,saorderno, partnumber, partname, partspec, stepname, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[设备清单查看履历] |
| | | public static ToMessage DeviceResumeSearch(string eqpcode, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and AA.operdate between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select top 100 percent AA.*,U.username as operusername from ( |
| | | select '点检' as opertype,chk_user as operuser,chk_date as operdate,chk_result as operresult |
| | | from TEqpchk_Proc_Main where eqp_code=@eqpcode |
| | | union all |
| | | select '保养' as opertype,maint_user as operuser,maint_date as operdate,maint_result as operresult |
| | | from TEqpmaint_Proc_Main where eqp_code=@eqpcode |
| | | union all |
| | | select '待维修' as opertype,request_person as operuser,request_date as operdate,'维修申请' as operresult |
| | | from TEqp_RepairRequest where eqp_code=@eqpcode |
| | | union all |
| | | select '已维修' as opertype,repair_person as operuser,repair_date as operdate,'维修完成' as operresult |
| | | from TEqp_RepairRequest A |
| | | inner join TEqp_Repair B on A.docu_code=B.source_wo |
| | | where A.eqp_code=@eqpcode and B.repair_person<>'' |
| | | union all |
| | | select '已验证' as opertype,verify_person as operuser,verify_date as operdate,B.verify_result as operresult |
| | | from TEqp_RepairRequest A |
| | | inner join TEqp_Repair B on A.docu_code=B.source_wo |
| | | where A.eqp_code=@eqpcode and B.verify_person<>'' |
| | | ) as AA |
| | | left join TUser U on AA.operuser=U.usercode |
| | | where 1=1 " + search + " order by AA.operdate desc "; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.message = "查询成功!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[设备点检项列表查询] |
| | | public static ToMessage DeviceCheckItemSearch(string checkitemcode, string checkitemname, string checkdescr, string isqrcode, string cycle, int startNum, int endNum, string prop, string order) |
| | |
| | | break; |
| | | case "Update"://修改 |
| | | //判断是否生成检验记录(入厂检验(InCheck) 出厂检验(OutCheck) FirstCheck(首检) PatroCheck(巡检) EndCheck(完工检)) |
| | | sql = @"select * from TStepCheckRecord where checkstaned_code=@qualityinsptcode and check_type=@checktype"; |
| | | dynamicParams.Add("@qualityinsptcode", qualityinsptcode); |
| | | dynamicParams.Add("@checktype", checktype); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "修改失败,当前质检方案已生成对应检验记录!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | //sql = @"select * from TStepCheckRecord where checkstaned_code=@qualityinsptcode and check_type=@checktype"; |
| | | //dynamicParams.Add("@qualityinsptcode", qualityinsptcode); |
| | | //dynamicParams.Add("@checktype", checktype); |
| | | //var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | //if (data.Rows.Count > 0) |
| | | //{ |
| | | // mes.code = "300"; |
| | | // mes.count = 0; |
| | | // mes.message = "修改失败,当前质检方案已生成对应检验记录!"; |
| | | // mes.data = null; |
| | | // return mes; |
| | | //} |
| | | //删除质检方案子表 |
| | | sql = @"delete from TStepCheckStandardSub where stepstaned_code=@code"; |
| | | list.Add(new { str = sql, parm = new { code = qualityinsptcode } }); |
| | |
| | | step_code = data0.Rows[j]["step_code"].ToString(), |
| | | route_code = data0.Rows[j]["default_route"].ToString(), |
| | | stepprice = decimal.Parse(data0.Rows[j]["unprice"].ToString() == "" || data0.Rows[j]["unprice"].ToString() == null ? "0" : data0.Rows[j]["unprice"].ToString()), |
| | | plan_quantity = cdqty + (decimal.Parse(markqty) - sumqty), //末单下单数量=切分数量+(下单数量-累计切分下单数量), |
| | | plan_qty = cdqty + (decimal.Parse(markqty) - sumqty), //末单下单数量=切分数量+(下单数量-累计切分下单数量), |
| | | plan_quantity = cdqty, |
| | | plan_qty = cdqty, |
| | | ratio = 0, |
| | | status = orderstatus, |
| | | isbott = data0.Rows[j]["first_choke"].ToString(), |
| | |
| | | |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(自制)] |
| | | public static ToMessage MesOrderStepSearch(string wkshopcode, string wocode,string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepSearch(string wkshopcode, string wocode,string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var sql = ""; |
| | | string search = ""; |
| | |
| | | search += "and A.wo_code=@ordercode "; |
| | | dynamicParams.Add("@ordercode", ordercode); |
| | | } |
| | | if (ordercode != "" && stepcode != "") //工单号不为空,工序号不为空 |
| | | if (saorderno != "" && saorderno != "") //工单号不为空,工序号不为空 |
| | | { |
| | | search += "and A.wo_code=@ordercode "; |
| | | dynamicParams.Add("@ordercode", ordercode); |
| | |
| | | search += "and B.m_po like '%'+@orderno+'%' "; |
| | | dynamicParams.Add("@orderno", orderno); |
| | | } |
| | | if (saorderno != "" && saorderno != null) |
| | | { |
| | | search += "and B.saleOrderCode like '%'+@saorderno+'%' "; |
| | | dynamicParams.Add("@saorderno", saorderno); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and M.partcode like '%'+@partcode+'%' "; |
| | |
| | | dynamicParams.Add("@partspec", partspec); |
| | | } |
| | | //根据条件查询工单工序任务(自制工序) |
| | | sql = @"select A.id,A.status,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.m_po,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | sql = @"select A.id,A.status,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.m_po,B.saleOrderCode,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | S.stepcode,S.stepname,S.descr,A.plan_quantity,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date, |
| | | M.priuserdefnvc1,M.priuserdefnvc2,M.priuserdefnvc3,M.priuserdefnvc4,M.priuserdefnvc5,M.priuserdefnvc6 |
| | | from TK_Wrk_Step A |
| | |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(外协)] |
| | | public static ToMessage MesOrderWxStepSearch(string wkshopcode, string wocode, string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderWxStepSearch(string wkshopcode, string wocode, string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var sql = ""; |
| | | string search = ""; |
| | |
| | | search += "and B.m_po like '%'+@orderno+'%' "; |
| | | dynamicParams.Add("@orderno", orderno); |
| | | } |
| | | if (saorderno != "" && saorderno != null) |
| | | { |
| | | search += "and B.saleOrderCode like '%'+@saorderno+'%' "; |
| | | dynamicParams.Add("@saorderno", saorderno); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and M.partcode like '%'+@partcode+'%' "; |
| | |
| | | dynamicParams.Add("@partspec", partspec); |
| | | } |
| | | //根据条件查询工单工序任务(自制工序) |
| | | sql = @"select A.id,A.status,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.m_po,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | sql = @"select A.id,A.status,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.m_po,B.saleOrderCode,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | S.stepcode,S.stepname,S.descr,A.plan_quantity,A.plan_qty,A.good_qty,A.ng_qty, |
| | | (select isnull(sum(fqty),0) as fqty from TK_Wrk_OutRecord where wo_code=A.wo_code and step_code=A.step_code and style='F') as fqty, |
| | | A.laborbad_qty,A.materielbad_qty,A.plan_startdate,A.plan_enddate,B.lm_date, |
| | |
| | | #endregion |
| | | |
| | | #region[生产开报工扫码获取工单对应工序任务(不良)] |
| | | public static ToMessage MesOrderNgStepSearch(string wkshopcode, string wocode, string orderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderNgStepSearch(string wkshopcode, string wocode, string orderno,string saorderno, string partcode, string partname, string partspec, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var sql = ""; |
| | | string search = ""; |
| | |
| | | search += "and B.m_po like '%'+@orderno+'%' "; |
| | | dynamicParams.Add("@orderno", orderno); |
| | | } |
| | | if (saorderno != "" && saorderno != null) |
| | | { |
| | | search += "and B.saleOrderCode like '%'+@saorderno+'%' "; |
| | | dynamicParams.Add("@saorderno", saorderno); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and M.partcode like '%'+@partcode+'%' "; |
| | |
| | | dynamicParams.Add("@partspec", partspec); |
| | | } |
| | | //根据条件查询工单工序任务(自制工序) |
| | | sql = @"select A.id,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.m_po,M.partcode,M.partname,M.partspec,A.seq,A.isend, |
| | | sql = @"select A.id,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,B.saleOrderCode,B.m_po,M.partcode,M.partname,M.partspec,A.seq,A.isend, |
| | | S.stepcode,S.stepname,S.descr,A.plan_quantity,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date, |
| | | M.priuserdefnvc1,M.priuserdefnvc2,M.priuserdefnvc3,M.priuserdefnvc4,M.priuserdefnvc5,M.priuserdefnvc6 |
| | | from TK_Wrk_Step A |
| | |
| | | try |
| | | { |
| | | //1.根据工单+工序查找当前工序是否首道工序 |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.status, |
| | | sql = @"select A.wo_code,M.m_po,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.status, |
| | | A.plan_quantity,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,A.isbott,A.isend |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | rt.wo_code = data.Rows[0]["wo_code"].ToString(); //工单号 |
| | | rt.orderno = data.Rows[0]["m_po"].ToString(); //订单号 |
| | | rt.partnumber = data.Rows[0]["partcode"].ToString(); //产品编码 |
| | | rt.partname = data.Rows[0]["partname"].ToString(); //产品名称 |
| | | rt.partspec = data.Rows[0]["partspec"].ToString(); //产品规格 |
| | |
| | | |
| | | |
| | | #region[生产执行,报工调整数据查询接口] |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code,string orderno, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code,string orderno,string saorderno, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | { |
| | | search += "and AA.m_po like '%'+@orderno+'%' "; |
| | | dynamicParams.Add("@orderno", orderno); |
| | | } |
| | | if (saorderno != "" && saorderno != null) |
| | | { |
| | | search += "and AA.saleOrderCode like '%'+@saorderno+'%' "; |
| | | dynamicParams.Add("@saorderno", saorderno); |
| | | } |
| | | if (partnumber != "" && partnumber != null) |
| | | { |
| | |
| | | // --------------查询指定自制报工外协收料数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from( |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,M.saleOrderCode,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name, |
| | | B.report_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | |
| | | left join TGroup G on G.usergroupcode=B.usergroup_code |
| | | where A.style='B' and B.style='B' and M.status<>'CLOSED' and A.verify='N' |
| | | union all |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,M.saleOrderCode,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name, |
| | | B.in_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | |
| | | |
| | | |
| | | #region[生产执行,报工审核列表数据查询接口] |
| | | public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code, string orderno, 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 orderno,string saorderno, 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 = ""; |
| | |
| | | { |
| | | search += "and AA.m_po like '%'+@orderno+'%' "; |
| | | dynamicParams.Add("@orderno", orderno); |
| | | } |
| | | if (saorderno != "" && saorderno != null) |
| | | { |
| | | search += "and AA.saleOrderCode like '%'+@saorderno+'%' "; |
| | | dynamicParams.Add("@saorderno", saorderno); |
| | | } |
| | | if (partnumber != "" && partnumber != null) |
| | | { |
| | |
| | | // --------------查询指定自制报工外协收料数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from( |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,M.saleOrderCode,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name, |
| | | B.report_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | |
| | | left join TGroup G on G.usergroupcode=B.usergroup_code |
| | | where A.style='B' and B.style='B' and M.status<>'CLOSED' |
| | | union all |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | select A.id,B.id as sbid,A.wo_code,M.m_po,M.saleOrderCode,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name, |
| | | B.in_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | |
| | | public class ScanStartReportData |
| | | { |
| | | public string wo_code { get; set; } //工单编号 |
| | | public string orderno { get; set; }//订单号 |
| | | public string partnumber { get; set; } //产品编码 |
| | | public string partname { get; set; } //产品名称 |
| | | |
| | |
| | | public class ScanStartReportDataOut |
| | | { |
| | | public string wo_code { get; set; } //工单编号 |
| | | public string orderno { get; set; } //订单号 |
| | | public string partnumber { get; set; } //产品编码 |
| | | public string partname { get; set; } //产品名称 |
| | | public string partspec { get; set; } //产品规格 |
| | |
| | | } |
| | | |
| | | //1.根据工单+工序查找当前工序是否首道工序 |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.stepprice,A.seq,T.flwtype,T.descr,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | sql = @"select A.wo_code,M.m_po,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.stepprice,A.seq,T.flwtype,T.descr,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.wkshopcode = data.Rows[0]["torg_code"].ToString(); //车间编码 |
| | | rt.wkshopname = data.Rows[0]["torg_name"].ToString(); //车间名称 |
| | | rt.wo_code = data.Rows[0]["WO_CODE"].ToString(); //工单号 |
| | | rt.orderno= data.Rows[0]["M_PO"].ToString(); //订单号 |
| | | rt.partnumber = data.Rows[0]["PARTCODE"].ToString(); //产品编码 |
| | | rt.partname = data.Rows[0]["PARTNAME"].ToString(); //产品名称 |
| | | rt.partspec = data.Rows[0]["PARTSPEC"].ToString(); //产品规格 |
| | |
| | | } |
| | | |
| | | //1.根据工单+工序查找当前工序是否首道工序 |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.stepprice,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | sql = @"select A.wo_code,M.m_po,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.stepprice,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.wkshopcode = data.Rows[0]["torg_code"].ToString(); //车间编码 |
| | | rt.wkshopname = data.Rows[0]["torg_name"].ToString(); //车间名称 |
| | | rt.wo_code = data.Rows[0]["WO_CODE"].ToString(); //工单号 |
| | | rt.orderno = data.Rows[0]["M_PO"].ToString(); //订单号 |
| | | rt.partnumber = data.Rows[0]["PARTCODE"].ToString(); //产品编码 |
| | | rt.partname = data.Rows[0]["PARTNAME"].ToString(); //产品名称 |
| | | rt.partspec = data.Rows[0]["PARTSPEC"].ToString(); //产品规格 |
| | |
| | | } |
| | | |
| | | //1.根据工单+工序查找当前工序是否首道工序 |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.stepprice,A.seq,T.flwtype,T.descr,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | sql = @"select A.wo_code,M.m_po,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.stepprice,A.seq,T.flwtype,T.descr,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.wkshopcode = data.Rows[0]["torg_code"].ToString(); //车间编码 |
| | | rt.wkshopname = data.Rows[0]["torg_name"].ToString(); //车间名称 |
| | | rt.wo_code = data.Rows[0]["WO_CODE"].ToString(); //工单号 |
| | | rt.orderno= data.Rows[0]["M_PO"].ToString(); //订单号 |
| | | rt.partnumber = data.Rows[0]["PARTCODE"].ToString(); //产品编码 |
| | | rt.partname = data.Rows[0]["PARTNAME"].ToString(); //产品名称 |
| | | rt.partspec = data.Rows[0]["PARTSPEC"].ToString(); //产品规格 |
| | |
| | | } |
| | | |
| | | //1.根据工单+工序查找当前工序是否首道工序 |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.stepprice,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | sql = @"select A.wo_code,M.m_po,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.stepprice,A.status,A.plan_quantity,A.plan_qty,A.isbott,A.isend,L.torg_code,L.torg_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.wkshopcode = data.Rows[0]["torg_code"].ToString(); //车间编码 |
| | | rt.wkshopname = data.Rows[0]["torg_name"].ToString(); //车间名称 |
| | | rt.wo_code = data.Rows[0]["WO_CODE"].ToString(); //工单号 |
| | | rt.orderno = data.Rows[0]["M_PO"].ToString(); //订单号 |
| | | rt.partnumber = data.Rows[0]["PARTCODE"].ToString(); //产品编码 |
| | | rt.partname = data.Rows[0]["PARTNAME"].ToString(); //产品名称 |
| | | rt.partspec = data.Rows[0]["PARTSPEC"].ToString(); //产品规格 |