|
|
@@ -155,7 +155,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else if (unload.Checked == true)
|
|
|
{
|
|
|
- if (LogicHandler.CheckStepSNAndMacode(macode, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage))
|
|
|
+ if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out macode, out Msid, out ErrorMessage))
|
|
|
{
|
|
|
dt = (DataTable)dh.ExecuteSql("select ms_firstsn,cm_id,cm_stepcode,ms_makecode,cm_mccode,cm_makecode,cm_craftcode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + macode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -202,7 +202,7 @@ namespace UAS_MES.Make
|
|
|
string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
|
|
|
string sp_tracekind = ListA.Rows[RemainIndex]["sp_tracekind"].ToString();
|
|
|
string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
|
|
|
- if (LogicHandler.CheckSNBeforeLoad(macode, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
|
|
|
+ if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
|
|
|
{
|
|
|
CollectData.Add(code.Text);
|
|
|
CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());
|
|
|
@@ -226,7 +226,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("mcd_stepname,sp_fsoncode,ma_craftcode,ma_craftname,:barcode,1,sysdate,'" + User.UserCode + "',ma_linecode,ma_wccode,");
|
|
|
sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code left join stepproduct on sp_stepcode=mcd_stepcode ");
|
|
|
sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
|
|
|
- sql.Append("where ma_code='" + macode + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
|
|
|
+ sql.Append("where ma_code='" + ma_code.Text + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
|
|
|
dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
|
|
|
//更新半成品SN已被工单使用
|
|
|
dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + ms_sncode.Text + "' and ms_makecode<>'" + ma_code.Text + "')", "update");
|