|
|
@@ -77,7 +77,6 @@ namespace UAS_MES.Make
|
|
|
|
|
|
private void Confirm_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- //模拟键盘事件
|
|
|
KeyEventArgs e2 = new KeyEventArgs(Keys.Enter);
|
|
|
code_KeyDown(sender, e2);
|
|
|
}
|
|
|
@@ -153,9 +152,7 @@ namespace UAS_MES.Make
|
|
|
code.Text = "";
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>序列号无前段工单\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
else if (make_code == ma_code.Text && nextstepcode == User.CurrentStepCode)
|
|
|
@@ -215,9 +212,7 @@ namespace UAS_MES.Make
|
|
|
code.Text = "";
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>序列号" + code.Text + "错误\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -228,10 +223,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
//输入框有值但未选择工单号
|
|
|
else if (code.Text != "" && ma_code.Text == "" && sn_code.Text == "")
|
|
|
- {
|
|
|
- Console.WriteLine("fiugwabkrflbslvblebf");
|
|
|
GetCollectItem();
|
|
|
- }
|
|
|
//序列号不为空的时候
|
|
|
else if (sn_code.Text != "")
|
|
|
{
|
|
|
@@ -261,18 +253,12 @@ namespace UAS_MES.Make
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
if (dh.getRowCount("craftmaterial", "cm_sncode='" + sn_code.Text + "' and cm_barcode='" + code.Text + "' and cm_soncode='" + sp_soncode + "'") > 0)
|
|
|
- {
|
|
|
OperateResult.AppendText(">>条码已采集过\n", Color.Red);
|
|
|
- }
|
|
|
else
|
|
|
- {
|
|
|
Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>序列号不存在\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
//单件管控物料
|
|
|
else if (pr_tracekind == "1")
|
|
|
@@ -281,20 +267,14 @@ namespace UAS_MES.Make
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
if (sp_soncode != dt.Rows[0]["bar_prodcode"].ToString())
|
|
|
- {
|
|
|
OperateResult.AppendText(">>用户条码号对应的物料不是:" + sp_soncode + "\n");
|
|
|
- }
|
|
|
else
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterail where cm_soncode='" + sp_soncode + "' and cm_barcode='" + code.Text + "'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial where cm_soncode='" + sp_soncode + "' and cm_barcode='" + code.Text + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
OperateResult.AppendText(">>条码已采集过\n", Color.Red);
|
|
|
- }
|
|
|
else
|
|
|
- {
|
|
|
Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -317,28 +297,18 @@ namespace UAS_MES.Make
|
|
|
//进行正则表达式匹配
|
|
|
Regex re = new Regex(sp_regex);
|
|
|
if (re.IsMatch(code.Text))
|
|
|
- {
|
|
|
Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
|
|
|
- }
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>正则表达式不匹配\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>长度不匹配\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>前缀不匹配\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -386,9 +356,7 @@ namespace UAS_MES.Make
|
|
|
LogicHandler.InsertMakeProcess(ms_macode, sn_code.Text, "下料成功", User.UserName);
|
|
|
int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + sn_code.Text + "'");
|
|
|
if (count == 0)
|
|
|
- {
|
|
|
dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
|
|
|
- }
|
|
|
OperateResult.AppendText(">>下料成功\n", Color.Green);
|
|
|
code.Text = "";
|
|
|
}
|
|
|
@@ -402,17 +370,11 @@ namespace UAS_MES.Make
|
|
|
string ms_status = dt.Rows[0]["ms_status"].ToString();
|
|
|
string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
|
|
|
if (ms_status == "1" && ms_nextstepcode != User.CurrentStepCode)
|
|
|
- {
|
|
|
OperateResult.AppendText(">>该序列号当前工序不是" + User.CurrentStepName + "\n", Color.Red);
|
|
|
- }
|
|
|
else if (ms_status == "0" && ms_nextstepcode != User.CurrentStepCode)
|
|
|
- {
|
|
|
OperateResult.AppendText(">>该序列号当前工序不是" + User.CurrentStepName + "\n", Color.Red);
|
|
|
- }
|
|
|
else if (ms_status == "2" && ms_nextstepcode != User.CurrentStepCode)
|
|
|
- {
|
|
|
OperateResult.AppendText(">>该序列号已经包装\n", Color.Red);
|
|
|
- }
|
|
|
else
|
|
|
{
|
|
|
dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial where cm_sncode='" + sn_code.Text + "'", "select");
|
|
|
@@ -422,9 +384,7 @@ namespace UAS_MES.Make
|
|
|
sn_code.Text = code.Text;
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
OperateResult.AppendText(">>该序列号未上料,无需下料\n", Color.Red);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
code.Text = "";
|