|
|
@@ -228,23 +228,28 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
|
|
|
if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
|
|
|
{
|
|
|
if (oMsID == "" || oMsID == "null")
|
|
|
{
|
|
|
oMsID = dt.Rows[0]["ms_id"].ToString();
|
|
|
oMsStatus = dt.Rows[0]["ms_status"].ToString();
|
|
|
+ oMakeCode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
}
|
|
|
// PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
|
|
|
sql.Clear();
|
|
|
- sql.Append("select ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
|
|
|
+ sql.Append("select ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
|
|
|
sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
|
|
|
sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ string ms_makecode = "";
|
|
|
+ string ms_prodcode = "";
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
|
|
|
+ ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
+ ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
|
|
|
BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
}
|
|
|
if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
|
|
|
@@ -276,7 +281,7 @@ namespace UAS_MES.Make
|
|
|
switch (pr_packrule.Text.ToUpper())
|
|
|
{
|
|
|
case "MAKE":
|
|
|
- if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != pa_makecode.Text && pa_makecode.Text != "")
|
|
|
+ if (ms_makecode != pa_makecode.Text && pa_makecode.Text != "")
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
|
|
|
return;
|
|
|
@@ -297,7 +302,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
break;
|
|
|
case "PROD":
|
|
|
- if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
|
|
|
+ if (ms_prodcode != pr_code.Text && pr_code.Text != "")
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
|
|
|
return;
|
|
|
@@ -360,7 +365,7 @@ namespace UAS_MES.Make
|
|
|
if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
|
|
|
{
|
|
|
ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim();
|
|
|
- float weigh = float.Parse(ActWeigh);
|
|
|
+ float weigh = float.Parse(ActWeigh);
|
|
|
if (PR_CHECKCARTONW != "0")
|
|
|
{
|
|
|
if (!(weigh >= MinWeight && weigh <= MaxWeight))
|
|
|
@@ -466,7 +471,7 @@ namespace UAS_MES.Make
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
|
|
|
LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
LogicHandler.CartonBoxStepPass(pa_makecode.Text, User.UserSourceCode, pa_outboxcode.Text, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", out ErrorMessage);
|
|
|
- dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
LoadCheckQTY();
|
|
|
}
|
|
|
}
|