Commit 540c30d6 by 刘军

提交代码

parents
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnalyzeTask", "AnalyzeTask\AnalyzeTask.csproj", "{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestTask", "UnitTestTask\UnitTestTask.csproj", "{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}.Release|Any CPU.Build.0 = Release|Any CPU
{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7470908F-A108-44F7-97DC-DF06C2EBEAE3}
EndGlobalSection
EndGlobal
<?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>{DC081EC2-FAAC-4DCB-9491-7FC39C81F927}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AnalyzeTask</RootNamespace>
<AssemblyName>AnalyzeTask</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>H:\项目空间\北大一院\Release\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>D415B40D6385639D3E66718189758F4D3A9522B7</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>AnalyzeTask_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=1.60.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.60.6\lib\net451\Dapper.dll</HintPath>
</Reference>
<Reference Include="Dapper.Contrib, Version=1.60.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.Contrib.1.60.1\lib\net451\Dapper.Contrib.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
<HintPath>..\packages\Oracle.ManagedDataAccess.19.3.1\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=2.6.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.2.6.0\lib\net40\Quartz.dll</HintPath>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.2.8.0\lib\net46\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.Console, Version=3.1.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.Sinks.Console.3.1.1\lib\net45\Serilog.Sinks.Console.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.File, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.Sinks.File.4.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Runtime.Remoting" />
<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="DataSource\DataManipulation.cs" />
<Compile Include="DataSource\NeedSynData.cs" />
<Compile Include="DataSource\OracleSourceDB.cs" />
<Compile Include="Model\CheckRepeatData.cs" />
<Compile Include="Model\OrcalResult.cs" />
<Compile Include="Model\Pregnancy.cs" />
<Compile Include="Model\TableConfig.cs" />
<Compile Include="Program.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QuartzPack\CurrentSchedPack.cs" />
<Compile Include="QuartzPack\BaseListener\JobListener.cs" />
<Compile Include="QuartzPack\MyJobListener.cs" />
<Compile Include="QuartzPack\BaseListener\SchedulerListener.cs" />
<Compile Include="QuartzPack\BaseListener\TriggerListener.cs" />
<Compile Include="SchedulingTasks\anemia.cs" />
<Compile Include="SchedulingTasks\BaseJob\BaseJob.cs" />
<Compile Include="SchedulingTasks\BloodType.cs" />
<Compile Include="SchedulingTasks\CoagulationFunction.cs" />
<Compile Include="SchedulingTasks\Complement.cs" />
<Compile Include="SchedulingTasks\GlycatedHemoglobin.cs" />
<Compile Include="SchedulingTasks\GlycosylatedAlbumin.cs" />
<Compile Include="SchedulingTasks\ImmuneIndexesOfRheumatism.cs" />
<Compile Include="SchedulingTasks\LupusAnticoagulants.cs" />
<Compile Include="SchedulingTasks\OralGlucoseToleranceTest.cs" />
<Compile Include="SchedulingTasks\PlateletAggregationTest.cs" />
<Compile Include="SchedulingTasks\RoutineUrine.cs" />
<Compile Include="SchedulingTasks\RoutineBloodTask.cs" />
<Compile Include="SchedulingTasks\ScreeningForInfectious.cs" />
<Compile Include="SchedulingTasks\TheBloodBiochemistry.cs" />
<Compile Include="SchedulingTasks\ThyroidFunction.cs" />
<Compile Include="SchedulingTasks\TORCH.cs" />
<Compile Include="Tool\Dapper\Command.cs" />
<Compile Include="Tool\Dapper\CommandCollection.cs" />
<Compile Include="Tool\Dapper\DapperHelp.cs" />
<Compile Include="Tool\Dapper\DbContext.cs" />
<Compile Include="Tool\Dapper\DBType.cs" />
<Compile Include="Tool\Dapper\IDbContext.cs" />
<Compile Include="Tool\DataTableTool.cs" />
<Compile Include="Tool\Serilog.cs" />
<Compile Include="Tool\StringHelp.cs" />
</ItemGroup>
<ItemGroup>
<None Include="AnalyzeTask_TemporaryKey.pfx" />
<None Include="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="job_scheduling_data_2_0.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<appSettings>
<add key="DeBug" value="5"/>
<add key="Cron" value="0 0 0 1/1 * ? *"/>
</appSettings>
<connectionStrings>
<add name="SQLSERVER" connectionString="Enlist=false;Data Source=.;Database=bdyy_MB;User Id=sa;Password=abcd1234;"/>
<add name="Oracle" connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.31.6) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= bdyy)));User Id=hwzb; Password=huaweizb"/>
<add name="OracleResult" connectionString="Enlist=false;Data Source=.;Database=OracleResult;User Id=sa;Password=abcd1234;"/>
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client"/>
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<publisherPolicy apply="no"/>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
</dataSources>
</version>
</oracle.manageddataaccess.client>
</configuration>
using AnalyzeTask.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnalyzeTask.Tool.Dapper;
using Serilog;
using AnalyzeTask.Tool;
using Newtonsoft.Json;
namespace AnalyzeTask.DataSource
{
/// <summary>
/// 数据操作
/// </summary>
public class DataManipulation : IDisposable
{
private ILogger log = Serilogs.logger;
/// <summary>
/// 获取某一项指标的数据
/// </summary>
/// <param name="needSynData"></param>
/// <param name="oracleSourceDB"></param>
/// <param name="Tag">某一项指标,如:血常规、血生化</param>
public DataTable GetOneInDicatorsByTag(string Tag)
{
DataTable newTable = new DataTable();
//找出当前需要的指标
DataTable TagList = NeedSynData.GettableConfigs(Tag);
StringBuilder InFo = new StringBuilder();
if (TagList.Rows.Count > 0)
{
InFo.Append("(");
for (int i = 0; i < TagList.Rows.Count; i++)
{
if (i != TagList.Rows.Count - 1)
{
InFo.Append("'");
InFo.Append(TagList.Rows[i][0]);
InFo.Append("',");
}
else
{
InFo.Append("'");
InFo.Append(TagList.Rows[i][0]);
InFo.Append("'");
}
}
InFo.Append(")");
//在我们数据库中的字段就获取,没有就不获取
//这里修改为从数据库中查找。
DataTable DataSource = OracleSourceDB.GetResult(InFo.ToString());
if (DataSource.Rows.Count > 0)
{
newTable = DataSource;
}
}
log.Debug($"{Tag}结果指标数据有{newTable.Rows.Count}条");
return newTable;
}
/// <summary>
/// 获取指标的配置数据
/// </summary>
/// <param name="Tag"></param>
/// <returns></returns>
public List<TableConfig> GetTagTableConfig(string Tag)
{
var TagTableConfig = NeedSynData.GetAlltableConfigs(Tag);
return TagTableConfig;
}
/// <summary>
/// 将数据插入到数据库
/// </summary>
/// <param name="configs">表配置</param>
/// <param name="Rows">数据源</param>
/// <param name="keyValuePairs">双方表的字段对应</param>
/// <param name="action">回调</param>
public void InsertIntoMSSQL(List<TableConfig> configs, DataTable Table, Action<Task> action)
{
Task task = Task.Run(() =>
{
string Rval = "";
string RConlum = "";
string TableName = string.Empty;
try
{
//判断是否重复的数据
List<string> Conlums = new List<string>();
//获取要插入的表
TableName = configs.Distinct().Select(n => n.DYBD).FirstOrDefault().Trim();
//获取要插入的字段
StringBuilder Conlum = new StringBuilder();
StringBuilder Val = new StringBuilder();
string ConlumName = string.Empty;
string Value = string.Empty;
List<CheckRepeatData> repeatDatas = new List<CheckRepeatData>();
//寻找当前人的数据
NeedSynData.pregnancies.ForEach(n =>
{
DataRow[] Rows = Table.Select($"INPATIENT_ID='{n.AttendanceCard}'").Distinct().ToArray();//当前人所有的信息
if (Rows.Length > 0)
{
DataTable dt = Rows.CopyToDataTable();
DataView dv = dt.DefaultView;
DataTable Date = dv.ToTable(true, "INSERT_TIME");
for (int k = 0; k < Date.Rows.Count; k++)
{
DataRow[] rows = dt.Select($"INSERT_TIME='{Date.Rows[k]["INSERT_TIME"]}'").Distinct().ToArray();
if (rows.Length > 0)
{
DataTable dts = rows.CopyToDataTable();
DataView dvs = dts.DefaultView;
DataTable Datas = dvs.ToTable(true, "INSERT_TIME", "INPATIENT_ID", "TEST_ITEM_ID", "QUANTITATIVE_RESULT");
rows = Datas.Select("1=1");
Conlum.Append($"INSERT INTO {TableName}(");
Val.Append($" VALUES (");
for (int i = 0; i < rows.Length; i++)
{
if (i == 0)
{
Conlum.Append($"JCRQ,ZKKH,{TableName}OID,");
Value = rows[i]["QUANTITATIVE_RESULT"].ToString();
Val.Append($"'{rows[i]["INSERT_TIME"].ToString()}','{ StringHelp.StringRemoveLeft('0', rows[i]["INPATIENT_ID"].ToString()) }','{Guid.NewGuid()}',");
}
ConlumName = configs.FindAll(m => m.ZDID == rows[i]["TEST_ITEM_ID"].ToString()).Select(m => m.ZDMC).FirstOrDefault().Trim();//找出配置表中这条数据应该放在哪一列
if (string.IsNullOrEmpty(Conlums.FirstOrDefault(f => f == ConlumName)))
{
if (!string.IsNullOrEmpty(ConlumName))
{
Conlum.Append($"{ConlumName},");
Value = rows[i]["QUANTITATIVE_RESULT"].ToString();
Val.Append($"'{Value}',");
Conlums.Add(ConlumName);
}
}
}
Rval = Val.ToString().Substring(0, Val.ToString().Length - 1);
RConlum = Conlum.ToString().Substring(0, Conlum.ToString().Length - 1);
RConlum += $")";
Rval += $")";
DateTime time = new DateTime();
DateTime.TryParse(rows[0]["INSERT_TIME"].ToString(), out time);
//log.Debug($"插入语句{Conlum.ToString() + Val.ToString()}\r\n");
repeatDatas.Add(new CheckRepeatData { SQL = RConlum + Rval, Card = StringHelp.StringRemoveLeft('0', n.AttendanceCard), Time = time.ToString("yyyy/MM/DD HH:mm:ss") });
Conlums.Clear();
Conlum.Clear();
RConlum = "";
Rval = "";
Val.Clear();
}
}
Date.Clear();
}
});
//对重复的数据进行过滤
//log.Debug($"命令行中数据条数{repeatDatas.Count}");
//repeatDatas = CheckRepeatDatas(repeatDatas, TableName);
CommandCollection command = new CommandCollection();
repeatDatas.ForEach(n =>
{
command.Add(new Command(n.SQL));
});
//插入数据库
NeedSynData.dbContext.ExecuteTransaction(command);
}
catch (Exception ex)
{
log.Debug(ex, $"{TableName}----InsertIntoMSSQL出错" + $"插入语句{RConlum.ToString() + Rval.ToString()}\r\n");
}
});
action(task);
}
/// <summary>
/// 检查已经有的数据
/// </summary>
/// <param name="repeatDatas"></param>
/// <param name="TableName"></param>
/// <returns></returns>
private List<CheckRepeatData> CheckRepeatDatas(List<CheckRepeatData> repeatDatas, string TableName)
{
log.Debug("开始检查数据");
List<CheckRepeatData> data = new List<CheckRepeatData>();
DataTable HasData = NeedSynData.GetHasData(TableName);
foreach (var item in repeatDatas)
{
DataRow[] row = HasData.Select($"ZKKH='{item.Card}' AND JCRQ='{item.Time}'");
if (row.Length > 0)
{
repeatDatas.Remove(item);
}
}
return repeatDatas;
}
public void Dispose()
{
log.Debug("DataManipulation资源被释放");
GC.SuppressFinalize(this);
}
}
}
using AnalyzeTask.Model;
using AnalyzeTask.Tool;
using AnalyzeTask.Tool.Dapper;
using Serilog;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.DataSource
{
/// <summary>
/// 获取需要同步的数据
/// </summary>
public class NeedSynData : IDisposable
{
/// <summary>
/// 需要同步的数据集合
/// </summary>
public static List<string> DateTimeList = new List<string>();
public static List<Pregnancy> pregnancies = new List<Pregnancy>();
public static List<TableConfig> tableConfigs = new List<TableConfig>();
public static DbContext dbContext = new DbContext().ChangeContext(DBType.SQLSERVER);
private static ILogger log = Serilogs.logger;
public void GetNeedSynData()
{
//从任务表中获取需要同步的日期
DateTimeList = dbContext.Query<string>("SELECT ImportDate FROM AnalysisofLaboratoryIndicator WHERE status=2").ToList();
//获取需要同步的成员数据
pregnancies = dbContext.Query<Pregnancy>("SELECT * FROM dbo.Pregnancy WHERE ImportDate IN (SELECT ImportDate FROM AnalysisofLaboratoryIndicator WHERE status=2)").ToList();
pregnancies.ForEach(n => { n.AttendanceCard = StringHelp.StringPadLeft('0', 12, n.AttendanceCard); });//将就诊卡号补0,12位
//获取需要获取的数据表单配置
tableConfigs = dbContext.Query<TableConfig>("SELECT * FROM TableConfig").ToList();
//清空表数据
DelTableData();
}
public static DataTable GettableConfigs(string TaskName)
{
string sql = $"SELECT DISTINCT ZDID FROM dbo.TableConfig WHERE SSXM LIKE '%{TaskName.Trim()}%'";
DataTable table = dbContext.ExecuteDataTable(sql, CommandType.Text);
log.Debug($"当前项目:{TaskName}总共条数:{table.Rows.Count}");
if (table.Rows.Count == 0)
{
log.Debug($"SELECT DISTINCT ZDID FROM dbo.TableConfig WHERE SSXM LIKE '%{TaskName.Trim()}%'");
}
return table;
}
/// <summary>
/// 获取全部的配置数据
/// </summary>
/// <param name="TaskName"></param>
/// <returns></returns>
public static List<TableConfig> GetAlltableConfigs(string TaskName)
{
string sql = $"SELECT * FROM dbo.TableConfig WHERE SSXM LIKE '%{TaskName.Trim()}%'";
List<TableConfig> table = dbContext.Query<TableConfig>(sql, CommandType.Text).ToList();
log.Debug($"当前项目:{TaskName}总共条数:{table.Count}");
if (table.Count == 0)
{
log.Debug($"SELECT DISTINCT ZDID FROM dbo.TableConfig WHERE SSXM LIKE '%{TaskName.Trim()}%'");
}
return table;
}
/// <summary>
/// 获取某一张表中已经有的数据
/// </summary>
/// <param name="TableName"></param>
/// <returns></returns>
public static DataTable GetHasData(string TableName)
{
try
{
DataTable data = dbContext.ExecuteDataTable($"SELECT A.* FROM {TableName} A LEFT JOIN Pregnancy B ON A.ZKKH=B.AttendanceCard WHERE B.ImportDate IN(SELECT ImportDate FROM AnalysisofLaboratoryIndicator WHERE status = 2)", CommandType.Text);
return data;
}
catch (Exception)
{
Log.Debug($"SELECT A.* FROM {TableName} A LEFT JOIN Pregnancy B ON A.ZKKH=B.AttendanceCard WHERE B.ImportDate IN(SELECT ImportDate FROM AnalysisofLaboratoryIndicator WHERE status = 2)");
}
return new DataTable();
}
/// <summary>
/// 清空数据
/// </summary>
private void DelTableData()
{
CommandCollection command = new CommandCollection();
command.Add(new Command("truncate table RoutineBlood"));
command.Add(new Command("truncate table RoutineUrine"));
command.Add(new Command("truncate table TheBloodBiochemistry"));
command.Add(new Command("truncate table CoagulationFunction"));
command.Add(new Command("truncate table OralGlucoseToleranceTest"));
command.Add(new Command("truncate table GlycosylatedAlbumin"));
command.Add(new Command("truncate table GlycatedHemoglobin"));
command.Add(new Command("truncate table ThyroidFunction"));
command.Add(new Command("truncate table ScreeningForInfectious"));
command.Add(new Command("truncate table TORCH"));
command.Add(new Command("truncate table ImmuneIndexesOfRheumatism"));
command.Add(new Command("truncate table Complement"));
command.Add(new Command("truncate table LupusAnticoagulants"));
command.Add(new Command("truncate table anemia"));
NeedSynData.dbContext.ExecuteTransaction(command);
log.Debug("结果表数据已清除");
}
public void Dispose()
{
log.Debug("NeedSynData资源被释放");
DateTimeList = null;
pregnancies = null;
tableConfigs = null;
GC.SuppressFinalize(this);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Model
{
public class CheckRepeatData
{
/// <summary>
/// 需要执行的SQL
/// </summary>
public string SQL { get; set; }
/// <summary>
/// 卡号
/// </summary>
public string Card { get; set; }
/// <summary>
/// 入组时间
/// </summary>
public string Time { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Model
{
public class OrcalResult
{
public string TEST_ITEM_ID { get; set; }
public string ENGLISH_NAME { get; set; }
public string CHINESE_NAME { get; set; }
public string QUANTITATIVE_RESULT { get; set; }
public string INPATIENT_ID { get; set; }
public DateTime INSERT_TIME { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Model
{
/// <summary>
/// 成员导入表
/// </summary>
public class Pregnancy
{
public Guid PregnancyOID { get; set; }
public DateTime? ImportDate { get; set; }
public string UserName { get; set; }
public string AttendanceCard { get; set; }
public string Status { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Model
{
public class TableConfig
{
public Guid TableConfigOID { get; set; }
/// <summary>
/// 字段名称
/// </summary>
public string ZDMC { get; set; }
/// <summary>
/// 字段ID
/// </summary>
public string ZDID { get; set; }
/// <summary>
/// 所属项目
/// </summary>
public string SSXM { get; set; }
/// <summary>
/// 对应表单
/// </summary>
public string DYBD { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AnalyzeTask.SchedulingTasks;
using AnalyzeTask.Tool;
using Quartz;
using Quartz.Impl;
using Serilog;
namespace AnalyzeTask
{
class Program
{
static void Main(string[] args)
{
BaseJob.Initialize(new List<BaseJob> {
new anemia(),//贫血
new BloodType(),//血型
new CoagulationFunction(),//凝血功能
new Complement(),//补体
new GlycatedHemoglobin(),//糖化血红蛋白
new GlycosylatedAlbumin(),//糖化白蛋白
new ImmuneIndexesOfRheumatism(),//风湿免疫指标
new LupusAnticoagulants(),//狼疮抗凝物
new OralGlucoseToleranceTest(),//口服葡萄糖耐量实验
new PlateletAggregationTest(),//血小板聚集试验
new RoutineBloodTask(),//血常规
new RoutineUrine(),//尿常规
new ScreeningForInfectious(),//感染疾病筛查
new TheBloodBiochemistry(),//血生化
new ThyroidFunction(),//甲状腺功能
new TORCH()//TORCH
});
BaseJob.Run();
Console.ReadKey();
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AnalyzeTask")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AnalyzeTask")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("dc081ec2-faac-4dcb-9491-7fc39c81f927")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.QuartzPack
{
public class JobListener : IJobListener
{
public virtual string Name
{
get { return "JobListener"; }
}
public virtual void JobToBeExecuted(IJobExecutionContext context)
{
}
public virtual void JobExecutionVetoed(IJobExecutionContext context)
{
}
public virtual void JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException)
{
}
}
}
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.QuartzPack
{
public class SchedulerListener : ISchedulerListener
{
public virtual void JobScheduled(ITrigger trigger) {
}
public virtual void JobUnscheduled(TriggerKey triggerKey) {
}
public virtual void TriggerFinalized(ITrigger trigger) {
}
public virtual void TriggerPaused(TriggerKey triggerKey) {
}
public virtual void TriggersPaused(string triggerGroup) {
}
public virtual void TriggersResumed(string triggerGroup) {
}
public virtual void TriggerResumed(TriggerKey triggerKey)
{
}
public virtual void JobAdded(IJobDetail jobDetail) {
}
public virtual void JobDeleted(JobKey jobKey) {
}
public virtual void JobPaused(JobKey jobKey) {
}
public virtual void JobsPaused(string jobGroup) {
}
public virtual void JobResumed(JobKey jobKey) {
}
public virtual void JobsResumed(string jobGroup) {
}
public virtual void SchedulerError(string msg, SchedulerException cause) {
}
public virtual void SchedulerInStandbyMode() {
}
public virtual void SchedulerStarted() {
}
public virtual void SchedulerStarting() {
}
public virtual void SchedulerShutdown() {
}
public virtual void SchedulerShuttingdown() {
}
public virtual void SchedulingDataCleared() {
}
}
}
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.QuartzPack
{
class TriggerListener : ITriggerListener
{
public string Name
{
get { return "TriggerListener"; }
}
public void TriggerFired(ITrigger trigger, IJobExecutionContext context)
{
}
public bool VetoJobExecution(ITrigger trigger, IJobExecutionContext context)
{
return true;
}
public void TriggerMisfired(ITrigger trigger)
{
}
public void TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode)
{
}
}
}
using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.QuartzPack
{
public class CurrentSchedPack
{
//private IJobDetail simpleJob;
//private ITrigger simpleTrigger;
//public IScheduler CurrentSchedFactory(Action<IJobDetail, ITrigger> action)
//{
// IScheduler CurrentSched = StdSchedulerFactory.GetDefaultScheduler();
//}
//public void SchedRun(this IScheduler pack, Action action)
//{
// pack.Start();
//}
}
}
using AnalyzeTask.DataSource;
using AnalyzeTask.SchedulingTasks;
using AnalyzeTask.Tool;
using Quartz;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace AnalyzeTask.QuartzPack
{
public class MyJobListener : JobListener
{
private ILogger log = Serilogs.logger;
public override string Name => base.Name;
/// <summary>
/// 当任务执行前加载数据源
/// </summary>
/// <param name="context"></param>
private static int JobIndex = 0;
private static int WasIndex = 0;
public int JobCount = BaseJob.jobDetails.Count;
private NeedSynData needSynData = new NeedSynData();
private OracleSourceDB oracleSourceDB = new OracleSourceDB();
public override void JobToBeExecuted(IJobExecutionContext context)
{
lock (this)
{
try
{
if (JobIndex == 0)
{
log.Information($"正在加载数据,当前索引{JobIndex}");
JobIndex++;
needSynData.GetNeedSynData();
var BR = NeedSynData.pregnancies.Select(n => n.AttendanceCard).ToArray();
oracleSourceDB.GetAllCheckResultByJZKOne(BR);
log.Information("数据加载完成");
log.Information($"{NeedSynData.DateTimeList.Count}|{NeedSynData.pregnancies.Count}|{NeedSynData.tableConfigs.Count}");
log.Debug($"日期数:{NeedSynData.DateTimeList.Count}|人数:{NeedSynData.pregnancies.Count}|表配置:{NeedSynData.tableConfigs.Count}|检查结果:{OracleSourceDB.AllBRResult.Rows.Count}");
}
}
catch (Exception ex)
{
log.Error(ex, ex.Message);
}
}
}
public override void JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException)
{
WasIndex++;
if (WasIndex == JobCount)
{
WasIndex = 0;
//释放所有公共资源
needSynData.Dispose();
oracleSourceDB.Dispose();
log.Information("--------所有任务执行完成--------");
}
}
}
}
using Quartz;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnalyzeTask.Tool;
using Quartz.Impl;
using System.Configuration;
using AnalyzeTask.QuartzPack;
using Quartz.Impl.Matchers;
using AnalyzeTask.Tool.Dapper;
using System.Data;
using AnalyzeTask.DataSource;
namespace AnalyzeTask.SchedulingTasks
{
/// <summary>
/// 插件化处理
/// </summary>
public abstract class BaseJob : IJob
{
private static IScheduler CurrentSched { get; set; }
protected static ILogger log = Serilogs.logger;
private static string Cron = ConfigurationManager.AppSettings["Cron"];
protected ITrigger cronTrigger = null;
public static List<IJobDetail> jobDetails = new List<IJobDetail>();
public static List<ITrigger> cronTriggers = new List<ITrigger>();
protected DbContext dbContext = new DbContext();
protected OracleSourceDB oracleSource = new OracleSourceDB();
protected string TaskName { get; set; }
public BaseJob()
{
int DeBug = 0;
int.TryParse(ConfigurationManager.AppSettings["DeBug"], out DeBug);
if (DeBug > 0)
{
cronTrigger = TriggerBuilder.Create().WithIdentity(Guid.NewGuid().ToString(), JobKey.DefaultGroup.ToLower()).StartNow()
.WithSimpleSchedule(x => x.WithIntervalInMinutes(DeBug).RepeatForever()).Build();
}
else
{
if (cronTrigger == null)
{
cronTrigger = TriggerBuilder.Create().WithIdentity(Guid.NewGuid().ToString(), JobKey.DefaultGroup.ToLower()).StartNow().WithCronSchedule(Cron).Build();
}
}
}
public static void Initialize(List<BaseJob> baseJob, string TriggerName = "Default")
{
log.Information("日志控件加载");
CurrentSched = CurrentSched = StdSchedulerFactory.GetDefaultScheduler();
for (int i = 0; i < baseJob.Count; i++)
{
log.Debug(baseJob[i].TaskName + "正在初始化");
jobDetails.Add(baseJob[i].CreateJobDetail(JobKey.DefaultGroup.ToLower()));
cronTriggers.Add(baseJob[i].CreateITrigger(Guid.NewGuid().ToString(), JobKey.DefaultGroup.ToLower()));
}
log.Information("初始化完成");
}
public virtual void Execute(IJobExecutionContext context)
{
log.Information($"Hello");
}
protected void NextTime(IJobExecutionContext context)
{
log.Information($"{TaskName}=>下次执行时间为:{context.NextFireTimeUtc}");
}
public abstract IJobDetail CreateJobDetail(string TaskGroup);
public abstract ITrigger CreateITrigger(string TriggerName, string TriggerGroup);
public static void Run()
{
for (int i = 0; i < jobDetails.Count; i++)
{
CurrentSched.ScheduleJob(jobDetails[i], cronTriggers[i]);
}
GroupMatcher<JobKey> matcher = GroupMatcher<JobKey>.GroupEquals(JobKey.DefaultGroup.ToLower());
JobListener jobListener = new MyJobListener();
CurrentSched.ListenerManager.AddJobListener(jobListener, matcher);
CurrentSched.Start();
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class BloodType : BaseJob, IJob
{
public BloodType()
{
TaskName = "血型";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<BloodType>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class CoagulationFunction : BaseJob, IJob
{
public CoagulationFunction()
{
TaskName = "凝血功能";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<CoagulationFunction>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class Complement : BaseJob, IJob
{
public Complement()
{
TaskName = "补体";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<Complement>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class GlycatedHemoglobin : BaseJob, IJob
{
public GlycatedHemoglobin()
{
TaskName = "糖化血红蛋白";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<GlycatedHemoglobin>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class GlycosylatedAlbumin : BaseJob, IJob
{
public GlycosylatedAlbumin()
{
TaskName = "糖化白蛋白";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<GlycosylatedAlbumin>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class ImmuneIndexesOfRheumatism : BaseJob, IJob
{
public ImmuneIndexesOfRheumatism()
{
TaskName = "风湿免疫指标";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<ImmuneIndexesOfRheumatism>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class LupusAnticoagulants : BaseJob, IJob
{
public LupusAnticoagulants()
{
TaskName = "狼疮抗凝物";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<LupusAnticoagulants>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class OralGlucoseToleranceTest : BaseJob, IJob
{
public OralGlucoseToleranceTest()
{
TaskName = "口服葡萄糖耐量实验";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<OralGlucoseToleranceTest>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class PlateletAggregationTest : BaseJob, IJob
{
public PlateletAggregationTest()
{
TaskName = "血小板聚集试验";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<PlateletAggregationTest>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Data;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
/// <summary>
/// 血常规任务
/// </summary>
public class RoutineBloodTask : BaseJob, IJob
{
public RoutineBloodTask()
{
TaskName = "血常规";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<RoutineBloodTask>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class RoutineUrine : BaseJob, IJob
{
public RoutineUrine()
{
TaskName = "尿常规";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<RoutineUrine>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class ScreeningForInfectious : BaseJob, IJob
{
public ScreeningForInfectious()
{
TaskName = "感染疾病筛查";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<ScreeningForInfectious>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class TORCH : BaseJob, IJob
{
public TORCH()
{
TaskName = "TORCH";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{this.TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<TORCH>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class TheBloodBiochemistry : BaseJob, IJob
{
public TheBloodBiochemistry()
{
TaskName = "血生化";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<TheBloodBiochemistry>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class ThyroidFunction : BaseJob, IJob
{
public ThyroidFunction()
{
TaskName = "甲状腺功能";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<ThyroidFunction>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using AnalyzeTask.DataSource;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.SchedulingTasks
{
public class anemia : BaseJob, IJob
{
public anemia()
{
TaskName = "贫血";
}
public override void Execute(IJobExecutionContext context)
{
try
{
DataManipulation manipulation = new DataManipulation();
DataTable data = manipulation.GetOneInDicatorsByTag(TaskName);
var TagSource = manipulation.GetTagTableConfig(TaskName);
if (data.Rows.Count == 0 || TagSource.Count == 0)
{
log.Information($"{TaskName}没有需要同步的数据");
}
else
{
manipulation.InsertIntoMSSQL(TagSource, data,
n =>
{
n.Wait();
log.Information($"{TaskName}同步成功");
manipulation.Dispose();
});
}
base.NextTime(context);
}
catch (Exception ex)
{
log.Error(ex, $"{TaskName}同步出错");
}
}
/// <summary>
/// 注册方法
/// </summary>
/// <param name="TaskName"></param>
/// <param name="TaskGroup"></param>
/// <returns></returns>
public override IJobDetail CreateJobDetail(string TaskGroup)
{
IJobDetail simpleJob = JobBuilder.Create<anemia>().WithIdentity(TaskName, TaskGroup).Build();
return simpleJob;
}
/// <summary>
/// 每个插件在此自定义触发器
/// </summary>
/// <param name="TriggerName"></param>
/// <param name="TriggerGroup"></param>
/// <returns></returns>
public override ITrigger CreateITrigger(string TriggerName, string TriggerGroup)
{
cronTrigger = base.cronTrigger;
return cronTrigger;
}
}
}
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
namespace AnalyzeTask.Tool.Dapper
{
/// <summary>
/// 命令对象(命令:增删改)
/// </summary>
public class Command
{
/// <summary>
/// 是否允许空结果
/// </summary>
private bool _isAllowZeroResult = false;
private string _sqlText = null;
private object _sqlParameter = null;
private CommandType _commandType = CommandType.Text;
private string _dbType = null;
/// <summary>
/// 待执行的SQL语句
/// </summary>
public string SqlText
{
get { return _sqlText; }
}
/// <summary>
/// 参数数组
/// </summary>
public object SqlParameter
{
get
{
return _sqlParameter;
}
}
/// <summary>
/// 是否运行结果为:0(默认不允许)
/// </summary>
public bool IsAllowZeroResult
{
get
{
return _isAllowZeroResult;
}
}
/// <summary>
/// 命令类型(默认:Text)
/// </summary>
public CommandType CommandType
{
get { return _commandType; }
}
/// <summary>
/// 当前数据库的类型
/// </summary>
public string DbType
{
get { return _dbType; }
}
/// <summary>
/// 数据库操作命令
/// </summary>
/// <param name="sqlText">数据库操作语句</param>
/// <param name="parameter">参数</param>
/// <param name="isAllowZeroResult"> 是否运行结果为:0</param>
public Command(string sqlText, object parameter=null, bool isAllowZeroResult = false, string dbType = null) : this(sqlText, parameter, CommandType.Text, isAllowZeroResult, dbType)
{
}
/// <summary>
/// 数据库操作命令
/// </summary>
/// <param name="sqlText">数据库操作语句</param>
/// <param name="parameter">参数</param>
/// <param name="commandType">命令类型</param>
/// <param name="isAllowZeroResult">是否运行结果为:0</param>
public Command(string sqlText, object parameter, CommandType commandType, bool isAllowZeroResult = false, string dbType = null)
{
_sqlText = sqlText;
_sqlParameter = parameter;
_commandType = commandType;
_isAllowZeroResult = isAllowZeroResult;
_dbType = dbType;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool.Dapper
{
/// <summary>
/// 命令集合
/// </summary>
public class CommandCollection
{
private readonly List<Command> _commands = null;
public CommandCollection(params Command[] commands)
{
_commands = new List<Command>();
if (commands != null)
{
_commands.AddRange(commands);
}
}
public List<Command> GetCommands
{
get { return _commands; }
}
/// <summary>
/// 向现有的命令集合加入一个命令
/// </summary>
/// <param name="command"></param>
public void Add(Command command)
{
_commands.Add(command);
}
/// <summary>
/// 获取当前命令集合的条数
/// </summary>
/// <returns></returns>
public int GetCount()
{
return _commands.Count;
}
/// <summary>
/// 向现有的命令集合删除一个命令
/// </summary>
/// <param name="command"></param>
public void Remove(Command command)
{
_commands.Remove(command);
}
/// <summary>
/// 批量加入命令
/// </summary>
/// <param name="commands"></param>
public void BatchAdd(List<Command> commands)
{
_commands.AddRange(commands);
}
/// <summary>
/// 批量加入命令
/// </summary>
/// <param name="commands"></param>
public void BatchAdd(Command[] commands)
{
_commands.AddRange(commands);
}
public void Clear()
{
_commands.Clear();
}
public bool Any(Func<Command, bool> predicate = null)
{
if (predicate == null)
{
return _commands.Any();
}
else
{
return _commands.Any(predicate);
}
}
public IEnumerable<IGrouping<string, Command>> GetDbType()
{
return _commands.GroupBy(d => d.DbType);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool.Dapper
{
/// <summary>
/// 数据库类型(为支持数据分离模式,对应配置文件中数据连接位)
/// </summary>
public class DBType
{
/// <summary>
/// SQLSERVER
/// </summary>
public const string SQLSERVER = "SQLSERVER";
/// <summary>
/// Oracle
/// </summary>
public const string Oracle = "Oracle";
/// <summary>
/// OracleResult
/// </summary>
public const string OracleResult = "OracleResult";
}
}
using Serilog;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool.Dapper
{
public class DbContext : IDbContext
{
private static ILogger log = Serilogs.logger;
public static NameValueCollection _dbLinkPool = _dbLinkPool = new NameValueCollection();//连接位集合
private string _currentContextName = null;//当前连接位
/// <summary>
/// 加载所有连接位
/// </summary>
static DbContext()
{
foreach (ConnectionStringSettings connStrSetting in ConfigurationManager.ConnectionStrings)
{
if (connStrSetting.Name.ToUpper() == "LocalSqlServer".ToUpper())
continue;
_dbLinkPool.Add(connStrSetting.Name, connStrSetting.ConnectionString);
}
}
/// <summary>
/// 默认使用第一个连接位(如果不指定连接位)
/// </summary>
public DbContext()
{
if (_dbLinkPool.Count > 0)
{
_currentContextName = _dbLinkPool.Keys[0];
}
}
/// <summary>
/// 切换上下文
/// </summary>
/// <param name="connectionStringName"></param>
/// <param name="useOnlyCurrent"></param>
/// <returns></returns>
public DbContext ChangeContext(string connectionStringName, bool useOnlyCurrent = false)
{
if (string.IsNullOrWhiteSpace(_dbLinkPool[connectionStringName]))
throw new Exception("连接不存在");
if (useOnlyCurrent)
{
new DbContext() { _currentContextName = connectionStringName };
return this;
}
else
{
_currentContextName = connectionStringName;
}
return this;
}
/// <summary>
/// 获取数据连接字符串
/// </summary>
public string CurrentContext
{
get { return _dbLinkPool[_currentContextName]; }
}
/// <summary>
/// 获取数据连接字符串集合
/// </summary>
public NameValueCollection LinkPool
{
get { return _dbLinkPool; }
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool.Dapper
{
public interface IDbContext
{
string CurrentContext { get; }
DbContext ChangeContext(string connectionStringName, bool useOnlyCurrent = false);
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool
{
public class DataTableTool
{
/// <summary>
/// 表合并
/// </summary>
/// <param name="target">合入表</param>
/// <param name="Passive"><被合入表/param>
/// <returns></returns>
public static DataTable DataTableMerge(DataTable target, List<DataTable> Passive)
{
DataTable newtable = target.Copy();
for (int j = 1; j < Passive.Count; j++)
{
for (int i = 0; i < Passive[j].Rows.Count; i++)
{
newtable.Rows.Add(Passive[j].Rows[i].ItemArray);
}
}
return newtable;
}
}
}
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool
{
/// <summary>
/// 日志方法扩展
/// </summary>
public static class Serilogs
{
public static ILogger logger = new LoggerConfiguration().MinimumLevel.Debug().WriteTo.Console().WriteTo.File("logs\\Log.txt", rollingInterval: RollingInterval.Day).CreateLogger();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnalyzeTask.Tool
{
public class StringHelp
{
/// <summary>
/// 补充左边
/// </summary>
/// <param name="cr"></param>
/// <param name="largest"></param>
/// <param name="str"></param>
/// <returns></returns>
public static string[] StringPadLeft(char cr, int largest, string[] str)
{
for (int i = 0; i < str.Length; i++)
{
str[i] = str[i].PadLeft(largest, cr);
}
return str;
}
/// <summary>
/// 补充左边
/// </summary>
/// <param name="cr"></param>
/// <param name="largest"></param>
/// <param name="str"></param>
/// <returns></returns>
public static string StringPadLeft(char cr, int largest, string str)
{
str = str.PadLeft(largest, cr);
return str;
}
/// <summary>
/// 从开始位置移除
/// </summary>
/// <param name="cr"></param>
/// <param name="str"></param>
/// <returns></returns>
public static string[] StringRemoveLeft(char cr, string[] str)
{
for (int i = 0; i < str.Length; i++)
{
str[i] = str[i].TrimStart(cr);
}
return str;
}
/// <summary>
/// 从开始位置移除
/// </summary>
/// <param name="cr"></param>
/// <param name="str"></param>
/// <returns></returns>
public static string StringRemoveLeft(char cr, string str)
{
str = str.TrimStart(cr);
return str;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Common.Logging" version="3.3.1" targetFramework="net472" />
<package id="Common.Logging.Core" version="3.3.1" targetFramework="net472" />
<package id="Dapper" version="1.60.6" targetFramework="net472" />
<package id="Dapper.Contrib" version="1.60.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="Oracle.ManagedDataAccess" version="19.3.1" targetFramework="net472" />
<package id="Quartz" version="2.6.0" targetFramework="net472" />
<package id="Serilog" version="2.8.0" targetFramework="net472" />
<package id="Serilog.Sinks.Console" version="3.1.1" targetFramework="net472" />
<package id="Serilog.Sinks.File" version="4.0.0" targetFramework="net472" />
</packages>
\ No newline at end of file
# Default Properties file for use by StdSchedulerFactory
# to create a Quartz Scheduler Instance, if a different
# properties file is not explicitly specified.
#
quartz.scheduler.instanceName = DefaultQuartzScheduler
quartz.threadPool.threadCount = 10
quartz.jobStore.misfireThreshold = 60000
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("UnitTestTask")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTestTask")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("6366efa5-2699-4dd8-9e6e-227e8e1cd47b")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using AnalyzeTask.DataSource;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestTask
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
string str = "4562";
str = str.PadLeft(12,'0');
str = str.TrimStart('0');
//OracleSourceDB oracleSourceDB = new OracleSourceDB();
//string[] vs= new string[2510];
//for (int i = 0; i < 2510; i++)
//{
// vs[i] = "测试" + i;
//}
//oracleSourceDB.GetAllCheckResultByJZK(vs);
//NeedSynData needSynData = new NeedSynData();
//needSynData.GetNeedSynData();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" />
<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>{6366EFA5-2699-4DD8-9E6E-227E8E1CD47B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UnitTestTask</RootNamespace>
<AssemblyName>UnitTestTask</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.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>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AnalyzeTask\AnalyzeTask.csproj">
<Project>{dc081ec2-faac-4dcb-9491-7fc39c81f927}</Project>
<Name>AnalyzeTask</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<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\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.3.2\build\net45\MSTest.TestAdapter.targets')" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
</packages>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论