前置机数据库建模

This commit is contained in:
falcon 2019-03-26 08:46:52 +08:00
parent d02573bbee
commit 02ef0a10f3
14 changed files with 223 additions and 30 deletions

View File

@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmdjyHisFront", "CmdjyHisFr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HisInterfaceModels", "HisInterfaceModels\HisInterfaceModels.csproj", "{D0FE758C-DA33-45C7-8110-563056A58717}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonHelper", "CommonHelper\CommonHelper.csproj", "{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -36,6 +38,10 @@ Global
{D0FE758C-DA33-45C7-8110-563056A58717}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0FE758C-DA33-45C7-8110-563056A58717}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0FE758C-DA33-45C7-8110-563056A58717}.Release|Any CPU.Build.0 = Release|Any CPU
{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -193,7 +193,6 @@
<Compile Include="Bll\BackgroundTask.cs" />
<Compile Include="Bll\DesHelper.cs" />
<Compile Include="Bll\Cache.cs" />
<Compile Include="Bll\ObjExtend.cs" />
<Compile Include="Controllers\CompanyController.cs" />
<Compile Include="Controllers\HisInfoController.cs" />
<Compile Include="Controllers\HisUpdataController.cs" />
@ -299,6 +298,10 @@
<Content Include="Scripts\jquery-3.3.1.min.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonHelper\CommonHelper.csproj">
<Project>{aa5638cd-29e5-48e7-96f2-f3a32d42be9f}</Project>
<Name>CommonHelper</Name>
</ProjectReference>
<ProjectReference Include="..\HisInterfaceModels\HisInterfaceModels.csproj">
<Project>{d0fe758c-da33-45c7-8110-563056a58717}</Project>
<Name>HisInterfaceModels</Name>

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Web.Services;
using Cmdjy.Bll;
using Newtonsoft.Json;
using System.Threading.Tasks;
using Cmdjy.Dal;
using CommonHelper;
using Newtonsoft.Json;
namespace Cmdjy.ws
{

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CommonClass.Factory;
using CmdjyHisFront.Dal;
using HisInterfaceModels;
using CommonHelper;
using Newtonsoft.Json;
namespace CmdjyHisFront.Bll
{
public interface IPostHelper
{
void PostPrescription();
void PostDrug();
}
public class PostHelper:IPostHelper, IRegisterBaseInterface
{
public Lazy<HisFrontDbContext> Db { get; set; }
public void PostDrug() {
throw new NotImplementedException();
}
public void PostPrescription() {
throw new NotImplementedException();
}
private HisPrescriptionResult prescription(HisPrescriptionInfo info) {
using(var server = new HisServer.HisInterfaceSoapClient()) {
var msg = JsonConvert.SerializeObject(info);
return JsonConvert.DeserializeObject<HisPrescriptionResult>(msg);
}
}
private HisDrugResult drug(HisDrugInfo info) {
using(var server = new HisServer.HisInterfaceSoapClient()) {
var msg = JsonConvert.SerializeObject(info);
return JsonConvert.DeserializeObject<HisDrugResult>(msg);
}
}
}
}

View File

@ -165,6 +165,7 @@
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Bll\BackgroundTask.cs" />
<Compile Include="Bll\PostHelper.cs" />
<Compile Include="Connected Services\HisServer\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@ -173,9 +174,10 @@
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Dal\DbConfig.cs" />
<Compile Include="Dal\HisFrontDbContext.cs" />
<Compile Include="Dal\Tables\HisDrugInfo.cs" />
<Compile Include="Dal\Tables\HisPrescriptionInfo.cs" />
<Compile Include="Dal\Tables\PostLog.cs" />
<Compile Include="Dal\Tables\DjyDrugInfo.cs" />
<Compile Include="Dal\Tables\DjyPrescriptionInfo.cs" />
<Compile Include="Dal\Tables\DjyDrugInfoLog.cs" />
<Compile Include="Dal\Tables\DjyPrescriptionInfoLog.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
@ -254,6 +256,10 @@
<Content Include="Scripts\jquery-3.3.1.min.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonHelper\CommonHelper.csproj">
<Project>{aa5638cd-29e5-48e7-96f2-f3a32d42be9f}</Project>
<Name>CommonHelper</Name>
</ProjectReference>
<ProjectReference Include="..\HisInterfaceModels\HisInterfaceModels.csproj">
<Project>{d0fe758c-da33-45c7-8110-563056a58717}</Project>
<Name>HisInterfaceModels</Name>

View File

@ -18,11 +18,18 @@ namespace CmdjyHisFront.Dal
/// <summary>
/// 处方信息
/// </summary>
public DbSet<HisPrescriptionInfo> PrescriptionInfo { get; set; }
public DbSet<DjyPrescriptionInfo> PrescriptionInfo { get; set; }
/// <summary>
/// 药品信息
/// </summary>
public DbSet<HisDrugInfo> DrugInfo { get; set; }
public DbSet<DjyDrugInfo> DrugInfo { get; set; }
/// <summary>
/// 处方上传记录
/// </summary>
public DbSet<DjyPrescriptionInfoLog> PrescriptionInfoLogs { get; set; }
/// <summary>
/// 药品上传记录
/// </summary>
public DbSet<DjyDrugInfoLog> DrugInfoLogs { get; set; }
}
}

View File

@ -7,8 +7,8 @@ namespace CmdjyHisFront.Dal.Tables
/// <summary>
/// HIS发送的药品信息
/// </summary>
[Table("HisDrugInfo")]
public class HisDrugInfo
[Table("DjyDrugInfo")]
public class DjyDrugInfo
{
/// <summary>
/// 主键,药品流水号

View File

@ -0,0 +1,37 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace CmdjyHisFront.Dal.Tables
{
/// <summary>
/// 上传记录表
/// </summary>
[Table("DjyDrugInfoLog")]
public class DjyDrugInfoLog
{
/// <summary>
/// 序号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 药品表编号
/// </summary>
public int HisDrugInfoId { get; set; }
/// <summary>
/// 上传返回代码
/// </summary>
public int ResultCode { get; set; }
/// <summary>
/// 上传返回信息
/// </summary>
public string ResultMsg { get; set; }
/// <summary>
/// 中心药品编号
/// </summary>
public int DrugId { get; set; }
/// <summary>
/// 上传时间
/// </summary>
public DateTime PostDatatime { get; set; }
}
}

View File

@ -7,8 +7,8 @@ namespace CmdjyHisFront.Dal.Tables
/// <summary>
/// HIS发送的处方信息
/// </summary>
[Table("HisPrescriptionInfo")]
public class HisPrescriptionInfo
[Table("DjyPrescriptionInfo")]
public class DjyPrescriptionInfo
{
/// <summary>
/// 主键,处方流水号

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
@ -8,33 +9,31 @@ namespace CmdjyHisFront.Dal.Tables
/// <summary>
/// 上传记录表
/// </summary>
public class PostLog
[Table("DjyPrescriptionInfoLog")]
public class DjyPrescriptionInfoLog
{
/// <summary>
///
/// 序号
/// </summary>
public int Id { get; set; }
/// <summary>
///
/// 处方表编号
/// </summary>
public int HisPrescriptionInfoId { get; set; }
/// <summary>
///
/// 上传返回代码
/// </summary>
public int ResultCode { get; set; }
/// <summary>
///
/// </summary>
/// <summary>
///
/// 上传返回信息
/// </summary>
public string ResultMsg { get; set; }
/// <summary>
///
/// 中心处方编号
/// </summary>
public int PrescriptionId { get; set; }
/// <summary>
///
/// 上传时间
/// </summary>
public DateTime PostDatatime { get; set; }
}

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
@ -14,7 +10,7 @@ namespace CmdjyHisFront
public class MvcApplication:System.Web.HttpApplication
{
protected void Application_Start() {
Database.SetInitializer(new MigrateDatabaseToLatestVersion<HisFrontDbContext,DbConfig>());
Database.SetInitializer<HisFrontDbContext>(null);
//配置autofac依赖注入
DependencyResolver.SetResolver(new AutofacDependencyResolver(IocFactory.Factory));

View File

@ -0,0 +1,47 @@
<?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>{AA5638CD-29E5-48E7-96F2-F3A32D42BE9F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CommonHelper</RootNamespace>
<AssemblyName>CommonHelper</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ObjExtend.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,4 +1,4 @@
namespace Cmdjy.Bll
namespace CommonHelper
{
using System;
@ -21,6 +21,17 @@
}
}
/// <summary>
/// 从目标对象中复制属性的值,执行浅表复制
/// </summary>
/// <typeparam name="T">对象类型</typeparam>
/// <param name="t">复制目标</param>
/// <param name="s">复制原</param>
/// <returns></returns>
public static T CopyFrom<T>(this T t,object s) where T : class {
CopyFrom(t,s);
return t as T;
}
/// <summary>
/// 判断一个类型是否可以转换为另一个类型
/// </summary>
/// <param name="source">原类型</param>

View File

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