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
9ee68265
Commit
9ee68265
authored
May 07, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增文件,医院列表新增hasconfig
parent
0d17a785
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
16 deletions
+71
-16
performance/Performance.Api/Controllers/TemplateController.cs
+3
-12
performance/Performance.Api/appsettings.json
+3
-1
performance/Performance.DtoModels/AppSettings/Application.cs
+4
-0
performance/Performance.DtoModels/Response/HospitalRequest.cs
+1
-0
performance/Performance.Services/HospitalService.cs
+13
-3
performance/Performance.Services/TemplateService.cs
+47
-0
No files found.
performance/Performance.Api/Controllers/TemplateController.cs
View file @
9ee68265
...
...
@@ -14,17 +14,7 @@ namespace Performance.Api.Controllers
[
Route
(
"api/[controller]"
)]
public
class
TemplateController
:
Controller
{
public
Application
emailOptions
;
public
TemplateController
(
IOptions
<
Application
>
emailOptions
)
{
this
.
emailOptions
=
emailOptions
.
Value
;
}
[
Route
(
"gettest"
)]
public
ApiResponse
apiResponse
()
{
var
a
=
emailOptions
.
Receiver
;
return
new
ApiResponse
(
ResponseType
.
OK
,
""
,
new
per_allot
{
});
}
public
TemplateController
()
{
}
}
}
\ No newline at end of file
performance/Performance.Api/appsettings.json
View file @
9ee68265
...
...
@@ -32,6 +32,8 @@
//护士长二次绩效管理员
"NurseRole"
:
"3"
,
//科主任二次绩效管理员
"DirectorRole"
:
"4"
"DirectorRole"
:
"4"
,
//邮件指定接收人
"Receiver"
:
[
"chengxiang.li@suvalue.com"
,
"486035085@qq.com"
]
}
}
performance/Performance.DtoModels/AppSettings/Application.cs
View file @
9ee68265
...
...
@@ -26,5 +26,9 @@ public class Application
/// 科主任二次绩效管理员
/// </summary>
public
int
DirectorRole
{
get
;
set
;
}
/// <summary>
/// 邮件指定接收人
/// </summary>
public
string
[]
Receiver
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Response/HospitalRequest.cs
View file @
9ee68265
...
...
@@ -13,5 +13,6 @@ public class HospitalResponse
public
string
HosLevel
{
get
;
set
;
}
public
string
HosType
{
get
;
set
;
}
public
int
States
{
get
;
set
;
}
public
int
HasConfig
{
get
;
set
;
}
}
}
performance/Performance.Services/HospitalService.cs
View file @
9ee68265
...
...
@@ -13,11 +13,14 @@ public class HospitalService : IAutoInjection
{
private
PerforHospitalRepository
_hospitalRepository
;
private
PerforUserhospitalRepository
_joinRepository
;
private
PerforHospitalconfigRepository
_hospitalconfigRepository
;
public
HospitalService
(
PerforHospitalRepository
hospitalRepository
,
PerforUserhospitalRepository
joinRepository
)
PerforUserhospitalRepository
joinRepository
,
PerforHospitalconfigRepository
hospitalconfigRepository
)
{
this
.
_hospitalRepository
=
hospitalRepository
;
this
.
_joinRepository
=
joinRepository
;
this
.
_hospitalconfigRepository
=
hospitalconfigRepository
;
}
/// <summary>
...
...
@@ -35,8 +38,15 @@ public List<HospitalResponse> GetUserHopital(int userid)
return
null
;
var
hosList
=
_hospitalRepository
.
GetEntities
(
t
=>
joinList
.
Select
(
j
=>
j
.
HospitalID
).
Contains
(
t
.
ID
));
return
Mapper
.
Map
<
List
<
sys_hospital
>,
List
<
HospitalResponse
>>(
hosList
);
var
hosId
=
hosList
?.
Select
(
item
=>
item
.
ID
).
ToList
();
hosId
=
_hospitalconfigRepository
.
GetEntities
(
t
=>
hosId
.
Contains
(
t
.
HospitalId
.
Value
))?.
Select
(
t
=>
t
.
HospitalId
.
Value
).
ToList
();
var
list
=
Mapper
.
Map
<
List
<
sys_hospital
>,
List
<
HospitalResponse
>>(
hosList
);
list
.
ForEach
(
t
=>
{
if
(
hosId
!=
null
&&
hosId
.
Contains
(
t
.
HosID
))
t
.
HasConfig
=
1
;
});
return
list
;
}
/// <summary>
...
...
performance/Performance.Services/TemplateService.cs
0 → 100644
View file @
9ee68265
using
Microsoft.Extensions.Options
;
using
Performance.DtoModels.AppSettings
;
using
Performance.Infrastructure
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services
{
public
class
TemplateService
:
IAutoInjection
{
private
Application
application
;
private
IEmailService
emailService
;
public
TemplateService
(
IOptions
<
Application
>
options
,
IEmailService
emailService
)
{
this
.
application
=
options
.
Value
;
this
.
emailService
=
emailService
;
}
public
bool
FirstSubmit
()
{
return
true
;
}
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="allot"></param>
/// <param name="mail"></param>
/// <param name="subject"></param>
/// <param name="body"></param>
private
void
SendEmail
(
string
mail
,
string
subject
,
string
body
)
{
var
message
=
new
EmailMessage
{
To
=
application
.
Receiver
.
ToList
(),
DisplayName
=
"溯直健康"
,
Subject
=
subject
,
Body
=
body
};
emailService
.
SendAsync
(
message
);
}
}
}
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