You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.2 KiB
27 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Warehouse.Models.mesModel;
|
|
|
|
namespace Warehouse.DAL.WOStatus
|
|
{
|
|
public class WOStatus
|
|
{
|
|
public List<dynamic> WOStatusInfo(string wo, string sales)
|
|
{
|
|
using (var context = new mesModel())
|
|
{
|
|
string sql = @"select distinct a.serial_nbr,a.workorder,b.sale_order,convert(varchar(100), c.wks_visit_date,120) wks_visit_date
|
|
,e.descriptions process_code,a.exterior_grade,a.el_grade,a.final_grade,d.pmax from mes_main.dbo.assembly_status a
|
|
inner join mes_main.dbo.wo_mfg b on a.workorder = b.workorder
|
|
inner join mes_main.dbo.trace_workstation_visit c on a.serial_nbr = c.serial_nbr and c.wks_id like '%HJJ%'
|
|
left join [mes_level2_iface].[dbo].[iv] d on a.serial_nbr = d.serial_nbr
|
|
left join [mes_main].[dbo].[df_processes] e on a.process_code = e.process_code where 1=1";
|
|
sql += string.IsNullOrEmpty(wo) ? "" : " and a.workorder ='" + wo + "'";
|
|
sql += string.IsNullOrEmpty(sales) ? "" : " and b.sale_order = '" + sales + "'";
|
|
var res = context.DynamicListFromSql(sql, null);
|
|
return res.ToList();
|
|
}
|
|
}
|
|
}
|
|
}
|