Commit 153b9b6a authored by 姜春辉's avatar 姜春辉

增加本地库保留自助登记流水 表

parent cccd6a16
<?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>{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GS.Terminal.VisitorSelfService.LocalDB</RootNamespace>
<AssemblyName>GS.Terminal.VisitorSelfService.LocalDB</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="GS.Unitive.Framework.Persistent, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.Persistent.1.4.0.2\lib\net40\GS.Unitive.Framework.Persistent.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<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="自助登记流水.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.VisitorSelfService.LocalDB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.VisitorSelfService.LocalDB")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2d67ce40-81fb-4c5e-af60-1b0cdaf4bce5")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GS.Unitive.Framework.Persistent" version="1.4.0.2" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
using GS.Unitive.Framework.Data.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.LocalDB
{
public class 自助登记流水 : UnitiveObject
{
public 自助登记流水(Session session) : base(session)
{
}
private Guid _Id;
[Key(true)]
public Guid Id
{
get { return _Id; }
set { SetPropertyValue("Id", ref _Id, value); }
}
private string _访客证件号;
public string 访客证件号
{
get { return _访客证件号; }
set { SetPropertyValue("访客证件号", ref _访客证件号, value); }
}
private string _预约访客Id;
public string 预约访客Id
{
get { return _预约访客Id; }
set { SetPropertyValue("预约访客Id", ref _预约访客Id, value); }
}
}
}
......@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Views", "ViewModelView\View
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.VisitorSelfService.Logic", "Logic\GS.Terminal.VisitorSelfService.Logic\GS.Terminal.VisitorSelfService.Logic.csproj", "{72A63753-479C-4603-B152-1326A9ABF737}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.VisitorSelfService.LocalDB", "GS.Terminal.VisitorSelfService.LocalDB\GS.Terminal.VisitorSelfService.LocalDB.csproj", "{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -41,6 +43,10 @@ Global
{72A63753-479C-4603-B152-1326A9ABF737}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72A63753-479C-4603-B152-1326A9ABF737}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72A63753-479C-4603-B152-1326A9ABF737}.Release|Any CPU.Build.0 = Release|Any CPU
{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -49,6 +55,7 @@ Global
{B8146415-FD96-4F1A-8627-4E90C55D0A1B} = {F9D6302D-E62B-4824-9B1E-DADACEC0CB42}
{D38C35DE-4988-4648-9FB6-73932AB2E178} = {F9D6302D-E62B-4824-9B1E-DADACEC0CB42}
{72A63753-479C-4603-B152-1326A9ABF737} = {FEB897EF-8930-46EF-B7B1-22AC424686C4}
{2D67CE40-81FB-4C5E-AF60-1B0CDAF4BCE5} = {FEB897EF-8930-46EF-B7B1-22AC424686C4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D6663188-0D2E-4194-98BE-F87A14BCC977}
......
<?xml version="1.0" encoding="utf-8"?>
<DataSpaces xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Encrypt="false" xmlns="urn:Chinags-DataSpaceConfig">
<Connection Name="sqlite" DBType="SQLITE" Database="accesscontrollocal.db" User="" Password="123" />
<!--<Connection Name="newremotedb" DBType="MSSQL" Server="G8CsuMGIXvISFZeg6h7LXw==" Database="z+C83fAdj1ACJizHGCZYefpbXgl0F0Qs" User="ASzXJHPQZrI=" Password="QBIFkMnkHGk=" />-->
<Connection Name="sqlite" DBType="SQLITE" Database="visitorselfservice.db" User="" Password="123" />
</DataSpaces>
\ No newline at end of file
......@@ -86,6 +86,9 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.112.0\lib\net451\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
......@@ -119,6 +122,10 @@
<Link>Addons\GS.Terminal.VisitorSelfService.Logic\GS.Terminal.Common.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Logic\GS.Terminal.VisitorSelfService.Logic\bin\Debug\GS.Terminal.VisitorSelfService.LocalDB.dll">
<Link>Addons\GS.Terminal.VisitorSelfService.Logic\GS.Terminal.VisitorSelfService.LocalDB.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Logic\GS.Terminal.VisitorSelfService.Logic\bin\Debug\SafeObjectPool.dll">
<Link>Addons\GS.Terminal.VisitorSelfService.Logic\SafeObjectPool.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
......@@ -383,5 +390,7 @@
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\build\OpenCvSharp3-AnyCPU.props'))" />
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.112.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.112.0\build\net451\System.Data.SQLite.Core.targets'))" />
</Target>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.112.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.112.0\build\net451\System.Data.SQLite.Core.targets')" />
</Project>
\ No newline at end of file
......@@ -8,4 +8,5 @@
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="OpenCvSharp3-AnyCPU" version="4.0.0.20181129" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.112.0" targetFramework="net452" />
</packages>
\ No newline at end of file
using GS.Terminal.LogicShell.Interface;
using GS.Terminal.VisitorSelfService.LocalDB;
using GS.Terminal.VisitorSelfService.Logic.Remote;
using GS.Terminal.VisitorSelfService.Logic.Remote.Models;
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
......@@ -59,7 +60,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
MainShell.ShowPrompt("通讯异常.请重试");
return false;
}
if (result.Status) return result.Status;
if (result.Status)
{
SaveToLocalDB(VM.Appointment.idCardNum, appointmentId.ToString("N"));
return result.Status;
}
if (!result.Status && !string.IsNullOrEmpty(result.Message))
{
MainShell.ShowPrompt(result.Message);
......@@ -119,5 +124,15 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
ShowView();
}
private void SaveToLocalDB(string idnum, string dataid)
{
var session = Program._ObjectSpace.Session;
var entity = new 自助登记流水(session)
{
访客证件号 = idnum,
预约访客Id = dataid
};
entity.Save();
}
}
}
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Terminal.VisitorSelfService.LocalDB;
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Unitive.Framework.Data.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -18,6 +20,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private void VM_OnNavigateInto(LogicShell.Interface.IViewModel obj)
{
Summary();
Handlers.GetHandler<HeadHandler>().Stop();
}
......@@ -69,5 +72,16 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
}
return true;
}
private void Summary()
{
Task.Run(() =>
{
var session = Program._ObjectSpace.Session;
var query = session.Query<自助登记流水>();
var count = query.Count(ss => ss.CreationTime.Date == DateTime.Now.Date);
VM.TodayPerson = count;
});
}
}
}
......@@ -149,6 +149,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GS.Terminal.VisitorSelfService.LocalDB\GS.Terminal.VisitorSelfService.LocalDB.csproj">
<Project>{2d67ce40-81fb-4c5e-af60-1b0cdaf4bce5}</Project>
<Name>GS.Terminal.VisitorSelfService.LocalDB</Name>
</ProjectReference>
<ProjectReference Include="..\..\ViewModelView\ViewModels\ViewModels.csproj">
<Project>{B8146415-FD96-4F1A-8627-4E90C55D0A1B}</Project>
<Name>ViewModels</Name>
......
......@@ -6,11 +6,12 @@
<Activator Type="GS.Terminal.VisitorSelfService.Logic.Program"/>
<Runtime>
<Assembly Path="GS.Terminal.VisitorSelfService.Logic.dll" Share="true"/>
<Assembly Path="GS.Terminal.VisitorSelfService.LocalDB.dll" Share="true"/>
</Runtime>
<ObjectSpaces>
<Channel ConnectionName="sqlite" ModelAssembly="GS.Terminal.DoorAccessControl.DB" Name="c1"/>
<Channel ConnectionName="sqlite" ModelAssembly="GS.Terminal.VisitorSelfService.LocalDB" Name="c1"/>
</ObjectSpaces>
<Services>
<Service TypeAndName="GS.Terminal.VisitorSelfService.Logic.AddonService"/>
<!--<Service TypeAndName="GS.Terminal.VisitorSelfService.Logic.AddonService"/>-->
</Services>
</Extensibility>
\ No newline at end of file
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using GS.Unitive.Framework.Core;
using GS.Unitive.Framework.Persistent;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -12,6 +13,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
public class Program : IAddonActivator
{
internal static IAddonContext _Context;
internal static IObjectSpace _ObjectSpace;
internal static Locator vmLocator;
internal static string _logicVersion = "0730";
......@@ -25,6 +27,9 @@ namespace GS.Terminal.VisitorSelfService.Logic
private void Instance_onRuntimeCompleted(object sender)
{
var manager = new ObjectSpaceManager();
_ObjectSpace = manager.CreateObjectSpace(_Context, "c1");
_ObjectSpace.UpdateDataSchema();
Handlers.Product();
ThirdAddon.LogicShell.ShowView(vmLocator.MenuPage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment