|
|
@@ -151,7 +151,17 @@ namespace UAS_MES_NEW.Make
|
|
|
DataTable combinedata = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
//如果绑定的料和上料的料数量一样则可以上料
|
|
|
DataTable be_dt = BaseUtil.filterDataTable(dt1, "sp_ifbeforhandle='是'");
|
|
|
- if (combinedata.Rows.Count == be_dt.Rows.Count && combinedata.Rows.Count > 0)
|
|
|
+ bool Load = false;
|
|
|
+ for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ object value = LabelDataGridView.Rows[i].Cells["BarCode"].Value;
|
|
|
+ object value1 = LabelDataGridView.Rows[i].Cells["sp_ifbeforhandle"].Value;
|
|
|
+ if ((value == null || (value != null && value.ToString() == "")) && value1.ToString() == "是")
|
|
|
+ {
|
|
|
+ Load = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (combinedata.Rows.Count == be_dt.Rows.Count && combinedata.Rows.Count > 0 && Load)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
|
|
|
@@ -201,7 +211,7 @@ namespace UAS_MES_NEW.Make
|
|
|
sn_code.Text = "";
|
|
|
}
|
|
|
}
|
|
|
- else if (!dh.CheckExist("BEFOREHANDPROCESS", "bhp_barcode='" + code.Text + "'"))
|
|
|
+ else
|
|
|
{
|
|
|
bool Filled = true;
|
|
|
for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
|
|
|
@@ -232,6 +242,14 @@ namespace UAS_MES_NEW.Make
|
|
|
set1.ShowDialog();
|
|
|
return;
|
|
|
}
|
|
|
+ if (dh.CheckExist("BEFOREHANDPROCESS", "bhp_barcode='" + code.Text + "'"))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>条码" + code.Text + "已在预加工绑定主板,不允许上料\n", Color.Red, code);
|
|
|
+ SetCheck set1 = new SetCheck("NG", Color.Red);
|
|
|
+ BaseUtil.SetFormCenter(set1);
|
|
|
+ set1.ShowDialog();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (CollectData.Contains(code.Text))
|
|
|
{
|
|
|
OperateResult.AppendText(">>条码" + code.Text + "已经上料\n", Color.Red, code);
|
|
|
@@ -297,13 +315,13 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>预加工条码" + code.Text + "未绑定所有指定物料,请在预加工界面核对\n", Color.Red, code);
|
|
|
- SetCheck set = new SetCheck("NG", Color.Red);
|
|
|
- BaseUtil.SetFormCenter(set);
|
|
|
- set.ShowDialog();
|
|
|
- }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // OperateResult.AppendText(">>预加工条码" + code.Text + "未绑定所有指定物料,请在预加工界面核对\n", Color.Red, code);
|
|
|
+ // SetCheck set = new SetCheck("NG", Color.Red);
|
|
|
+ // BaseUtil.SetFormCenter(set);
|
|
|
+ // set.ShowDialog();
|
|
|
+ //}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -356,6 +374,7 @@ namespace UAS_MES_NEW.Make
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
BaseUtil.SetFormValue(Controls, dt);
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集", "下料成功", code.Text, "");
|
|
|
+ sn_code.Clear();
|
|
|
OperateResult.AppendText(">>序列号" + code.Text + "下料成功\n", Color.Green, code);
|
|
|
}
|
|
|
else OperateResult.AppendText(">>序列号" + code.Text + "未上料,无需下料\n", Color.Red, code);
|
|
|
@@ -506,17 +525,14 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- string soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
|
|
|
- string prdetail = dt1.Rows[RemainIndex]["pr_detail"].ToString();
|
|
|
- OperateResult.AppendText("<<请采集主条码" + prdetail + "数据\n", Color.Black);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
+ for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green);
|
|
|
- code.Text = "";
|
|
|
- sn_code.Text = "";
|
|
|
+ object value = LabelDataGridView.Rows[i].Cells["BarCode"].Value;
|
|
|
+ if (value == null || (value != null && value.ToString() == ""))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<请采集" + dt1.Rows[i]["pr_detail"].ToString() + "数据\n", Color.Black);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|