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
7ec5bd17
Commit
7ec5bd17
authored
Mar 25, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效下发
parent
b5931dfa
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
12 deletions
+106
-12
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
+4
-4
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 @
7ec5bd17
...
@@ -237,5 +237,21 @@ public ApiResponse AllotLog([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
...
@@ -237,5 +237,21 @@ public ApiResponse AllotLog([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
var
list
=
_allotService
.
AllotLog
(
allot
);
var
list
=
_allotService
.
AllotLog
(
allot
);
return
new
ApiResponse
(
ResponseType
.
OK
,
list
);
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 @
7ec5bd17
...
@@ -186,6 +186,13 @@
...
@@ -186,6 +186,13 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</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)"
>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetCompute(Performance.DtoModels.ComputerRequest)"
>
<summary>
<summary>
获取绩效发放列表
获取绩效发放列表
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
7ec5bd17
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
<summary>
正在生成绩效
</summary>
<summary>
正在生成绩效
</summary>
</member>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateSucceed"
>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateSucceed"
>
<summary>
绩效结果
解析成功
</summary>
<summary>
绩效结果
通过审核,允许下发
</summary>
</member>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateFail"
>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateFail"
>
<summary>
绩效解析失败
</summary>
<summary>
绩效解析失败
</summary>
...
@@ -140,6 +140,9 @@
...
@@ -140,6 +140,9 @@
<member
name=
"F:Performance.DtoModels.AllotStates.Wait"
>
<member
name=
"F:Performance.DtoModels.AllotStates.Wait"
>
<summary>
归档
</summary>
<summary>
归档
</summary>
</member>
</member>
<member
name=
"F:Performance.DtoModels.AllotStates.GenerateAccomplish"
>
<summary>
绩效结果解析成功
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerAgainData.RowNumber"
>
<member
name=
"P:Performance.DtoModels.PerAgainData.RowNumber"
>
<summary>
<summary>
行号
行号
...
...
performance/Performance.DtoModels/Enum.cs
View file @
7ec5bd17
...
@@ -65,7 +65,7 @@ public enum AllotStates
...
@@ -65,7 +65,7 @@ public enum AllotStates
/// <summary> 正在生成绩效 </summary>
/// <summary> 正在生成绩效 </summary>
[
Description
(
"正在生成绩效"
)]
[
Description
(
"正在生成绩效"
)]
InGenerate
=
5
,
InGenerate
=
5
,
/// <summary> 绩效结果
解析成功
</summary>
/// <summary> 绩效结果
通过审核,允许下发
</summary>
[
Description
(
"数据验证通过"
)]
[
Description
(
"数据验证通过"
)]
GenerateSucceed
=
6
,
GenerateSucceed
=
6
,
/// <summary> 绩效解析失败 </summary>
/// <summary> 绩效解析失败 </summary>
...
@@ -77,5 +77,8 @@ public enum AllotStates
...
@@ -77,5 +77,8 @@ public enum AllotStates
/// <summary> 归档 </summary>
/// <summary> 归档 </summary>
[
Description
(
"等待"
)]
[
Description
(
"等待"
)]
Wait
=
9
,
Wait
=
9
,
/// <summary> 绩效结果解析成功 </summary>
[
Description
(
"数据验证通过"
)]
GenerateAccomplish
=
10
,
}
}
}
}
performance/Performance.EntityModels/Entity/rep_importconfig.cs
View file @
7ec5bd17
...
@@ -49,7 +49,7 @@ public class rep_importconfig
...
@@ -49,7 +49,7 @@ public class rep_importconfig
/// <summary>
/// <summary>
/// 时间范围 1 当前 2 同期 3 上期
/// 时间范围 1 当前 2 同期 3 上期
/// </summary>
/// </summary>
public
int
TimeRange
{
get
;
set
;
}
public
string
TimeRange
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否有效 1 有效 0 无效
/// 是否有效 1 有效 0 无效
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
7ec5bd17
...
@@ -137,6 +137,9 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -137,6 +137,9 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
path
=
Path
.
Combine
(
dpath
,
FileHelper
.
GetFileName
(
file
.
FileName
));
path
=
Path
.
Combine
(
dpath
,
FileHelper
.
GetFileName
(
file
.
FileName
));
logger
.
LogInformation
(
$"保存历史绩效文件保存路径:"
+
path
);
logger
.
LogInformation
(
$"保存历史绩效文件保存路径:"
+
path
);
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
FileHelper
.
DeleteFile
(
path
);
using
(
var
stream
=
file
.
OpenReadStream
())
using
(
var
stream
=
file
.
OpenReadStream
())
{
{
byte
[]
bytes
=
new
byte
[
stream
.
Length
];
byte
[]
bytes
=
new
byte
[
stream
.
Length
];
...
@@ -151,10 +154,7 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -151,10 +154,7 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
//string filePath = newExtractService.ExtractData(allotId, request.Email, hospitalId);
//string filePath = newExtractService.ExtractData(allotId, request.Email, hospitalId);
string
filePath
=
dfExtractService
.
ExtractData
(
allotId
,
email
,
hospitalId
,
path
);
//抽取
string
filePath
=
dfExtractService
.
ExtractData
(
allotId
,
email
,
hospitalId
,
path
);
//抽取
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
FileHelper
.
DeleteFile
(
path
);
#
region
保存文件到网站下
#
region
保存文件到网站下
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
...
...
performance/Performance.Services/AllotService.cs
View file @
7ec5bd17
...
@@ -302,7 +302,7 @@ public void Generate(per_allot allot, string mail)
...
@@ -302,7 +302,7 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"保存绩效人均参考标准"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"保存绩效人均参考标准"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
perforResbaiscnormRepository
.
AddRange
(
baiscnormList
.
ToArray
());
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
);
logManageService
.
WriteMsg
(
"正在生成报表数据"
,
"正在生成报表数据"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
var
res
=
reportService
.
ImportData
(
allot
);
var
res
=
reportService
.
ImportData
(
allot
);
...
...
performance/Performance.Services/DFExtractService.cs
View file @
7ec5bd17
...
@@ -36,6 +36,7 @@ public class DFExtractService : IAutoInjection
...
@@ -36,6 +36,7 @@ public class DFExtractService : IAutoInjection
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImspecialunitRepository
perforImspecialunitRepository
;
private
readonly
PerforImspecialunitRepository
perforImspecialunitRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforRepimportconfigRepository
repimportconfigRepository
;
private
readonly
LogManageService
logManageService
;
private
readonly
LogManageService
logManageService
;
private
IWorkbook
workbook
=
null
;
private
IWorkbook
workbook
=
null
;
...
@@ -58,6 +59,7 @@ public class DFExtractService : IAutoInjection
...
@@ -58,6 +59,7 @@ public class DFExtractService : IAutoInjection
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImspecialunitRepository
perforImspecialunitRepository
,
PerforImspecialunitRepository
perforImspecialunitRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforRepimportconfigRepository
repimportconfigRepository
,
LogManageService
logManageService
)
LogManageService
logManageService
)
{
{
this
.
logger
=
logger
;
this
.
logger
=
logger
;
...
@@ -76,6 +78,7 @@ public class DFExtractService : IAutoInjection
...
@@ -76,6 +78,7 @@ public class DFExtractService : IAutoInjection
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImspecialunitRepository
=
perforImspecialunitRepository
;
this
.
perforImspecialunitRepository
=
perforImspecialunitRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
repimportconfigRepository
=
repimportconfigRepository
;
this
.
logManageService
=
logManageService
;
this
.
logManageService
=
logManageService
;
}
}
#
endregion
#
endregion
...
@@ -191,6 +194,8 @@ public string TemplateExecute(string email, per_allot lastAllot, sys_hospital ho
...
@@ -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"
);
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
,
5
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogInformation
(
$"提取绩效数据
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
);
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"
)}
成功提取。"
);
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
return
newPath
;
}
}
...
@@ -259,6 +264,8 @@ public string AlllotExecute(string email, per_allot lastAllot, sys_hospital hosp
...
@@ -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"
);
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
,
5
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogInformation
(
$"提取绩效数据
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
);
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"
)}
成功提取。"
);
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
return
newPath
;
}
}
...
@@ -849,6 +856,64 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
...
@@ -849,6 +856,64 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
return
pairs
;
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
#
endregion
#
region
Common
#
region
Common
...
@@ -872,7 +937,7 @@ private void SendEmail(string mail, string path, string subject, string body)
...
@@ -872,7 +937,7 @@ private void SendEmail(string mail, string path, string subject, string body)
};
};
if
(!
string
.
IsNullOrEmpty
(
path
))
if
(!
string
.
IsNullOrEmpty
(
path
))
message
.
Attachments
=
new
List
<
string
>
{
path
};
message
.
Attachments
=
new
List
<
string
>
{
path
};
emailService
.
Send
(
message
);
//
emailService.Send(message);
}
}
/// <summary>
/// <summary>
...
...
performance/Performance.Services/ExtractService.cs
View file @
7ec5bd17
...
@@ -213,17 +213,17 @@ public void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
...
@@ -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
);
var
conf
=
configs
.
FirstOrDefault
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
Id
==
import
.
ConfigId
);
if
(
conf
!=
null
)
if
(
conf
!=
null
)
{
{
if
(
import
.
TimeRange
==
1
)
if
(
import
.
TimeRange
==
"1"
)
{
{
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
}
}
else
if
(
import
.
TimeRange
==
2
)
else
if
(
import
.
TimeRange
==
"2"
)
{
{
pairs
.
Add
(
"@year"
,
allot
.
Year
-
1
);
pairs
.
Add
(
"@year"
,
allot
.
Year
-
1
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
pairs
.
Add
(
"@month"
,
allot
.
Month
);
}
}
else
if
(
import
.
TimeRange
==
3
)
else
if
(
import
.
TimeRange
==
"3"
)
{
{
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@year"
,
allot
.
Year
);
pairs
.
Add
(
"@month"
,
allot
.
Month
-
1
);
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