|
|
@@ -194,8 +194,13 @@ namespace UAS_MES.Make
|
|
|
if (RemainIndex >= RemainList.Length)
|
|
|
{
|
|
|
OperateResult.AppendText(">>当前序列号" + sn_code.Text + "没有需要采集的内容,请采集其他序列号\n", Color.Red);
|
|
|
- sn_code.Text = "";
|
|
|
- code.Text = "";
|
|
|
+ if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sn_code.Text, "上料采集", "上料成功", User.UserCode, out ErrorMessage))
|
|
|
+ {
|
|
|
+ sn_code.Text = "";
|
|
|
+ code.Text = "";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
string sp_soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
|
|
|
@@ -231,8 +236,8 @@ namespace UAS_MES.Make
|
|
|
//进行下料
|
|
|
sql.Clear();
|
|
|
sql.Append("delete from craftmaterial where (cm_sncode in (select sn from makesnrelation where firstsn");
|
|
|
- sql.Append("='"+ ms_firstsn + "') or cm_sncode = '"+ ms_firstsn + "') and cm_makecode = '"+ma_code.Text+"' ");
|
|
|
- sql.Append("and cm_status = 0 and cm_stepcode='"+User.CurrentStepCode+"'");
|
|
|
+ sql.Append("='" + ms_firstsn + "') or cm_sncode = '" + ms_firstsn + "') and cm_makecode = '" + ma_code.Text + "' ");
|
|
|
+ sql.Append("and cm_status = 0 and cm_stepcode='" + User.CurrentStepCode + "'");
|
|
|
dh.ExecuteSql(sql.GetString(), "delete");
|
|
|
LogicHandler.InsertMakeProcess(ms_macode, code.Text, User.UserSourceCode, "上料采集操作", "下料成功", User.UserCode);
|
|
|
int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + code.Text + "'");
|
|
|
@@ -296,7 +301,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append(",pr_id,sp_type,sp_prefix,sp_regex from stepproduct left join product on pr_code=sp_soncode where ");
|
|
|
sql.Append("sp_bomversion='" + mabomversion + "' and sp_craftcode='" + ms_craftcode + "' and sp_stepcode='" + User.CurrentStepCode + "'");
|
|
|
sql.Append("And sp_mothercode ='" + make_prodcode + "' and((sp_type = '物料' and( sp_tracekind <> 2 or sp_tracekind is null))or sp_type <> '物料')");
|
|
|
- sql.Append("and not exists(select 1 from craftmaterial where (cm_sncode='"+ ms_firstsn + "' or cm_sncode in (select sn from makesnrelation where firstsn='"+ms_firstsn+"')) and cm_makecode='" + ma_code.Text+"' and cm_soncode=");
|
|
|
+ sql.Append("and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
|
|
|
sql.Append("sp_soncode and cm_status=0) order by SP_DETNO asc");
|
|
|
dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
sn_code.Text = code.Text;
|