|
|
@@ -33,6 +33,7 @@ namespace UAS_MES.Make
|
|
|
|
|
|
string oMsId = "";
|
|
|
|
|
|
+ bool onlyPass = false;
|
|
|
bool hasSnList = false;//记录是否有转换后SN清单
|
|
|
|
|
|
bool hasMakeRule = false;//记录是否有工单防呆规则
|
|
|
@@ -163,6 +164,7 @@ namespace UAS_MES.Make
|
|
|
show_sncode.Text = bsncode;
|
|
|
OperateResult.AppendText(">>请输入SN号\n", Color.Green, sncode);
|
|
|
ChangeResult.Enabled = false;
|
|
|
+ onlyPass = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -206,8 +208,9 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
//防呆验证完成
|
|
|
- if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_id='" + oMsId + "' and ms_sncode='" + sncode.Text + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'") || (!ChangeResult.Checked && (bsncode == sncode.Text)))
|
|
|
+ if ((!ChangeResult.Checked && (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "'") && !onlyPass || onlyPass && bsncode == sncode.Text)) || (ChangeResult.Checked && !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "'")))
|
|
|
{
|
|
|
+ onlyPass = false;
|
|
|
string firstsn = "";
|
|
|
string updateSql = "";
|
|
|
//勾选了修改转换结果
|
|
|
@@ -230,7 +233,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
string insertSql = "insert into makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')";
|
|
|
dh.ExecuteSQLTran(updateSql, insertSql);
|
|
|
- OperateResult.AppendText("<<转换成功\n", Color.Green);
|
|
|
+ OperateResult.AppendText("<<序列号"+bsncode+"成功转换为"+sncode.Text+"\n", Color.Green);
|
|
|
//记录日志
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "序列转换", "转换成功", sncode.Text, "");
|
|
|
LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
|
|
|
@@ -256,7 +259,16 @@ namespace UAS_MES.Make
|
|
|
ChangeResult.Enabled = true;
|
|
|
}
|
|
|
else
|
|
|
- OperateResult.AppendText("<<序列号" + sncode.Text + "已存在,请输入其他序列号\n", Color.Red);
|
|
|
+ {
|
|
|
+ if (onlyPass)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<SN号"+sncode.Text+"错误,已完成转号只允许SN转SN\n", Color.Red);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<SN号" + sncode.Text + "已存在,请输入其他序列号\n", Color.Red);
|
|
|
+ }
|
|
|
+ }
|
|
|
sncode.Text = "";
|
|
|
}
|
|
|
}
|
|
|
@@ -284,6 +296,7 @@ namespace UAS_MES.Make
|
|
|
bsncode = "";
|
|
|
OperateResult.AppendText(">>请输入TSN号\n", Color.Green, show_sncode);
|
|
|
ChangeResult.Enabled = true;
|
|
|
+ onlyPass = false;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 工单号keydown
|