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
b875151f
Commit
b875151f
authored
Apr 11, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加获取人员列表,修改人员信息调整,表cog_again相关修改对应allotid,
parent
70967a56
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
46 deletions
+81
-46
performance/Performance.Api/Controllers/AgainAllotController.cs
+2
-2
performance/Performance.Api/Controllers/ConfigController.cs
+1
-1
performance/Performance.Api/Controllers/EmployeeController.cs
+13
-0
performance/Performance.DtoModels/Request/CofAgainRequest.cs
+1
-6
performance/Performance.DtoModels/Request/EmployeeRequest.cs
+4
-0
performance/Performance.EntityModels/Entity/cof_again.cs
+0
-5
performance/Performance.Services/AgainAllotService.cs
+2
-2
performance/Performance.Services/ConfigService.cs
+13
-25
performance/Performance.Services/EmployeeService.cs
+45
-5
No files found.
performance/Performance.Api/Controllers/AgainAllotController.cs
View file @
b875151f
...
@@ -107,8 +107,8 @@ public ApiResponse Import([FromForm] IFormCollection form)
...
@@ -107,8 +107,8 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(!
againAllotService
.
Update
(
allot
,
againid
))
if
(!
againAllotService
.
Update
(
allot
,
againid
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"
{
file
.
FileName
}
上传成功,修改状态失败"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"
{
file
.
FileName
}
上传成功,修改状态失败"
);
configService
.
ClearAgain
(
a
gainid
);
configService
.
ClearAgain
(
a
llot
.
ID
);
configService
.
CopyAgain
(
a
gainid
);
configService
.
CopyAgain
(
a
llot
.
ID
);
}
}
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
...
...
performance/Performance.Api/Controllers/ConfigController.cs
View file @
b875151f
...
@@ -255,7 +255,7 @@ public ApiResponse WorkyearDelete([CustomizeValidator(RuleSet = "Delete"), FromB
...
@@ -255,7 +255,7 @@ public ApiResponse WorkyearDelete([CustomizeValidator(RuleSet = "Delete"), FromB
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
GetAgainList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
CofAgainRequest
request
)
public
ApiResponse
GetAgainList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
CofAgainRequest
request
)
{
{
var
list
=
_configService
.
GetAgainList
(
request
.
A
gainA
llotID
);
var
list
=
_configService
.
GetAgainList
(
request
.
AllotID
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
}
...
...
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
b875151f
...
@@ -21,6 +21,19 @@ public EmployeeController(EmployeeService employeeService)
...
@@ -21,6 +21,19 @@ public EmployeeController(EmployeeService employeeService)
}
}
/// <summary>
/// <summary>
/// 获取人员列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getlist"
)]
[
HttpPost
]
public
ApiResponse
GetEmployeeList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
EmployeeRequest
request
)
{
var
employee
=
employeeService
.
GetEmployeeList
(
request
.
AllotID
.
Value
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
/// <summary>
/// 新增人员
/// 新增人员
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
...
...
performance/Performance.DtoModels/Request/CofAgainRequest.cs
View file @
b875151f
...
@@ -13,11 +13,6 @@ public class CofAgainRequest: ApiRequest
...
@@ -13,11 +13,6 @@ public class CofAgainRequest: ApiRequest
public
int
AllotID
{
get
;
set
;
}
public
int
AllotID
{
get
;
set
;
}
/// <summary>
/// <summary>
///
/// </summary>
public
int
AgainAllotID
{
get
;
set
;
}
/// <summary>
/// 1 职称绩效 2 工作量绩效 3 满勤天数
/// 1 职称绩效 2 工作量绩效 3 满勤天数
/// </summary>
/// </summary>
public
int
Type
{
get
;
set
;
}
public
int
Type
{
get
;
set
;
}
...
@@ -38,7 +33,7 @@ public CofAgainRequestValidator()
...
@@ -38,7 +33,7 @@ public CofAgainRequestValidator()
{
{
RuleSet
(
"Select"
,
()
=>
RuleSet
(
"Select"
,
()
=>
{
{
RuleFor
(
x
=>
x
.
A
gainA
llotID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
});
});
RuleSet
(
"Update"
,
()
=>
RuleSet
(
"Update"
,
()
=>
...
...
performance/Performance.DtoModels/Request/EmployeeRequest.cs
View file @
b875151f
...
@@ -113,6 +113,10 @@ public EmployeeRequestValidator()
...
@@ -113,6 +113,10 @@ public EmployeeRequestValidator()
RuleFor
(
x
=>
x
.
AccountingUnit
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
AccountingUnit
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
DoctorName
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
DoctorName
).
NotNull
().
NotEmpty
();
};
};
RuleSet
(
"Select"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Insert"
,
()
=>
RuleSet
(
"Insert"
,
()
=>
{
{
...
...
performance/Performance.EntityModels/Entity/cof_again.cs
View file @
b875151f
...
@@ -27,11 +27,6 @@ public class cof_again
...
@@ -27,11 +27,6 @@ public class cof_again
public
Nullable
<
int
>
AllotID
{
get
;
set
;
}
public
Nullable
<
int
>
AllotID
{
get
;
set
;
}
/// <summary>
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AgainAllotID
{
get
;
set
;
}
/// <summary>
/// 1 职称绩效 2 工作量绩效 3 满勤天数
/// 1 职称绩效 2 工作量绩效 3 满勤天数
/// </summary>
/// </summary>
public
Nullable
<
int
>
Type
{
get
;
set
;
}
public
Nullable
<
int
>
Type
{
get
;
set
;
}
...
...
performance/Performance.Services/AgainAllotService.cs
View file @
b875151f
...
@@ -74,12 +74,12 @@ public bool Generate(AgainAllotRequest request, UserIdentity user)
...
@@ -74,12 +74,12 @@ public bool Generate(AgainAllotRequest request, UserIdentity user)
perforPeragainallotRepository
.
Update
(
againAllot
,
p
=>
{
p
.
States
=
2
;
});
perforPeragainallotRepository
.
Update
(
againAllot
,
p
=>
{
p
.
States
=
2
;
});
//清理二次绩效无用数据
//清理二次绩效无用数据
configService
.
ClearAgain
(
againAllot
.
ID
);
configService
.
ClearAgain
(
againAllot
.
AllotID
.
Value
);
try
try
{
{
#
region
基础信息
#
region
基础信息
//获取基础配置信息
//获取基础配置信息
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
A
gainAllotID
==
againAllot
.
ID
);
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
A
llotID
==
againAllot
.
Allot
ID
);
var
jobfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
1
)?.
Value
;
var
jobfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
1
)?.
Value
;
var
workfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
2
)?.
Value
;
var
workfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
2
)?.
Value
;
var
days
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
3
)?.
Value
;
var
days
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
3
)?.
Value
;
...
...
performance/Performance.Services/ConfigService.cs
View file @
b875151f
...
@@ -345,9 +345,9 @@ public void Copy(per_allot allot)
...
@@ -345,9 +345,9 @@ public void Copy(per_allot allot)
/// 获取cof_drugprop列表
/// 获取cof_drugprop列表
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
List
<
cof_again
>
GetAgainList
(
int
a
gain
Id
)
public
List
<
cof_again
>
GetAgainList
(
int
a
llot
Id
)
{
{
var
list
=
_againRepository
.
GetEntities
(
t
=>
t
.
A
gainAllotID
==
again
Id
);
var
list
=
_againRepository
.
GetEntities
(
t
=>
t
.
A
llotID
==
allot
Id
);
return
list
;
return
list
;
}
}
...
@@ -358,10 +358,10 @@ public List<cof_again> GetAgainList(int againId)
...
@@ -358,10 +358,10 @@ public List<cof_again> GetAgainList(int againId)
/// <returns></returns>
/// <returns></returns>
public
cof_again
AgainInsert
(
CofAgainRequest
request
)
public
cof_again
AgainInsert
(
CofAgainRequest
request
)
{
{
var
workyear
=
Mapper
.
Map
<
cof_again
>(
request
);
var
again
=
Mapper
.
Map
<
cof_again
>(
request
);
if
(!
_againRepository
.
Add
(
workyear
))
if
(!
_againRepository
.
Add
(
again
))
throw
new
PerformanceException
(
"保存失败"
);
throw
new
PerformanceException
(
"保存失败"
);
return
workyear
;
return
again
;
}
}
/// <summary>
/// <summary>
...
@@ -414,12 +414,9 @@ public void ClearAgain(int againId)
...
@@ -414,12 +414,9 @@ public void ClearAgain(int againId)
/// 复制报表基础配置
/// 复制报表基础配置
/// </summary>
/// </summary>
/// <param name="iD"></param>
/// <param name="iD"></param>
public
void
CopyAgain
(
int
a
gaini
d
)
public
void
CopyAgain
(
int
a
llotI
d
)
{
{
var
again
=
perforPeragainallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
againid
);
var
allot
=
perforPerAllotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
again
==
null
)
throw
new
PerformanceException
(
"二次绩效不存在"
);
var
allot
=
perforPerAllotRepository
.
GetEntity
(
t
=>
t
.
ID
==
again
.
AllotID
);
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效不存在"
);
throw
new
PerformanceException
(
"绩效不存在"
);
...
@@ -432,22 +429,13 @@ public void CopyAgain(int againid)
...
@@ -432,22 +429,13 @@ public void CopyAgain(int againid)
}
}
List
<
cof_again
>
record
=
new
List
<
cof_again
>();
List
<
cof_again
>
record
=
new
List
<
cof_again
>();
//根据上月绩效获取二次绩效信息
//根据上月绩效获取二次绩效信息
var
beforeAgain
=
perforPeragainallotRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allot
.
ID
);
var
data
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
again
.
AllotID
!=
allot
.
ID
&&
beforeAgain
!=
null
)
if
(
data
==
null
||
data
.
Count
==
0
)
record
=
_againRepository
.
GetEntities
(
t
=>
t
.
AgainAllotID
==
beforeAgain
.
ID
);
if
(
record
==
null
||
record
.
Count
==
0
)
record
=
_againRepository
.
GetEntities
(
t
=>
t
.
AgainAllotID
==
-
1
);
var
againList
=
record
.
Select
(
t
=>
new
cof_again
{
{
AllotID
=
allot
.
ID
,
var
again
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
)
??
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
AgainAllotID
=
againid
,
var
newAgains
=
again
.
Select
(
t
=>
new
cof_again
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
Value
});
Type
=
t
.
Type
,
_againRepository
.
AddRange
(
newAgains
.
ToArray
());
TypeName
=
t
.
TypeName
,
}
Value
=
t
.
Value
});
_againRepository
.
AddRange
(
againList
.
ToArray
());
}
}
#
endregion
#
endregion
}
}
...
...
performance/Performance.Services/EmployeeService.cs
View file @
b875151f
...
@@ -22,6 +22,30 @@ public EmployeeService(PerforImemployeeRepository perforImemployeeRepository)
...
@@ -22,6 +22,30 @@ public EmployeeService(PerforImemployeeRepository perforImemployeeRepository)
}
}
/// <summary>
/// <summary>
///获取人员信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
im_employee
GetEmployee
(
EmployeeRequest
request
)
{
var
employee
=
perforImemployeeRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
employee
==
null
)
throw
new
PerformanceException
(
"该人员不存在"
);
return
employee
;
}
/// <summary>
///获取人员列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
List
<
im_employee
>
GetEmployeeList
(
int
allotId
)
{
var
employee
=
perforImemployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
employee
;
}
/// <summary>
/// 新增人员
/// 新增人员
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
...
@@ -34,7 +58,7 @@ public im_employee Insert(EmployeeRequest request)
...
@@ -34,7 +58,7 @@ public im_employee Insert(EmployeeRequest request)
}
}
/// <summary>
/// <summary>
/// 修改人员
/// 修改人员
信息
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -44,10 +68,23 @@ public im_employee Update(EmployeeRequest request)
...
@@ -44,10 +68,23 @@ public im_employee Update(EmployeeRequest request)
if
(
employee
==
null
)
if
(
employee
==
null
)
throw
new
PerformanceException
(
"该人员不存在"
);
throw
new
PerformanceException
(
"该人员不存在"
);
employee
.
AccountingUnit
=
request
.
AccountingUnit
;
employee
.
AccountingUnit
=
request
.
AccountingUnit
;
employee
.
Department
=
request
.
Department
??
employee
.
Department
;
employee
.
FitPeople
=
request
.
FitPeople
??
employee
.
FitPeople
;
employee
.
DoctorName
=
request
.
DoctorName
;
employee
.
DoctorName
=
request
.
DoctorName
;
employee
.
JobTitle
=
request
.
JobTitle
??
employee
.
JobTitle
;
employee
.
AccountType
=
request
.
AccountType
;
employee
.
Department
=
request
.
Department
;
employee
.
FitPeople
=
request
.
FitPeople
;
employee
.
JobTitle
=
request
.
JobTitle
;
employee
.
PostCoefficient
=
request
.
PostCoefficient
;
employee
.
WorkTime
=
request
.
WorkTime
;
employee
.
ScoreAverageRate
=
request
.
ScoreAverageRate
;
employee
.
Attendance
=
request
.
Attendance
;
employee
.
PeopleNumber
=
request
.
PeopleNumber
;
employee
.
Workload
=
request
.
Workload
;
employee
.
OtherPerfor
=
request
.
OtherPerfor
;
employee
.
Punishment
=
request
.
Punishment
;
employee
.
Adjust
=
request
.
Adjust
;
employee
.
Grant
=
request
.
Grant
;
//修改人员信息
perforImemployeeRepository
.
Update
(
employee
);
perforImemployeeRepository
.
Update
(
employee
);
return
employee
;
return
employee
;
}
}
...
@@ -59,7 +96,10 @@ public im_employee Update(EmployeeRequest request)
...
@@ -59,7 +96,10 @@ public im_employee Update(EmployeeRequest request)
/// <returns></returns>
/// <returns></returns>
public
bool
Delete
(
EmployeeRequest
request
)
public
bool
Delete
(
EmployeeRequest
request
)
{
{
var
employee
=
Mapper
.
Map
<
im_employee
>(
request
);
var
employee
=
perforImemployeeRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
null
==
employee
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
ID
}
"
);
return
perforImemployeeRepository
.
Remove
(
employee
);
return
perforImemployeeRepository
.
Remove
(
employee
);
}
}
}
}
...
...
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