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
27e9051f
Commit
27e9051f
authored
May 31, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医院其他绩效 录入科室 自动填充
parent
60f260d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
41 deletions
+92
-41
performance/Performance.Repository/PerforPerapramountRepository.cs
+49
-0
performance/Performance.Repository/Repository/PerforPerapramountRepository.cs
+0
-31
performance/Performance.Services/EmployeeService.cs
+43
-10
No files found.
performance/Performance.Repository/PerforPerapramountRepository.cs
0 → 100644
View file @
27e9051f
//-----------------------------------------------------------------------
// <copyright file=" per_apr_amount.cs">
// * FileName: per_apr_amount.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// per_apr_amount Repository
/// </summary>
public
partial
class
PerforPerapramountRepository
:
PerforRepository
<
per_apr_amount
>
{
public
List
<
view_per_apr_amount
>
GetFullAmount
(
Func
<
per_apr_amount
,
bool
>
predicate
)
{
var
employees
=
this
.
context
.
Set
<
per_employee
>().
AsEnumerable
();
var
amounts
=
this
.
context
.
Set
<
per_apr_amount
>().
Where
(
predicate
);
var
res
=
amounts
.
Join
(
employees
,
outer
=>
new
{
outer
.
AllotId
,
outer
.
PersonnelNumber
},
inner
=>
new
{
AllotId
=
inner
.
AllotId
??
0
,
inner
.
PersonnelNumber
},
(
outer
,
inner
)
=>
new
view_per_apr_amount
{
Id
=
outer
.
Id
,
AllotId
=
outer
.
AllotId
,
PersonnelNumber
=
outer
.
PersonnelNumber
,
DoctorName
=
outer
.
DoctorName
,
PerforType
=
outer
.
PerforType
,
Amount
=
outer
.
Amount
,
AccountingUnit
=
inner
.
AccountingUnit
,
UnitType
=
inner
.
UnitType
,
TypeInDepartment
=
outer
.
TypeInDepartment
,
Status
=
outer
.
Status
,
AuditTime
=
outer
.
AuditTime
,
AuditUser
=
outer
.
AuditUser
,
CreateDate
=
outer
.
CreateDate
,
CreateUser
=
outer
.
CreateUser
,
Remark
=
outer
.
Remark
,
IsVerify
=
outer
.
IsVerify
,
VerifyMessage
=
outer
.
VerifyMessage
,
});
return
res
.
ToList
()
??
new
List
<
view_per_apr_amount
>();
}
}
}
performance/Performance.Repository/Repository/PerforPerapramountRepository.cs
View file @
27e9051f
...
@@ -18,36 +18,5 @@ public partial class PerforPerapramountRepository : PerforRepository<per_apr_amo
...
@@ -18,36 +18,5 @@ public partial class PerforPerapramountRepository : PerforRepository<per_apr_amo
public
PerforPerapramountRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
public
PerforPerapramountRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
{
}
}
public
List
<
view_per_apr_amount
>
GetFullAmount
(
Func
<
per_apr_amount
,
bool
>
predicate
)
{
var
employees
=
this
.
context
.
Set
<
per_employee
>().
AsEnumerable
();
var
amounts
=
this
.
context
.
Set
<
per_apr_amount
>().
Where
(
predicate
);
var
res
=
amounts
.
Join
(
employees
,
outer
=>
new
{
outer
.
AllotId
,
outer
.
PersonnelNumber
},
inner
=>
new
{
AllotId
=
inner
.
AllotId
??
0
,
inner
.
PersonnelNumber
},
(
outer
,
inner
)
=>
new
view_per_apr_amount
{
Id
=
outer
.
Id
,
AllotId
=
outer
.
AllotId
,
PersonnelNumber
=
outer
.
PersonnelNumber
,
DoctorName
=
outer
.
DoctorName
,
PerforType
=
outer
.
PerforType
,
Amount
=
outer
.
Amount
,
AccountingUnit
=
inner
.
AccountingUnit
,
UnitType
=
inner
.
UnitType
,
TypeInDepartment
=
outer
.
TypeInDepartment
,
Status
=
outer
.
Status
,
AuditTime
=
outer
.
AuditTime
,
AuditUser
=
outer
.
AuditUser
,
CreateDate
=
outer
.
CreateDate
,
CreateUser
=
outer
.
CreateUser
,
Remark
=
outer
.
Remark
,
IsVerify
=
outer
.
IsVerify
,
VerifyMessage
=
outer
.
VerifyMessage
,
});
return
res
.
ToList
()
??
new
List
<
view_per_apr_amount
>();
}
}
}
}
}
performance/Performance.Services/EmployeeService.cs
View file @
27e9051f
...
@@ -31,9 +31,11 @@ public class EmployeeService : IAutoInjection
...
@@ -31,9 +31,11 @@ public class EmployeeService : IAutoInjection
private
PerforUserroleRepository
userroleRepository
;
private
PerforUserroleRepository
userroleRepository
;
private
PerforPeremployeeRepository
peremployeeRepository
;
private
PerforPeremployeeRepository
peremployeeRepository
;
private
PerforUserRepository
userRepository
;
private
PerforUserRepository
userRepository
;
private
readonly
PerforRoleRepository
_roleRepository
;
private
ILogger
<
EmployeeService
>
logger
;
private
ILogger
<
EmployeeService
>
logger
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforPerallotRepository
perforPerallotRepository
,
...
@@ -45,6 +47,7 @@ public class EmployeeService : IAutoInjection
...
@@ -45,6 +47,7 @@ public class EmployeeService : IAutoInjection
PerforUserroleRepository
userroleRepository
,
PerforUserroleRepository
userroleRepository
,
PerforPeremployeeRepository
peremployeeRepository
,
PerforPeremployeeRepository
peremployeeRepository
,
PerforUserRepository
userRepository
,
PerforUserRepository
userRepository
,
PerforRoleRepository
roleRepository
,
ILogger
<
EmployeeService
>
logger
)
ILogger
<
EmployeeService
>
logger
)
{
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
...
@@ -59,6 +62,7 @@ public class EmployeeService : IAutoInjection
...
@@ -59,6 +62,7 @@ public class EmployeeService : IAutoInjection
this
.
userroleRepository
=
userroleRepository
;
this
.
userroleRepository
=
userroleRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
this
.
userRepository
=
userRepository
;
this
.
userRepository
=
userRepository
;
_roleRepository
=
roleRepository
;
this
.
logger
=
logger
;
this
.
logger
=
logger
;
}
}
...
@@ -416,9 +420,12 @@ public bool InsertApr(per_apr_amount request, int userId)
...
@@ -416,9 +420,12 @@ public bool InsertApr(per_apr_amount request, int userId)
if
(
request
==
null
)
if
(
request
==
null
)
return
false
;
return
false
;
//var data = perapramountRepository.GetEntity(t => t.PersonnelNumber == request.PersonnelNumber && t.AllotId == request.AllotId);
if
(
string
.
IsNullOrEmpty
(
request
.
PersonnelNumber
))
//if (data != null)
throw
new
PerformanceException
(
"文件中存在“工号”为空的数据"
);
// throw new PerformanceException("人员工号已存在");
if
(
string
.
IsNullOrEmpty
(
request
.
PerforType
)
&&
request
.
Amount
!=
0
)
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
request
.
TypeInDepartment
=
GetTypeInDepartment
(
userId
);
request
.
Status
=
2
;
request
.
Status
=
2
;
request
.
CreateDate
=
DateTime
.
Now
;
request
.
CreateDate
=
DateTime
.
Now
;
request
.
CreateUser
=
userId
;
request
.
CreateUser
=
userId
;
...
@@ -430,6 +437,12 @@ public bool UpdateApr(per_apr_amount request)
...
@@ -430,6 +437,12 @@ public bool UpdateApr(per_apr_amount request)
if
(
request
==
null
)
if
(
request
==
null
)
return
false
;
return
false
;
if
(
string
.
IsNullOrEmpty
(
request
.
PersonnelNumber
))
throw
new
PerformanceException
(
"文件中存在“工号”为空的数据"
);
if
(
string
.
IsNullOrEmpty
(
request
.
PerforType
)
&&
request
.
Amount
!=
0
)
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
var
data
=
perapramountRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
var
data
=
perapramountRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
if
(
data
==
null
)
if
(
data
==
null
)
throw
new
PerformanceException
(
"修改数据无效"
);
throw
new
PerformanceException
(
"修改数据无效"
);
...
@@ -438,7 +451,6 @@ public bool UpdateApr(per_apr_amount request)
...
@@ -438,7 +451,6 @@ public bool UpdateApr(per_apr_amount request)
data
.
PersonnelNumber
=
request
.
PersonnelNumber
;
data
.
PersonnelNumber
=
request
.
PersonnelNumber
;
data
.
DoctorName
=
request
.
DoctorName
;
data
.
DoctorName
=
request
.
DoctorName
;
data
.
PerforType
=
request
.
PerforType
;
data
.
PerforType
=
request
.
PerforType
;
data
.
TypeInDepartment
=
request
.
TypeInDepartment
;
//data.AccountingUnit = request.AccountingUnit;
//data.AccountingUnit = request.AccountingUnit;
data
.
Amount
=
request
.
Amount
;
data
.
Amount
=
request
.
Amount
;
...
@@ -490,6 +502,27 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
...
@@ -490,6 +502,27 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
return
true
;
return
true
;
}
}
/// <summary>
/// 更加用户ID获取录入科室
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public
string
GetTypeInDepartment
(
int
userId
)
{
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未绑定角色"
);
string
typeIn
=
""
;
// 护士长/科主任/特殊科室/行政科室 录入科室为核算单元
if
(
new
int
[]
{
3
,
4
,
9
,
10
}.
Contains
(
userrole
.
RoleID
))
typeIn
=
userRepository
.
GetEntity
(
w
=>
w
.
ID
==
userId
)?.
Department
??
""
;
// 非 护士长/科主任/特殊科室/行政科室 则为角色名称
else
typeIn
=
_roleRepository
.
GetEntity
(
w
=>
w
.
ID
==
userrole
.
RoleID
)?.
RoleName
??
""
;
return
typeIn
;
}
public
void
ImpoerAprEmployees
(
int
allotid
,
string
path
,
int
userid
)
public
void
ImpoerAprEmployees
(
int
allotid
,
string
path
,
int
userid
)
{
{
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
...
@@ -532,7 +565,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -532,7 +565,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
Dictionary
<
string
,
int
>
dict
=
new
Dictionary
<
string
,
int
>
Dictionary
<
string
,
int
>
dict
=
new
Dictionary
<
string
,
int
>
{
{
{
"
录入科室"
,
-
1
},{
"核算单元"
,
-
1
},{
"
人员工号"
,
-
1
},
{
"姓名"
,
-
1
},
{
"绩效类型"
,
-
1
},
{
"金额"
,
-
1
},
{
"人员工号"
,
-
1
},
{
"姓名"
,
-
1
},
{
"绩效类型"
,
-
1
},
{
"金额"
,
-
1
},
};
};
foreach
(
var
key
in
dict
.
Keys
.
ToList
())
foreach
(
var
key
in
dict
.
Keys
.
ToList
())
...
@@ -543,7 +576,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -543,7 +576,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
var
entities
=
new
List
<
per_apr_amount
>();
var
entities
=
new
List
<
per_apr_amount
>();
var
createtime
=
DateTime
.
Now
;
var
createtime
=
DateTime
.
Now
;
var
typeIn
=
GetTypeInDepartment
(
userid
);
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
{
{
var
row
=
sheet
.
GetRow
(
rowindex
);
var
row
=
sheet
.
GetRow
(
rowindex
);
...
@@ -556,7 +589,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -556,7 +589,7 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
DoctorName
=
dict
[
"姓名"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
DoctorName
=
dict
[
"姓名"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
PerforType
=
dict
[
"绩效类型"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
PerforType
=
dict
[
"绩效类型"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
Amount
=
dict
[
"金额"
]
<
0
?
0
:
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"金额"
]).
GetValue
(),
0
),
Amount
=
dict
[
"金额"
]
<
0
?
0
:
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"金额"
]).
GetValue
(),
0
),
TypeInDepartment
=
dict
[
"录入科室"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"录入科室"
]).
GetValue
()
,
TypeInDepartment
=
typeIn
,
//AccountingUnit = dict["核算单元"] < 0 ? "" : row.GetCell(dict["核算单元"]).GetValue(),
//AccountingUnit = dict["核算单元"] < 0 ? "" : row.GetCell(dict["核算单元"]).GetValue(),
AllotId
=
allotid
,
AllotId
=
allotid
,
CreateDate
=
createtime
,
CreateDate
=
createtime
,
...
@@ -572,8 +605,8 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
...
@@ -572,8 +605,8 @@ public void ImpoerAprEmployees(int allotid, string path, int userid)
throw
new
PerformanceException
(
"文件中存在“工号”为空的数据"
);
throw
new
PerformanceException
(
"文件中存在“工号”为空的数据"
);
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
PerforType
)
&&
w
.
Amount
!=
0
))
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
PerforType
)
&&
w
.
Amount
!=
0
))
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
throw
new
PerformanceException
(
"文件中存在“绩效类型”为空的数据"
);
if
(
entities
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
TypeInDepartment
)
&&
w
.
Amount
!=
0
))
//
if (entities.Any(w => string.IsNullOrEmpty(w.TypeInDepartment) && w.Amount != 0))
throw
new
PerformanceException
(
"文件中存在“录入科室”为空的数据"
);
//
throw new PerformanceException("文件中存在“录入科室”为空的数据");
//var employees = peremployeeRepository.GetEntities(w => w.AllotId == allotid);
//var employees = peremployeeRepository.GetEntities(w => w.AllotId == allotid);
//foreach (var item in entities.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber)))
//foreach (var item in entities.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber)))
...
...
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