Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
6e161b9d
Commit
6e161b9d
authored
Mar 25, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature/new_report' into feature/new_report
parents
324445cc
7ec5bd17
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
105 additions
and
11 deletions
+105
-11
performance/Performance.Api/Controllers/AllotController.cs
+16
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+4
-1
performance/Performance.DtoModels/Enum.cs
+4
-1
performance/Performance.EntityModels/Entity/rep_importconfig.cs
+1
-1
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+3
-3
performance/Performance.Services/AllotService.cs
+1
-1
performance/Performance.Services/DFExtractService.cs
+66
-1
performance/Performance.Services/ExtractService.cs
+3
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
6e161b9d
...
...
@@ -237,5 +237,21 @@ public ApiResponse AllotLog([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
var
list
=
_allotService
.
AllotLog
(
allot
);
return
new
ApiResponse
(
ResponseType
.
OK
,
list
);
}
/// <summary>
/// 绩效审核通过,绩效下发
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"issued"
)]
[
HttpPost
]
public
ApiResponse
Issued
([
FromBody
]
AllotRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
ID
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
}
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
6e161b9d
...
...
@@ -186,6 +186,13 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Issued(Performance.DtoModels.AllotRequest)"
>
<summary>
绩效审核通过,绩效下发
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetCompute(Performance.DtoModels.ComputerRequest)"
>
<summary>
获取绩效发放列表
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
6e161b9d
...
...
@@ -129,7 +129,7 @@
<summary>
正在生成绩效
</summary>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateSucceed"
>
<summary>
绩效结果
解析成功
</summary>
<summary>
绩效结果
通过审核,允许下发
</summary>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateFail"
>
<summary>
绩效解析失败
</summary>
...
...
@@ -140,6 +140,9 @@
<member
name=
"F:Performance.DtoModels.AllotStates.Wait"
>
<summary>
归档
</summary>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateAccomplish"
>
<summary>
绩效结果解析成功
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerAgainData.RowNumber"
>
<summary>
行号
...
...
performance/Performance.DtoModels/Enum.cs
View file @
6e161b9d
...
...
@@ -65,7 +65,7 @@ public enum AllotStates
/// <summary> 正在生成绩效 </summary>
[
Description
(
"正在生成绩效"
)]
InGenerate
=
5
,
/// <summary> 绩效结果
解析成功
</summary>
/// <summary> 绩效结果
通过审核,允许下发
</summary>
[
Description
(
"数据验证通过"
)]
GenerateSucceed
=
6
,
/// <summary> 绩效解析失败 </summary>
...
...
@@ -77,5 +77,8 @@ public enum AllotStates
/// <summary> 归档 </summary>
[
Description
(
"等待"
)]
Wait
=
9
,
/// <summary> 绩效结果解析成功 </summary>
[
Description
(
"数据验证通过"
)]
GenerateAccomplish
=
10
,
}
}
performance/Performance.EntityModels/Entity/rep_importconfig.cs
View file @
6e161b9d
...
...
@@ -49,7 +49,7 @@ public class rep_importconfig
/// <summary>
/// 时间范围 1 当前 2 同期 3 上期
/// </summary>
public
int
TimeRange
{
get
;
set
;
}
public
string
TimeRange
{
get
;
set
;
}
/// <summary>
/// 是否有效 1 有效 0 无效
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
6e161b9d
...
...
@@ -137,6 +137,9 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
path
=
Path
.
Combine
(
dpath
,
FileHelper
.
GetFileName
(
file
.
FileName
));
logger
.
LogInformation
(
$"保存历史绩效文件保存路径:"
+
path
);
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
FileHelper
.
DeleteFile
(
path
);
using
(
var
stream
=
file
.
OpenReadStream
())
{
byte
[]
bytes
=
new
byte
[
stream
.
Length
];
...
...
@@ -152,9 +155,6 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
//string filePath = newExtractService.ExtractData(allotId, request.Email, hospitalId);
string
filePath
=
dfExtractService
.
ExtractData
(
allotId
,
email
,
hospitalId
,
path
);
//抽取
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
FileHelper
.
DeleteFile
(
path
);
#
region
保存文件到网站下
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
...
...
performance/Performance.Services/AllotService.cs
View file @
6e161b9d
...
...
@@ -302,7 +302,7 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"保存绩效人均参考标准"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
perforResbaiscnormRepository
.
AddRange
(
baiscnormList
.
ToArray
());
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
Generate
Succeed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
Generate
Accomplish
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateAccomplish
));
logManageService
.
WriteMsg
(
"正在生成报表数据"
,
"正在生成报表数据"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
var
res
=
reportService
.
ImportData
(
allot
);
...
...
performance/Performance.Services/DFExtractService.cs
View file @
6e161b9d
...
...
@@ -36,6 +36,7 @@ public class DFExtractService : IAutoInjection
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImspecialunitRepository
perforImspecialunitRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforRepimportconfigRepository
repimportconfigRepository
;
private
readonly
LogManageService
logManageService
;
private
IWorkbook
workbook
=
null
;
...
...
@@ -58,6 +59,7 @@ public class DFExtractService : IAutoInjection
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImspecialunitRepository
perforImspecialunitRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforRepimportconfigRepository
repimportconfigRepository
,
LogManageService
logManageService
)
{
this
.
logger
=
logger
;
...
...
@@ -76,6 +78,7 @@ public class DFExtractService : IAutoInjection
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImspecialunitRepository
=
perforImspecialunitRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
repimportconfigRepository
=
repimportconfigRepository
;
this
.
logManageService
=
logManageService
;
}
#
endregion
...
...
@@ -191,6 +194,8 @@ public string TemplateExecute(string email, per_allot lastAllot, sys_hospital ho
}
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
,
5
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogInformation
(
$"提取绩效数据
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
);
ImportData
(
Allot
,
configs
);
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
}
...
...
@@ -259,6 +264,8 @@ public string AlllotExecute(string email, per_allot lastAllot, sys_hospital hosp
}
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
,
5
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogInformation
(
$"提取绩效数据
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
);
ImportData
(
Allot
,
configs
);
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
}
...
...
@@ -849,6 +856,64 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
return
pairs
;
}
/// <summary>
/// 从HIS抽取报表数据
/// </summary>
/// <param name="allot"></param>
/// <param name="configs"></param>
public
void
ImportData
(
per_allot
allot
,
List
<
sys_hospitalconfig
>
configs
)
{
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>
{
{
"@allotid"
,
allot
.
ID
},
{
"@hospitalid"
,
allot
.
HospitalId
},
{
"@year"
,
allot
.
Year
},
{
"@month"
,
allot
.
Month
},
};
var
imports
=
repimportconfigRepository
.
GetEntities
(
w
=>
w
.
ScriptType
==
1
);
if
(
imports
==
null
||
!
imports
.
Any
())
return
;
foreach
(
var
import
in
imports
)
{
var
conf
=
configs
.
FirstOrDefault
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
Id
==
import
.
ConfigId
);
if
(
conf
!=
null
)
{
var
timeRanges
=
import
.
TimeRange
.
SplitRemoveEmpty
(
","
);
if
(
timeRanges
==
null
||
!
timeRanges
.
Any
())
continue
;
foreach
(
var
item
in
timeRanges
)
{
if
(
item
==
"1"
)
{
pairs
[
"@year"
]
=
allot
.
Year
;
pairs
[
"@month"
]
=
allot
.
Month
;
}
else
if
(
item
==
"2"
)
{
pairs
[
"@year"
]
=
allot
.
Year
-
1
;
pairs
[
"@month"
]
=
allot
.
Month
;
}
else
if
(
item
==
"3"
)
{
pairs
[
"@year"
]
=
allot
.
Year
;
pairs
[
"@month"
]
=
allot
.
Month
-
1
;
}
try
{
DatabaseType
type
=
(
DatabaseType
)
conf
.
DataBaseType
;
var
connection
=
ConnectionBuilder
.
Create
(
type
,
conf
.
DbSource
,
conf
.
DbName
,
conf
.
DbUser
,
conf
.
DbPassword
);
var
data
=
connection
.
Query
(
import
.
ImportScript
,
new
DynamicParameters
(
pairs
),
commandTimeout
:
60
*
60
);
perforPerallotRepository
.
ImportData
(
import
,
pairs
,
data
);
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
ex
.
ToString
());
}
}
}
}
}
#
endregion
#
region
Common
...
...
@@ -872,7 +937,7 @@ private void SendEmail(string mail, string path, string subject, string body)
};
if
(!
string
.
IsNullOrEmpty
(
path
))
message
.
Attachments
=
new
List
<
string
>
{
path
};
emailService
.
Send
(
message
);
//
emailService.Send(message);
}
/// <summary>
...
...
performance/Performance.Services/ExtractService.cs
View file @
6e161b9d
...
...
@@ -213,17 +213,17 @@ public void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
var
conf
=
configs
.
FirstOrDefault
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
Id
==
import
.
ConfigId
);
if
(
conf
!=
null
)
{
if
(
import
.
TimeRange
==
1
)
if
(
import
.
TimeRange
==
"1"
)
{
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
}
else
if
(
import
.
TimeRange
==
2
)
else
if
(
import
.
TimeRange
==
"2"
)
{
pairs
.
Add
(
"@year"
,
allot
.
Year
-
1
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
}
else
if
(
import
.
TimeRange
==
3
)
else
if
(
import
.
TimeRange
==
"3"
)
{
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@month"
,
allot
.
Month
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment