|
|
@@ -30,6 +30,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
Document doc;
|
|
|
|
|
|
+ Regex re = new Regex("\\d+.\\d+\\w+");
|
|
|
+
|
|
|
Thread thread;
|
|
|
|
|
|
string PR_CHECKCARTONW = "0";
|
|
|
@@ -141,13 +143,13 @@ namespace UAS_MES.Make
|
|
|
//称量合格或不合格都记录重量
|
|
|
if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight && ActualWeight != 0)
|
|
|
{
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱"+ outboxcode.Text + "称重", "称量合格:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱" + outboxcode.Text + "称重", "称量合格:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱"+ outboxcode.Text + "称重", "称量不合格:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱" + outboxcode.Text + "称重", "称量不合格:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red, outboxcode);
|
|
|
return;
|
|
|
@@ -155,7 +157,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱"+ outboxcode.Text + "称重", "称量完成:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱" + outboxcode.Text + "称重", "称量完成:" + weight.Text.Trim(), outboxcode.Text, "");
|
|
|
LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
|
|
|
}
|
|
|
if (AutoPrint.Checked)
|
|
|
@@ -184,7 +186,11 @@ namespace UAS_MES.Make
|
|
|
//{
|
|
|
// OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
//}
|
|
|
- LogicHandler.OutBoxStepPass(outboxcode.Text, ma_code.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage);
|
|
|
+ if (!LogicHandler.OutBoxStepPass(outboxcode.Text, ma_code.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, outboxcode);
|
|
|
+ return;
|
|
|
+ }
|
|
|
dh.UpdateByCondition("package", "pa_printcount= nvl(pa_printcount,0)+1,pa_weight='" + ActualWeight + "',pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + outboxcode.Text + "'");
|
|
|
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='" + outboxcode.Text + "'").ToString() + "' ,PA_CURRENTSTEP = '' ", "pa_outboxcode='" + outboxcode.Text + "'");
|
|
|
LoadCheckQTY();
|
|
|
@@ -207,8 +213,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- weight.Text = serialPort1.ReadLine();
|
|
|
- //weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
+ weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|