|
|
@@ -80,14 +80,14 @@ namespace UAS_MES.Make
|
|
|
if (pa_outboxcode.Text != "")
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pr_code,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(0,pr_outboxinnerqty)pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join product on pa_prodcode=");
|
|
|
+ sql.Append("select pr_code,pa_outboxcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,pr_outboxinnerqty)pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
|
|
|
sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
Err = "箱号";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select ms_makecode,pr_code,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
|
|
|
+ sql.Append("select ms_makecode,pr_code,pa_makecode,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
|
|
|
sql.Append("pa_outboxcode 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 + "'");
|
|
|
Err = "序列号";
|
|
|
@@ -110,37 +110,6 @@ namespace UAS_MES.Make
|
|
|
pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
|
|
|
}
|
|
|
|
|
|
- private void InsertDetail()
|
|
|
- {
|
|
|
- if (dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_id='" + oMsID + "'").ToString() == sn_code.Text)
|
|
|
- {
|
|
|
- if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
|
|
|
- {
|
|
|
- sql.Clear();
|
|
|
- sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
|
|
|
- sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
- dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
|
|
|
- if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
|
|
|
- //满箱更新状态为1
|
|
|
- if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
|
|
|
- {
|
|
|
- dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- if (AutoPrint.Checked)
|
|
|
- Print_Click(new object(), new EventArgs());
|
|
|
- }
|
|
|
- LoadGridData();
|
|
|
- sn_code.Clear();
|
|
|
- }
|
|
|
- }
|
|
|
- else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
|
|
|
- }
|
|
|
- else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
|
|
|
- }
|
|
|
|
|
|
private void Print_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
@@ -197,7 +166,7 @@ namespace UAS_MES.Make
|
|
|
switch (pr_packrule.Text.ToUpper())
|
|
|
{
|
|
|
case "MAKE":
|
|
|
- if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
|
|
|
+ if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != pa_makecode.Text)
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
|
|
|
return;
|
|
|
@@ -259,7 +228,7 @@ 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(pa_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
|
|
|
@@ -270,6 +239,7 @@ namespace UAS_MES.Make
|
|
|
if (AutoPrint.Checked)
|
|
|
Print_Click(new object(), new EventArgs());
|
|
|
}
|
|
|
+ LoadData();
|
|
|
LoadGridData();
|
|
|
sn_code.Clear();
|
|
|
}
|
|
|
@@ -303,7 +273,7 @@ namespace UAS_MES.Make
|
|
|
private void pr_code_TextChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
LoadCheckQTY();
|
|
|
- pa_outboxcode.MakeCode = ms_makecode.Text;
|
|
|
+ pa_outboxcode.MakeCode = pa_makecode.Text;
|
|
|
pa_outboxcode.ProdCode = pr_code.Text;
|
|
|
pa_outboxcode.Caller = "PACKAGE";
|
|
|
dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
|