|
|
@@ -29,6 +29,8 @@ namespace UAS_MES.Make
|
|
|
string ErrorMessage = "";
|
|
|
string oMakeCode = "";
|
|
|
string oMsID = "";
|
|
|
+ string ActWeigh;
|
|
|
+
|
|
|
//称量的标准重量
|
|
|
double Weight;
|
|
|
//最大重量
|
|
|
@@ -111,9 +113,8 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
- if (pr_cartonunit.Text == "kg")
|
|
|
- weight.Text = (double.Parse(weight.Text == "" ? "0" : weight.Text) / 1000).ToString();
|
|
|
+ weight.Text = serialPort1.ReadLine();
|
|
|
+ ActWeigh = weight.Text.Replace("kg", "").Trim();
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
@@ -277,25 +278,29 @@ 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
|
|
|
+ if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
|
|
|
{
|
|
|
- if (ErrorMessage.Contains("AFTERSUCCESS"))
|
|
|
- OperateResult.AppendText(">>" + ErrorMessage + "\n");
|
|
|
- LoadCheckQTY();
|
|
|
- OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
|
|
|
- LastSncode = 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_packageqty=pa_currentqty,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- if (AutoPrint.Checked)
|
|
|
- Print_Click(new object(), new EventArgs());
|
|
|
- }
|
|
|
- LoadData();
|
|
|
- LoadGridData();
|
|
|
- sn_code.Clear();
|
|
|
+ float weigh = float.Parse(ActWeigh);
|
|
|
+ dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
|
|
|
+ LogicHandler.CartonBoxStepPass(ms_makecode.Text, User.UserSourceCode, pa_outboxcode.Text, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", out ErrorMessage);
|
|
|
+ if (AutoPrint.Checked)
|
|
|
+ Print_Click(new object(), new EventArgs());
|
|
|
}
|
|
|
- else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
+ LoadData();
|
|
|
+ LoadGridData();
|
|
|
+ sn_code.Clear();
|
|
|
+ //}
|
|
|
+ //else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
}
|
|
|
else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
}
|