|
|
@@ -85,7 +85,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("select ms_makecode,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_colorboxunit,pr_code,pr_colorboxgw,");
|
|
|
- sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw from makeserial left join make on ms_makecode=ma_code left join product on ");
|
|
|
+ sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW from makeserial left join make on ms_makecode=ma_code left join product on ");
|
|
|
sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode='" + sncode.Text + "' order by ms_id desc");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -95,6 +95,7 @@ namespace UAS_MES.Make
|
|
|
string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
|
|
|
string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
|
|
|
string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
|
|
|
+ string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
|
|
|
//赋值重量单位
|
|
|
Weight = double.Parse(_weight == "" ? "0" : _weight);
|
|
|
MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
|
|
|
@@ -129,33 +130,44 @@ namespace UAS_MES.Make
|
|
|
WeightChange = true;
|
|
|
}
|
|
|
double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
|
|
|
- if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
|
|
|
+ if (PR_CHECKCOLORBOXW != "0")
|
|
|
{
|
|
|
- ListViewItem lsi = new ListViewItem();
|
|
|
- lsi.SubItems.Add(sncode.Text);
|
|
|
- lsi.SubItems.Add(ActualWeight.ToString());
|
|
|
- lsi.SubItems.Add(System.DateTime.Now.ToString());
|
|
|
- WeighRecord.Items.Add(lsi);
|
|
|
- //显示最近的三个称量记录
|
|
|
- if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
|
|
|
+ if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
|
|
|
{
|
|
|
- //提示正确返回时传递的信息
|
|
|
- if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
- OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
- LoadCheckQTY();
|
|
|
- OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);
|
|
|
- //记录送检前的最后一个序列号
|
|
|
- LastSncode = sncode.Text;
|
|
|
- if (AutoPrint.Checked)
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>打印条码号" + sncode.Text + "\n", Color.Green);
|
|
|
- Confirm.PerformClick();
|
|
|
- }
|
|
|
- sncode.Text = "";
|
|
|
+ OperateResult.AppendText(">>彩盒" + sncode.Text + "重量检测检测合格\n", Color.Green, sncode);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重", "称量合格", sncode.Text, "");
|
|
|
}
|
|
|
- else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>彩盒" + sncode.Text + "重量检测未通过\n", Color.Red, sncode);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重", "称量不合格", sncode.Text, "");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ListViewItem lsi = new ListViewItem();
|
|
|
+ lsi.SubItems.Add(sncode.Text);
|
|
|
+ lsi.SubItems.Add(ActualWeight.ToString());
|
|
|
+ lsi.SubItems.Add(System.DateTime.Now.ToString());
|
|
|
+ WeighRecord.Items.Add(lsi);
|
|
|
+ OperateResult.AppendText(">>彩盒" + sncode.Text + "称重完成\n", Color.Green, sncode);
|
|
|
+ //显示最近的三个称量记录
|
|
|
+ if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
|
|
|
+ {
|
|
|
+ //提示正确返回时传递的信息
|
|
|
+ if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
+ OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
+ LoadCheckQTY();
|
|
|
+
|
|
|
+ //记录送检前的最后一个序列号
|
|
|
+ LastSncode = sncode.Text;
|
|
|
+ if (AutoPrint.Checked)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>打印条码号" + sncode.Text + "\n", Color.Green);
|
|
|
+ Confirm.PerformClick();
|
|
|
+ }
|
|
|
+ sncode.Text = "";
|
|
|
}
|
|
|
- else OperateResult.AppendText(">>" + sncode.Text + "重量检测未通过\n", Color.Red);
|
|
|
+ else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
|
|
|
//称量是否通过都记录重量
|
|
|
dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'", "update");
|
|
|
sncode.Clear();
|