Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 years ago
parent
commit
4b6c4a9a8c

+ 16 - 7
UAS-MES/FunctionCode/Make/Make_CartonBoxSNWeigh.cs

@@ -36,6 +36,8 @@ namespace UAS_MES.Make
 
         bool LockSn = false;
 
+        Regex re = new Regex("\\d+.\\d+\\w+");
+
         string PR_CHECKCARTONW = "0";
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
@@ -198,15 +200,22 @@ namespace UAS_MES.Make
                         }
                     }
                     OperateResult.AppendText(">>箱号" + outboxcode + "称重完成\n", Color.Green);
-                    if (LogicHandler.CartonBoxStepPass(ma_code.Text, User.UserSourceCode, outboxcode, User.UserCode, "卡通箱:" + outboxcode + "整箱过站", out ErrorMessage))
-                    {
-                        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 + "'");
-                        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 + "'").ToString() + "' ,PA_CURRENTSTEP = '' ", "pa_outboxcode='" + outboxcode + "'");
-                    }
-                    else
+                    //if (LogicHandler.CartonBoxStepPass(ma_code.Text, User.UserSourceCode, outboxcode, User.UserCode, "卡通箱:" + outboxcode + "整箱过站", out ErrorMessage))
+                    //{
+                    //    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 + "'");
+                    //    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 + "'").ToString() + "' ,PA_CURRENTSTEP = '' ", "pa_outboxcode='" + outboxcode + "'");
+                    //}
+                    //else
+                    //{
+                    //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    //}
+                    if (!LogicHandler.OutBoxStepPass(outboxcode, ma_code.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + outboxcode + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        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 + "'");
+                    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 + "'").ToString() + "' ,PA_CURRENTSTEP = '' ", "pa_outboxcode='" + outboxcode + "'");
                     LoadCheckQTY();
                     sncode.Clear();
                 }
