|
|
@@ -92,9 +92,9 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
sql.Clear();
|
|
|
sql.Append("select wm_concat(pr_detail) sp_soncode from stepproduct left join product on pr_code=sp_fsoncode where ");
|
|
|
sql.Append("sp_bomversion='" + ms_bomversion + "' and sp_craftcode='" + ms_craftcode + "' ");
|
|
|
- sql.Append("And sp_mothercode ='" + ms_prodcode + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where ");
|
|
|
- sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_fsoncode=");
|
|
|
- sql.Append("sp_fsoncode and cm_status=0 and cm_stepcode=sp_stepcode)");
|
|
|
+ sql.Append("And sp_mothercode ='" + ms_prodcode + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial left join makematerial on cm_makecode=mm_code and (cm_fsoncode=mm_prodcode or instr(mm_repprodcode,cm_fsoncode)>0) where ");
|
|
|
+ sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and ");
|
|
|
+ sql.Append("(sp_fsoncode=mm_prodcode or sp_fsoncode=mm_repprodcode or cm_fsoncode=sp_fsoncode) and cm_status=0 and cm_stepcode=sp_stepcode)");
|
|
|
DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -116,9 +116,9 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
sql.Clear();
|
|
|
sql.Append("select wm_concat(pr_detail) sp_soncode from stepproduct left join product on pr_code=sp_fsoncode where ");
|
|
|
sql.Append("sp_bomversion='" + ms_bomversion + "' and sp_craftcode='" + ms_craftcode + "' ");
|
|
|
- sql.Append("And sp_mothercode ='" + ms_prodcode + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where ");
|
|
|
- sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_fsoncode=");
|
|
|
- sql.Append("sp_fsoncode and cm_status=0 and cm_stepcode=sp_stepcode) ");
|
|
|
+ sql.Append("And sp_mothercode ='" + ms_prodcode + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial left join makematerial on cm_makecode=mm_code and (cm_fsoncode=mm_prodcode or instr(mm_repprodcode,cm_fsoncode)>0) where ");
|
|
|
+ sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and ");
|
|
|
+ sql.Append("(sp_fsoncode=mm_prodcode or sp_fsoncode=mm_repprodcode or cm_fsoncode=sp_fsoncode) and cm_status=0 and cm_stepcode=sp_stepcode)");
|
|
|
DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
{
|