|
|
@@ -159,6 +159,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("'" + User.CurrentStepCode + "' and ms_sncode='" + code.Text + "'");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
sn_code.Text = code.Text;
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "上料采集成功", sn_code.Text, "");
|
|
|
OperateResult.AppendText(">>序列号" + code.Text + "上料成功\n", Color.Green);
|
|
|
RemainIndex = RemainIndex + 1;
|
|
|
GetCollectItem();
|
|
|
@@ -227,7 +228,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select cm_status,cm_id,cm_stepcode,ms_makecode,cm_mccode,cm_materialtype from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + ma_code.Text + "'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select nvl(cm_status,0)cm_status,cm_id,cm_stepcode,ms_makecode,cm_mccode,cm_materialtype from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + code.Text + "' and cm_makecode='" + ma_code.Text + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
@@ -235,13 +236,14 @@ namespace UAS_MES.Make
|
|
|
string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
|
|
|
string cm_materialtype = dt.Rows[0]["cm_materialtype"].ToString();
|
|
|
string cm_status = dt.Rows[0]["cm_status"].ToString();
|
|
|
- if (cm_materialtype == "1")
|
|
|
+ if (cm_materialtype == "1" && cm_status == "0")
|
|
|
{
|
|
|
dh.ExecuteSql("delete from craftmaterial where cm_sncode='" + code.Text + "' and cm_makecode='" + ma_code.Text + "'", "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 + "'");
|
|
|
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 + "'");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "上料采集", "下料成功", code.Text, "");
|
|
|
OperateResult.AppendText(">>序列号" + code.Text + "下料成功\n", Color.Green, code);
|
|
|
}
|
|
|
else OperateResult.AppendText(">>序列号" + code.Text + "已被扣料,不允许下料\n", Color.Green, code);
|