diff --git a/WebSiteCode/Cmdjy/Cmdjy.sln b/WebSiteCode/Cmdjy/Cmdjy.sln index 37932b6..644eb56 100644 --- a/WebSiteCode/Cmdjy/Cmdjy.sln +++ b/WebSiteCode/Cmdjy/Cmdjy.sln @@ -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 diff --git a/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj b/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj index 133d89c..c78f2d8 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj +++ b/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj @@ -193,7 +193,6 @@ - @@ -299,6 +298,10 @@ + + {aa5638cd-29e5-48e7-96f2-f3a32d42be9f} + CommonHelper + {d0fe758c-da33-45c7-8110-563056a58717} HisInterfaceModels diff --git a/WebSiteCode/Cmdjy/Cmdjy/ws/WsdInterface.asmx.cs b/WebSiteCode/Cmdjy/Cmdjy/ws/WsdInterface.asmx.cs index eae6a1d..1328ada 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/ws/WsdInterface.asmx.cs +++ b/WebSiteCode/Cmdjy/Cmdjy/ws/WsdInterface.asmx.cs @@ -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 { diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Bll/PostHelper.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Bll/PostHelper.cs new file mode 100644 index 0000000..778c6cb --- /dev/null +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Bll/PostHelper.cs @@ -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 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(msg); + } + } + + private HisDrugResult drug(HisDrugInfo info) { + using(var server = new HisServer.HisInterfaceSoapClient()) { + var msg = JsonConvert.SerializeObject(info); + return JsonConvert.DeserializeObject(msg); + } + } + } +} \ No newline at end of file diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/CmdjyHisFront.csproj b/WebSiteCode/Cmdjy/CmdjyHisFront/CmdjyHisFront.csproj index 04ce6de..bd1f485 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/CmdjyHisFront.csproj +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/CmdjyHisFront.csproj @@ -165,6 +165,7 @@ + True True @@ -173,9 +174,10 @@ - - - + + + + Global.asax @@ -254,6 +256,10 @@ + + {aa5638cd-29e5-48e7-96f2-f3a32d42be9f} + CommonHelper + {d0fe758c-da33-45c7-8110-563056a58717} HisInterfaceModels diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs index b6016be..c04c97b 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs @@ -18,11 +18,18 @@ namespace CmdjyHisFront.Dal /// /// 处方信息 /// - public DbSet PrescriptionInfo { get; set; } + public DbSet PrescriptionInfo { get; set; } /// /// 药品信息 /// - public DbSet DrugInfo { get; set; } - + public DbSet DrugInfo { get; set; } + /// + /// 处方上传记录 + /// + public DbSet PrescriptionInfoLogs { get; set; } + /// + /// 药品上传记录 + /// + public DbSet DrugInfoLogs { get; set; } } } \ No newline at end of file diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisDrugInfo.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfo.cs similarity index 93% rename from WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisDrugInfo.cs rename to WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfo.cs index 37a354d..02f44d7 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisDrugInfo.cs +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfo.cs @@ -7,8 +7,8 @@ namespace CmdjyHisFront.Dal.Tables /// /// HIS发送的药品信息 /// - [Table("HisDrugInfo")] - public class HisDrugInfo + [Table("DjyDrugInfo")] + public class DjyDrugInfo { /// /// 主键,药品流水号 diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfoLog.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfoLog.cs new file mode 100644 index 0000000..348a23d --- /dev/null +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyDrugInfoLog.cs @@ -0,0 +1,37 @@ +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CmdjyHisFront.Dal.Tables +{ + /// + /// 上传记录表 + /// + [Table("DjyDrugInfoLog")] + public class DjyDrugInfoLog + { + /// + /// 序号 + /// + public int Id { get; set; } + /// + /// 药品表编号 + /// + public int HisDrugInfoId { get; set; } + /// + /// 上传返回代码 + /// + public int ResultCode { get; set; } + /// + /// 上传返回信息 + /// + public string ResultMsg { get; set; } + /// + /// 中心药品编号 + /// + public int DrugId { get; set; } + /// + /// 上传时间 + /// + public DateTime PostDatatime { get; set; } + } +} \ No newline at end of file diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisPrescriptionInfo.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfo.cs similarity index 95% rename from WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisPrescriptionInfo.cs rename to WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfo.cs index df2b0c4..317a2a4 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/HisPrescriptionInfo.cs +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfo.cs @@ -7,8 +7,8 @@ namespace CmdjyHisFront.Dal.Tables /// /// HIS发送的处方信息 /// - [Table("HisPrescriptionInfo")] - public class HisPrescriptionInfo + [Table("DjyPrescriptionInfo")] + public class DjyPrescriptionInfo { /// /// 主键,处方流水号 diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/PostLog.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfoLog.cs similarity index 69% rename from WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/PostLog.cs rename to WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfoLog.cs index 60c1981..4b4fcfe 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/PostLog.cs +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Dal/Tables/DjyPrescriptionInfoLog.cs @@ -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 /// /// 上传记录表 /// - public class PostLog + [Table("DjyPrescriptionInfoLog")] + public class DjyPrescriptionInfoLog { /// - /// + /// 序号 /// public int Id { get; set; } /// - /// + /// 处方表编号 /// public int HisPrescriptionInfoId { get; set; } /// - /// + /// 上传返回代码 /// public int ResultCode { get; set; } /// - /// - /// - /// - /// + /// 上传返回信息 /// public string ResultMsg { get; set; } /// - /// + /// 中心处方编号 /// public int PrescriptionId { get; set; } /// - /// + /// 上传时间 /// public DateTime PostDatatime { get; set; } } diff --git a/WebSiteCode/Cmdjy/CmdjyHisFront/Global.asax.cs b/WebSiteCode/Cmdjy/CmdjyHisFront/Global.asax.cs index 6b65e8b..c0e03c4 100644 --- a/WebSiteCode/Cmdjy/CmdjyHisFront/Global.asax.cs +++ b/WebSiteCode/Cmdjy/CmdjyHisFront/Global.asax.cs @@ -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()); + Database.SetInitializer(null); //配置autofac依赖注入 DependencyResolver.SetResolver(new AutofacDependencyResolver(IocFactory.Factory)); diff --git a/WebSiteCode/Cmdjy/CommonHelper/CommonHelper.csproj b/WebSiteCode/Cmdjy/CommonHelper/CommonHelper.csproj new file mode 100644 index 0000000..b36f90a --- /dev/null +++ b/WebSiteCode/Cmdjy/CommonHelper/CommonHelper.csproj @@ -0,0 +1,47 @@ + + + + + Debug + AnyCPU + {AA5638CD-29E5-48E7-96F2-F3A32D42BE9F} + Library + Properties + CommonHelper + CommonHelper + v4.6.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebSiteCode/Cmdjy/Cmdjy/Bll/ObjExtend.cs b/WebSiteCode/Cmdjy/CommonHelper/ObjExtend.cs similarity index 72% rename from WebSiteCode/Cmdjy/Cmdjy/Bll/ObjExtend.cs rename to WebSiteCode/Cmdjy/CommonHelper/ObjExtend.cs index 3c0adca..9553056 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Bll/ObjExtend.cs +++ b/WebSiteCode/Cmdjy/CommonHelper/ObjExtend.cs @@ -1,4 +1,4 @@ -namespace Cmdjy.Bll +namespace CommonHelper { using System; @@ -21,6 +21,17 @@ } } /// + /// 从目标对象中复制属性的值,执行浅表复制 + /// + /// 对象类型 + /// 复制目标 + /// 复制原 + /// + public static T CopyFrom(this T t,object s) where T : class { + CopyFrom(t,s); + return t as T; + } + /// /// 判断一个类型是否可以转换为另一个类型 /// /// 原类型 diff --git a/WebSiteCode/Cmdjy/CommonHelper/Properties/AssemblyInfo.cs b/WebSiteCode/Cmdjy/CommonHelper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..86f15e7 --- /dev/null +++ b/WebSiteCode/Cmdjy/CommonHelper/Properties/AssemblyInfo.cs @@ -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")]