|
@@ -288,28 +288,32 @@ namespace UAS_MES_NEW.Make
|
|
|
SQLS.Add(sql.GetString());
|
|
|
if (re_autodecom != "0")
|
|
|
{
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select cm_makecode,cm_soncode,cm_barcode from craftmaterial left join makeserial on ms_makecode=");
|
|
|
- sql.Append("cm_makecode and ms_sncode=cm_sncode and ms_prodcode=cm_maprodcode where ms_id='" + Msid + "'");
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
- string cm_makecode = "";
|
|
|
- string cm_soncode = "";
|
|
|
- string cm_barcode = "";
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- cm_makecode = dt.Rows[0]["cm_makecode"].ToString();
|
|
|
- cm_soncode = dt.Rows[0]["cm_soncode"].ToString();
|
|
|
- cm_barcode = dt.Rows[0]["cm_barcode"].ToString();
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sql.Clear();
|
|
|
sql.Append("update craftmaterial set cm_status=-1,cm_dropcode='" + re_code + "',cm_dropman='" + User.UserCode + "',cm_dropdate=sysdate where ");
|
|
|
sql.Append("cm_firstsn='" + firstsn + "' and nvl(cm_status,0)=0 and exists (select 1 from makesndecompose ");
|
|
|
sql.Append("where msd_recode='" + re_code + "' and msd_fsoncode=cm_fsoncode and msd_stepcode=cm_stepcode)");
|
|
|
SQLS.Add(sql.GetString());
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sql.Clear();
|
|
|
- sql.Append("update makeserial set ms_nextmacode='' where ms_nextmacode='" + cm_makecode + "'");
|
|
|
- sql.Append(" and ms_sncode='" + cm_barcode + "' and ms_prodcode='" + cm_soncode + "' ");
|
|
|
+ sql.Append("update makeserial set ms_nextmacode='' where ms_id in (select a.ms_id from makeserial B INNER JOIN CRAFTMATERIAL ON cm_firstsn=B.ms_firstsn");
|
|
|
+ sql.Append("inner join makeserial a on cm_barcode=A.ms_sncode and cm_soncode=A.ms_prodcode inner join makesndecompose on msd_fsoncode=cm_fsoncode and msd_stepcode=cm_stepcode ");
|
|
|
+ sql.Append("AND A.MS_NEXTMACODE=cm_makecode where b.ms_id='" + Msid + "' and msd_recode='" + re_code + "')");
|
|
|
SQLS.Add(sql.GetString());
|
|
|
}
|
|
|
dh.ExecuteSQLTran(SQLS.ToArray());
|