| | |
| | | |
| | | |
| | | #region[生产进度报表] |
| | | public static ToMessage ProductionScheduleReportSearch(string wkshopcode, string status, string wocode, string saleordercode, string routecode, string routename, string partcode, string partname, string partspec, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage ProductionScheduleReportSearch(string wkshopcode, string status, string wocode, string partcode, string partname, string partspec, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | { |
| | | search += "and AA.wo_code like '%'+@wocode+'%' "; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | } |
| | | if (saleordercode != "" && saleordercode != null) |
| | | { |
| | | search += "and AA.saleOrderCode like '%'+@saleordercode+'%' "; |
| | | dynamicParams.Add("@saleordercode", saleordercode); |
| | | } |
| | | if (routecode != "" && routecode != null) |
| | | { |
| | | search += "and AA.route_code like '%'+@routecode+'%' "; |
| | | dynamicParams.Add("@routecode", routecode); |
| | | } |
| | | if (routename != "" && routename != null) |
| | | { |
| | | search += "and AA.route_name like '%'+@routename+'%' "; |
| | | dynamicParams.Add("@routename", routename); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select top 100 percent AA.saleOrderCode,AA.m_po,AA.wkshp_code,AA.wkshp_name,AA.wo_code,AA.status,AA.lm_date, |
| | | AA.route_code,AA.route_name,AA.partcode,AA.partname,AA.partspec,AA.plan_qty,left(AA.concat_name,len(concat_name)-1) as concat_name |
| | | AA.partcode,AA.partname,AA.partspec,AA.plan_qty,left(AA.concat_name,len(concat_name)-1) as concat_name |
| | | from ( |
| | | select E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.org_name as wkshp_name, |
| | | select E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.torg_name as wkshp_name, |
| | | case when W.status='START' then '执行中' when W.status='CLOSED' then '已完成' else '未开始' end as status, |
| | | W.lm_date,W.route_code,R.name as route_name, |
| | | W.lm_date, |
| | | P.partcode,P.partname,P.partspec,W.plan_qty, |
| | | ( |
| | | select s.stepname+'/'+cast(cast(n.good_qty as decimal(18,2)) AS varchar(50))+',' |
| | |
| | | select wo,saleOrderCode from TKimp_Ewo |
| | | ) as E on W.m_po=E.wo |
| | | left join TMateriel_Info P on W.materiel_code=p.partcode |
| | | left join TFlw_Rout R on W.route_code=R.code |
| | | left join TOrganization F on W.wkshp_code=F.org_code |
| | | group by E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.org_name,W.status,W.lm_date,W.route_code,R.name,P.partcode,P.partname,P.partspec,W.plan_qty |
| | | left join TOrganization F on W.wkshp_code=F.torg_code |
| | | group by E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.torg_name,W.status,W.lm_date,P.partcode,P.partname,P.partspec,W.plan_qty |
| | | ) as AA where " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | |
| | | #endregion |
| | | |
| | | #region[生产进度报表导出] |
| | | public static ToMessage ProductionScheduleReportExcelSearch(string wkshopcode, string status, string wocode, string saleordercode, string routecode, string routename, string partcode, string partname, string partspec, string opendate, string closedate) |
| | | public static ToMessage ProductionScheduleReportExcelSearch(string wkshopcode, string status, string wocode,string partcode, string partname, string partspec, string opendate, string closedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | { |
| | | search += "and AA.wo_code like '%'+@wocode+'%' "; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | } |
| | | if (saleordercode != "" && saleordercode != null) |
| | | { |
| | | search += "and AA.saleOrderCode like '%'+@saleordercode+'%' "; |
| | | dynamicParams.Add("@saleordercode", saleordercode); |
| | | } |
| | | if (routecode != "" && routecode != null) |
| | | { |
| | | search += "and AA.route_code like '%'+@routecode+'%' "; |
| | | dynamicParams.Add("@routecode", routecode); |
| | | } |
| | | if (routename != "" && routename != null) |
| | | { |
| | | search += "and AA.route_name like '%'+@routename+'%' "; |
| | | dynamicParams.Add("@routename", routename); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | |
| | | AA.status as 工单状态,AA.lm_date as 单据日期,AA.route_code as 工艺路线编号,AA.route_name as 工艺路线名称, |
| | | AA.partcode as 产品编码,AA.partname as 产品名称,AA.partspec as 产品规格,AA.plan_qty as 任务数量,left(AA.concat_name,len(concat_name)-1) as 生产进度 |
| | | from ( |
| | | select E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.org_name as wkshp_name, |
| | | select E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.torg_name as wkshp_name, |
| | | case when W.status='START' then '执行中' when W.status='CLOSED' then '已完成' else '未开始' end as status, |
| | | W.lm_date,W.route_code,R.name as route_name, |
| | | W.lm_date, |
| | | P.partcode,P.partname,P.partspec,W.plan_qty, |
| | | ( |
| | | select s.stepname+'/'+cast(cast(n.good_qty as decimal(18,2)) AS varchar(50))+',' |
| | |
| | | select wo,saleOrderCode from TKimp_Ewo |
| | | ) as E on W.m_po=E.wo |
| | | left join TMateriel_Info P on W.materiel_code=p.partcode |
| | | left join TFlw_Rout R on W.route_code=R.code |
| | | left join TOrganization F on W.wkshp_code=F.org_code |
| | | group by E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.org_name,W.status,W.lm_date,W.route_code,R.name,P.partcode,P.partname,P.partspec,W.plan_qty |
| | | left join TOrganization F on W.wkshp_code=F.torg_code |
| | | group by E.saleOrderCode,W.m_po,W.wo_code,W.wkshp_code,F.torg_name,W.status,W.lm_date,P.partcode,P.partname,P.partspec,W.plan_qty |
| | | ) as AA |
| | | where " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |