|
@@ -107,7 +107,7 @@ namespace UAS_MES.Make
|
|
|
//根据箱号查询表单数据
|
|
//根据箱号查询表单数据
|
|
|
sql.Clear();
|
|
sql.Clear();
|
|
|
sql.Append("select pa_totalqty,ma_code,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_cartonunit,pr_code,pr_cartongw,");
|
|
sql.Append("select pa_totalqty,ma_code,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_cartonunit,pr_code,pr_cartongw,");
|
|
|
- sql.Append("pr_cartonmaxw,pr_cartonminw from package left join product on pr_code=pa_prodcode left join make on ma_prodcode=pr_code ");
|
|
|
|
|
|
|
+ sql.Append("pr_cartonmaxw,pr_cartonminw,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW from package left join product on pr_code=pa_prodcode left join make on ma_prodcode=pr_code ");
|
|
|
sql.Append("left join makecraftdetail on mcd_macode=ma_code where pa_outboxcode='" + outboxcode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
|
|
sql.Append("left join makecraftdetail on mcd_macode=ma_code where pa_outboxcode='" + outboxcode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
//填充Form的值
|
|
//填充Form的值
|
|
@@ -117,6 +117,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
{
|
|
|
string ErrorMessage;
|
|
string ErrorMessage;
|
|
|
//重量的临时变量
|
|
//重量的临时变量
|
|
|
|
|
+ string PR_CHECKCARTONW = dt.Rows[0]["PR_CHECKCARTONW"].ToString();
|
|
|
string _weight = dt.Rows[0]["pr_cartongw"].ToString();
|
|
string _weight = dt.Rows[0]["pr_cartongw"].ToString();
|
|
|
string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
|
|
string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
|
|
|
string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
|
|
string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
|
|
@@ -134,34 +135,41 @@ namespace UAS_MES.Make
|
|
|
weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
|
}
|
|
}
|
|
|
double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
|
|
double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
|
|
|
- //称量合格或不合格都记录重量
|
|
|
|
|
- if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
|
|
|
|
|
|
|
+ //需要检查称重重量
|
|
|
|
|
+ if (PR_CHECKCARTONW != "0")
|
|
|
{
|
|
{
|
|
|
- if (AutoPrint.Checked)
|
|
|
|
|
|
|
+ //称量合格或不合格都记录重量
|
|
|
|
|
+ if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
|
|
|
{
|
|
{
|
|
|
- if (PrintLabel.Items.Count > 0)
|
|
|
|
|
- {
|
|
|
|
|
- doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
|
|
|
|
|
- Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- OperateResult.AppendText(">>产品" + pr_code.Text + "未维护卡通标签\n", Color.Green);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
|
|
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green,outboxcode);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格", outboxcode.Text, "");
|
|
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red,outboxcode);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
|
|
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
|
|
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
|
|
+ if (AutoPrint.Checked)
|
|
|
{
|
|
{
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格", outboxcode.Text, "");
|
|
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red);
|
|
|
|
|
|
|
+ if (PrintLabel.Items.Count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
|
|
|
|
|
+ Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ OperateResult.AppendText(">>产品" + pr_code.Text + "未维护卡通标签\n", Color.Green);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
ListViewItem lsi = new ListViewItem();
|
|
ListViewItem lsi = new ListViewItem();
|
|
|
lsi.SubItems.Add(outboxcode.Text);
|
|
lsi.SubItems.Add(outboxcode.Text);
|
|
|
lsi.SubItems.Add(ActualWeight.ToString() + pr_cartonunit.Text);
|
|
lsi.SubItems.Add(ActualWeight.ToString() + pr_cartonunit.Text);
|
|
|
lsi.SubItems.Add(System.DateTime.Now.ToString());
|
|
lsi.SubItems.Add(System.DateTime.Now.ToString());
|
|
|
WeighRecord.Items.Add(lsi);
|
|
WeighRecord.Items.Add(lsi);
|
|
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green,outboxcode);
|
|
|
dh.ExecuteSql("update package set pa_weight='" + weight.Text + "', pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
|
|
dh.ExecuteSql("update package set pa_weight='" + weight.Text + "', pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
|
|
|
outboxcode.Clear();
|
|
outboxcode.Clear();
|
|
|
}
|
|
}
|