zoulei 1 year ago
parent
commit
212186f338

+ 2 - 2
XdCxRhDW.App/App.config

@@ -13,10 +13,10 @@
 		<add key="LocalIP" value="" />
 
 		<!--自采集地图源URL-->
-		<add key="ZCJ_URL" value="http://192.168.1.7:12338/static/source/assets/textures"/>
+		<add key="ZCJ_URL" value="http://192.168.1.7:12338/static/source/assets/textures" />
 
 		<!--数据中心地图源URL-->
-		<add key="SJZX_URL" value="http://192.168.1.7:5889/MapServer"/>
+		<add key="SJZX_URL" value="http://192.168.1.7:5889/MapServer" />
 
 	</appSettings>
 	<startup>

+ 0 - 7
XdCxRhDW.App/MainForm.cs

@@ -272,26 +272,20 @@ namespace XdCxRhDW
             KillProcess();
              Process pro = new Process();
             pro.StartInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Service\\CPU参估服务\\CPU参估服务.exe");
-            //pro.StartInfo.CreateNoWindow = true;
             pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             pro.StartInfo.Arguments = $"http://127.0.0.1:{SysConfig.Config.HttpPort}";
-            //pro.StartInfo.UseShellExecute = false;
             pro.Start();
 
             pro = new Process();
             pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             pro.StartInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Service\\GPU参估服务\\GPU参估服务.exe");
-            //pro.StartInfo.CreateNoWindow = true;
             pro.StartInfo.Arguments = $"http://127.0.0.1:{SysConfig.Config.HttpPort}";
-            //pro.StartInfo.UseShellExecute = false;
             pro.Start();
 
             pro = new Process();
             pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             pro.StartInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Service\\信号检测服务\\信号检测服务.exe");
-            //pro.StartInfo.CreateNoWindow = true;
             pro.StartInfo.Arguments = $"http://127.0.0.1:{SysConfig.Config.HttpPort}";
-            //pro.StartInfo.UseShellExecute = false;
             pro.Start();
         }
         private void KillProcess()
@@ -308,7 +302,6 @@ namespace XdCxRhDW
                 }
                 catch
                 {
-                    item.Kill();
                 }
             }
         }

+ 22 - 0
XdCxRhDW.Entity/03.XdCxRhDW.Entity.csproj

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +13,8 @@
     <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Deterministic>true</Deterministic>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -21,6 +24,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <NoWarn>CS1591</NoWarn>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -31,9 +35,18 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
+    <Reference Include="SQLite.CodeFirst, Version=1.7.0.36, Culture=neutral, PublicKeyToken=eb96ba0a78d831a7, processorArchitecture=MSIL">
+      <HintPath>..\packages\SQLite.CodeFirst.1.7.0.36\lib\net45\SQLite.CodeFirst.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Core" />
@@ -67,7 +80,16 @@
     <Compile Include="XlInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <None Include="App.config" />
     <None Include="packages.config" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
+    <Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
+  </Target>
+  <Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
 </Project>

+ 12 - 0
XdCxRhDW.Entity/App.config

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <entityFramework>
+    <providers>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+    </providers>
+  </entityFramework>
+</configuration>

+ 6 - 1
XdCxRhDW.Entity/BaseEntity.cs

@@ -1,4 +1,5 @@
-using System;
+using SQLite.CodeFirst;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
@@ -19,6 +20,7 @@ namespace XdCxRhDW.Entity
         }
         [Key]   // 主键
         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]       // 自增列
+        [Autoincrement]
         [Display(Name ="编号")]
         public int ID { get; set; }
 
@@ -38,6 +40,9 @@ namespace XdCxRhDW.Entity
             this.UpdateTime = DateTime.Now;
         }
         [Display(Name = "编号")]
+        [Key]   // 主键
+        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]       // 自增列
+        [Autoincrement]
         public TID ID { get; set; }
 
         [Display(Name = "创建时间")]

+ 2 - 0
XdCxRhDW.Entity/packages.config

@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
+  <package id="EntityFramework" version="6.4.4" targetFramework="net472" />
   <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
+  <package id="SQLite.CodeFirst" version="1.7.0.36" targetFramework="net472" />
 </packages>

+ 0 - 2
XdCxRhDW.Repostory/EFContext/RHDWContext.cs

@@ -13,7 +13,6 @@ using XdCxRhDW.Entity;
 
 namespace XdCxRhDW.Repostory
 {
-
     /// <summary>
     /// 基础表上下文(id为int)
     /// </summary>
@@ -21,7 +20,6 @@ namespace XdCxRhDW.Repostory
     {
         public RHDWContext() : base("DbCon") //配置使用的连接名
         {
-
         }
 
         protected override void OnModelCreating(DbModelBuilder modelBuilder)