@@ -227,7 +236,7 @@ namespace UAS_MES.Make
                         {
                             try
                             {
-                                weight.Text = serialPort1.ReadLine();
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
                             }
                             catch (Exception)
                             {

+ 11 - 6
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -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)
                             {

+ 3 - 10
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -38,6 +38,8 @@ namespace UAS_MES.Make
         string LastSncode;
         bool WeightChange = false;
 
+        Regex re = new Regex("\\d+.\\d+\\w+");
+
         string ErrorMessage;
 
         Thread InitPrint;
@@ -208,16 +210,7 @@ namespace UAS_MES.Make
                         {
                             try
                             {
-                                weight.Text = serialPort1.ReadLine();
-                                //if (pr_colorboxunit.Text == "kg")
-                                //{
-                                //    weight.Text = (float.Parse(weight.Text) / 1000).ToString();
-                                //    WeightChange = true;
-                                //}
-                                //else
-                                //{
-                                //    WeightChange = false;
-                                //}
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
                             }
                             catch (Exception)
                             {

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -208,7 +208,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        if (oMakeCode == ""||(oMakeCode != "" && oMakeCode != ma_code.Text))
+                        if (oMakeCode == "" || (oMakeCode != "" && oMakeCode == ma_code.Text))
                         {
                             oMakeCode = ma_code.Text;
                         }

+ 65 - 2
UAS-MES/UAS-MES.csproj

@@ -38,11 +38,11 @@
     <ProductName>优软MES系统</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>优软MES系统</SuiteName>
-    <MinimumRequiredVersion>1.0.0.490</MinimumRequiredVersion>
+    <MinimumRequiredVersion>1.0.0.524</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>491</ApplicationRevision>
+    <ApplicationRevision>525</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -116,6 +116,15 @@
     <Reference Include="DevComponents.DotNetBar2">
       <HintPath>Tool\DevComponents.DotNetBar2.dll</HintPath>
     </Reference>
+    <Reference Include="DevExpress.Data.v15.2">
+      <HintPath>Tool\DevExpress.Data.v15.2.dll</HintPath>
+    </Reference>
+    <Reference Include="DevExpress.Utils.v15.2">
+      <HintPath>Tool\DevExpress.Utils.v15.2.dll</HintPath>
+    </Reference>
+    <Reference Include="DevExpress.XtraNavBar.v15.2">
+      <HintPath>Tool\DevExpress.XtraNavBar.v15.2.dll</HintPath>
+    </Reference>
     <Reference Include="ExcelHelper">
       <HintPath>Tool\ExcelHelper.dll</HintPath>
     </Reference>
@@ -165,6 +174,12 @@
     <Compile Include="CustomControl\AccordionMenu\AccordionMenu.Designer.cs">
       <DependentUpon>AccordionMenu.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\AccordionMenu\NavagationBar.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="CustomControl\AccordionMenu\NavagationBar.Designer.cs">
+      <DependentUpon>NavagationBar.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\BaseForm\BaseForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -219,6 +234,12 @@
     <Compile Include="CustomControl\ComBoxWithFocus\ComBoxWithFocus.Designer.cs">
       <DependentUpon>ComBoxWithFocus.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\ComBoxWithFocus\ComboxWithTip.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="CustomControl\ComBoxWithFocus\ComboxWithTip.Designer.cs">
+      <DependentUpon>ComboxWithTip.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\ComBoxWithFocus\PrinterCombox.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -358,6 +379,12 @@
     <Compile Include="CustomControl\TextBoxWithIcon\NumOnlyTextBox.Designer.cs">
       <DependentUpon>NumOnlyTextBox.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\TextBoxWithIcon\RoundTextBox.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="CustomControl\TextBoxWithIcon\RoundTextBox.Designer.cs">
+      <DependentUpon>RoundTextBox.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\TextBoxWithIcon\SearchTextBox.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -461,6 +488,12 @@
     <Compile Include="FunctionCode\Make\Make_BigBoxWeight.Designer.cs">
       <DependentUpon>Make_BigBoxWeight.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_CartonBoxSNWeigh.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_CartonBoxSNWeigh.Designer.cs">
+      <DependentUpon>Make_CartonBoxSNWeigh.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_CollectBTMAC.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -569,6 +602,12 @@
     <Compile Include="FunctionCode\Make\Make_PalletWeightRecord.Designer.cs">
       <DependentUpon>Make_PalletWeightRecord.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_PalletWightCollection.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_PalletWightCollection.Designer.cs">
+      <DependentUpon>Make_PalletWightCollection.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_RePrintLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -623,6 +662,12 @@
     <Compile Include="FunctionCode\Query\Query_MakeInf.Designer.cs">
       <DependentUpon>Query_MakeInf.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Query\Query_SpecialReport.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Query\Query_SpecialReport.Designer.cs">
+      <DependentUpon>Query_SpecialReport.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_MendLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1004,12 +1049,18 @@
     <EmbeddedResource Include="CustomControl\AccordionMenu\AccordionMenu.resx">
       <DependentUpon>AccordionMenu.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="CustomControl\AccordionMenu\NavagationBar.resx">
+      <DependentUpon>NavagationBar.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\BaseForm\BaseForm.resx">
       <DependentUpon>BaseForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\ClickPicBox\ClickPicBox.resx">
       <DependentUpon>ClickPicBox.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="CustomControl\ComBoxWithFocus\ComboxWithTip.resx">
+      <DependentUpon>ComboxWithTip.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\ComBoxWithFocus\PrinterCombox.resx">
       <DependentUpon>PrinterCombox.cs</DependentUpon>
     </EmbeddedResource>
@@ -1058,6 +1109,9 @@
     <EmbeddedResource Include="CustomControl\TextBoxWithIcon\NumOnlyTextBox.resx">
       <DependentUpon>NumOnlyTextBox.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="CustomControl\TextBoxWithIcon\RoundTextBox.resx">
+      <DependentUpon>RoundTextBox.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\TextBoxWithIcon\SearchTextBox.resx">
       <DependentUpon>SearchTextBox.cs</DependentUpon>
     </EmbeddedResource>
@@ -1094,6 +1148,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_BigBoxWeight.resx">
       <DependentUpon>Make_BigBoxWeight.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_CartonBoxSNWeigh.resx">
+      <DependentUpon>Make_CartonBoxSNWeigh.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_CollectBTMAC.resx">
       <DependentUpon>Make_CollectBTMAC.cs</DependentUpon>
     </EmbeddedResource>
@@ -1148,6 +1205,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_PalletWeightRecord.resx">
       <DependentUpon>Make_PalletWeightRecord.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_PalletWightCollection.resx">
+      <DependentUpon>Make_PalletWightCollection.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_RePrintLabel.resx">
       <DependentUpon>Make_RePrintLabel.cs</DependentUpon>
     </EmbeddedResource>
@@ -1175,6 +1235,9 @@
     <EmbeddedResource Include="FunctionCode\Query\Query_MakeInf.resx">
       <DependentUpon>Query_MakeInf.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Query\Query_SpecialReport.resx">
+      <DependentUpon>Query_SpecialReport.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_MendLabel.resx">
       <DependentUpon>Special_MendLabel.cs</DependentUpon>
     </EmbeddedResource>