Преглед изворни кода

5月上线更新+财务接口接入

singlese7en пре 2 година
родитељ
комит
0d7335176e

+ 15 - 0
HisClientReceiveToScan.sln

@@ -73,6 +73,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		README.md = README.md
 	EndProjectSection
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediII.Adapter.BizComponent.DFT", "IL.BizComponent\MediII.Adapter.BizComponent.DFT\MediII.Adapter.BizComponent.DFT.csproj", "{E6D36719-0871-4942-8BA6-4CD1D0ADA192}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -232,6 +234,18 @@ Global
 		{FB0F3AD4-26BC-44D6-B4BB-88380A445C53}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{FB0F3AD4-26BC-44D6-B4BB-88380A445C53}.Release|x64.ActiveCfg = Release|Any CPU
 		{FB0F3AD4-26BC-44D6-B4BB-88380A445C53}.Release|x86.ActiveCfg = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|x64.ActiveCfg = Release|Any CPU
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -242,6 +256,7 @@ Global
 		{E634900C-0A19-4575-A0F7-BF5780AE20C3} = {092D7052-844E-4C0F-B6BB-D18B84FC7F99}
 		{70F1BFF2-22D0-4B1D-BD85-4279FAC616C1} = {092D7052-844E-4C0F-B6BB-D18B84FC7F99}
 		{B937B9E7-11DE-47BF-9D62-FEAD3DE51D0D} = {092D7052-844E-4C0F-B6BB-D18B84FC7F99}
+		{E6D36719-0871-4942-8BA6-4CD1D0ADA192} = {092D7052-844E-4C0F-B6BB-D18B84FC7F99}
 		{F182AC2B-A0D5-40D2-89AF-8D547606B6AC} = {0F0E79A2-AED1-4FD1-859B-A518FCB4BA31}
 		{4E8C6D0E-E696-4F02-812F-CEDD6FE3F6DC} = {13F2A33E-FD55-41A7-9288-18572D9E5130}
 		{0ADDDB14-B0F6-4D12-8025-5EC8124A511B} = {13F2A33E-FD55-41A7-9288-18572D9E5130}

+ 168 - 0
IL.BizComponent/MediII.Adapter.BizComponent.DFT/BizComponent_DFT.cs

@@ -0,0 +1,168 @@
+using System;
+using System.Data;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using MediII.Adapter.BaseBiz;
+using System.Data.Common;
+using System.Transactions;
+using Microsoft.Practices.EnterpriseLibrary.Data;
+//using MediII.Adapter.Model.UE;
+using System.Globalization;
+using MediII.Adapter.BizComponent.Base;
+using IL.Common;
+using System.Xml;
+
+namespace MediII.Adapter.BizComponent.DFT
+{
+    public class BizComponent_DFT : BaseBizComponent, IBizComponent
+    {
+        const string Insert = "B01"; //财务明细
+
+
+        //数据库连接
+        protected Database ctx;
+        protected Database Scanctx;
+        public BizComponent_DFT()
+        {
+            DatabaseProviderFactory factory = new DatabaseProviderFactory();
+            ctx = factory.Create("HealthCare");
+            Scanctx = factory.CreateDefault();
+        }
+        ////HealthCareContainer HealthCareContainer = new HealthCareContainer();
+        //private Database ctx = null;
+        //public BizComponent_PMU(Database dbCtx)
+        //{
+        //    ctx = dbCtx;
+        //}
+        public override string DoProcess(string m, string msgType)
+        {
+            string strMsgType = null;
+            var resultCode = string.Empty;
+            var result = string.Empty;
+            
+
+            //
+            OperateXmlUtil xmlHelper = new OperateXmlUtil();
+
+            //返回数据解析
+            XmlNode root = xmlHelper.GetContentRootNode(m);
+            XmlNodeList list = root.SelectNodes("//FinaDetails//FinaDetail");
+            if (list.Count <= 0)
+                return string.Empty;
+            int num = 0;
+
+            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))
+            {
+                 foreach (XmlElement xn in list)
+                 {
+                     var year = xn.SelectSingleNode("year").InnerText;
+                     var month = xn.SelectSingleNode("month").InnerText;
+                     var deptCode = xn.SelectSingleNode("deptCode").InnerText;
+                     var acntCpde = xn.SelectSingleNode("acntCpde").InnerText;
+                   
+                    num = GetCount(year, month, deptCode, acntCpde);
+                     if (num>0)
+                         UpDateData(xn);
+                     else
+                         AddData(xn);
+                    
+                 }
+                scope.Complete();
+            }
+           
+            return string.Empty;
+        }
+        public void AddData(XmlElement xn)
+        {
+            #region 新增
+            string sql = @"INSERT INTO dbo.data_caiwu
+                                    ( fee_date ,
+                                    year ,
+                                    month ,
+                                    unit_id ,
+                                    unit_name,
+cost_code,cost_name,fee
+                                    )
+                            VALUES  ( @feeDate,
+                                    @year ,
+                                    @month ,
+                                    @unit_id ,
+                                    @unit_name,@cost_code,@cost_name,@fee)";
+            var year = xn.SelectSingleNode("year").InnerText;
+            var month = xn.SelectSingleNode("month").InnerText;
+            var deptCode = xn.SelectSingleNode("deptCode").InnerText;
+            var deptName = xn.SelectSingleNode("deptName").InnerText;
+            var acntCpde = xn.SelectSingleNode("acntCpde").InnerText;
+            var acntName = xn.SelectSingleNode("acntName").InnerText;
+            decimal Cost = 0;
+            var costtmp = xn.SelectSingleNode("Cost").InnerText;
+            decimal.TryParse(costtmp, out Cost);
+            DateTime feeDate = Convert.ToDateTime("1999-01-01 00:00:00");
+            var feedatetmp = xn.SelectSingleNode("feeDate").InnerText;
+            DateTime.TryParse(feedatetmp, out feeDate);
+
+            var cmd = SqlDataAccess.GetSqlStringCommand(ctx, sql);
+            SqlDataAccess.AddInParameter(ctx,cmd, "year", System.Data.DbType.String, year);
+            SqlDataAccess.AddInParameter(ctx, cmd, "month", System.Data.DbType.String, month);
+            SqlDataAccess.AddInParameter(ctx, cmd, "feeDate", System.Data.DbType.DateTime, feeDate);
+            SqlDataAccess.AddInParameter(ctx, cmd, "unit_id", System.Data.DbType.String, deptCode);
+            SqlDataAccess.AddInParameter(ctx, cmd, "unit_name", System.Data.DbType.String, deptName);
+            SqlDataAccess.AddInParameter(ctx, cmd, "cost_code", System.Data.DbType.String, acntCpde);
+            SqlDataAccess.AddInParameter(ctx, cmd, "cost_name", System.Data.DbType.String, acntName);
+            SqlDataAccess.AddInParameter(ctx, cmd, "fee", System.Data.DbType.Decimal, Cost);
+            SqlDataAccess.ExecuteNonQuery(ctx, cmd);
+            #endregion
+        }
+        public void UpDateData(XmlElement xn)
+        {
+            #region 修改
+            string sql1 = @"update dbo.data_caiwu set 
+                                    fee_date =@feeDate,
+                                    unit_name =@unit_name,
+                                    cost_name =@cost_name,
+                                    fee=@fee
+                                where year=@year and month=@month and unit_id=@unit_id and cost_code=@cost_code";
+            
+            var year = xn.SelectSingleNode("year").InnerText;
+            var month = xn.SelectSingleNode("month").InnerText;
+            var deptCode = xn.SelectSingleNode("deptCode").InnerText;
+            var deptName = xn.SelectSingleNode("deptName").InnerText;
+            var acntCpde = xn.SelectSingleNode("acntCpde").InnerText;
+            var acntName = xn.SelectSingleNode("acntName").InnerText;
+            decimal Cost = 0;
+            var costtmp = xn.SelectSingleNode("Cost").InnerText;
+            decimal.TryParse(costtmp, out Cost);
+            DateTime feeDate = Convert.ToDateTime("1999-01-01 00:00:00");
+            var feedatetmp = xn.SelectSingleNode("feeDate").InnerText;
+            DateTime.TryParse(feedatetmp, out feeDate);
+
+            DbCommand command1 = ctx.GetSqlStringCommand(sql1.ToString());
+            SqlDataAccess.AddInParameter(ctx, command1, "year", System.Data.DbType.String, year);
+            SqlDataAccess.AddInParameter(ctx, command1, "month", System.Data.DbType.String, month);
+            SqlDataAccess.AddInParameter(ctx, command1, "feeDate", System.Data.DbType.DateTime, feeDate);
+            SqlDataAccess.AddInParameter(ctx, command1, "unit_id", System.Data.DbType.String, deptCode);
+            SqlDataAccess.AddInParameter(ctx, command1, "unit_name", System.Data.DbType.String, deptName);
+            SqlDataAccess.AddInParameter(ctx, command1, "cost_code", System.Data.DbType.String, acntCpde);
+            SqlDataAccess.AddInParameter(ctx, command1, "cost_name", System.Data.DbType.String, acntName);
+            SqlDataAccess.AddInParameter(ctx, command1, "fee", System.Data.DbType.Decimal, Cost);
+            SqlDataAccess.ExecuteNonQuery(ctx, command1);
+            #endregion
+        }
+
+        protected int GetCount(string year,string month,string deptCode,string acntCode)
+        {
+            var sql = "SELECT count(1) FROM dbo.data_caiwu WITH(NOLOCK) WHERE year=@year and month=@month and unit_id=@deptCode and cost_code=@acntCode";
+            var cmd = ctx.DBGetSqlStringCommand(sql);
+            ctx.AddInParameter(cmd, "year", DbType.String, year);
+            ctx.AddInParameter(cmd, "month", DbType.String, month);
+            ctx.AddInParameter(cmd, "deptCode", DbType.String, deptCode);
+            ctx.AddInParameter(cmd, "acntCode", DbType.String, acntCode);
+            var obj = int.Parse(StrHelepr.Obj2StrTrim(ctx.DBExecuteScalar(cmd)));
+            return obj;
+        }
+      
+
+    }
+
+}

+ 102 - 0
IL.BizComponent/MediII.Adapter.BizComponent.DFT/MediII.Adapter.BizComponent.DFT.csproj

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E6D36719-0871-4942-8BA6-4CD1D0ADA192}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>MediII.Adapter.BizComponent.DFT</RootNamespace>
+    <AssemblyName>MediII.Adapter.BizComponent.DFT</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </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>
+    <DocumentationFile>
+    </DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="MediII.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\dll\MediII.Common.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\dll\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\dll\Microsoft.Practices.EnterpriseLibrary.Data.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\dll\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Transactions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BizComponent_DFT.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\Public\IL.Common\IL.Common.csproj">
+      <Project>{f320951f-886b-4f99-a3fd-5686c0a97868}</Project>
+      <Name>IL.Common</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\Public\MediII.Adapter.Scan.Interface\MediII.Adapter.Scan.Interface.csproj">
+      <Project>{4e8c6d0e-e696-4f02-812f-cedd6fe3f6dc}</Project>
+      <Name>MediII.Adapter.Scan.Interface</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MediII.Adapter.BizComponent.Base\MediII.Adapter.BizComponent.Base.csproj">
+      <Project>{619b1dbf-55b7-446b-af40-852a6ab689a0}</Project>
+      <Name>MediII.Adapter.BizComponent.Base</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>Copy $(TargetDir)   $(ProjectDir)..\..\MessageToScan\UE\
+Copy $(TargetDir)   $(ProjectDir)..\..\MessageToScanServer\UE\</PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 36 - 0
IL.BizComponent/MediII.Adapter.BizComponent.DFT/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("MediII.Adapter.BizComponent.PMU")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MediII.Adapter.BizComponent.PMU")]
+[assembly: AssemblyCopyright("Copyright ©  2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("ff47b8b9-7d92-43ac-93a8-dcd10d1ff028")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      内部版本号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 24 - 0
MediII.Adapter.Scan.UE/HL7_DFT_Scanner.cs

@@ -0,0 +1,24 @@
+
+using MediII.Adapter.Scanner;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Transactions;
+using Microsoft.Practices.EnterpriseLibrary.Data;
+using MediII.Adapter.BizComponent.Base;
+using IL.Common;
+using MediII.Adapter.ReceiveToScanModel;
+
+namespace MediII.Adapter.BizComponent.UE
+{
+    public class HL7_DFT_Scanner : DefaultDBScanner
+    {
+        protected override string GetMessageType()
+        {
+            return "DFT";
+        } 
+         
+    }
+}

+ 2 - 1
MediII.Adapter.Scan.UE/MediII.Adapter.BizComponent.UE.csproj

@@ -71,6 +71,7 @@
     <Compile Include="DebugScanner.cs" />
     <Compile Include="DefaultDBScanner.cs" />
     <Compile Include="HL7_MFN_Scanner.cs" />
+    <Compile Include="HL7_DFT_Scanner.cs" />
     <Compile Include="HL7_PMU_Scanner.cs" />
     <Compile Include="HL7_ADT_Scanner.cs" />
     <Compile Include="HL7_Lock_Scanner.cs" />
@@ -92,7 +93,7 @@
     </ProjectReference>
     <ProjectReference Include="..\MediII.Adapter.ReceiveToScanModel\MediII.Adapter.ReceiveToScanModel.csproj">
       <Project>{f182ac2b-a0d5-40d2-89af-8d547606b6ac}</Project>
-      <Name>MediII.Adapter.ReceiveToSIModel</Name>
+      <Name>MediII.Adapter.ReceiveToScanModel</Name>
     </ProjectReference>
     <ProjectReference Include="..\MediII.Adapter.Scanner\MediII.Adapter.Scanner.csproj">
       <Project>{0adddb14-b0f6-4d12-8025-5ec8124a511b}</Project>