yi eason пре 3 година
родитељ
комит
88f9d8b232

+ 6 - 0
CarLocalMeter/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 80 - 0
CarLocalMeter/CarLocalMeter.csproj

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1A70F24F-2219-453B-A1F1-B31F72048324}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>CarLocalMeter</RootNamespace>
+    <AssemblyName>CarLocalMeter</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 41 - 0
CarLocalMeter/Form1.Designer.cs

@@ -0,0 +1,41 @@
+
+namespace CarLocalMeter
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Text = "Form1";
+        }
+
+        #endregion
+    }
+}
+

+ 20 - 0
CarLocalMeter/Form1.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CarLocalMeter
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 22 - 0
CarLocalMeter/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CarLocalMeter
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 7 - 7
CarMeterSystemTests/Properties/AssemblyInfo.cs → CarLocalMeter/Properties/AssemblyInfo.cs

@@ -5,22 +5,22 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("CarMeterSystemTests")]
+[assembly: AssemblyTitle("CarLocalMeter")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
-[assembly: AssemblyProduct("CarMeterSystemTests")]
-[assembly: AssemblyCopyright("Copyright © HP Inc. 2022")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CarLocalMeter")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
-//将 ComVisible 设置为 false 将使此程序集中的类型
-//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
 //请将此类型的 ComVisible 特性设置为 true。
 [assembly: ComVisible(false)]
 
 // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("5ee4b425-5a69-4821-894f-8fc20a8f1952")]
+[assembly: Guid("1a70f24f-2219-453b-a1f1-b31f72048324")]
 
 // 程序集的版本信息由下列四个值组成: 
 //

+ 70 - 0
CarLocalMeter/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace CarLocalMeter.Properties
+{
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CarLocalMeter.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
CarLocalMeter/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
CarLocalMeter/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace CarLocalMeter.Properties
+{
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
CarLocalMeter/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 0 - 83
CarMeterSystemTests/CarMeterSystemTests.csproj

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{5EE4B425-5A69-4821-894F-8FC20A8F1952}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>CarMeterSystemTests</RootNamespace>
-    <AssemblyName>CarMeterSystemTests</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
-    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
-    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
-    <IsCodedUITest>False</IsCodedUITest>
-    <TestProjectType>UnitTest</TestProjectType>
-    <TargetFrameworkProfile />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-  </ItemGroup>
-  <Choose>
-    <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
-      <ItemGroup>
-        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
-      </ItemGroup>
-    </When>
-    <Otherwise>
-      <ItemGroup>
-        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
-      </ItemGroup>
-    </Otherwise>
-  </Choose>
-  <ItemGroup>
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <Choose>
-    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
-      <ItemGroup>
-        <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-          <Private>False</Private>
-        </Reference>
-        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-          <Private>False</Private>
-        </Reference>
-        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-          <Private>False</Private>
-        </Reference>
-        <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-          <Private>False</Private>
-        </Reference>
-      </ItemGroup>
-    </When>
-  </Choose>
-  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

+ 6 - 1
Common/cacheCls/PbCache.cs

@@ -286,7 +286,7 @@ namespace Common
         public static void Load() 
         {
             
-           isHaveFirst = false;
+            isHaveFirst = false;
             isLockFrm = false;
             isLockWgt = false;
             dtStartTime = null;
@@ -398,6 +398,11 @@ namespace Common
         /// </summary>
         public static string icoredbType { get; set; }
 
+        #region eason add 2023-03-10 用于重命名图片时使用
+        public static string oldTempImgId { get; set; }
+
+        public static string oldActualFirstNo { get; set; }
+        #endregion
 
         #region 扫码器相关
         /// <summary>

+ 20 - 0
HnstMeteringSystem.sln

@@ -42,6 +42,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FantasyCorrector", "Fantasy
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarMeterMonitor", "CarMeterMonitor\CarMeterMonitor.csproj", "{1D59985C-5276-485C-A041-F733F0868BB4}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCollect", "SystemCollect\SystemCollect.csproj", "{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarLocalMeter", "CarLocalMeter\CarLocalMeter.csproj", "{1A70F24F-2219-453B-A1F1-B31F72048324}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -208,6 +212,22 @@ Global
 		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|Any CPU.Build.0 = Release|Any CPU
 		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|x86.ActiveCfg = Release|Any CPU
 		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|x86.Build.0 = Release|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Debug|x86.Build.0 = Debug|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Release|x86.ActiveCfg = Release|Any CPU
+		{DFAD2973-38CB-4EB5-83EF-DA6DAEF7A599}.Release|x86.Build.0 = Release|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Debug|x86.Build.0 = Debug|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|x86.ActiveCfg = Release|Any CPU
+		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 48 - 34
MeterPlugInLibrary/图片处理/ImageCurlControl.cs

@@ -56,29 +56,25 @@ namespace MeterPlugInLibrary
         {
             do
             {
-                int waitSecs = 10000;
+                int waitSecs = 1000;
                 int i = 0;
                 try
                 {
-                    string sPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "imgShort\\";
-                    i = 1;
-                    string picPath = Path.Combine(sPath, "formalImg");
-                    i = 2;
-                    ArrayList UnZipedFiles = GetFiles(picPath, ".jpg");//tmp!
-                    i = 3;
-                    //ZipFiles(UnZipedFiles); //2021年3月2日不再进行图片压缩,直接存到正式文件夹formalImg中
-                    i = 4;
-                    //获取正式目录文件进行上传
-                    ArrayList files = GetFiles(sPath + "formalImg", ".jpg");
-                    i = 5;
-                    UploadFiles(files);
-                    i = 6;
-                    //删除正式目录文件
-                    if (Directory.Exists(sPath))//如果不存在就不用删
+                    //为了避免给图片编号与这边压缩同时操作一个图片,所以需等车辆下去后进行该操作
+                    if (PbCache.collect?.weight < 500 && !string.IsNullOrEmpty(PbCache.oldTempImgId) && !string.IsNullOrEmpty(PbCache.oldActualFirstNo))
                     {
-                        //RemoveRedundantDir(Path.Combine(sPath, "formalImg"), 0);
+
+                        string sPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "imgShort\\";
+                        string picPath = Path.Combine(sPath, "formalImg");
+                        ArrayList UnZipedFiles = GetFiles(picPath, ".jpg");//tmp!
+                        i = 3;
+                        ZipFiles(UnZipedFiles); //2021年3月2日不再进行图片压缩,直接存到正式文件夹formalImg中
+                        i = 4;
+                        //获取正式目录文件进行上传
+                        ArrayList files = GetFiles(sPath + "formalImg", ".jpg");
+                        i = 5;
+                        UploadFiles(files);
                     }
-                    i = 7;
                 }
                 catch (Exception exp)
                 {
@@ -101,26 +97,44 @@ namespace MeterPlugInLibrary
             {
                 if (string.IsNullOrEmpty(fn)) continue;
                 if (!File.Exists(fn)) continue;
-
-                //临时目录图片压缩后存储与正式目录
-                string jpgFile = fn.Replace("tempImg", "formalImg");
-                Image img = ImageZip.BytesToBitmap(ImageZip.ZipImageByte(fn));
-                if (img != null)
+                //如果带tempImg则说明没有压缩过,需要压缩
+                if (fn.Contains("tempImg"))
                 {
-                    //iz.ResourceImage = img;
-                    //压缩图片并保存
-                    //iz.GetReducedImage(AppConfigCache.imgWidth, AppConfigCache.imgHeight).Save(jpgFile);
+                    //临时目录图片压缩后存储与正式目录
+                    string jpgFile = fn.Replace("tempImg", "").Replace(PbCache.oldTempImgId, PbCache.oldActualFirstNo);
 
-                    img.Save(jpgFile);
-                    File.Delete(fn);//删除临时目录数据
+                    Image img = ImageZip.BytesToBitmap(ImageZip.ZipImageByte(fn));
+                    if (img.Width > AppConfigCache.imgWidth && img.Height > AppConfigCache.imgHeight)
+                    {
+                        if (img != null)
+                        {
+                            iz.ResourceImage = img;
+                            //压缩图片并保存
+                            iz.GetReducedImage(AppConfigCache.imgWidth, AppConfigCache.imgHeight).Save(jpgFile);
+
+                            img.Save(jpgFile);
+                            File.Delete(fn);//删除临时目录数据
+                        }
+                    }
+                    else
+                    {
+                        //这个是仪表的那个图
+                        // 将原图片重命名为正式图片名称
+                        if (File.Exists(fn) && fn.Contains(PbCache.oldTempImgId))
+                        {
+                            File.Move(fn, jpgFile);
+                        }
+                    }
                 }
-                else
+                else if(!fn.Contains(PbCache.oldTempImgId) && !fn.Contains(PbCache.oldActualFirstNo))
                 {
-                    iz.ResourceImage = img;
-                    //压缩图片并保存
-                    iz.GetReducedImage(400, 400).Save(jpgFile);
-
-                    //File.Move(fn, jpgFile);
+                    string path= AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "imgShort\\bakImg";
+                    if (!Directory.Exists(path))//如果不存在就创建file文件夹
+                    {
+                        Directory.CreateDirectory(path);
+                    }
+                    //要是正常,则以后这里直接File.Delete(fn);
+                    File.Move(fn, fn.Replace("formalImg", "bakImg"));
                 }
             }
         }

+ 2 - 0
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -339,6 +339,7 @@ namespace MeterSceneLibrary
                                 // 只存在一条有效的一次计量数据
                                 else if (firstList == null || firstList.Count == 1)
                                 {
+                                    /*
                                     // 读结净最小值配置
                                     ComBaseInfoService cbis = new ComBaseInfoService();
                                     RESTfulResult<List<ComBaseInfo>> res = cbis.doQueryBaseList(new ComBaseInfo { baseCode = "001031001" });
@@ -356,6 +357,7 @@ namespace MeterSceneLibrary
                                             }
                                         }
                                     }
+                                    //*/
                                     if (firstList[0].weightType == "0" && list[0].weightTypeNo == "001033001")
                                     {
                                         // 历史皮重验证

+ 4 - 2
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -366,6 +366,7 @@ namespace MeterSceneLibrary
                                             EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
                                             mwaf = entityBase1.format<MeterWorkCarActualFirst>(listPreScale[0], mwaf);
 
+                                            /*
                                             // 读结净最小值配置
                                             ComBaseInfoService cbis = new ComBaseInfoService();
                                             RESTfulResult<List<ComBaseInfo>> res = cbis.doQueryBaseList(new ComBaseInfo { baseCode = "001031001" });
@@ -383,7 +384,7 @@ namespace MeterSceneLibrary
                                                     }
                                                 }
                                             }
-
+                                            //*/
                                             if (Math.Abs(newActualFirst.meterWeight.Value - PbCache.lockWgt) > diffrentWgt || listMonitor.Data[0].validPredictionDiff == "0")
                                             {
                                                 // 将当次一次计量数据重量类型改为毛重
@@ -561,6 +562,7 @@ namespace MeterSceneLibrary
                 // 存在一次计量数据
                 else if(list.Count == 1)
                 {
+                    /*
                     // 读结净最小值配置
                     ComBaseInfoService cbis = new ComBaseInfoService();
                     RESTfulResult<List<ComBaseInfo>> res = cbis.doQueryBaseList(new ComBaseInfo { baseCode = "001031001" });
@@ -578,7 +580,7 @@ namespace MeterSceneLibrary
                             }
                         }
                     }
-
+                    //*/
                     // 校验上次计量数据和当次计量数据是否满足基础配置表中的结净最小值条件
                     if (Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) > diffrentWgt || listMonitor.Data[0].validPredictionDiff == "0")
                     {

+ 1581 - 0
MeterSceneLibrary/JISCO/private/SaveMethod2.cs

@@ -0,0 +1,1581 @@
+using com.hnshituo.core.webapp.vo;
+using Common;
+using OtherInterface;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MeterSceneLibrary.JISCO
+{
+
+    public class SaveMethod
+    {
+        // 一次计量数据
+        private MeterWorkCarActualFirstService mwcfs = new MeterWorkCarActualFirstService();
+        // 车辆委托表
+        private PreTrackScaleService preTrackScaleService = new PreTrackScaleService();
+
+        // 留期限皮操作
+        private MeterBaseTermTareDataService termTareDate = new MeterBaseTermTareDataService();
+
+        private rtInfo rt = new rtInfo();
+
+        // 结净最小值,默认取配置文件
+        private double diffrentWgt = AppConfigCache.differenceWgt;
+
+        // 根据车号查询委托表中未使用和使用中的委托
+        private List<PreTrackScale> listPreScale;
+
+        #region 私有方法
+        /// <summary>
+        /// 保存一次计量数据
+        /// </summary>
+        public rtInfo doAddFirst(PreTrackScale scale,MeterWorkCarActualFirst model)
+        {
+            if(scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                model = entityBase.format<MeterWorkCarActualFirst>(scale, model);
+            }
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = model.baseSpotNo;
+            monitorNote.baseSpotName = model.baseSpotName;
+            monitorNote.operationContent = string.Format("产生一次计量数据");
+            monitorNote.operationTime = model.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = model.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            PbSomeModel<MeterWorkCarActualFirst, MeterMonitorNote, MeterMonitorNote, MeterMonitorNote> pbSomeModel = new PbSomeModel<MeterWorkCarActualFirst, MeterMonitorNote, MeterMonitorNote, MeterMonitorNote>();
+            pbSomeModel.one = model;
+            pbSomeModel.two = monitorNote;
+
+            RESTfulResult<string> rmI = mwcfs.doAdd(pbSomeModel);
+
+            PbCache.yardFirst = model;
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (model.weightType == "0")
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 产生一次计量数据和没有委托的洁净数据
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        public rtInfo doNet(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst2)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 将第一个一次数据状态改为 已结净
+            //actualFirst.valueFlag = "2";
+            netDb.isPreScale = "0";
+            // 复制对象
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                netDb = entityBase.format<MeterWorkCarActual>(scale, netDb);
+                netDb.isPreScale = "1";
+            }
+
+            PbCache.mwPreFirst = actualFirst2;
+            PbCache.isPre = true;
+
+            if (actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value)
+            {
+                actualFirst2.weightType = "0";//毛重
+            }
+            else
+            {
+                actualFirst2.weightType = "1";//皮重
+            }
+
+            netDb.carNo = actualFirst.carNo;
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            /* netDb.tare_man_no = "";
+             netDb.tare_man_name = "";
+             netDb.tare_class = "";
+             netDb.tare_group = "";*/
+
+            // 毛重计量作业编号
+            // netDb.actualFirst1No = actualFirst.meterWeight.Value > PbCache.lockWgt ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            // 皮重计量作业编号
+            // netDb.actualFirst2No = actualFirst.meterWeight.Value < PbCache.lockWgt ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            netDb.actualFirst1No = actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value ? "" : actualFirst.actualFirstNo;
+            netDb.actualFirst2No = actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value ? actualFirst.actualFirstNo : "";
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+            netDb.valueFlag = "1";
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.uploadFlag = "1"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1";//1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                   //要判断下当前是否勾选了不验证皮重
+
+            if (actualFirst2.weightType == "0")
+            {
+                netDb.grossManNo = "system";
+                netDb.grossManName = "system";
+                netDb.grossTime = DateTime.Now;
+
+                netDb.tareManName = actualFirst.createManName;
+                netDb.tareManNo = actualFirst.createManNo;
+                netDb.tareTime = actualFirst.createTime;
+            }
+            else
+            {
+                netDb.tareManName = "system";
+                netDb.tareManNo = "system";
+                netDb.tareTime = DateTime.Now;
+
+                netDb.grossManName = actualFirst.createManName;
+                netDb.grossManNo = actualFirst.createManNo;
+                netDb.grossTime = actualFirst.createTime;
+            }
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+
+            PbCache.yardActual = netDb;
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst2.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst2.baseSpotName;
+            monitorNote.operationContent = string.Format("产生一次计量数据和洁净数据");
+            monitorNote.operationTime = actualFirst2.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst2.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddNet(actualFirst, actualFirst2, netDb, monitorNote, "1");
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value)
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+                
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+
+        /// <summary>
+        /// 混装/混卸保存逻辑
+        /// </summary>
+        /// <param name="scale">委托数据</param>
+        /// <param name="actualFirst">自动创建的一次计量数据</param>
+        /// <param name="actualFirst2">本次一次计量数据</param>
+        public rtInfo doNetHZHX(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst2)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 复制委托
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                netDb = entityBase3.format<MeterWorkCarActual>(scale, netDb);
+                netDb.isPreScale = "1";
+            }
+
+            actualFirst.weightType = "1";
+            actualFirst2.weightType = "0";
+
+            netDb.carNo = actualFirst.carNo;
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < actualFirst2.meterWeight.Value ? actualFirst.meterWeight.Value : actualFirst2.meterWeight.Value; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            /* netDb.tare_man_no = "";
+             netDb.tare_man_name = "";
+             netDb.tare_class = "";
+             netDb.tare_group = "";*/
+
+            //netDb.actualFirst1No = actualFirst.meterWeight.Value > actualFirst2.meterWeight.Value ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            //netDb.actualFirst2No = actualFirst.meterWeight.Value < actualFirst2.meterWeight.Value ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > actualFirst2.meterWeight.Value ? actualFirst.meterWeight.Value : actualFirst2.meterWeight.Value; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.actualFirst2No = actualFirst.actualFirstNo;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.grossManNo = "system";
+            netDb.grossManName = "system";
+            netDb.grossTime = DateTime.Now;
+            netDb.tareManName = "system";
+            netDb.tareManNo = "system";
+            netDb.tareTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+            netDb.valueFlag = "1";
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "1"; //0=有效,1=作废
+            netDb.uploadFlag = "1"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1";//1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                   //要判断下当前是否勾选了不验证皮重
+
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst2.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst2.baseSpotName;
+            monitorNote.operationContent = string.Format("混装/混卸保存逻辑");
+            monitorNote.operationTime = actualFirst2.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst2.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddNetHZHX(actualFirst2, actualFirst2, netDb, monitorNote, "0");
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value)
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 混装/混卸保存逻辑
+        /// </summary>
+        /// <param name="scale">委托数据</param>
+        /// <param name="actualFirst">自动创建的一次计量数据</param>
+        /// <param name="actualFirst2">本次一次计量数据</param>
+        public rtInfo doAddNetNewHZHX(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst2)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 复制委托
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                netDb = entityBase3.format<MeterWorkCarActual>(scale, netDb);
+                netDb.isPreScale = "1";
+            }
+
+            actualFirst.weightType = "1";
+            actualFirst2.weightType = "0";
+
+            netDb.carNo = actualFirst.carNo;
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < actualFirst2.meterWeight.Value ? actualFirst.meterWeight.Value : actualFirst2.meterWeight.Value; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            /* netDb.tare_man_no = "";
+             netDb.tare_man_name = "";
+             netDb.tare_class = "";
+             netDb.tare_group = "";*/
+
+            //netDb.actualFirst1No = actualFirst.meterWeight.Value > actualFirst2.meterWeight.Value ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            //netDb.actualFirst2No = actualFirst.meterWeight.Value < actualFirst2.meterWeight.Value ? actualFirst.actualFirstNo : actualFirst2.actualFirstNo;
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > actualFirst2.meterWeight.Value ? actualFirst.meterWeight.Value : actualFirst2.meterWeight.Value; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.actualFirst2No = actualFirst.actualFirstNo;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.grossManNo = "system";
+            netDb.grossManName = "system";
+            netDb.grossTime = DateTime.Now;
+            netDb.tareManName = "system";
+            netDb.tareManNo = "system";
+            netDb.tareTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+            netDb.valueFlag = "1";
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "1"; //0=有效,1=作废
+            netDb.uploadFlag = "1"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1";//1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                   //要判断下当前是否勾选了不验证皮重
+
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst2.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst2.baseSpotName;
+            monitorNote.operationContent = string.Format("混装/混卸保存逻辑");
+            monitorNote.operationTime = actualFirst2.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst2.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddNetNewHZHX(actualFirst2, actualFirst, netDb, monitorNote, "0");
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (actualFirst2.meterWeight.Value > actualFirst.meterWeight.Value)
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 产生一次计量数据,同时结净并匹配委托
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        public rtInfo doNetAndScale(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst2)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 复制对象
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                netDb = entityBase.format<MeterWorkCarActual>(scale, netDb);
+            }
+
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            /* netDb.tare_man_no = "";
+             netDb.tare_man_name = "";
+             netDb.tare_class = "";
+             netDb.tare_group = "";*/
+
+            netDb.actualFirst1No = actualFirst.actualFirstNo;
+            netDb.actualFirst2No = actualFirst.actualFirstNo;
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.grossManNo = actualFirst.createManNo;
+            netDb.grossManName = actualFirst.createManName;
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+            netDb.valueFlag = "1";
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "0"; //0=有效,1=作废
+            netDb.uploadFlag = "0"; //0=待审核;1:待上传;2=已上传
+                                    //要判断下当前是否勾选了不验证皮重
+
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 产生一次计量数据,同时结净并匹配委托(多委托)
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        public rtInfo doNetAddTwo(List<PreTrackScale> scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst1)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+
+            netDb.actualFirst1No = actualFirst1.meterWeight.Value > actualFirst.meterWeight.Value ? "" : actualFirst.actualFirstNo;
+            netDb.actualFirst2No = actualFirst1.meterWeight.Value > actualFirst.meterWeight.Value ? actualFirst.actualFirstNo : "";
+
+            if (actualFirst1.meterWeight.Value > actualFirst.meterWeight.Value)
+            {
+                actualFirst1.weightType = "0";
+            }
+            else
+            {
+                actualFirst1.weightType = "1";
+            }
+
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < actualFirst1.meterWeight.Value ? actualFirst.meterWeight.Value : actualFirst1.meterWeight.Value; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            
+            netDb.tareClass = actualFirst1.meterClass;
+            netDb.tareGroup = actualFirst1.meterGroup;
+            
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.grossManNo = "system";
+            netDb.grossManName = "system";
+            netDb.grossTime = DateTime.Now;
+            netDb.tareManName = "system";
+            netDb.tareManNo = "system";
+            netDb.tareTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "0"; //0=有效,1=作废
+            netDb.uploadFlag = "0"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1"; //1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                    //要判断下当前是否勾选了不验证皮重
+
+            PbCache.yardActual = netDb;
+            PbCache.yardActual.predictionNo = scale[0].predictionNo;
+            PbCache.yardActual.businessGroup = scale[0].businessGroup;
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetAddTwo(scale, actualFirst1, netDb);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成,双委托洁净";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (actualFirst1.meterWeight.Value > actualFirst.meterWeight.Value)
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 期限皮重保存洁净
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        public rtInfo doNetTermTare(PreTrackScale scale, MeterWorkCarActualFirst actualFirst)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                netDb = entityBase.format<MeterWorkCarActual>(scale, netDb);
+                netDb.isPreScale = "1";//是否匹配委托,0未匹配,1已匹配
+            }
+
+            netDb.actualFirst1No = actualFirst.actualFirstNo;
+
+            netDb.tareTime = DateTime.Now;
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netMode = "2"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "1"; //0=有效,1=作废
+            netDb.uploadFlag = "1"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1"; //1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                    //要判断下当前是否勾选了不验证皮重
+
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.grossManNo = "system";
+            netDb.grossManName = "system";
+            netDb.grossTime = DateTime.Now;
+            netDb.tareManName = "system";
+            netDb.tareManNo = "system";
+            netDb.tareTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetTermTare(actualFirst, netDb,"1");
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = false;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 一车多卸
+        /// a. 取第一条委托正常洁净产生一条净重记录
+        /// b.并自动生成一条一次毛重计量数据并和第二条委托匹配,重量值为当次计量数据中的毛重
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        public rtInfo doNetMass(List<PreTrackScale> scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst1)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 复制对象
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                netDb = entityBase.format<MeterWorkCarActual>(scale[0], netDb);
+            }
+
+            netDb.tareTime = DateTime.Now;
+            netDb.tareWeight = actualFirst.meterWeight.Value < PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁小谁是皮 BourneCao
+            netDb.baseSpot2No = PbCache.sportInfo.baseSpotNo;
+            netDb.baseSpot2Name = PbCache.sportInfo.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            /* netDb.tare_man_no = "";
+             netDb.tare_man_name = "";
+             netDb.tare_class = "";
+             netDb.tare_group = "";*/
+
+            netDb.actualFirst1No = actualFirst.actualFirstNo;
+            netDb.grossTime = actualFirst.createTime;
+            netDb.grossWeight = actualFirst.meterWeight.Value > PbCache.lockWgt ? actualFirst.meterWeight.Value : PbCache.lockWgt; // 谁大谁是毛 BourneCao
+            netDb.baseSpot1No = actualFirst.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.grossManNo = actualFirst.createManNo;
+            netDb.grossManName = actualFirst.createManName;
+            netDb.grossClass = actualFirst.meterClass;
+            netDb.grossGroup = actualFirst.meterGroup;
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.valueFlag = "0"; //0=有效,1=作废
+            netDb.uploadFlag = "0"; //0=待审核;1:待上传;2=已上传
+                                    //要判断下当前是否勾选了不验证皮重
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            return rt;
+        }
+
+        public rtInfo validHisTare(string WeightType = "001033001")
+        {
+            // 查询当前秤点是否启用历史皮重判断(暂时不考虑此限制)By BourneCao
+            //String spotNo = PbCache.sportInfo.baseSpotNo;
+
+            /* 判断当前重量是否满足历史皮重相应限制 */
+            // 读取车辆历史皮重信息
+            List<MeterBaseHisTareData> validHis = getHisTare(PbCache.lockCarNo);
+
+            // 读取历史皮重计算配置
+            MeterBaseHisTareCount hisTareCount = PbCache.tareCount;
+
+            // 没有历史皮重记录,相关操作都可跳过
+            if (validHis.Count >= 1)
+            {
+                double maxWgt = 0, minWgt = 0, wgt = PbCache.lockWgt;
+
+                if (hisTareCount.countTypeNo == "001011001") //固重 当前重量>=历史皮重-固重   当前重量<=历史皮重+固重
+                {
+                    long meterWeight = (PbCache.tareCount.contrastTypeNo == "001012001" ? validHis[0].upWeight.Value : validHis[0].meterWeight.Value);
+
+                    maxWgt = meterWeight + hisTareCount.fixedWeightValue.Value;
+                    minWgt = meterWeight - hisTareCount.fixedWeightValue.Value;
+
+                    if (PbCache.lockWgt >= minWgt && PbCache.lockWgt <= maxWgt)
+                    {
+                        PbCache.monitorResult.valid_wgt = true;
+                    }
+                    else
+                    {
+                        PbCache.monitorResult.valid_wgt = false;
+                        PbCache.ResultMessage = "当前皮重【" + PbCache.lockWgt / 1000 + "T 】不在皮重配置范围,历史皮重为【" + Convert.ToDouble(meterWeight) / 1000 + "T】,偏差最大允许重量为【" + hisTareCount.fixedWeightValue.Value + "kg】";
+                    }
+                }
+                else if (hisTareCount.countTypeNo == "001011002") //比例 当前重量>=历史皮重-历史皮重*比例   当前重量<=历史皮重+历史皮重*比例
+                {
+                    long meterWeight = (PbCache.tareCount.contrastTypeNo == "001012001" ? validHis[0].upWeight.Value : validHis[0].meterWeight.Value);
+
+                    maxWgt = meterWeight + meterWeight * (hisTareCount.rateValue.Value / 100); //历史皮重+历史皮重*比例
+                    minWgt = meterWeight - meterWeight * (hisTareCount.rateValue.Value / 100); //历史皮重-历史皮重*比例
+
+                    if (PbCache.lockWgt >= minWgt && PbCache.lockWgt <= maxWgt)
+                    {
+                        PbCache.monitorResult.valid_wgt = true;
+                    }
+                    else
+                    {
+                        PbCache.monitorResult.valid_wgt = false;
+                        PbCache.ResultMessage = "当前皮重【" + PbCache.lockWgt / 1000 + "T 】不在皮重配置范围,历史皮重为【" + (double)Convert.ToDouble(meterWeight) / 1000 + "T】,偏差最大允许比例值为【" + hisTareCount.fixedWeightValue.Value + "%】";
+                    }
+                }
+                else
+                {
+                    PbCache.monitorResult.valid_wgt = false;
+                    PbCache.ResultMessage = string.Format("未找到历史皮重计算类型{0}配置数据", hisTareCount.countTypeNo);
+                }
+            }
+            else
+            {
+                //if (WeightType == "001033002")
+                //{
+                //    PbCache.monitorResult.valid_wgt = true;
+                //}
+                if (WeightType == "001033002")
+                {
+                    PbCache.monitorResult.valid_wgt = true;
+                }
+                // 毛重
+                else
+                {
+                    PbCache.monitorResult.valid_wgt = false;
+                }
+                //PbCache.ResultMessage = "0";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 验证历史皮重,只计算不报警
+        /// </summary>
+        /// <param name="WeightType"></param>
+        /// <returns></returns>
+        public rtInfo validHisTare2(string WeightType = "001033001")
+        {
+            // 查询当前秤点是否启用历史皮重判断(暂时不考虑此限制)By BourneCao
+            //String spotNo = PbCache.sportInfo.baseSpotNo;
+
+            /* 判断当前重量是否满足历史皮重相应限制 */
+            // 读取车辆历史皮重信息
+            List<MeterBaseHisTareData> validHis = getHisTare(PbCache.lockCarNo);
+
+            // 读取历史皮重计算配置
+            MeterBaseHisTareCount hisTareCount = PbCache.tareCount;
+
+            // 没有历史皮重记录,相关操作都可跳过
+            if (validHis.Count >= 1)
+            {
+                double maxWgt = 0, minWgt = 0, wgt = PbCache.lockWgt;
+
+                if (hisTareCount.countTypeNo == "001011001") //固重 当前重量>=历史皮重-固重   当前重量<=历史皮重+固重
+                {
+                    long meterWeight = (PbCache.tareCount.contrastTypeNo == "001012001" ? validHis[0].upWeight.Value : validHis[0].meterWeight.Value);
+
+                    maxWgt = meterWeight + hisTareCount.fixedWeightValue.Value;
+                    minWgt = meterWeight - hisTareCount.fixedWeightValue.Value;
+
+                    if (PbCache.lockWgt >= minWgt && PbCache.lockWgt <= maxWgt)
+                    {
+                        PbCache.monitorResult.valid_wgt = true;
+                    }
+                    else
+                    {
+                        PbCache.monitorResult.valid_wgt = false;
+                        //PbCache.ResultMessage = "当前皮重【" + PbCache.lockWgt / 1000 + "T 】不在皮重配置范围,历史皮重为【" + Convert.ToDouble(meterWeight) / 1000 + "T】,偏差最大允许重量为【" + hisTareCount.fixedWeightValue.Value + "kg】";
+                    }
+                }
+                else if (hisTareCount.countTypeNo == "001011002") //比例 当前重量>=历史皮重-历史皮重*比例   当前重量<=历史皮重+历史皮重*比例
+                {
+                    long meterWeight = (PbCache.tareCount.contrastTypeNo == "001012001" ? validHis[0].upWeight.Value : validHis[0].meterWeight.Value);
+
+                    maxWgt = meterWeight + meterWeight * (hisTareCount.rateValue.Value / 100); //历史皮重+历史皮重*比例
+                    minWgt = meterWeight - meterWeight * (hisTareCount.rateValue.Value / 100); //历史皮重-历史皮重*比例
+
+                    if (PbCache.lockWgt >= minWgt && PbCache.lockWgt <= maxWgt)
+                    {
+                        PbCache.monitorResult.valid_wgt = true;
+                    }
+                    else
+                    {
+                        PbCache.monitorResult.valid_wgt = false;
+                        //PbCache.ResultMessage = "当前皮重【" + PbCache.lockWgt / 1000 + "T 】不在皮重配置范围,历史皮重为【" + (double)Convert.ToDouble(meterWeight) / 1000 + "T】,偏差最大允许比例值为【" + hisTareCount.fixedWeightValue.Value + "%】";
+                    }
+                }
+                else
+                {
+                    PbCache.monitorResult.valid_wgt = false;
+                    //PbCache.ResultMessage = string.Format("未找到历史皮重计算类型{0}配置数据", hisTareCount.countTypeNo);
+                }
+            }
+            else
+            {
+                // 皮重
+                if (WeightType == "001033002")
+                {
+                    PbCache.monitorResult.valid_wgt = true;
+                }
+                // 毛重
+                else
+                {
+                    PbCache.monitorResult.valid_wgt = false;
+                }
+                //PbCache.monitorResult.valid_wgt = true;
+                //PbCache.ResultMessage = "0";
+            }
+
+            return rt;
+        }
+
+        public List<MeterBaseHisTareData> getHisTare(string carNo)
+        {
+            List<MeterBaseHisTareData> lmhtd = new List<MeterBaseHisTareData>();
+
+            PbCache.monitorResult.haveHisTare = false;//不存在历史皮
+            MeterBaseHisTareDataService mbtds = new MeterBaseHisTareDataService();
+            RESTfulResult<List<MeterBaseHisTareData>> rm = mbtds.doQueryWf(new MeterBaseHisTareData { valueFlag = "0", carNo = carNo });
+            if (rm.Succeed)
+            {
+                if (rm.Data != null && rm.Data.Count > 0)
+                {
+                    PbCache.monitorResult.haveHisTare = true;//存在历史皮
+                    lmhtd = rm.Data;
+                }
+            }
+            else
+            {
+                lmhtd = null;
+            }
+            PbCache.monitorResult.hisTareData = lmhtd;
+            return lmhtd;
+        }
+
+
+        public rtInfo doTermTareData()
+        {
+            MeterBaseTermTareData mbttd = new MeterBaseTermTareData();
+            mbttd.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+            mbttd.baseSpotName = PbCache.sportInfo.baseSpotName;
+            mbttd.carNo = PbCache.collect.carno;
+            mbttd.meterWeight = PbCache.lockWgt;
+            mbttd.valueFlag = "0";
+            mbttd.createTime = DateTime.Now;
+            mbttd.createManNo = PbCache.sportInfo.baseSpotNo;
+            mbttd.createManName = PbCache.sportInfo.baseSpotName;
+            mbttd.meterTime = mbttd.createTime.Value;
+            mbttd.startTime = mbttd.createTime.Value;
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = mbttd.baseSpotNo;
+            monitorNote.baseSpotName = mbttd.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = mbttd.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = mbttd.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            RESTfulResult<string> RESTfulResult = termTareDate.doSaveWf(mbttd, monitorNote);
+
+            rt.result = true;
+            rt.isError = false;
+            rt.resultInfo = "期限皮重保存成功";
+
+            return rt;
+        }
+
+        public rtInfo doTermTareNet(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst1,string flag)
+        {
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doTermTareNet(scale, actualFirst, actualFirst1);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (flag == "1")
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+                else
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 多毛一皮
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doNetAddMuchGross(List<MeterWorkCarActualFirst> actualFirst, MeterWorkCarActualFirst actualFirst1)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst1.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst1.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = actualFirst1.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst1.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetAddMuchGross(actualFirst, actualFirst1, monitorNote);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 多毛一皮
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doNetAddMuchGrossDouble(List<MeterWorkCarActualFirst> actualFirst, MeterWorkCarActualFirst actualFirst1)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst1.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst1.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = actualFirst1.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst1.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetAddMuchGrossDouble(actualFirst, actualFirst1, monitorNote);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 多毛一重
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        public rtInfo doNetAddMuch(MeterWorkCarActualFirst actualFirst)
+        {
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetAddMuch(actualFirst);
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 产生一次计量数据和没有委托的洁净数据
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        public rtInfo doNetError(PreTrackScale scale, MeterWorkCarActualFirst actualFirst, MeterWorkCarActualFirst actualFirst1, MeterWorkCarActualFirst mwaf)
+        {
+            // 构造结净数据
+            MeterWorkCarActual netDb = new MeterWorkCarActual();
+
+            // 将第一个一次数据状态改为 已结净
+            //actualFirst.valueFlag = "2";
+            netDb.isPreScale = "0";
+            // 复制对象
+            if (scale != null)
+            {
+                EntityBase<PreTrackScale> entityBase = new EntityBase<PreTrackScale>();
+                netDb = entityBase.format<MeterWorkCarActual>(scale, netDb);
+                netDb.isPreScale = "1";
+            }
+
+            netDb.carNo = actualFirst.carNo;
+            netDb.tareTime = actualFirst.createTime;
+            netDb.tareWeight = actualFirst.meterWeight.Value;
+            netDb.baseSpot2No = actualFirst.baseSpotNo;
+            netDb.baseSpot2Name = actualFirst.baseSpotName;
+            netDb.tareMode = "2";//1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.actualFirst1No = actualFirst.actualFirstNo;
+            netDb.actualFirst2No = actualFirst1.actualFirstNo;
+            netDb.grossTime = actualFirst1.createTime;
+            netDb.grossWeight = actualFirst1.meterWeight.Value;
+            netDb.baseSpot1No = actualFirst1.baseSpotNo;
+            netDb.baseSpot1Name = actualFirst1.baseSpotName;
+            netDb.grossMode = "2"; // 1:远程计量;2:智能计量;3:手工录入;4:放行智能计量;5:滞后匹配
+            netDb.grossClass = actualFirst1.meterClass;
+            netDb.grossGroup = actualFirst1.meterGroup;
+            netDb.valueFlag = "1";
+
+            netDb.netTime = DateTime.Now;
+
+            //netDb.netManNo = appUser.userid; //净重计量员编码 
+            //netDb.netManName = appUser.username; //净重计量员名称
+            netDb.netSpot3No = PbCache.sportInfo.baseSpotNo; //净重计量点编号
+            netDb.netSpot3Name = PbCache.sportInfo.baseSpotName; //净重计量点
+
+            netDb.addWeight = (actualFirst.addWeight == null ? 0 : actualFirst.addWeight.Value);
+            //净重=毛-皮-附加重量
+            netDb.netWeight = netDb.grossWeight - netDb.tareWeight - netDb.addWeight;
+            netDb.netMode = "1"; //1:正常结净;2:匹配结净
+            netDb.uploadFlag = "1"; //0=待审核;1:待上传;2=已上传
+            netDb.dataSource = "1";//1 = 智能终端,2 = 本地计量,3 = 应急计量,4 = 手动录入(计量票据录入)
+                                   //要判断下当前是否勾选了不验证皮重
+
+            netDb.grossManNo = actualFirst1.createManNo;
+            netDb.grossManName = actualFirst1.createManName;
+            netDb.grossTime = actualFirst1.createTime;
+
+
+            netDb.tareManName = actualFirst.createManNo;
+            netDb.tareManNo = actualFirst.createManName;
+            netDb.tareTime = actualFirst.createTime;
+
+
+            netDb.netManName = "system";
+            netDb.netManNo = "system";
+            netDb.netTime = DateTime.Now;
+            netDb.createManName = "system";
+            netDb.createTime = DateTime.Now;
+            netDb.updateManName = "system";
+            netDb.updateManNo = "system";
+            netDb.updateTime = DateTime.Now;
+
+
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst1.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst1.baseSpotName;
+            monitorNote.operationContent = string.Format("产生一次计量数据和洁净数据");
+            monitorNote.operationTime = actualFirst1.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst1.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            // 保存结净记录,后续改成统一提交模式  BourneCao
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddNetError(actualFirst, mwaf, netDb, monitorNote, "1");
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (mwaf.weightType == "0")
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 较称新增
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doCompare(Hashtable meterWorkCompareSpot)
+        {
+
+            //期限皮重数据保存
+            MeterWorkCompareSpotService actualService = new MeterWorkCompareSpotService();
+            RESTfulResult<string> rmI = actualService.doAdd(meterWorkCompareSpot);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 较称新增
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doCompareModify(MeterWorkCompareSpot meterWorkCompareSpot)
+        {
+
+            //期限皮重数据保存
+            MeterWorkCompareSpotService actualService = new MeterWorkCompareSpotService();
+            RESTfulResult<string> rmI = actualService.doMofity(meterWorkCompareSpot);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 失败执行逻辑
+        /// </summary>
+        public rtInfo doError(string msg)
+        {
+            rt.result = false;
+            rt.isError = true;
+            rt.resultInfo = "计量失败:" + msg;
+            
+            return rt;
+        }
+
+        private Log lg = Log.GetInstance(); //写日志
+
+        public void sendToZnlc()
+        {
+            if (PbCache.sportInfo.baseSpotNo.Equals("JT0005") || PbCache.sportInfo.baseSpotNo.Equals("JT0006")
+              || PbCache.sportInfo.baseSpotNo.Equals("JT0034") || PbCache.sportInfo.baseSpotNo.Equals("JT0035"))
+            {
+                if (PbCache.yardActual != null)
+                {
+                    if (!string.IsNullOrEmpty(PbCache.yardActual.predictionNo))
+                    {
+                        if (PbCache.yardActual.businessGroup.Equals("PO2GM"))
+                        {
+                            string sendResult = ZnlcInterface.sendNet(PbCache.yardActual);
+                            lg.WriteLog(38, "结净发送料场,车号:"+ PbCache.yardActual.carNo + ",毛重:" + PbCache.yardActual.grossWeight + ",返回内容:" + sendResult);
+                            if (sendResult.Contains("error"))
+                            {
+                                //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;
+                            }
+                            else
+                            {
+                                //PbCache.LEDResultMessage = sendResult;
+                            }
+                        }
+                    }
+                }
+                else if (PbCache.yardFirst != null)
+                {
+                    if (!string.IsNullOrEmpty(PbCache.yardFirst.predictionNo))
+                    {
+                        if (PbCache.yardFirst.businessGroup.Equals("PO2GM"))
+                        {
+                            string sendResult = ZnlcInterface.sendFirst(PbCache.yardFirst);
+                            lg.WriteLog(38, "一次发送料场,车号:" + PbCache.yardFirst.carNo + ",重量:" + PbCache.yardFirst.meterWeight + ",返回内容:" + sendResult);
+                            if (sendResult.Contains("error"))
+                            {
+                                //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;
+                            }
+                            else
+                            {
+                                PbCache.LEDResultMessage = sendResult;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 保存一次内倒双委托计量数据
+        /// </summary>
+        public rtInfo doAddDoubleFirst(PreTrackScale scale, PreTrackScale scale1, MeterWorkCarActualFirst model)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = model.baseSpotNo;
+            monitorNote.baseSpotName = model.baseSpotName;
+            monitorNote.operationContent = string.Format("产生一次计量数据");
+            monitorNote.operationTime = model.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = model.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            PbSomeModel<MeterWorkCarActualFirst, PreTrackScale, PreTrackScale, MeterMonitorNote> pbSomeModel = new PbSomeModel<MeterWorkCarActualFirst, PreTrackScale, PreTrackScale, MeterMonitorNote>();
+            pbSomeModel.one = model;
+            pbSomeModel.two = scale;
+            pbSomeModel.three = scale1;
+            pbSomeModel.four = monitorNote;
+
+            RESTfulResult<string> rmI = mwcfs.doDoubleAdd(pbSomeModel);
+
+            PbCache.yardFirst = model;
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (model.weightType == "0")
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+
+            return rt;
+        }
+
+        /// <summary>
+        /// 产生一次计量数据,同时结净并匹配委托(多委托)
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        public rtInfo doAddDoubleNet(PreTrackScale scale, PreTrackScale scale1, MeterWorkCarActualFirst TareactualFirst, MeterWorkCarActualFirst GorssactualFirst, string flag)
+        {
+
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddDoubleNet(scale, scale1, TareactualFirst, GorssactualFirst);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成,双委托洁净";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (flag == "0")
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+                else
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        public rtInfo doTermTareNetDouble(PreTrackScale scale, PreTrackScale scale1, MeterWorkCarActualFirst actualFirst,string flag)
+        {
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doTermTareNetDouble(scale, scale1, actualFirst);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (flag == "1")
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+                else
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 不存期限皮多毛一皮
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doAddDoubleMuchNet(List<MeterWorkCarActualFirst> actualFirsts, MeterWorkCarActualFirst TareactualFirst)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = TareactualFirst.baseSpotNo;
+            monitorNote.baseSpotName = TareactualFirst.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = TareactualFirst.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = TareactualFirst.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddDoubleMuchNet(actualFirsts, TareactualFirst, monitorNote);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        /// <summary>
+        /// 存期限皮多毛一皮
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doAddDoubleMuchNetRetain(List<MeterWorkCarActualFirst> actualFirsts, MeterWorkCarActualFirst TareactualFirst)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = TareactualFirst.baseSpotNo;
+            monitorNote.baseSpotName = TareactualFirst.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = TareactualFirst.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = TareactualFirst.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doAddDoubleMuchNetRetain(actualFirsts, TareactualFirst, monitorNote);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+
+        public rtInfo doTermTareNetDoubleRetain(PreTrackScale scale, PreTrackScale scale1, MeterWorkCarActualFirst TareactualFirst, MeterWorkCarActualFirst GrossactualFirst,string flag)
+        {
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doTermTareNetDoubleRetain(scale, scale1, TareactualFirst, GrossactualFirst);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                if (flag == "1")
+                {
+                    PbCache.isTareWeight = true;//皮重
+                }
+                else
+                {
+                    PbCache.isTareWeight = false;//毛重
+                }
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
+        #endregion
+    }
+}

+ 12 - 0
SystemCollect/Class1.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SystemCollect
+{
+    public class Class1
+    {
+    }
+}

+ 36 - 0
SystemCollect/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("SystemCollect")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SystemCollect")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("dfad2973-38cb-4eb5-83ef-da6daef7a599")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 54 - 0
SystemCollect/SystemCollect.csproj

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>dfad2973-38cb-4eb5-83ef-da6daef7a599</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>SystemCollect</RootNamespace>
+    <AssemblyName>SystemCollect</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System"/>
+    
+    <Reference Include="System.Core"/>
+    <Reference Include="System.Xml.Linq"/>
+    <Reference Include="System.Data.DataSetExtensions"/>
+    
+    
+    <Reference Include="Microsoft.CSharp"/>
+    
+    <Reference Include="System.Data"/>
+    
+    <Reference Include="System.Net.Http"/>
+    
+    <Reference Include="System.Xml"/>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Class1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ </Project>