Commit 9a8cc93b by zry

api dev

parent e2d44293
This diff was suppressed by a .gitattributes entry.
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{CA39468E-CBB1-4FE6-A410-72B2AFCA315E}" Label="" LastModificationDate="1551161171" Name="绩效" Objects="208" Symbols="27" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{CA39468E-CBB1-4FE6-A410-72B2AFCA315E}" Label="" LastModificationDate="1551669188" Name="绩效" Objects="218" Symbols="28" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
......@@ -12,7 +12,7 @@
<a:Code>绩效</a:Code>
<a:CreationDate>1550820261</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551158678</a:ModificationDate>
<a:ModificationDate>1551668924</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:PackageOptionsText>[FolderOptions]
......@@ -3700,7 +3700,7 @@ PhysOpts=</a:ModelOptionsText>
<a:Code>PhysicalDiagram_1</a:Code>
<a:CreationDate>1550820261</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551150989</a:ModificationDate>
<a:ModificationDate>1551668924</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DisplayPreferences>[DisplayPreferences]
......@@ -4809,6 +4809,33 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o58"/>
</c:Object>
</o:TableSymbol>
<o:TableSymbol Id="o59">
<a:CreationDate>1551668924</a:CreationDate>
<a:ModificationDate>1551668934</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-64257,-403), (-52033,12918))</a:Rect>
<a:AutoAdjustToText>0</a:AutoAdjustToText>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 新宋体,8,N
DISPNAME 0 新宋体,8,N
OWNRDISPNAME 0 新宋体,8,N
Columns 0 新宋体,8,N
TablePkColumns 0 新宋体,8,U
TableFkColumns 0 新宋体,8,N
Keys 0 新宋体,8,N
Indexes 0 新宋体,8,N
Triggers 0 新宋体,8,N
LABL 0 新宋体,8,N</a:FontList>
<a:BrushStyle>6</a:BrushStyle>
<a:GradientFillMode>65</a:GradientFillMode>
<a:GradientEndColor>16777215</a:GradientEndColor>
<a:ManuallyResized>1</a:ManuallyResized>
<c:Object>
<o:Table Ref="o60"/>
</c:Object>
</o:TableSymbol>
</c:Symbols>
</o:PhysicalDiagram>
</c:PhysicalDiagrams>
......@@ -4828,7 +4855,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:RowGrowthRate>50</a:RowGrowthRate>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o59">
<o:Column Id="o61">
<a:ObjectID>A2B720AA-A14F-4661-A3BB-A6ABEC1EA5AE</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -4840,7 +4867,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o60">
<o:Column Id="o62">
<a:ObjectID>218C7836-B834-44E5-87CC-6E0E123A323B</a:ObjectID>
<a:Name>绩效分配ID</a:Name>
<a:Code>AllotID</a:Code>
......@@ -4850,7 +4877,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o61">
<o:Column Id="o63">
<a:ObjectID>85B83825-6BBD-41DA-8D76-FC644F3166EE</a:ObjectID>
<a:Name>SheetName</a:Name>
<a:Code>SheetName</a:Code>
......@@ -4861,7 +4888,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(100)</a:DataType>
<a:Length>100</a:Length>
</o:Column>
<o:Column Id="o62">
<o:Column Id="o64">
<a:ObjectID>09655D91-08A0-468C-8A1B-9BDEFEE05B48</a:ObjectID>
<a:Name>SheetType</a:Name>
<a:Code>SheetType</a:Code>
......@@ -4873,7 +4900,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o63">
<o:Key Id="o65">
<a:ObjectID>33BB68F5-3117-4876-AD75-AC17A81EBD15</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -4882,12 +4909,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1550823169</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o46">
......@@ -4896,12 +4923,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Code>Sys_Hosptail</a:Code>
<a:CreationDate>1550823558</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551074214</a:ModificationDate>
<a:ModificationDate>1551664106</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:Comment>医院信息</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o64">
<o:Column Id="o66">
<a:ObjectID>12D8A4C4-BB02-4A7E-B19B-77005E3A671A</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -4913,19 +4940,39 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o65">
<o:Column Id="o67">
<a:ObjectID>11037AE5-823C-4191-8971-74A7733598AA</a:ObjectID>
<a:Name>CreateDate</a:Name>
<a:Code>CreateDate</a:Code>
<a:CreationDate>1551664064</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551664106</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>datetime</a:DataType>
</o:Column>
<o:Column Id="o68">
<a:ObjectID>89925586-2308-4B67-AE5F-917E65BC4100</a:ObjectID>
<a:Name>CreateUser</a:Name>
<a:Code>CreateUser</a:Code>
<a:CreationDate>1551664064</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551664106</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o69">
<a:ObjectID>F186D6E4-12AE-4100-B31B-6B63B2A74F58</a:ObjectID>
<a:Name>医院名称</a:Name>
<a:Code>HospitalName</a:Code>
<a:Code>HosName</a:Code>
<a:CreationDate>1550823698</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550829846</a:ModificationDate>
<a:ModificationDate>1551668811</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:Comment>医院名称</a:Comment>
<a:DataType>varchar(100)</a:DataType>
<a:Length>100</a:Length>
</o:Column>
<o:Column Id="o66">
<o:Column Id="o70">
<a:ObjectID>B60E2419-84A9-4458-9372-82AFEEB22F95</a:ObjectID>
<a:Name>简称</a:Name>
<a:Code>ShortName</a:Code>
......@@ -4937,7 +4984,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(100)</a:DataType>
<a:Length>100</a:Length>
</o:Column>
<o:Column Id="o67">
<o:Column Id="o71">
<a:ObjectID>CC07D2CB-0383-4047-9E33-1FAD3403214A</a:ObjectID>
<a:Name>区域编码</a:Name>
<a:Code>AreaCode</a:Code>
......@@ -4948,27 +4995,27 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(10)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o68">
<o:Column Id="o72">
<a:ObjectID>99CD20BF-9242-48D6-87E7-5FFB35458703</a:ObjectID>
<a:Name>医院等级</a:Name>
<a:Code>HospitalLevel</a:Code>
<a:Code>HosLevel</a:Code>
<a:CreationDate>1550829991</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550830144</a:ModificationDate>
<a:ModificationDate>1551668811</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o69">
<o:Column Id="o73">
<a:ObjectID>300C342F-3B84-49FC-B689-A74AF882D2DA</a:ObjectID>
<a:Name>医院类型</a:Name>
<a:Code>HospitalType</a:Code>
<a:Code>HosType</a:Code>
<a:CreationDate>1550829991</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550830144</a:ModificationDate>
<a:ModificationDate>1551668811</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o70">
<o:Column Id="o74">
<a:ObjectID>067B9B55-6E70-4531-B46E-D264C8B935A4</a:ObjectID>
<a:Name>医院状态</a:Name>
<a:Code>States</a:Code>
......@@ -4980,7 +5027,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o71">
<o:Key Id="o75">
<a:ObjectID>F078B90F-FDA8-49A3-9389-BBDDC900C1C2</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -4989,12 +5036,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1550823867</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o64"/>
<o:Column Ref="o66"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o71"/>
<o:Key Ref="o75"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o47">
......@@ -5008,7 +5055,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>医院绩效分配</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o72">
<o:Column Id="o76">
<a:ObjectID>BEABB5B0-F4B8-428A-BC3F-D4CFE4D5DA13</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5020,7 +5067,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o73">
<o:Column Id="o77">
<a:ObjectID>AAD8FD1D-0425-4F98-843C-95C61BB27ADC</a:ObjectID>
<a:Name>医院ID</a:Name>
<a:Code>HospitalId</a:Code>
......@@ -5031,7 +5078,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>医院ID</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o74">
<o:Column Id="o78">
<a:ObjectID>48635D75-96CD-4378-91CB-0F5590A0F1EF</a:ObjectID>
<a:Name>绩效发放年</a:Name>
<a:Code>Year</a:Code>
......@@ -5042,7 +5089,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效发放年</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o75">
<o:Column Id="o79">
<a:ObjectID>DEDAC51A-AB9B-4FD8-AD9C-5E074E218856</a:ObjectID>
<a:Name>绩效发放月</a:Name>
<a:Code>Month</a:Code>
......@@ -5053,7 +5100,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效发放月</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o76">
<o:Column Id="o80">
<a:ObjectID>FA17B90B-EE44-4F30-8807-577FFA390CB7</a:ObjectID>
<a:Name>绩效发放总金额</a:Name>
<a:Code>AllocationFee</a:Code>
......@@ -5064,7 +5111,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效发放总金额</a:Comment>
<a:DataType>decimal</a:DataType>
</o:Column>
<o:Column Id="o77">
<o:Column Id="o81">
<a:ObjectID>FF684FAF-C15A-40B6-8CF1-E652E31574CF</a:ObjectID>
<a:Name>绩效统计时间</a:Name>
<a:Code>CreateDatetime</a:Code>
......@@ -5075,7 +5122,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效统计时间</a:Comment>
<a:DataType>datetime</a:DataType>
</o:Column>
<o:Column Id="o78">
<o:Column Id="o82">
<a:ObjectID>C805F094-834C-405F-B929-C7CB2FCA1C35</a:ObjectID>
<a:Name>文件上传路径</a:Name>
<a:Code>Path</a:Code>
......@@ -5086,7 +5133,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(100)</a:DataType>
<a:Length>100</a:Length>
</o:Column>
<o:Column Id="o79">
<o:Column Id="o83">
<a:ObjectID>A350087F-B90E-4C6F-AE42-1FD7ACD49782</a:ObjectID>
<a:Name>上传时间</a:Name>
<a:Code>UploadDate</a:Code>
......@@ -5096,7 +5143,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>datetime</a:DataType>
</o:Column>
<o:Column Id="o80">
<o:Column Id="o84">
<a:ObjectID>BCFC7804-7101-42D4-9B8F-06D66F92520A</a:ObjectID>
<a:Name>状态</a:Name>
<a:Code>States</a:Code>
......@@ -5108,7 +5155,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o81">
<o:Key Id="o85">
<a:ObjectID>D6E42B3A-64CB-4D9E-BD24-E873771D2556</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5117,12 +5164,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1550828777</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o72"/>
<o:Column Ref="o76"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o81"/>
<o:Key Ref="o85"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o48">
......@@ -5136,7 +5183,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效分配明细</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o82">
<o:Column Id="o86">
<a:ObjectID>C3A5D5C7-52A6-4345-A469-537C6520B9CB</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5148,7 +5195,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o83">
<o:Column Id="o87">
<a:ObjectID>154E45D4-8FD5-446F-9864-1DDA5BF7B12E</a:ObjectID>
<a:Name>医院绩效分配ID</a:Name>
<a:Code>HospitalAllotID</a:Code>
......@@ -5159,7 +5206,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>医院绩效分配ID</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o84">
<o:Column Id="o88">
<a:ObjectID>784D47D3-5D09-481A-AE17-7C258078ABA5</a:ObjectID>
<a:Name>成员名称</a:Name>
<a:Code>MemberName</a:Code>
......@@ -5171,7 +5218,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(10)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o85">
<o:Column Id="o89">
<a:ObjectID>3E620D10-FA48-499E-87D6-26A345C065DA</a:ObjectID>
<a:Name>分配金额</a:Name>
<a:Code>AllotFee</a:Code>
......@@ -5184,7 +5231,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o86">
<o:Key Id="o90">
<a:ObjectID>050BFF09-97F5-40A4-B95A-20A7F3954FA6</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5193,12 +5240,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1550828826</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o82"/>
<o:Column Ref="o86"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o86"/>
<o:Key Ref="o90"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o49">
......@@ -5212,7 +5259,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>excel单元格描述信息</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o87">
<o:Column Id="o91">
<a:ObjectID>1EA5802C-59E5-436C-A51B-8B779387559A</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5223,7 +5270,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o88">
<o:Column Id="o92">
<a:ObjectID>EB2B661D-C19F-41BB-ABEE-D156D2F89321</a:ObjectID>
<a:Name>Sheet页ID</a:Name>
<a:Code>SheetID</a:Code>
......@@ -5234,7 +5281,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>Sheet页ID</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o89">
<o:Column Id="o93">
<a:ObjectID>BC167B89-945E-4BDB-AFB9-E45C876D7109</a:ObjectID>
<a:Name>行坐标(0开始)</a:Name>
<a:Code>PointRow</a:Code>
......@@ -5245,7 +5292,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>行坐标(0开始)</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o90">
<o:Column Id="o94">
<a:ObjectID>390AACD7-BD10-4806-9C4D-95297EB24047</a:ObjectID>
<a:Name>列坐标(0开始)</a:Name>
<a:Code>PointColumn</a:Code>
......@@ -5256,7 +5303,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>列坐标(0开始)</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o91">
<o:Column Id="o95">
<a:ObjectID>30EC75FC-8A5D-4528-8FE0-F0CAFDFB1554</a:ObjectID>
<a:Name>合并行</a:Name>
<a:Code>MergeRow</a:Code>
......@@ -5267,7 +5314,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>合并行</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o92">
<o:Column Id="o96">
<a:ObjectID>B134F06D-FD19-4190-90AD-4E05691A315D</a:ObjectID>
<a:Name>合并列</a:Name>
<a:Code>MergeColumn</a:Code>
......@@ -5278,7 +5325,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>合并列</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o93">
<o:Column Id="o97">
<a:ObjectID>F2841DC1-B8EF-4824-9206-A2BCCF062EF1</a:ObjectID>
<a:Name>单元格内容</a:Name>
<a:Code>CellContent</a:Code>
......@@ -5290,7 +5337,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(100)</a:DataType>
<a:Length>100</a:Length>
</o:Column>
<o:Column Id="o94">
<o:Column Id="o98">
<a:ObjectID>FB9099E1-7779-47A1-BEE2-7040C83E6FC0</a:ObjectID>
<a:Name>父级单元格ID</a:Name>
<a:Code>ParentID</a:Code>
......@@ -5301,7 +5348,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>父级单元格ID</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o95">
<o:Column Id="o99">
<a:ObjectID>B4A28BED-E5EC-42F5-892E-EB1EE25333D4</a:ObjectID>
<a:Name>单元格等级</a:Name>
<a:Code>Level</a:Code>
......@@ -5314,7 +5361,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o96">
<o:Key Id="o100">
<a:ObjectID>2928AEFE-EA5E-4D73-8D24-BC12B34F3609</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5323,12 +5370,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551152004</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o87"/>
<o:Column Ref="o91"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o96"/>
<o:Key Ref="o100"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o50">
......@@ -5342,7 +5389,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>绩效分配明细</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o97">
<o:Column Id="o101">
<a:ObjectID>94F0619F-F7F7-4B5C-A645-F17F9B547F3C</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5354,7 +5401,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o98">
<o:Column Id="o102">
<a:ObjectID>94A74A61-9CEE-4B63-9C89-151EF9E630CD</a:ObjectID>
<a:Name>医院绩效分配ID</a:Name>
<a:Code>HospitalAllotID</a:Code>
......@@ -5365,7 +5412,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>医院绩效分配ID</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o99">
<o:Column Id="o103">
<a:ObjectID>2B7357A2-DFAE-4D0B-98DC-71FDF8FC841F</a:ObjectID>
<a:Name>成员名称</a:Name>
<a:Code>MemberName</a:Code>
......@@ -5377,7 +5424,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(10)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o100">
<o:Column Id="o104">
<a:ObjectID>BC70C352-490A-4185-8CAD-0ABDAA378AB3</a:ObjectID>
<a:Name>分配金额</a:Name>
<a:Code>AllotFee</a:Code>
......@@ -5390,7 +5437,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o101">
<o:Key Id="o105">
<a:ObjectID>D72BCA7D-06E9-4CCB-83B1-3B2493899A5C</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5399,12 +5446,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1550830983</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o97"/>
<o:Column Ref="o101"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o101"/>
<o:Key Ref="o105"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o51">
......@@ -5417,7 +5464,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o102">
<o:Column Id="o106">
<a:ObjectID>8FBBBEE8-88BB-4C04-9F25-AD71F6BC7ED8</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5428,7 +5475,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o103">
<o:Column Id="o107">
<a:ObjectID>6253DC7E-ED11-45A0-9CBE-4890E46DF135</a:ObjectID>
<a:Name>SheetID</a:Name>
<a:Code>SheetID</a:Code>
......@@ -5438,7 +5485,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o104">
<o:Column Id="o108">
<a:ObjectID>97C3CBEF-8AC9-48E7-82ED-C31CC840D0FE</a:ObjectID>
<a:Name>人员名单</a:Name>
<a:Code>StaffName</a:Code>
......@@ -5449,7 +5496,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o105">
<o:Column Id="o109">
<a:ObjectID>BB0962BD-8943-4AB1-9156-77BE149706EB</a:ObjectID>
<a:Name>绩效核算方式</a:Name>
<a:Code>PerforType</a:Code>
......@@ -5459,7 +5506,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o106">
<o:Column Id="o110">
<a:ObjectID>8E2A5AB4-DA27-43EA-BADD-BE11A7EB1D6D</a:ObjectID>
<a:Name>群体</a:Name>
<a:Code>Department</a:Code>
......@@ -5470,7 +5517,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o107">
<o:Column Id="o111">
<a:ObjectID>33BF8F72-459B-4746-A99A-D243E396A35C</a:ObjectID>
<a:Name>职称</a:Name>
<a:Code>JobTitle</a:Code>
......@@ -5483,7 +5530,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o108">
<o:Key Id="o112">
<a:ObjectID>D15BACB4-D020-406E-92C4-FABE01EF23C2</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5492,12 +5539,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551058553</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o102"/>
<o:Column Ref="o106"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o108"/>
<o:Key Ref="o112"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o52">
......@@ -5510,7 +5557,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o109">
<o:Column Id="o113">
<a:ObjectID>73382E78-C3CE-457F-A031-0F61D6B2A12D</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5521,7 +5568,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o110">
<o:Column Id="o114">
<a:ObjectID>47683352-1032-43B5-A6A2-F024D7C2581C</a:ObjectID>
<a:Name>真实姓名</a:Name>
<a:Code>RealName</a:Code>
......@@ -5532,7 +5579,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o111">
<o:Column Id="o115">
<a:ObjectID>CCA675C4-9CEC-4493-81E6-7F3C15A54A91</a:ObjectID>
<a:Name>登录名</a:Name>
<a:Code>Login</a:Code>
......@@ -5543,7 +5590,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o112">
<o:Column Id="o116">
<a:ObjectID>D3FA5A5B-3638-4A40-9496-7F1F7A0060A6</a:ObjectID>
<a:Name>密码</a:Name>
<a:Code>Password</a:Code>
......@@ -5554,7 +5601,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o113">
<o:Column Id="o117">
<a:ObjectID>0418B6FD-1AEB-4F59-BF83-734A77003E2A</a:ObjectID>
<a:Name>邮箱</a:Name>
<a:Code>Mail</a:Code>
......@@ -5565,7 +5612,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o114">
<o:Column Id="o118">
<a:ObjectID>F56E07D1-1242-403E-8BE4-A20C7B699681</a:ObjectID>
<a:Name>手机号</a:Name>
<a:Code>Mobile</a:Code>
......@@ -5576,7 +5623,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(20)</a:DataType>
<a:Length>20</a:Length>
</o:Column>
<o:Column Id="o115">
<o:Column Id="o119">
<a:ObjectID>1BB9A78A-E2CC-4FC5-B76C-07D7674EB97B</a:ObjectID>
<a:Name>用户状态</a:Name>
<a:Code>States</a:Code>
......@@ -5588,7 +5635,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o116">
<o:Key Id="o120">
<a:ObjectID>CE4E3133-19C2-48C9-9208-F69A7864CC3A</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5597,12 +5644,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551073604</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o109"/>
<o:Column Ref="o113"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o116"/>
<o:Key Ref="o120"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o53">
......@@ -5615,7 +5662,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o117">
<o:Column Id="o121">
<a:ObjectID>0B22ADC1-DDD0-482C-9EFC-EFF043DDE0F6</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5626,7 +5673,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o118">
<o:Column Id="o122">
<a:ObjectID>E5F739B4-A4B4-4D9A-BCE4-5DDCA829C5C3</a:ObjectID>
<a:Name>UserID</a:Name>
<a:Code>UserID</a:Code>
......@@ -5636,19 +5683,19 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o119">
<o:Column Id="o123">
<a:ObjectID>FEF4312F-BA20-4254-8934-9665473A779B</a:ObjectID>
<a:Name>HospitalID</a:Name>
<a:Code>HospitalID</a:Code>
<a:Name>HosID</a:Name>
<a:Code>HosID</a:Code>
<a:CreationDate>1551073650</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551074214</a:ModificationDate>
<a:ModificationDate>1551668820</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o120">
<o:Key Id="o124">
<a:ObjectID>FEBF592E-0005-401E-A832-641B5588BD83</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5657,12 +5704,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551074147</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o117"/>
<o:Column Ref="o121"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o120"/>
<o:Key Ref="o124"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o54">
......@@ -5676,7 +5723,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>科室绩效分配明细</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o121">
<o:Column Id="o125">
<a:ObjectID>2999FA9B-43FA-4F00-A1B8-6D9F816FB4E3</a:ObjectID>
<a:Name>科室ID</a:Name>
<a:Code>DepartmentID</a:Code>
......@@ -5687,7 +5734,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>行坐标(0开始)</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o122">
<o:Column Id="o126">
<a:ObjectID>226919C2-1B5E-4267-B6C2-F3AD4D7F21BF</a:ObjectID>
<a:Name>行坐标(0开始)</a:Name>
<a:Code>PointRow</a:Code>
......@@ -5697,7 +5744,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o123">
<o:Column Id="o127">
<a:ObjectID>0E367CB5-CFAE-4458-8361-0E99892E2F8D</a:ObjectID>
<a:Name>列坐标(0开始)</a:Name>
<a:Code>PointColumn</a:Code>
......@@ -5708,7 +5755,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>列坐标(0开始)</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o124">
<o:Column Id="o128">
<a:ObjectID>00976B2B-01CC-42F5-8DC0-A713BEC2E7FB</a:ObjectID>
<a:Name>合并行</a:Name>
<a:Code>MergeRow</a:Code>
......@@ -5719,7 +5766,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>合并行</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o125">
<o:Column Id="o129">
<a:ObjectID>867EF945-1528-4B7E-8D8C-A12C9E7AC0DE</a:ObjectID>
<a:Name>合并列</a:Name>
<a:Code>MergeColumn</a:Code>
......@@ -5730,7 +5777,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Comment>合并列</a:Comment>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o126">
<o:Column Id="o130">
<a:ObjectID>D9A1CF5E-1A0B-4C59-97F3-A8FA7BD27133</a:ObjectID>
<a:Name>单元格内容</a:Name>
<a:Code>CellContent</a:Code>
......@@ -5754,7 +5801,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o127">
<o:Column Id="o131">
<a:ObjectID>27000451-C897-4AE3-911A-7F98048C1B0D</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5765,7 +5812,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o128">
<o:Column Id="o132">
<a:ObjectID>67207FC3-8FFF-48A3-B276-7AA1C984C871</a:ObjectID>
<a:Name>SheetID</a:Name>
<a:Code>SheetID</a:Code>
......@@ -5775,7 +5822,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o129">
<o:Column Id="o133">
<a:ObjectID>FE192FD6-564F-4623-92A2-08ACD9CEC5EB</a:ObjectID>
<a:Name>核算单元</a:Name>
<a:Code>StandardName</a:Code>
......@@ -5786,7 +5833,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o130">
<o:Column Id="o134">
<a:ObjectID>B32870A9-AEE0-47E8-B622-0D7B783E2EB8</a:ObjectID>
<a:Name>科室名称</a:Name>
<a:Code>Department</a:Code>
......@@ -5797,7 +5844,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o131">
<o:Column Id="o135">
<a:ObjectID>899D3E4E-DA0F-47AD-A920-2A538B6003D1</a:ObjectID>
<a:Name>具体成本类型</a:Name>
<a:Code>TypeName</a:Code>
......@@ -5808,7 +5855,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o132">
<o:Column Id="o136">
<a:ObjectID>4F32232C-F2B5-438D-BEDD-A715B873234F</a:ObjectID>
<a:Name>成本一级分类</a:Name>
<a:Code>ParentType</a:Code>
......@@ -5819,7 +5866,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
</o:Column>
<o:Column Id="o133">
<o:Column Id="o137">
<a:ObjectID>9D0245C3-ECC4-4A34-8648-62CF400D3361</a:ObjectID>
<a:Name></a:Name>
<a:Code>CellValue</a:Code>
......@@ -5829,7 +5876,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:DataType>decimal</a:DataType>
</o:Column>
<o:Column Id="o134">
<o:Column Id="o138">
<a:ObjectID>67530784-2AA6-41F8-BFC4-EBA6588703CA</a:ObjectID>
<a:Name>注释</a:Name>
<a:Code>Annotation</a:Code>
......@@ -5842,7 +5889,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o135">
<o:Key Id="o139">
<a:ObjectID>C0E33D1D-386A-45D4-BD7E-160B14C7337A</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5851,12 +5898,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551152049</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o127"/>
<o:Column Ref="o131"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o135"/>
<o:Key Ref="o139"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o56">
......@@ -5869,7 +5916,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o136">
<o:Column Id="o140">
<a:ObjectID>166E8EE2-42F3-49F0-81BC-E3B112039EF2</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5881,7 +5928,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o137">
<o:Column Id="o141">
<a:ObjectID>EC0EBA18-C2AF-4C74-9D9F-F70FD5F34A52</a:ObjectID>
<a:Name>SheetID</a:Name>
<a:Code>SheetID</a:Code>
......@@ -5893,7 +5940,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
<c:Keys>
<o:Key Id="o138">
<o:Key Id="o142">
<a:ObjectID>2D499ED9-2C54-4260-B6D1-F1C89FF05566</a:ObjectID>
<a:Name>Key_1</a:Name>
<a:Code>Key_1</a:Code>
......@@ -5902,12 +5949,12 @@ LABL 0 新宋体,8,N</a:FontList>
<a:ModificationDate>1551152062</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Key.Columns>
<o:Column Ref="o136"/>
<o:Column Ref="o140"/>
</c:Key.Columns>
</o:Key>
</c:Keys>
<c:PrimaryKey>
<o:Key Ref="o138"/>
<o:Key Ref="o142"/>
</c:PrimaryKey>
</o:Table>
<o:Table Id="o57">
......@@ -5920,7 +5967,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o139">
<o:Column Id="o143">
<a:ObjectID>BA463675-3797-4DE1-A9FA-0A9A6806B35D</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5943,7 +5990,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o140">
<o:Column Id="o144">
<a:ObjectID>0BAEE902-EDBB-43F4-9BE1-305B3BF8A1F5</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
......@@ -5956,6 +6003,80 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Column>
</c:Columns>
</o:Table>
<o:Table Id="o60">
<a:ObjectID>52B38B92-3BD7-4CFA-BC23-F63FFFE6CC49</a:ObjectID>
<a:Name>Sys_SMS</a:Name>
<a:Code>Sys_SMS</a:Code>
<a:CreationDate>1551668924</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o145">
<a:ObjectID>5461FBEC-59ED-443F-A2AD-27B9DB2269A9</a:ObjectID>
<a:Name>ID</a:Name>
<a:Code>ID</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o146">
<a:ObjectID>C2A0BD4E-7AE7-42EF-BE94-EC627493E6BF</a:ObjectID>
<a:Name>CreateUser</a:Name>
<a:Code>CreateUser</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>int</a:DataType>
</o:Column>
<o:Column Id="o147">
<a:ObjectID>D64F3EED-484D-4210-9C2A-89FF00108F32</a:ObjectID>
<a:Name>CreateDate</a:Name>
<a:Code>CreateDate</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>datetime</a:DataType>
</o:Column>
<o:Column Id="o148">
<a:ObjectID>1CC43171-229C-4672-8E73-92E59D37FDA6</a:ObjectID>
<a:Name>Mobile</a:Name>
<a:Code>Mobile</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>varchar(20)</a:DataType>
<a:Length>20</a:Length>
</o:Column>
<o:Column Id="o149">
<a:ObjectID>F5DC0B88-B5A2-424B-AE01-2117407D4BCC</a:ObjectID>
<a:Name>SmsCode</a:Name>
<a:Code>SmsCode</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>varchar(10)</a:DataType>
<a:Length>10</a:Length>
</o:Column>
<o:Column Id="o150">
<a:ObjectID>885FB9CA-6490-49D3-87FE-AFDF1E495B7C</a:ObjectID>
<a:Name>Expiration</a:Name>
<a:Code>Expiration</a:Code>
<a:CreationDate>1551668935</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551669188</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<a:DataType>datetime</a:DataType>
</o:Column>
</c:Columns>
</o:Table>
</c:Tables>
<c:References>
<o:Reference Id="o8">
......@@ -5976,20 +6097,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o47"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o71"/>
<o:Key Ref="o75"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o141">
<o:ReferenceJoin Id="o151">
<a:ObjectID>5BDD4961-A16A-4F60-9EE7-A09702835F83</a:ObjectID>
<a:CreationDate>1550826241</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550826260</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o64"/>
<o:Column Ref="o66"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o73"/>
<o:Column Ref="o77"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6012,20 +6133,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o48"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o81"/>
<o:Key Ref="o85"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o142">
<o:ReferenceJoin Id="o152">
<a:ObjectID>522FBDCB-2928-4F6F-9530-844D9F1D9325</a:ObjectID>
<a:CreationDate>1550828764</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550828808</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o72"/>
<o:Column Ref="o76"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o83"/>
<o:Column Ref="o87"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6048,20 +6169,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o50"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o81"/>
<o:Key Ref="o85"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o143">
<o:ReferenceJoin Id="o153">
<a:ObjectID>8E6E733B-5BA2-40D9-A6C2-F369338361C9</a:ObjectID>
<a:CreationDate>1550831317</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1550831317</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o72"/>
<o:Column Ref="o76"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o97"/>
<o:Column Ref="o101"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6084,20 +6205,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o53"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o116"/>
<o:Key Ref="o120"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o144">
<o:ReferenceJoin Id="o154">
<a:ObjectID>3CCBB4B2-EAB9-4013-9E10-595B44048AD6</a:ObjectID>
<a:CreationDate>1551074152</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551074204</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o109"/>
<o:Column Ref="o113"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o118"/>
<o:Column Ref="o122"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6120,20 +6241,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o53"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o71"/>
<o:Key Ref="o75"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o145">
<o:ReferenceJoin Id="o155">
<a:ObjectID>81C29E42-E308-42EA-AA27-FA6567D96170</a:ObjectID>
<a:CreationDate>1551074153</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551074214</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o64"/>
<o:Column Ref="o66"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o119"/>
<o:Column Ref="o123"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6156,20 +6277,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o49"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o146">
<o:ReferenceJoin Id="o156">
<a:ObjectID>D67BB107-1B04-426A-98A6-5864A7F34A24</a:ObjectID>
<a:CreationDate>1551090095</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551090104</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o88"/>
<o:Column Ref="o92"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6192,20 +6313,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o54"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o86"/>
<o:Key Ref="o90"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o147">
<o:ReferenceJoin Id="o157">
<a:ObjectID>7FFA1932-1E25-42E1-B7A0-AFD577386BD0</a:ObjectID>
<a:CreationDate>1551091271</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551091282</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o82"/>
<o:Column Ref="o86"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o121"/>
<o:Column Ref="o125"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6228,20 +6349,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o45"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o81"/>
<o:Key Ref="o85"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o148">
<o:ReferenceJoin Id="o158">
<a:ObjectID>3FA09F6C-786E-4A6B-B968-1A107EFD19F7</a:ObjectID>
<a:CreationDate>1551150520</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551150546</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o72"/>
<o:Column Ref="o76"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o60"/>
<o:Column Ref="o62"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6264,20 +6385,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o55"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o149">
<o:ReferenceJoin Id="o159">
<a:ObjectID>E0FA243F-87C4-4A73-ACCE-CB34A40E45FA</a:ObjectID>
<a:CreationDate>1551150867</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551152034</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o128"/>
<o:Column Ref="o132"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6300,20 +6421,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o56"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o150">
<o:ReferenceJoin Id="o160">
<a:ObjectID>C67CA4B0-DB70-47CC-B852-042E43B68F1B</a:ObjectID>
<a:CreationDate>1551150868</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551152072</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o137"/>
<o:Column Ref="o141"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6336,20 +6457,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o57"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o151">
<o:ReferenceJoin Id="o161">
<a:ObjectID>18DE5428-0072-4BA5-9871-BE500805D695</a:ObjectID>
<a:CreationDate>1551150872</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551150872</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o139"/>
<o:Column Ref="o143"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6372,20 +6493,20 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o58"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o152">
<o:ReferenceJoin Id="o162">
<a:ObjectID>679663BE-3543-48EE-BD01-3B87FA0A06CE</a:ObjectID>
<a:CreationDate>1551150874</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551150874</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o140"/>
<o:Column Ref="o144"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
......@@ -6408,27 +6529,27 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Table Ref="o51"/>
</c:ChildTable>
<c:ParentKey>
<o:Key Ref="o63"/>
<o:Key Ref="o65"/>
</c:ParentKey>
<c:Joins>
<o:ReferenceJoin Id="o153">
<o:ReferenceJoin Id="o163">
<a:ObjectID>CB0E5792-4CB3-4EC5-BA48-4378F3D1F804</a:ObjectID>
<a:CreationDate>1551150989</a:CreationDate>
<a:Creator>ry</a:Creator>
<a:ModificationDate>1551150989</a:ModificationDate>
<a:Modifier>ry</a:Modifier>
<c:Object1>
<o:Column Ref="o59"/>
<o:Column Ref="o61"/>
</c:Object1>
<c:Object2>
<o:Column Ref="o102"/>
<o:Column Ref="o106"/>
</c:Object2>
</o:ReferenceJoin>
</c:Joins>
</o:Reference>
</c:References>
<c:DefaultGroups>
<o:Group Id="o154">
<o:Group Id="o164">
<a:ObjectID>822E8E80-3332-40DE-B9F6-7576C50A0A64</a:ObjectID>
<a:Name>PUBLIC</a:Name>
<a:Code>PUBLIC</a:Code>
......@@ -6439,7 +6560,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Group>
</c:DefaultGroups>
<c:TargetModels>
<o:TargetModel Id="o155">
<o:TargetModel Id="o165">
<a:ObjectID>9E4573A5-7E2D-4C69-AFAC-BF23E7FF9609</a:ObjectID>
<a:Name>MySQL 5.0</a:Name>
<a:Code>MYSQL50</a:Code>
......
using Microsoft.AspNetCore.Mvc;
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
......@@ -13,7 +14,7 @@
namespace Performance.Api.Controllers
{
[Route("api/[controller]/[action]")]
[Route("api/[controller]")]
public class AccountController : Controller
{
UserService _userService;
......@@ -28,23 +29,74 @@ public class AccountController : Controller
_options = options.Value;
}
/// <summary>
/// 登录
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[NoVerify]
[HttpPost]
public ApiResponse<LoginInfo> Login([FromBody]LoginRequest request)
[Route("login")]
public ApiResponse<UserIdentity> Login([FromBody]LoginRequest request)
{
var response = _userService.Login(request);
if (response.State == ResponseType.OK)
var user = _userService.Login(request);
if (string.IsNullOrEmpty(user.Token))
user.Token = Guid.NewGuid().ToString("N");
var option = new MemoryCacheEntryOptions()
{
if (string.IsNullOrEmpty(response.Data.Token))
response.Data.Token = Guid.NewGuid().ToString("N");
var option = new MemoryCacheEntryOptions()
{
SlidingExpiration = TimeSpan.FromMinutes(_options.ExpirationMinutes)
};
_memoryCache.Set(response.Data.Token, response.Data, option);
}
return response;
SlidingExpiration = TimeSpan.FromMinutes(_options.ExpirationMinutes)
};
_memoryCache.Set(user.Token, user, option);
return new ApiResponse<UserIdentity>(ResponseType.OK, user);
}
/// <summary>
/// 新增用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("insert")]
[HttpPost]
public ApiResponse Insert(
[CustomizeValidator(RuleSet = "Insert")]
[FromBody]UserRequest request)
{
if (!_userService.Insert(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 修改用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("update")]
[HttpPost]
public ApiResponse Update(
[CustomizeValidator(RuleSet = "Update")]
[FromBody]UserRequest request)
{
if (!_userService.Update(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 设置用户管辖医院
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("sethospital")]
[HttpPost]
public ApiResponse SetHospital([FromBody]SetHospitalRequest request)
{
if (!_userService.SetHospital(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
}
}
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Performance.DtoModels;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class DefaultController : ControllerBase
{
ILogger<DefaultController> _logger;
PerExcelService _excelService;
UserService _userService;
public DefaultController(PerExcelService excelService,
UserService userService,
ILogger<DefaultController> logger)
{
_excelService = excelService;
_userService = userService;
_logger = logger;
}
[HttpGet]
public ActionResult<PerExcel> Get()
{
var sd = _userService.GetUser();
_logger.LogDebug("debug", "aaaaaa");
var excel = _excelService.Analyze(@"C:\Users\ry\Desktop\文件\测试.xlsx");
return excel;
}
}
}
\ No newline at end of file
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
public class HospitalController : Controller
{
HospitalService _hospitalService;
public HospitalController(HospitalService hospitalService)
{
_hospitalService = hospitalService;
}
[Route("hospitallist")]
[HttpPost]
public ApiResponse<List<HospitalResponse>> GetHospitalList([FromBody]ApiRequest request)
{
var hospitalList = _hospitalService.GetUserHopital(request.ActiveUId);
return new ApiResponse<List<HospitalResponse>>(ResponseType.OK, "ok", hospitalList);
}
[Route("insert")]
[HttpPost]
public ApiResponse Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]HospitalRequest request)
{
if (!_hospitalService.Insert(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
[Route("update")]
[HttpPost]
public ApiResponse Update([CustomizeValidator(RuleSet = "Update"), FromBody]HospitalRequest request)
{
if (!_hospitalService.Update(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
[Route("delete")]
[HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]HospitalRequest request)
{
if (!_hospitalService.Delete(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
}
}
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
using Performance.DtoModels.Request;
using Performance.Infrastructure;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
public class SmsController : Controller
{
private SmsService _smsService;
public SmsController(SmsService smsService)
{
this._smsService = smsService;
}
/// <summary>
/// 发送验证码
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("code")]
[HttpPost]
[NoVerify]
public ApiResponse Code([FromBody]SmsCodeRequest request)
{
if (_smsService.SendCode(request.Type, request.Mobile))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 验证码验证
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("check")]
[HttpPost]
[NoVerify]
public ApiResponse Check([CustomizeValidator(RuleSet = "SmsCheck")][FromBody]SmsCodeRequest request)
{
if (_smsService.Check(request.Mobile, request.Code))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
}
}
......@@ -14,6 +14,7 @@ public class ValuesController : ControllerBase
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
//var excel = _excelService.Analyze(@"C:\Users\ry\Desktop\文件\测试.xlsx");
return new string[] { "value1", "value2" };
}
......
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
......@@ -18,35 +19,39 @@ namespace Performance.Api
{
public class ActionsFilter : IAsyncActionFilter
{
private readonly ILogger<ActionsFilter> logger;
private readonly IMemoryCache cache;
private readonly ILogger<ActionsFilter> _logger;
private readonly IMemoryCache _cache;
private readonly IHostingEnvironment _env;
public ActionsFilter(ILoggerFactory factory, IMemoryCache cache)
public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnvironment env)
{
this.logger = factory.CreateLogger<ActionsFilter>();
this.cache = cache;
this._logger = factory.CreateLogger<ActionsFilter>();
this._cache = cache;
this._env = env;
}
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
logger.BeginScope("s+++++++++++++++++++++++++++++++++");
var request = context.HttpContext.Request;
//启用body倒带功能
request.EnableRewind();
//记录Request请求
var kv = GetRequestContent(request);
logger.LogInformation($"请求内容 {request.Method}:{JsonHelper.Serialize(kv)}");
_logger.LogInformation($"请求内容 {request.Method}:{JsonHelper.Serialize(kv)}");
//token验证
var arry = ((ControllerActionDescriptor)context.ActionDescriptor).MethodInfo.GetCustomAttributes(typeof(NoVerifyAttribute), true);
if (arry.Length == 0)
if (!_env.IsDevelopment())
{
var token = kv.GetValue("token", "");
var user = cache.Get<LoginInfo>(token);
if (string.IsNullOrEmpty(token) || user == null || user.Token.Equals(token))
var arry = ((ControllerActionDescriptor)context.ActionDescriptor).MethodInfo.GetCustomAttributes(typeof(NoVerifyAttribute), true);
if (arry.Length == 0)
{
var response = new ApiResponse(ResponseType.TokenError, "Token无效");
context.Result = new ObjectResult(response);
return;
var token = kv.GetValue("token", "");
var user = _cache.Get<UserIdentity>(token);
if (string.IsNullOrEmpty(token) || user == null || !user.Token.Equals(token))
{
var response = new ApiResponse(ResponseType.TokenError, "Token无效");
context.Result = new ObjectResult(response);
return;
}
}
}
......@@ -56,19 +61,21 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache)
var messageList = context.ModelState.Values
.Where(t => !string.IsNullOrEmpty(t?.Errors?.FirstOrDefault()?.ErrorMessage))
.Select(t => t?.Errors?.FirstOrDefault()?.ErrorMessage);
string errorMessage = string.Join(",", messageList);
var response = new ApiResponse(ResponseType.ParameterError, "参数错误", errorMessage);
var response = new ApiResponse(ResponseType.ParameterError, "参数错误", messageList);
context.Result = new ObjectResult(response);
var jsonData = JsonHelper.Serialize(context.Result);
logger.LogInformation($"响应结果:{jsonData}");
_logger.LogInformation($"响应结果:{jsonData}");
}
//记录response结果
else
{
var executedContext = await next();
if (executedContext.Exception != null)
throw executedContext.Exception;
var objectResult = (ObjectResult)executedContext.Result;
var jsonData = JsonHelper.Serialize(objectResult.Value);
logger.LogInformation($"响应结果:{jsonData}");
_logger.LogInformation($"响应结果:{jsonData}");
}
}
......
......@@ -21,8 +21,15 @@ public Task OnExceptionAsync(ExceptionContext context)
{
var logger = loggerFactory.CreateLogger<ExceptionsFilter>();
logger.LogError($"接口异常:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.Error, "接口异常", context.Exception.Message);
context.Result = new ObjectResult(response);
if (context.Exception is PerformanceException)
{
context.Result = new ObjectResult(new ApiResponse(ResponseType.Fail, context.Exception.Message));
}
else
{
var response = new ApiResponse(ResponseType.Error, "接口内部异常", context.Exception.Message);
context.Result = new ObjectResult(response);
}
return Task.CompletedTask;
}
}
......
......@@ -46,12 +46,14 @@ public void ConfigureServices(IServiceCollection services)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
services
//筛选器配置
.AddMvc(option =>
{
option.Filters.Add<ActionsFilter>();
option.Filters.Add<ExceptionsFilter>();
})
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
//json格式配置
.AddJsonOptions(json =>
{
json.SerializerSettings.Converters.Add(new IsoDateTimeConverterContent() { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" });
......@@ -63,6 +65,7 @@ public void ConfigureServices(IServiceCollection services)
json.SerializerSettings.Culture = new CultureInfo("it-IT");
json.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
})
//model验证
.AddFluentValidation(fv =>
{
//禁用其他以使FluentValidation是唯一执行的验证库
......@@ -76,16 +79,25 @@ public void ConfigureServices(IServiceCollection services)
}
});
//automapper 配置
Mapper.Initialize(cfg => cfg.AddProfile<AutoMapperConfigs>());
services.AddAutoMapper();
//service注入 repoitory注入
services
.AddPerformanceService()
.AddPerformanceRepoitory()
.AddPerformanceRepoitory();
//appsetting注入
services
.Configure<AppConnection>(Configuration.GetSection("AppConnection"))
.Configure<Application>(Configuration.GetSection("Application"));
.Configure<Application>(Configuration.GetSection("Application"))
.Configure<HuyiSmsConfig>(Configuration.GetSection("HuyiSmsConfig"));
//huyi短信发送注入
services.AddScoped<HuyiSmsNotify>();
//ef配置
var connection = services.BuildServiceProvider().GetService<IOptions<AppConnection>>();
services.AddDbContext<PerformanceDbContext>(options =>
{
......
using Microsoft.Extensions.Caching.Memory;
using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Util
{
public class UserUtil
{
IMemoryCache _memoryCache;
public UserUtil(IMemoryCache memoryCache)
{
_memoryCache = memoryCache;
}
public UserIdentity At(ApiRequest request)
{
return At(request.Token);
}
public UserIdentity At(string token)
{
if (string.IsNullOrEmpty(token))
throw new PerformanceException("token is not null");
return _memoryCache.Get<UserIdentity>(token);
}
}
}
{
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"AppConnection": {
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
},
"Application": {
//登录过期时间
"ExpirationMinutes": "5",
//验证码过期
"SmsCodeMinutes": "5"
}
}
{
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
//连接字符串
"AppConnection": {
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
"PerformanceConnectionString": "server=116.62.245.55;database=db_performance;uid=suvalue;pwd=suvalue2017;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;"
},
//互亿
"HuyiSmsConfig": {
"Url": "http://106.ihuyi.cn/webservice/sms.php?method=Submit",
"Account": "cf_szjk",
"Password": "123456"
},
"Application": {
//¼ʱ
"ExpirationMinutes": "1"
//登录过期时间
"ExpirationMinutes": "120",
//验证码过期
"SmsCodeMinutes": "30",
//短信模板
"SmsTemplate": "溯直健康提醒您,您的验证码为:[code],当天有效!"
}
}
......@@ -14,4 +14,8 @@
<ProjectReference Include="..\Performance.Services\Performance.Services.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
</Project>
......@@ -9,5 +9,9 @@ namespace Performance.DtoModels
public class ApiRequest
{
public string Token { get; set; }
public string Version { get; set; }
public string Device { get; set; }
public string AppName { get; set; }
public int ActiveUId { get; set; }
}
}
......@@ -22,7 +22,7 @@ public ApiResponse()
{
}
public ApiResponse(ResponseType type)
: this(type, "", null)
: this(type, type.ToString(), null)
{
}
......@@ -31,6 +31,11 @@ public ApiResponse(ResponseType type, string message)
{
}
public ApiResponse(ResponseType type, TEntity entity)
: this(type, type.ToString(), entity)
{
}
public ApiResponse(ResponseType type, string message, TEntity entity)
{
State = type;
......@@ -39,7 +44,7 @@ public ApiResponse(ResponseType type, string message, TEntity entity)
}
}
public class ApiResponse : ApiResponse<Object>
public sealed class ApiResponse : ApiResponse<Object>
{
public ApiResponse()
{
......@@ -53,6 +58,10 @@ public ApiResponse(ResponseType type, string message) : base(type, message)
{
}
public ApiResponse(ResponseType type, object entity) : base(type, entity)
{
}
public ApiResponse(ResponseType type, string message, object entity) : base(type, message, entity)
{
}
......
......@@ -6,6 +6,17 @@ namespace Performance.DtoModels.AppSettings
{
public class Application
{
/// <summary>
/// 登录过期时间
/// </summary>
public int ExpirationMinutes { get; set; }
/// <summary>
/// 验证码过期
/// </summary>
public int SmsCodeMinutes { get; set; }
/// <summary>
/// 短信模板
/// </summary>
public string SmsTemplate { get; set; }
}
}
......@@ -10,10 +10,25 @@ public class AutoMapperConfigs : Profile
{
public AutoMapperConfigs()
{
CreateMap<LoginInfo, Sys_User>()
//用户登录信息
CreateMap<UserIdentity, sys_user>()
.ForMember(dest => dest.ID, opt => opt.MapFrom(src => src.UserID));
CreateMap<Sys_User, LoginInfo>()
CreateMap<sys_user, UserIdentity>()
.ForMember(dest => dest.UserID, opt => opt.MapFrom(src => src.ID));
//用户新增/修改 请求
CreateMap<UserRequest, sys_user>();
CreateMap<sys_user, UserRequest>();
// 用户医院列表 响应
CreateMap<HospitalResponse, sys_hospital>()
.ForMember(dest => dest.ID, opt => opt.MapFrom(src => src.HosID));
CreateMap<sys_hospital, HospitalResponse>()
.ForMember(dest => dest.HosID, opt => opt.MapFrom(src => src.ID));
// 医院新增/修改 请求
CreateMap<HospitalRequest, sys_hospital>();
CreateMap<sys_hospital, HospitalRequest>();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Performance.DtoModels
{
public class CustomValidator
{
/// <summary>
/// 判断输入的字符串是否是一个合法的手机号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static bool IsMobile(string input)
{
if (string.IsNullOrEmpty(input))
{
return false;
}
Regex regex = new Regex("^1[34578]\\d{9}$");
return regex.IsMatch(input);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace Performance.DtoModels
{
/// <summary> 验证码类型 </summary>
public enum SmsCodeType
{
[Description("登录")]
Login = 1,
[Description("其他")]
Other = 2,
}
/// <summary> 用户状态 </summary>
public enum States
{
[Description("登录")]
Enabled = 1,
[Description("其他")]
Disabled = 2,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
namespace Performance.DtoModels
{
public class PerformanceException : Exception
{
public PerformanceException()
{
}
public PerformanceException(string message) : base(message)
{
}
public PerformanceException(string message, Exception innerException) : base(message, innerException)
{
}
protected PerformanceException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
/// <summary>
/// 登录请求
/// </summary>
public class HospitalRequest : ApiRequest
{
public int ID { get; set; }
/// <summary>
/// 医院名称
/// </summary>
public string HosName { get; set; }
/// <summary>
/// 简称
/// </summary>
public string ShortName { get; set; }
/// <summary>
///
/// </summary>
public string AreaCode { get; set; }
/// <summary>
///
/// </summary>
public string HosLevel { get; set; }
/// <summary>
///
/// </summary>
public string HosType { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> States { get; set; }
}
public class HospitalRequestValidator : AbstractValidator<HospitalRequest>
{
public HospitalRequestValidator()
{
Action action = () =>
{
RuleFor(x => x.HosName).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.AreaCode).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.HosLevel).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.HosType).NotNull().NotEmpty().Length(1, 50);
};
RuleSet("Insert", () =>
{
action();
});
RuleSet("Update", () =>
{
action();
RuleFor(x => x.ID).NotNull().GreaterThan(0);
RuleFor(x => x.States).NotNull().InclusiveBetween(1, 2);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
......@@ -22,19 +22,11 @@ public class LoginRequestValidator : AbstractValidator<LoginRequest>
{
public LoginRequestValidator()
{
RuleFor(x => x.LoginType)
.InclusiveBetween(1, 2)
.WithMessage("LoginType超出范围");
RuleFor(x => x.LoginType).InclusiveBetween(1, 2);
RuleFor(x => x.Account)
.NotNull()
.Length(1, 200)
.WithMessage("Account参数错误");
RuleFor(x => x.Account).NotEmpty().NotNull().Length(1, 200);
RuleFor(x => x.Password)
.NotNull()
.Length(1, 200)
.WithMessage("Password参数错误");
RuleFor(x => x.Password).NotEmpty().NotNull().Length(1, 200);
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
/// <summary>
/// 登录请求
/// </summary>
public class SetHospitalRequest : ApiRequest
{
public int UserID { get; set; }
public int[] HosIDArray { get; set; }
}
public class SetHospitalRequestValidator : AbstractValidator<SetHospitalRequest>
{
public SetHospitalRequestValidator()
{
RuleFor(x => x.UserID).GreaterThan(0);
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Performance.DtoModels.Request
{
public class SmsCodeRequest : ApiRequest
{
/// <summary>
/// 短信验证类型 1 手机号登录 2 其他
/// </summary>
public int Type { get; set; }
public string Mobile { get; set; }
public string Code { get; set; }
}
public class SmsCodeRequestValidator : AbstractValidator<SmsCodeRequest>
{
public SmsCodeRequestValidator()
{
RuleFor(x => x.Type).InclusiveBetween(1, 2);
RuleFor(x => x.Mobile).Length(11).Must((pre) => { return CustomValidator.IsMobile(pre); });
RuleSet("SmsCheck", () =>
{
RuleFor(x => x.Code).Length(4, 6);
});
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Performance.DtoModels
{
public class UserRequest : ApiRequest
{
public int ID { get; set; }
/// <summary>
/// 真实名称
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 登录名称
/// </summary>
public string Login { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Mail { get; set; }
/// <summary>
/// 用户状态 1启用 2禁用
/// </summary>
public Nullable<int> States { get; set; }
}
public class UserRequestValidator : AbstractValidator<UserRequest>
{
public UserRequestValidator()
{
Action action = () =>
{
RuleFor(x => x.RealName).NotNull().NotEmpty();
RuleFor(x => x.Login).NotNull().NotEmpty();
RuleFor(x => x.Mobile).NotNull().NotEmpty().Must((pre) => { return CustomValidator.IsMobile(pre); });
RuleFor(x => x.Mail).EmailAddress().When(pre => { return !string.IsNullOrEmpty(pre.Mail); });
};
RuleSet("Insert", () =>
{
action();
RuleFor(x => x.Password).NotNull().NotEmpty().Length(4, 20);
});
RuleSet("Update", () =>
{
action();
RuleFor(x => x.ID).NotNull().NotEmpty().GreaterThan(0);
RuleFor(x => x.States).NotNull().NotEmpty().InclusiveBetween(1, 2);
});
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class HospitalResponse
{
public int HosID { get; set; }
public string HosName { get; set; }
public string ShortName { get; set; }
public string AreaCode { get; set; }
public string HosLevel { get; set; }
public string HosType { get; set; }
public string States { get; set; }
}
}
......@@ -4,7 +4,7 @@
namespace Performance.DtoModels
{
public class LoginInfo
public class UserIdentity
{
public string Token { get; set; }
public int UserID { get; set; }
......
......@@ -11,7 +11,9 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
{
}
public virtual DbSet<Sys_User> Sys_User { get; set; }
public virtual DbSet<sys_user> Sys_User { get; set; }
public virtual DbSet<sys_hospital> Sys_Hospital { get; set; }
public virtual DbSet<sys_sms> Sys_Sms { get; set; }
public virtual DbSet<sys_user_hospital> Sys_User_Hospital { get; set; }
}
}
using System;
using System.Collections.Generic;
//-----------------------------------------------------------------------
// <copyright file=" sys_user.cs">
// * FileName: sys_user.cs
// * history : 2019-03-05 14:05:41
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
namespace Performance.EntityModels
{
public partial class Sys_User
/// <summary>
/// sys_user Entity Model
/// </summary>
public class sys_user
{
public int ID { get; set; }
public DateTime? CreatDate { get; set; }
public int? CreateUser { get; set; }
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public Nullable<DateTime> CreateDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
public Nullable<int> CreateUser { get; set; }
/// <summary>
/// 真实名称
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 登录名称
/// </summary>
public string Login { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Mail { get; set; }
public int? States { get; set; }
/// <summary>
/// 用户状态 1启用 2禁用
/// </summary>
public Nullable<int> States { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_drug_tree.cs">
// * FileName: dis_drug_tree.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_drug_tree Entity Model
/// </summary>
public partial class dis_drug_tree
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 疾病
/// </summary>
public Nullable<int> disease { get; set; }
/// <summary>
/// 当前名称
/// </summary>
public string currentName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 父级名称
/// </summary>
public string parentName { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_drug_type.cs">
// * FileName: dis_drug_type.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_drug_type Entity Model
/// </summary>
public partial class dis_drug_type
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 疾病
/// </summary>
public Nullable<int> disease { get; set; }
/// <summary>
/// 药物分类(中、西、草)
/// </summary>
public string drugType { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 金额
/// </summary>
public Nullable<int> fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_drug_useinfo_fee.cs">
// * FileName: dis_drug_useinfo_fee.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_drug_useinfo_fee Entity Model
/// </summary>
public partial class dis_drug_useinfo_fee
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 药品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 费用
/// </summary>
public Nullable<int> fee { get; set; }
/// <summary>
/// 病种
/// </summary>
public Nullable<int> disease { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_drugatc.cs">
// * FileName: dis_drugatc.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_drugatc Entity Model
/// </summary>
public partial class dis_drugatc
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalId { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 药物化学物质
/// </summary>
public string mechanism { get; set; }
/// <summary>
/// 病种
/// </summary>
public Nullable<int> disease { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_ip_fee.cs">
// * FileName: dis_ip_fee.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_ip_fee Entity Model
/// </summary>
public partial class dis_ip_fee
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 手术量
/// </summary>
public Nullable<int> operationNum { get; set; }
/// <summary>
/// 总费用
/// </summary>
public Nullable<int> allFee { get; set; }
/// <summary>
/// 病床使用天数
/// </summary>
public Nullable<int> hosBad { get; set; }
/// <summary>
/// 病种
/// </summary>
public Nullable<int> disease { get; set; }
/// <summary>
/// 药费
/// </summary>
public Nullable<int> fee { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 人数
/// </summary>
public Nullable<int> personNum { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dis_use_drugs.cs">
// * FileName: dis_use_drugs.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// dis_use_drugs Entity Model
/// </summary>
public partial class dis_use_drugs
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 疾病
/// </summary>
public Nullable<int> disease { get; set; }
/// <summary>
/// 通名用
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_department_useinfo.cs">
// * FileName: drug_department_useinfo.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_department_useinfo Entity Model
/// </summary>
public partial class drug_department_useinfo
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 科室
/// </summary>
public string department { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_dosage.cs">
// * FileName: drug_dosage.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_dosage Entity Model
/// </summary>
public partial class drug_dosage
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 剂型
/// </summary>
public string dosage { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_first_use.cs">
// * FileName: drug_first_use.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_first_use Entity Model
/// </summary>
public partial class drug_first_use
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugname { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_hosinfo.cs">
// * FileName: drug_hosinfo.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_hosinfo Entity Model
/// </summary>
public partial class drug_hosinfo
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_p_info.cs">
// * FileName: drug_p_info.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_p_info Entity Model
/// </summary>
public partial class drug_p_info
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 费用
/// </summary>
public Nullable<int> fee { get; set; }
/// <summary>
/// 病种
/// </summary>
public string disease { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> dis_person_times { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> dis_fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_p_mi.cs">
// * FileName: drug_p_mi.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_p_mi Entity Model
/// </summary>
public partial class drug_p_mi
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 医保类型
/// </summary>
public string medicalInsurance { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_p_userinfo.cs">
// * FileName: drug_p_userinfo.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_p_userinfo Entity Model
/// </summary>
public partial class drug_p_userinfo
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 性别
/// </summary>
public string sex { get; set; }
/// <summary>
/// 年龄
/// </summary>
public Nullable<int> age { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" drug_som.cs">
// * FileName: drug_som.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// drug_som Entity Model
/// </summary>
public partial class drug_som
{
/// <summary>
///
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 商品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 通用名
/// </summary>
public string commonName { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 费用
/// </summary>
public Nullable<int> fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_department_coc.cs">
// * FileName: hos_department_coc.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_department_coc Entity Model
/// </summary>
public partial class hos_department_coc
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 科室
/// </summary>
public string department { get; set; }
/// <summary>
/// 耗材金额
/// </summary>
public Nullable<int> fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_department_fee.cs">
// * FileName: hos_department_fee.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_department_fee Entity Model
/// </summary>
public partial class hos_department_fee
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 科室
/// </summary>
public string department { get; set; }
/// <summary>
/// 药品金额
/// </summary>
public Nullable<int> fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_disease_person.cs">
// * FileName: hos_disease_person.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_disease_person Entity Model
/// </summary>
public partial class hos_disease_person
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 病种
/// </summary>
public string disease { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> persontimes { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_drug_fee.cs">
// * FileName: hos_drug_fee.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_drug_fee Entity Model
/// </summary>
public partial class hos_drug_fee
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 药品名
/// </summary>
public string drugName { get; set; }
/// <summary>
/// 药品费用
/// </summary>
public Nullable<int> fee { get; set; }
/// <summary>
///
/// </summary>
public string commonName { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
///
/// </summary>
public string drugtype { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_drug_type.cs">
// * FileName: hos_drug_type.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_drug_type Entity Model
/// </summary>
public partial class hos_drug_type
{
/// <summary>
/// 主键
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 药品名
/// </summary>
public string drugType { get; set; }
/// <summary>
/// 人次
/// </summary>
public Nullable<int> personTimes { get; set; }
/// <summary>
/// 金额
/// </summary>
public Nullable<int> fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" hos_drugatc.cs">
// * FileName: hos_drugatc.cs
// * history : Created by T4 2019-03-04 14:25:12
// </copyright>
//-----------------------------------------------------------------------
using System;
namespace Performance.EntityModels
{
/// <summary>
/// hos_drugatc Entity Model
/// </summary>
public partial class hos_drugatc
{
/// <summary>
/// ID
/// E:\code_git\performance\performance\Performance.EntityModels\Entity
/// </summary>
public int ID { get; set; }
/// <summary>
/// 省份
/// </summary>
public string province { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> hospitalid { get; set; }
/// <summary>
/// 年
/// </summary>
public int year { get; set; }
/// <summary>
/// 月
/// </summary>
public int month { get; set; }
/// <summary>
/// 数据源(门诊/住院)
/// </summary>
public string source { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string hosLevel { get; set; }
/// <summary>
/// 医院性质
/// </summary>
public string hosType { get; set; }
/// <summary>
/// 药物化学物质
/// </summary>
public string mechanism { get; set; }
/// <summary>
/// 金额
/// </summary>
public decimal fee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" sys_hospital.cs">
// * FileName: sys_hospital.cs
// * history : 2019-03-05 14:05:41
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// sys_hospital Entity Model
/// </summary>
public class sys_hospital
{
/// <summary>
/// ID
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> CreateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> CreateUser { get; set; }
/// <summary>
/// 医院名称
/// </summary>
public string HosName { get; set; }
/// <summary>
/// 简称
/// </summary>
public string ShortName { get; set; }
/// <summary>
/// 医院区域编码
/// </summary>
public string AreaCode { get; set; }
/// <summary>
/// 医院等级
/// </summary>
public string HosLevel { get; set; }
/// <summary>
/// 医院类型
/// </summary>
public string HosType { get; set; }
/// <summary>
/// 医院状态 1 启用 2 禁用
/// </summary>
public Nullable<int> States { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" sys_sms.cs">
// * FileName: sys_sms.cs
// * history : 2019-03-05 11:49:50
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// sys_sms Entity Model
/// </summary>
public class sys_sms
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> CreateUser { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> CreateDate { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 验证码
/// </summary>
public string SmsCode { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public DateTime Expiration { get; set; }
/// <summary>
/// 验证码类型 1 登录 2 其他
/// </summary>
public int CodeType { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" sys_user_hospital.cs">
// * FileName: sys_user_hospital.cs
// * history : 2019-03-05 11:49:50
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// sys_user_hospital Entity Model
/// </summary>
public class sys_user_hospital
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UserID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HosID { get; set; }
}
}
......@@ -11,6 +11,29 @@
</ItemGroup>
<ItemGroup>
<Compile Remove="Entity\dis_drugatc.Generated.cs" />
<Compile Remove="Entity\dis_drug_tree.Generated.cs" />
<Compile Remove="Entity\dis_drug_type.Generated.cs" />
<Compile Remove="Entity\dis_drug_useinfo_fee.Generated.cs" />
<Compile Remove="Entity\dis_ip_fee.Generated.cs" />
<Compile Remove="Entity\dis_use_drugs.Generated.cs" />
<Compile Remove="Entity\drug_department_useinfo.Generated.cs" />
<Compile Remove="Entity\drug_dosage.Generated.cs" />
<Compile Remove="Entity\drug_first_use.Generated.cs" />
<Compile Remove="Entity\drug_hosinfo.Generated.cs" />
<Compile Remove="Entity\drug_p_info.Generated.cs" />
<Compile Remove="Entity\drug_p_mi.Generated.cs" />
<Compile Remove="Entity\drug_p_userinfo.Generated.cs" />
<Compile Remove="Entity\drug_som.Generated.cs" />
<Compile Remove="Entity\hos_department_coc.Generated.cs" />
<Compile Remove="Entity\hos_department_fee.Generated.cs" />
<Compile Remove="Entity\hos_disease_person.Generated.cs" />
<Compile Remove="Entity\hos_drugatc.Generated.cs" />
<Compile Remove="Entity\hos_drug_fee.Generated.cs" />
<Compile Remove="Entity\hos_drug_type.Generated.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
</ItemGroup>
......
using System;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace Performance.Infrastructure
{
public class HttpHelper
{
#region 发送post请求
/// <summary>
/// 发送post请求
/// </summary>
/// <param name="Url"></param>
/// <param name="postDataStr"></param>
/// <returns></returns>
public static string HttpPost(string Url, string postDataStr, string encoding = "utf-8", bool IsJson = false)
{
HttpWebResponse response = null;
HttpWebRequest request = null;
string retString = "";
if (Url.ToLower().StartsWith("https"))
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);//验证服务器证书回调自动验证
try
{
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
System.GC.Collect();
request = (HttpWebRequest)WebRequest.Create(Url);
request.Method = "POST";
request.KeepAlive = false;
request.ProtocolVersion = HttpVersion.Version10;
if (IsJson)
request.ContentType = "application/json";
else
request.ContentType = "application/x-www-form-urlencoded";
byte[] bData = (Encoding.UTF8.GetBytes(postDataStr));
request.ContentLength = bData.Length;
Stream writeStream = request.GetRequestStream();
writeStream.Write(bData, 0, bData.Length);
writeStream.Close();
using (response = (HttpWebResponse)request.GetResponse())
{
Stream myResponseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding(encoding));
retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
return retString;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (request != null)
request.Abort();
if (response != null)
response.Close();
}
}
#endregion 发送post请求
public static string HttpPost(string Url, string postDataStr, bool IsJson)
{
return HttpPost(Url, postDataStr, "utf-8", IsJson);
}
#region 发送get请求
/// <summary>
/// 发送get请求
/// </summary>
/// <param name="Url"></param>
/// <param name="postDataStr"></param>
/// <returns></returns>
public static string HttpGet(string Url, string postDataStr, string encoding = "utf-8")
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url + (postDataStr == "" ? "" : "?") + postDataStr);
request.Method = "GET";
request.ContentType = "text/html;charset=UTF-8";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream myResponseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding(encoding));
string retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
return retString;
}
#endregion 发送get请求
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{ // 总是接受
return true;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.Infrastructure
{
public class RandomHelper
{
/// <summary>
/// 四位验证码
/// </summary>
/// <returns></returns>
public static string GetSmsCode()
{
Random rad = new Random(Guid.NewGuid().GetHashCode());
var code = rad.Next(1000, 10000);
return code.ToString().PadLeft(4, '0');
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Performance.Infrastructure
{
public class VerificationHelper
{
/// <summary>
/// 判断输入的字符串是否是一个合法的手机号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static bool IsMobilePhone(string input)
{
if (string.IsNullOrEmpty(input))
{
return false;
}
Regex regex = new Regex("^1[34578]\\d{9}$");
return regex.IsMatch(input);
}
}
}
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Xml.Serialization;
namespace Performance.Infrastructure
{
/// <summary>
/// XML序列化、反序列化工具类
/// </summary>
public class XMLSerializer
{
public XMLSerializer() : this("utf-8") { }
public XMLSerializer(string encodName)
{
EncodName = encodName;
}
public string EncodName { get; set; }
/// <summary>
/// 序列化器缓存
/// </summary>
private static Hashtable serializers = Hashtable.Synchronized(new Hashtable());
/// <summary>
/// 一个空的命名空间
/// </summary>
private static XmlSerializerNamespaces xmlNs = GetXmlNameSpace();
/// <summary>
/// 从字符串中反序列化一个T类型对象
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="source">T类型的格式化字符串</param>
/// <returns>T类型对象</returns>
public T Deserialize<T>(string source)
where T : class
{
MemoryStream stream = new MemoryStream(Encoding.GetEncoding(EncodName).GetBytes(source));
return Deserialize<T>(stream);
}
/// <summary>
/// 从当前流中反序列化一个T类型对象
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="source">T类型的流</param>
/// <returns>T类型对象</returns>
public T Deserialize<T>(System.IO.Stream source)
where T : class
{
XmlSerializer serializer = GetXmlSerializer(typeof(T));
T objRet = (T)serializer.Deserialize(source);
return objRet;
}
/// <summary>
/// 从当前字节串中反序列化一个T类型对象
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="source">T类型的字节串</param>
/// <returns>T类型对象</returns>
public T Deserialize<T>(byte[] source)
where T : class
{
if (source == null || source.Length == 0)
return default(T);
using (MemoryStream ms = new MemoryStream())
{
ms.Write(source, 0, source.Length);
ms.Position = 0;
return Deserialize<T>(ms);
}
}
/// <summary>
/// 从文件中反序列化一个T类型对象
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="fileName">T类型的格式化文件</param>
/// <returns>T类型对象</returns>
public T DeserializeFromFile<T>(string fileName)
where T : class
{
using (TextReader tr = new StreamReader(fileName, Encoding.UTF8))
{
XmlSerializer serializer = GetXmlSerializer(typeof(T));
T objRet = (T)serializer.Deserialize(tr);
return objRet;
}
}
/// <summary>
/// 将T类序列化为一个字符串
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="t">T类型对象</param>
/// <returns>T类型的格式化字符串</returns>
public string Serialize<T>(T t)
where T : class
{
string retSerialXml = "";
MemoryStream stream = new MemoryStream();
XmlSerializer serializer = GetXmlSerializer(typeof(T));
serializer.Serialize(stream, t, xmlNs);
retSerialXml = Encoding.GetEncoding(EncodName).GetString(stream.GetBuffer());
return retSerialXml.Trim('\0');
}
/// <summary>
/// 将T类序列化到一个流中
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="t">T类型对象</param>
/// <param name="destination">流</param>
public void Serialize<T>(T t, System.IO.Stream destination)
where T : class
{
XmlSerializer serializer = GetXmlSerializer(typeof(T));
serializer.Serialize(destination, t, xmlNs);
}
/// <summary>
/// 将T类序列化到一个字节序列中
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="t">T类型对象</param>
/// <param name="buf">字节序列</param>
public void Serialize<T>(T t, ref byte[] buf)
where T : class
{
MemoryStream stream = new MemoryStream();
XmlSerializer serializer = GetXmlSerializer(typeof(T));
serializer.Serialize(stream, t, xmlNs);
buf = stream.GetBuffer();
}
/// <summary>
/// 将T类序列化到一个文件中
/// </summary>
/// <typeparam name="T">序列化、反序列化对象的类型</typeparam>
/// <param name="t">T类型对象</param>
/// <param name="fileName">输出的文件名</param>
public void Serialize<T>(T t, string fileName)
where T : class
{
using (TextWriter writer = new StreamWriter(fileName))
{
XmlSerializer serializer = GetXmlSerializer(typeof(T));
serializer.Serialize(writer, t, xmlNs);
}
}
/// <summary>
/// 从缓存中获取一个XML序列化对象,如果没有,则创建,并添加到缓存中
/// </summary>
/// <returns>XML序列化对象</returns>
private XmlSerializer GetXmlSerializer(Type objType)
{
if (objType == null)
return null;
if (serializers.ContainsKey(objType.FullName))
return (XmlSerializer)serializers[objType.FullName];
else
{
if (serializers.Count >= 100)
serializers.Clear();
XmlSerializer serializer = new XmlSerializer(objType);
serializers.Add(objType.FullName, serializer);
return serializer;
}
}
/// <summary>
/// 获取一个空的命名空间
/// </summary>
/// <returns>空命名空间</returns>
private static XmlSerializerNamespaces GetXmlNameSpace()
{
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
return ns;
}
}
}
\ No newline at end of file
......@@ -5,6 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
</ItemGroup>
......
 using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
namespace Performance.Infrastructure
{
public class HuyiSmsConfig
{
public string Url { get; set; }
public string Account { get; set; }
public string Password { get; set; }
}
public class HuyiSmsNotify
{
private HuyiSmsConfig _config;
private readonly ILogger<HuyiSmsNotify> _logger;
public HuyiSmsNotify(IOptions<HuyiSmsConfig> config, ILoggerFactory factory)
{
this._logger = factory.CreateLogger<HuyiSmsNotify>();
_config = config.Value;
}
public HuyiResponse SendSms(string mobile, string content)
{
var cfg = _config;
string postBody = $"account={cfg.Account}&password={cfg.Password}&mobile={mobile}&content={content}";
UTF8Encoding encoding = new UTF8Encoding();
byte[] postData = encoding.GetBytes(postBody);
var response = HttpHelper.HttpPost(cfg.Url, postBody, false);
_logger.LogInformation(response);
var serializer = new XMLSerializer();
return serializer.Deserialize<HuyiResponse>(response);
}
}
[XmlRoot(ElementName = "SubmitResult", Namespace = "http://106.ihuyi.cn/")]
public class HuyiResponse
{
[XmlElement("code")]
public string code { get; set; }
[XmlElement("msg")]
public string msg { get; set; }
[XmlElement("smsid")]
public string smsid { get; set; }
}
}
using Microsoft.EntityFrameworkCore;
using Dapper;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -18,6 +19,15 @@ public BaseRepository(DbContext context)
this.context = context;
}
public TEntity DapperQueryFirst(string sql, object param)
{
return context.Database.GetDbConnection().QueryFirst<TEntity>(sql, param);
}
public IEnumerable<TEntity> DapperQuery(string sql, object param)
{
return context.Database.GetDbConnection().Query<TEntity>(sql, param);
}
public bool Add(TEntity entity)
{
context.Set<TEntity>().Add(entity);
......@@ -41,18 +51,22 @@ public bool AddRange(params TEntity[] entities)
await context.Set<TEntity>().AddRangeAsync(entities);
return await context.SaveChangesAsync() > 0;
}
public async Task<bool> Delete(TEntity entity)
public bool Remove(TEntity entity)
{
context.Set<TEntity>().Remove(entity);
return await context.SaveChangesAsync() > 0;
return context.SaveChanges() > 0;
}
public bool RemoveRange(params TEntity[] entities)
{
context.Set<TEntity>().RemoveRange(entities);
return context.SaveChanges() > 0;
}
public async Task<bool> Update(TEntity entity)
public bool Update(TEntity entity)
{
context.Set<TEntity>().Update(entity);
return await context.SaveChangesAsync() > 0;
return context.SaveChanges() > 0;
}
public IEnumerable<TEntity> GetEntities()
......
//-----------------------------------------------------------------------
// <copyright file=" sys_hospital.cs">
// * FileName: sys_hospital.cs
// * history : Created by T4 2019-03-04 14:41:21
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Performance.Repository
{
/// <summary>
/// sys_hospital Repository
/// </summary>
public class PerforHospitalRepository : PerforRepository<sys_hospital>
{
public PerforHospitalRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" sys_sms.cs">
// * FileName: sys_sms.cs
// * history : Created by T4 2019-03-04 14:41:21
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
using System;
namespace Performance.Repository
{
/// <summary>
/// sys_sms Repository
/// </summary>
public class PerforSmsRepository : PerforRepository<sys_sms>
{
public PerforSmsRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" sys_user_hospital.cs">
// * FileName: sys_user_hospital.cs
// * history : Created by T4 2019-03-04 14:41:21
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Performance.Repository
{
/// <summary>
/// sys_user_hospital Repository
/// </summary>
public class PerforUserhospitalRepository : PerforRepository<sys_user_hospital>
{
public PerforUserhospitalRepository(PerformanceDbContext context) : base(context)
{
}
public List<sys_user_hospital> GetUserHospital(int userid)
{
string sql = "select * from sys_user_hospital where userid=@userid";
return DapperQuery(sql, new { userid }).ToList();
}
}
}
using Performance.EntityModels;
//-----------------------------------------------------------------------
// <copyright file=" sys_user.cs">
// * FileName: sys_user.cs
// * history : Created by T4 2019-03-04 14:41:21
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.Repository
{
public class PerforUserRepository : PerforRepository<Sys_User>
/// <summary>
/// sys_user Repository
/// </summary>
public class PerforUserRepository : PerforRepository<sys_user>
{
public PerforUserRepository(PerformanceDbContext context) : base(context)
{
......
......@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.60.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="MySql.Data" Version="8.0.15" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.15" />
......
using AutoMapper;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
{
public class HospitalService : IAutoInjection
{
private PerforHospitalRepository _hospitalRepository;
private PerforUserhospitalRepository _joinRepository;
public HospitalService(PerforHospitalRepository hospitalRepository,
PerforUserhospitalRepository joinRepository)
{
this._hospitalRepository = hospitalRepository;
this._joinRepository = joinRepository;
}
/// <summary>
/// 查询用户下属医院
/// </summary>
/// <param name="userid"></param>
/// <returns></returns>
public List<HospitalResponse> GetUserHopital(int userid)
{
if (userid <= 0)
throw new PerformanceException($"userid:{userid} 错误");
var joinList = _joinRepository.GetEntities(t => t.UserID == userid).ToList();
if (joinList == null && joinList.Count == 0)
throw new PerformanceException($"userid:{userid} 没有下属医院");
var hosList = _hospitalRepository.GetEntities(t => joinList.Select(j => j.HosID).Contains(t.ID)).ToList();
return Mapper.Map<List<sys_hospital>, List<HospitalResponse>>(hosList);
}
/// <summary>
/// 新增医院
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool Insert(HospitalRequest request)
{
if (null != _hospitalRepository.GetEntity(t => t.HosName == request.HosName))
throw new PerformanceException("医院名称重复");
var hospital = Mapper.Map<sys_hospital>(request);
hospital.CreateDate = DateTime.Now;
hospital.CreateUser = request.ActiveUId;
hospital.States = (int)States.Enabled;
return _hospitalRepository.Add(hospital);
}
/// <summary>
/// 修改医院
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool Update(HospitalRequest request)
{
var hospital = _hospitalRepository.GetEntity(t => t.ID == request.ID);
if (null == hospital)
throw new PerformanceException($"医院不存在 ID:{request.ID}");
hospital.HosName = request.HosName;
hospital.ShortName = request.ShortName;
hospital.HosLevel = request.HosLevel;
hospital.HosType = request.HosType;
hospital.AreaCode = request.AreaCode;
hospital.States = request.States;
return _hospitalRepository.Update(hospital);
}
/// <summary>
/// 删除医院
/// </summary>
/// <param name="request"></param>
/// <param name="hosid"></param>
/// <returns></returns>
public bool Delete(HospitalRequest request)
{
var hospital = _hospitalRepository.GetEntity(t => t.ID == request.ID);
if (null == hospital)
throw new PerformanceException($"医院不存在 ID:{request.ID}");
return _hospitalRepository.Remove(hospital);
}
}
}
......@@ -4,6 +4,9 @@
namespace Performance.Services
{
/// <summary>
/// 继承接口 自动注入DI
/// </summary>
public interface IAutoInjection
{
}
......
using Microsoft.Extensions.Options;
using Performance.DtoModels;
using Performance.DtoModels.AppSettings;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.Services
{
public class SmsService : IAutoInjection
{
private PerforSmsRepository _smsRepository;
private PerforUserRepository _userRepository;
private Application _options;
private HuyiSmsNotify _sms;
public SmsService(PerforSmsRepository smsRepository,
PerforUserRepository userRepository,
IOptions<Application> options,
HuyiSmsNotify sms)
{
this._smsRepository = smsRepository;
this._userRepository = userRepository;
this._options = options.Value;
this._sms = sms;
}
/// <summary>
/// 发送验证码
/// </summary>
/// <param name="mobile"></param>
/// <returns></returns>
public bool SendCode(int type, string mobile)
{
int? uid = null;
if (type == (int)SmsCodeType.Login)
{
var user = _userRepository.GetEntity(t => t.Mobile == mobile || t.Login == mobile);
if (user == null)
throw new PerformanceException("当前手机号不是系统账号");
uid = user.ID;
}
var code = RandomHelper.GetSmsCode();
if (code.Length == 0)
throw new PerformanceException("随机验证码失败");
sys_sms sms = new sys_sms
{
CreateDate = DateTime.Now,
CreateUser = uid,
Mobile = mobile.Trim(),
SmsCode = code,
Expiration = DateTime.Now.AddMinutes(_options.SmsCodeMinutes),
CodeType = (int)SmsCodeType.Login
};
var message = _options.SmsTemplate.Replace("[code]", code);
var response = _sms.SendSms(mobile, message);
//2 是互亿返回成功状态
if (response.code != "2")
throw new PerformanceException(response.msg);
return _smsRepository.Add(sms);
}
/// <summary>
/// 检查验证码
/// </summary>
/// <param name="mobile"></param>
/// <param name="code"></param>
/// <returns></returns>
public bool Check(string mobile, string code)
{
if (string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(code))
throw new PerformanceException("参数无效");
var sms = _smsRepository.GetEntity(t => t.Mobile == mobile.Trim() && t.SmsCode == code.Trim());
return sms == null;
}
}
}
......@@ -13,37 +13,125 @@ namespace Performance.Services
{
public class UserService : IAutoInjection
{
PerforRepository<Sys_User> _userRepository;
public UserService(PerforRepository<Sys_User> userRepository)
private PerforUserRepository _userRepository;
private PerforSmsRepository _smsRepository;
private PerforHospitalRepository _hospitalRepository;
private PerforUserhospitalRepository _userhospitalRepository;
public UserService(PerforSmsRepository smsRepository,
PerforUserRepository userRepository,
PerforHospitalRepository hospitalRepository,
PerforUserhospitalRepository userhospitalRepository)
{
this._userRepository = userRepository;
this._smsRepository = smsRepository;
this._hospitalRepository = hospitalRepository;
this._userhospitalRepository = userhospitalRepository;
}
public List<Sys_User> GetUser()
{
return _userRepository.GetEntities().ToList();
}
public ApiResponse<LoginInfo> Login(LoginRequest request)
/// <summary>
/// 登录
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public UserIdentity Login(LoginRequest request)
{
//手机号登录
if (request.LoginType == 1)
{
var sms = _smsRepository.GetEntity(t => t.Mobile == request.Account.Trim() && t.SmsCode == request.Password.Trim());
if (sms == null)
throw new PerformanceException("验证码验证失败");
var user = _userRepository.GetEntity(t => t.Mobile == request.Account);
if (user == null)
throw new PerformanceException("用户信息查询失败");
var data = Mapper.Map<UserIdentity>(user);
data.Token = Guid.NewGuid().ToString("N");
return data;
}
//账号密码登录
else if (request.LoginType == 2)
{
var user = _userRepository.GetEntity(t => t.Login == request.Account);
if (user != null && user.Password == request.Password)
{
var data = Mapper.Map<LoginInfo>(user);
data.Token = Guid.NewGuid().ToString("N");
return new ApiResponse<LoginInfo>(ResponseType.OK, "登录成功", data);
}
if (user == null)
throw new PerformanceException($"用户不存在 UserId:{request.Account}");
if (!user.Password.Equals(request.Password, StringComparison.OrdinalIgnoreCase))
throw new PerformanceException($"密码错误");
var data = Mapper.Map<UserIdentity>(user);
data.Token = Guid.NewGuid().ToString("N");
return data;
}
return new ApiResponse<LoginInfo>();
throw new PerformanceException($"登录类型LoginType:{request.LoginType}暂不支持");
}
/// <summary>
/// 新增用户
/// </summary>
/// <param name="request"></param>
public bool Insert(UserRequest request)
{
if (null != _userRepository.GetEntity(t => t.Login == request.Login))
throw new PerformanceException("登录名重复");
if (null != _userRepository.GetEntity(t => t.Mobile == request.Mobile))
throw new PerformanceException("手机号重复");
var user = Mapper.Map<sys_user>(request);
user.CreateDate = DateTime.Now;
user.CreateUser = request.ActiveUId;
user.States = (int)States.Enabled;
return _userRepository.Add(user);
}
/// <summary>
/// 设置用户医院
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool SetHospital(SetHospitalRequest request)
{
var user = _userRepository.GetEntity(t => t.ID == request.UserID);
if (null == user)
throw new PerformanceException($"用户不存在 UserId:{request.UserID}");
var userHospital = _userhospitalRepository.GetUserHospital(request.UserID);
bool rmResult = true, addResult = true;
//获取需要删除的医院
var rmHospital = userHospital.Where(t => !request.HosIDArray.Contains(t.HosID.Value));
if (rmHospital != null && rmHospital.Count() > 0)
rmResult = _userhospitalRepository.RemoveRange(rmHospital.ToArray());
//获取需要新增的医院
var addHospital = request.HosIDArray.Where(t => !userHospital.Select(u => u.HosID).Contains(t));
if (addHospital != null && addHospital.Count() > 0)
{
var allHospital = _hospitalRepository.GetEntities();
//获取有效医院ID
var array = addHospital.Where(t => allHospital.Select(h => h.ID).Contains(t))
.Select(t => new sys_user_hospital { UserID = request.UserID, HosID = t }).ToArray();
addResult = _userhospitalRepository.AddRange(array);
}
return rmResult && addResult;
}
/// <summary>
/// 修改用户
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool Update(UserRequest request)
{
var user = _userRepository.GetEntity(t => t.ID == request.ID);
if (null == user)
throw new PerformanceException($"用户不存在 UserId:{request.ID}");
user.Login = request.Login;
user.Mobile = request.Mobile;
user.RealName = request.RealName;
user.Mail = request.Mail;
user.States = request.States;
return _userRepository.Update(user);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment