|
|
@@ -159,11 +159,11 @@ namespace UAS_MES.Make
|
|
|
string _weight = dt.Rows[0]["pr_cartongw"].ToString();
|
|
|
string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
|
|
|
string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
|
|
|
- PR_CHECKCARTONW = dt.Rows[0]["PR_CHECKCARTONW"].ToString();
|
|
|
- if (PR_CHECKCARTONW != "0")
|
|
|
- checkweightlabel.Text = "需要检测重量";
|
|
|
- else
|
|
|
- checkweightlabel.Text = "不需检测重量";
|
|
|
+ //PR_CHECKCARTONW = dt.Rows[0]["PR_CHECKCARTONW"].ToString();
|
|
|
+ //if (PR_CHECKCARTONW != "0")
|
|
|
+ // checkweightlabel.Text = "需要检测重量";
|
|
|
+ //else
|
|
|
+ // checkweightlabel.Text = "不需检测重量";
|
|
|
//赋值重量单位
|
|
|
Weight = double.Parse(_weight == "" ? "0" : _weight);
|
|
|
MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
|
|
|
@@ -233,6 +233,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
oMsID = dt.Rows[0]["ms_id"].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,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
|
|
|
sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
|
|
|
@@ -333,47 +334,47 @@ namespace UAS_MES.Make
|
|
|
////箱号不存在的情况
|
|
|
if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
|
|
|
{
|
|
|
- if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
|
|
|
+ //if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
|
|
|
+ //{
|
|
|
+ //提示正确返回时传递的信息
|
|
|
+ if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
+ OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
+ LoadCheckQTY();
|
|
|
+ OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
|
|
|
+ LastSncode = sn_code.Text;
|
|
|
+ //满箱更新状态为1
|
|
|
+ LoadData();
|
|
|
+ //采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
|
|
|
+ if (pa_currentqty.Text == "1")
|
|
|
{
|
|
|
- //提示正确返回时传递的信息
|
|
|
- if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
- OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
- LoadCheckQTY();
|
|
|
- OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
|
|
|
- //满箱更新状态为1
|
|
|
- LoadData();
|
|
|
- //采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
|
|
|
- if (pa_currentqty.Text == "1")
|
|
|
- {
|
|
|
- string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
|
|
|
- dh.UpdateByCondition("package", "pa_nextstep='" + nextstepcode + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- }
|
|
|
- if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
|
|
|
+ // string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
|
|
|
+ dh.UpdateByCondition("package", "pa_nextstep='" + User.CurrentStepCode + "', PA_CURRENTSTEP = '" + User.CurrentStepCode + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ }
|
|
|
+ LoadGridData();
|
|
|
+ sn_code.Clear();
|
|
|
+ if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
|
|
|
+ {
|
|
|
+ float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
|
|
|
+ dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weight + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ pa_standardqty.Text = "";
|
|
|
+ pa_status.Text = "1";
|
|
|
+ OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱封箱成功\n", Color.Green);
|
|
|
+ if (PR_CHECKCARTONW != "0")
|
|
|
{
|
|
|
-
|
|
|
- float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
|
|
|
- if (PR_CHECKCARTONW != "0")
|
|
|
+ if (!(weigh >= MinWeight && weigh <= MaxWeight))
|
|
|
{
|
|
|
- if (!(weigh >= MinWeight && weigh <= MaxWeight))
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
|
|
|
- return;
|
|
|
- }
|
|
|
+ OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
|
|
|
+ return;
|
|
|
}
|
|
|
- LogicHandler.CartonBoxStepPass(oMakeCode, User.UserSourceCode, pa_outboxcode.Text, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", out ErrorMessage);
|
|
|
- dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight='" + weigh + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- pa_standardqty.Text = "";
|
|
|
- pa_status.Text = "1";
|
|
|
- OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱封箱成功\n", Color.Green);
|
|
|
- OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量完成\n", Color.Green);
|
|
|
- LastSncode = sn_code.Text;
|
|
|
- if (AutoPrint.Checked)
|
|
|
- Print_Click(new object(), new EventArgs());
|
|
|
}
|
|
|
-
|
|
|
- LoadGridData();
|
|
|
- sn_code.Clear();
|
|
|
+ LogicHandler.CartonBoxStepPass(oMakeCode, 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 + "'");
|
|
|
+ LoadCheckQTY();
|
|
|
+ OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "称量完成\n", Color.Green);
|
|
|
+ if (AutoPrint.Checked)
|
|
|
+ Print_Click(new object(), new EventArgs());
|
|
|
}
|
|
|
+ //}
|
|
|
}
|
|
|
else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
}
|
|
|
@@ -437,25 +438,27 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and nvl(pa_status,0)=0"))
|
|
|
{
|
|
|
-
|
|
|
- if (PR_CHECKCARTONW != "0")
|
|
|
- {
|
|
|
- //检查重量合格
|
|
|
- float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
|
|
|
- if (!(weigh > MinWeight && weigh < MaxWeight))
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (Seal == "Yes")
|
|
|
{
|
|
|
- LogicHandler.CartonBoxStepPass(oMakeCode, User.UserSourceCode, pa_outboxcode.Text, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", out ErrorMessage);
|
|
|
dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
pa_status.Text = "1";
|
|
|
+ pa_standardqty.Text = "";
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");
|
|
|
OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
|
|
|
+ if (PR_CHECKCARTONW != "0")
|
|
|
+ {
|
|
|
+ float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
|
|
|
+ if (!(weigh > MinWeight && weigh < MaxWeight))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LogicHandler.CartonBoxStepPass(oMakeCode, 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 + "'");
|
|
|
+ LoadCheckQTY();
|
|
|
}
|
|
|
}
|
|
|
else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
|