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
0a860949
Commit
0a860949
authored
Apr 10, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature/df' into dev
parents
9da16caa
e73d4b6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
10 deletions
+38
-10
performance/Performance.Api/Controllers/ModExtractController.cs
+2
-1
performance/Performance.Api/Startup.cs
+1
-1
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+8
-2
performance/Performance.Services/AllotService.cs
+3
-3
performance/Performance.Services/DFExtractService.cs
+0
-0
performance/Performance.Services/Hubs/AllotLogHub.cs
+6
-0
performance/Performance.Services/LogManageService.cs
+7
-1
performance/Performance.Services/ModExtractService.cs
+4
-1
performance/Performance.Services/SecondAllotService.cs
+7
-1
No files found.
performance/Performance.Api/Controllers/ModExtractController.cs
View file @
0a860949
...
@@ -160,8 +160,9 @@ public ApiResponse AddItem([FromBody]ItemListRequest request)
...
@@ -160,8 +160,9 @@ public ApiResponse AddItem([FromBody]ItemListRequest request)
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
Items
([
FromBody
]
ModItemRequest
request
)
public
ApiResponse
Items
([
FromBody
]
ModItemRequest
request
)
{
{
logger
.
LogInformation
(
$"请求地址
{
url
.
HttpPost
}
/modextract/items"
);
logger
.
LogInformation
(
$"
绩效收入模板配置项列表 :
请求地址
{
url
.
HttpPost
}
/modextract/items"
);
HttpHelper
.
HttpPost
(
url
.
HttpPost
+
"/modextract/items"
,
JsonHelper
.
Serialize
(
request
),
true
);
HttpHelper
.
HttpPost
(
url
.
HttpPost
+
"/modextract/items"
,
JsonHelper
.
Serialize
(
request
),
true
);
logger
.
LogInformation
(
$"绩效收入模板配置项列表在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd hh:mm:ss完成请求"
)}
"
);
var
list
=
modExtractService
.
Items
(
request
.
ModuleId
.
Value
);
var
list
=
modExtractService
.
Items
(
request
.
ModuleId
.
Value
);
return
new
ApiResponse
(
ResponseType
.
OK
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
list
);
}
}
...
...
performance/Performance.Api/Startup.cs
View file @
0a860949
...
@@ -233,7 +233,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
...
@@ -233,7 +233,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
#
endregion
#
endregion
app
.
UseCors
(
"SignalrCore"
);
app
.
UseCors
(
"SignalrCore"
);
app
.
UseSignalR
(
routes
=>
routes
.
MapHub
<
AllotLogHub
>(
"/performance/allotLogHub"
));
//
app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
loggerFactory
.
CreateLogger
<
Startup
>().
LogDebug
(
env
.
EnvironmentName
);
loggerFactory
.
CreateLogger
<
Startup
>().
LogDebug
(
env
.
EnvironmentName
);
app
.
UseMvc
();
app
.
UseMvc
();
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
0a860949
...
@@ -136,6 +136,8 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -136,6 +136,8 @@ 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
);
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
if
(!
string
.
IsNullOrEmpty
(
path
)
&&
FileHelper
.
IsExistFile
(
path
))
FileHelper
.
DeleteFile
(
path
);
FileHelper
.
DeleteFile
(
path
);
...
@@ -154,12 +156,16 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -154,12 +156,16 @@ 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
);
//抽取
#
region
保存文件到网站下
#
region
保存文件到网站下
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
{
{
logger
.
LogInformation
(
"请求路径:"
+
url
.
ImportFile
+
",请求参数"
+
JsonHelper
.
Serialize
(
new
{
allotId
,
hospitalId
}));
logger
.
LogInformation
(
"请求路径:"
+
url
.
ImportFile
+
",请求参数"
+
JsonHelper
.
Serialize
(
new
{
allotId
,
hospitalId
}));
int
i
=
1
;
int
i
=
1
;
while
(
i
<=
5
)
while
(
i
<=
5
)
{
{
...
...
performance/Performance.Services/AllotService.cs
View file @
0a860949
...
@@ -262,7 +262,7 @@ public void Generate(per_allot allot, string mail)
...
@@ -262,7 +262,7 @@ public void Generate(per_allot allot, string mail)
if
(!
checkDataService
.
Check
(
excel
,
allot
))
if
(!
checkDataService
.
Check
(
excel
,
allot
))
{
{
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
CheckFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
CheckFail
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
CheckFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
CheckFail
));
SendEmail
(
allot
,
mail
,
3
,
time
);
//
SendEmail(allot, mail, 3, time);
logManageService
.
WriteMsg
(
"绩效数据校验失败"
,
"详情可至“更多 -- 查看日志”查看"
,
3
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
logManageService
.
WriteMsg
(
"绩效数据校验失败"
,
"详情可至“更多 -- 查看日志”查看"
,
3
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
return
;
return
;
}
}
...
@@ -335,7 +335,7 @@ public void Generate(per_allot allot, string mail)
...
@@ -335,7 +335,7 @@ public void Generate(per_allot allot, string mail)
//发送邮件
//发送邮件
logManageService
.
WriteMsg
(
"正在发送邮件"
,
"正在发送邮件"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
logManageService
.
WriteMsg
(
"正在发送邮件"
,
"正在发送邮件"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
SendEmail
(
allot
,
mail
,
1
,
time
);
//
SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService
.
WriteMsg
(
"绩效生成结束"
,
"绩效生成成功"
,
5
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
logManageService
.
WriteMsg
(
"绩效生成结束"
,
"绩效生成成功"
,
5
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
}
}
...
@@ -344,7 +344,7 @@ public void Generate(per_allot allot, string mail)
...
@@ -344,7 +344,7 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"绩效生成失败"
,
"程序异常,请重新尝试。"
,
4
,
allot
.
ID
,
"ReceiveMessage"
);
logManageService
.
WriteMsg
(
"绩效生成失败"
,
"程序异常,请重新尝试。"
,
4
,
allot
.
ID
,
"ReceiveMessage"
);
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
ex
.
ToString
(),
4
);
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
ex
.
ToString
(),
4
);
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateFail
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateFail
));
SendEmail
(
allot
,
mail
,
2
,
time
);
//
SendEmail(allot, mail, 2, time);
//throw ex;
//throw ex;
}
}
}
}
...
...
performance/Performance.Services/DFExtractService.cs
View file @
0a860949
This diff is collapsed.
Click to expand it.
performance/Performance.Services/Hubs/AllotLogHub.cs
View file @
0a860949
...
@@ -9,6 +9,12 @@
...
@@ -9,6 +9,12 @@
namespace
Performance.Services
namespace
Performance.Services
{
{
public
class
HubGroupInfo
{
public
DateTime
AddTime
{
get
;
set
;
}
public
string
ConnectionId
{
get
;
set
;
}
}
public
class
AllotLogHub
:
Hub
public
class
AllotLogHub
:
Hub
{
{
private
readonly
ILogger
<
AllotLogHub
>
logger
;
private
readonly
ILogger
<
AllotLogHub
>
logger
;
...
...
performance/Performance.Services/LogManageService.cs
View file @
0a860949
using
Microsoft.AspNetCore.Mvc.ViewFeatures
;
using
Microsoft.AspNetCore.Mvc.ViewFeatures
;
using
Microsoft.AspNetCore.SignalR
;
using
Microsoft.AspNetCore.SignalR
;
using
Microsoft.Extensions.Logging
;
using
Performance.Repository
;
using
Performance.Repository
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -9,11 +10,15 @@ namespace Performance.Services
...
@@ -9,11 +10,15 @@ namespace Performance.Services
{
{
public
class
LogManageService
:
IAutoInjection
public
class
LogManageService
:
IAutoInjection
{
{
private
readonly
ILogger
<
LogManageService
>
logger
;
private
readonly
IHubContext
<
AllotLogHub
>
hubContext
;
private
readonly
IHubContext
<
AllotLogHub
>
hubContext
;
private
PerforLogdbugRepository
logdbug
;
private
PerforLogdbugRepository
logdbug
;
public
LogManageService
(
IHubContext
<
AllotLogHub
>
hubContext
,
public
LogManageService
(
ILogger
<
LogManageService
>
logger
,
IHubContext
<
AllotLogHub
>
hubContext
,
PerforLogdbugRepository
logdbug
)
PerforLogdbugRepository
logdbug
)
{
{
this
.
logger
=
logger
;
this
.
hubContext
=
hubContext
;
this
.
hubContext
=
hubContext
;
this
.
logdbug
=
logdbug
;
this
.
logdbug
=
logdbug
;
}
}
...
@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection
...
@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection
/// <param name="method">方法名称</param>
/// <param name="method">方法名称</param>
public
void
WriteMsg
(
string
tag
,
string
message
,
int
level
,
int
allotId
,
string
method
,
bool
isDebug
=
false
)
public
void
WriteMsg
(
string
tag
,
string
message
,
int
level
,
int
allotId
,
string
method
,
bool
isDebug
=
false
)
{
{
logger
.
LogInformation
(
$"method:
{
method
}
;tag:
{
tag
}
; message:
{
message
}
; level:
{
level
}
"
);
hubContext
.
Clients
.
Group
(
allotId
.
ToString
()).
SendAsync
(
method
,
tag
,
message
,
level
);
hubContext
.
Clients
.
Group
(
allotId
.
ToString
()).
SendAsync
(
method
,
tag
,
message
,
level
);
if
(
isDebug
)
if
(
isDebug
)
{
{
...
...
performance/Performance.Services/ModExtractService.cs
View file @
0a860949
...
@@ -440,9 +440,12 @@ public void AddItems(int moduleId)
...
@@ -440,9 +440,12 @@ public void AddItems(int moduleId)
throw
new
PerformanceException
(
$"医院配置信息未设置"
);
throw
new
PerformanceException
(
$"医院配置信息未设置"
);
}
}
var
connection
=
ConnectionBuilder
.
Create
(
DatabaseType
.
SqlServer
,
hospitalConfig
.
DbSource
,
hospitalConfig
.
DbName
,
hospitalConfig
.
DbUser
,
hospitalConfig
.
DbPassword
);
logger
.
LogInformation
(
"创建数据库连接"
);
var
connection
=
ConnectionBuilder
.
Create
(
DatabaseType
.
Oracle
,
hospitalConfig
.
DbSource
,
hospitalConfig
.
DbName
,
hospitalConfig
.
DbUser
,
hospitalConfig
.
DbPassword
);
string
sql
=
sqlconfig
.
Content
;
string
sql
=
sqlconfig
.
Content
;
logger
.
LogInformation
(
$"执行sql:
{
sql
}
"
);
var
dataList
=
perforExtractRepository
.
ExecuteScript
(
connection
,
sql
,
null
);
var
dataList
=
perforExtractRepository
.
ExecuteScript
(
connection
,
sql
,
null
);
logger
.
LogInformation
(
$"获取数据
{
dataList
?.
Count
??
0
}
条"
);
if
(
dataList
!=
null
&&
dataList
.
Any
())
if
(
dataList
!=
null
&&
dataList
.
Any
())
{
{
var
itemList
=
dataList
.
Select
(
t
=>
new
mod_item
var
itemList
=
dataList
.
Select
(
t
=>
new
mod_item
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
0a860949
...
@@ -88,7 +88,13 @@ public List<SecondListResponse> GetSecondList(int userId)
...
@@ -88,7 +88,13 @@ public List<SecondListResponse> GetSecondList(int userId)
throw
new
NotImplementedException
(
"该医院未生成绩效"
);
throw
new
NotImplementedException
(
"该医院未生成绩效"
);
var
allotListId
=
allotList
.
Select
(
t
=>
t
.
ID
).
ToList
();
var
allotListId
=
allotList
.
Select
(
t
=>
t
.
ID
).
ToList
();
var
secondList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
user
.
Department
);
Expression
<
Func
<
ag_secondallot
,
bool
>>
exp
=
t
=>
allotListId
.
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
user
.
Department
;
if
(
role
.
RoleID
==
application
.
NurseRole
)
exp
=
exp
.
And
(
t
=>
t
.
UnitType
==
"护理组"
);
else
exp
=
exp
.
And
(
t
=>
t
.
UnitType
!=
"护理组"
);
var
secondList
=
perforAgsecondallotRepository
.
GetEntities
(
exp
);
//各科室绩效分配结果
//各科室绩效分配结果
var
accountList
=
perforResaccountRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotID
.
Value
)
&&
t
.
Department
==
user
.
Department
);
var
accountList
=
perforResaccountRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotID
.
Value
)
&&
t
.
Department
==
user
.
Department
);
//取得未生成二次绩效的绩效id
//取得未生成二次绩效的绩效id
...
...
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