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
0b80d627
Commit
0b80d627
authored
May 08, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人事科 权限 修改
parent
cef7e40f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
233 additions
and
12 deletions
+233
-12
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+1
-1
performance/Performance.Repository/PerforCofdirectorRepository.cs
+20
-0
performance/Performance.Services/AllotCompute/QueryDataService.cs
+184
-0
performance/Performance.Services/AllotService.cs
+18
-11
performance/Performance.Services/ConfigService.cs
+10
-0
No files found.
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
0b80d627
...
...
@@ -142,7 +142,7 @@ public AutoMapperConfigs()
.
ForMember
(
dest
=>
dest
.
Effic
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
DoctorEffic
))
.
ForMember
(
dest
=>
dest
.
Grant
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
DoctorGrant
));
CreateMap
<
PerDataSpecialUnit
,
im_specialunit
>();
CreateMap
<
PerDataSpecialUnit
,
im_specialunit
>()
.
ReverseMap
()
;
//CreateMap<PerDataAccountDoctor, res_accountdoctor>();
//CreateMap<PerDataAccountNurse, res_accountnurse>();
//CreateMap<res_accountdoctor, PerDataAccountBaisc>();
...
...
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
0b80d627
...
...
@@ -43,6 +43,26 @@ public int DeleteData(int allotId)
return
Execute
(
sql
,
new
{
allotId
});
}
public
int
DeleteResData
(
int
allotId
)
{
List
<
string
>
tableArray
=
new
List
<
string
>
{
"res_account"
,
"res_accountdoctor"
,
"res_accountnurse"
,
"res_baiscnorm"
,
"res_compute"
,
"res_specialunit"
,
"log_check"
,
"log_dbug"
,
};
string
sql
=
""
;
tableArray
.
ForEach
(
t
=>
sql
+=
$"delete from
{
t
}
where allotid=@allotId;"
);
sql
+=
"delete from per_sheet where allotid=@allotId and source=2;"
;
return
Execute
(
sql
,
new
{
allotId
});
}
public
int
DelAgain
(
int
againid
)
{
List
<
string
>
tableArray
=
new
List
<
string
>
...
...
performance/Performance.Services/AllotCompute/QueryDataService.cs
0 → 100644
View file @
0b80d627
using
AutoMapper
;
using
Microsoft.EntityFrameworkCore.Internal
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services.AllotCompute
{
public
class
QueryDataService
:
IAutoInjection
{
private
readonly
LogManageService
logManageService
;
private
readonly
PerforPersheetRepository
persheetRepository
;
private
readonly
PerforImemployeeRepository
imemployeeRepository
;
private
readonly
PerforImemployeeclinicRepository
imemployeeclinicRepository
;
private
readonly
PerforImaccountbasicRepository
imaccountbasicRepository
;
private
readonly
PerforImspecialunitRepository
imspecialunitRepository
;
private
readonly
PerforImdataRepository
imdataRepository
;
private
readonly
PerforImheaderRepository
imheaderRepository
;
public
QueryDataService
(
LogManageService
logManageService
,
PerforPersheetRepository
persheetRepository
,
PerforImemployeeRepository
imemployeeRepository
,
PerforImemployeeclinicRepository
imemployeeclinicRepository
,
PerforImaccountbasicRepository
imaccountbasicRepository
,
PerforImspecialunitRepository
imspecialunitRepository
,
PerforImdataRepository
imdataRepository
,
PerforImheaderRepository
imheaderRepository
)
{
this
.
logManageService
=
logManageService
;
this
.
persheetRepository
=
persheetRepository
;
this
.
imemployeeRepository
=
imemployeeRepository
;
this
.
imemployeeclinicRepository
=
imemployeeclinicRepository
;
this
.
imaccountbasicRepository
=
imaccountbasicRepository
;
this
.
imspecialunitRepository
=
imspecialunitRepository
;
this
.
imdataRepository
=
imdataRepository
;
this
.
imheaderRepository
=
imheaderRepository
;
}
public
PerExcel
QueryDataAndHeader
(
per_allot
allot
)
{
var
sheetTypes
=
new
List
<
int
>
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
Income
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Overtime
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
,
(
int
)
SheetType
.
AccountBasic
,
(
int
)
SheetType
.
ClinicEmployee
,
};
var
sheets
=
persheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
sheetTypes
.
Contains
(
t
.
SheetType
.
Value
));
return
Query
(
sheets
,
allot
.
ID
);
}
private
PerExcel
Query
(
List
<
per_sheet
>
sheets
,
int
allotId
)
{
if
(
sheets
==
null
||
!
sheets
.
Any
())
throw
new
Exception
(
"未查询到数据"
);
var
allheader
=
imheaderRepository
.
GetEntities
(
t
=>
sheets
.
Select
(
s
=>
s
.
ID
).
Contains
(
t
.
SheetID
.
Value
));
if
(
allheader
==
null
||
!
allheader
.
Any
())
throw
new
Exception
(
"未获取到列"
);
var
perExcel
=
new
PerExcel
{
PerSheet
=
new
List
<
PerSheet
>()
};
sheets
.
ForEach
(
t
=>
{
perExcel
.
PerSheet
.
Add
(
new
PerSheet
{
SheetName
=
t
.
SheetName
,
SheetType
=
(
SheetType
)
t
.
SheetType
,
PerData
=
new
List
<
IPerData
>(),
PerHeader
=
new
List
<
PerHeader
>()
});
;
});
foreach
(
var
sheet
in
perExcel
.
PerSheet
)
{
var
imSheet
=
sheets
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
SheetType
==
(
int
)
sheet
.
SheetType
);
logManageService
.
WriteMsg
(
"获取基础数据"
,
$"开始查询数据 --
{
sheet
.
SheetName
}
"
,
1
,
allotId
,
"ReceiveMessage"
,
true
);
if
(
sheet
.
SheetType
==
SheetType
.
Employee
)
{
QueryHeader
(
allotId
,
imSheet
.
ID
,
allheader
,
sheet
);
QueryEmployee
(
allotId
,
imSheet
.
ID
,
sheet
);
}
else
if
(
sheet
.
SheetType
==
SheetType
.
ClinicEmployee
)
{
QueryHeader
(
allotId
,
imSheet
.
ID
,
allheader
,
sheet
);
QueryClinicEmployee
(
allotId
,
imSheet
.
ID
,
sheet
);
}
else
if
(
sheet
.
SheetType
==
SheetType
.
AccountBasic
)
{
QueryHeader
(
allotId
,
imSheet
.
ID
,
allheader
,
sheet
);
QueryAccountBasic
(
allotId
,
imSheet
.
ID
,
sheet
);
}
else
if
(
sheet
.
SheetType
==
SheetType
.
SpecialUnit
)
{
QueryHeader
(
allotId
,
imSheet
.
ID
,
allheader
,
sheet
);
QuerySpecialUnit
(
allotId
,
imSheet
.
ID
,
sheet
);
}
else
{
QueryHeader
(
allotId
,
imSheet
.
ID
,
allheader
,
sheet
);
QueryCommon
(
allotId
,
imSheet
.
ID
,
sheet
);
}
}
logManageService
.
WriteMsg
(
"保存基础数据"
,
$"基础数据保存完成!"
,
1
,
allotId
,
"ReceiveMessage"
,
true
);
return
perExcel
;
}
private
void
QueryEmployee
(
int
allotId
,
int
sheetId
,
PerSheet
sheet
)
{
var
data
=
imemployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
);
var
sheetData
=
Mapper
.
Map
<
List
<
PerDataEmployee
>>(
data
);
if
(
sheetData
!=
null
&&
sheetData
.
Any
())
sheet
.
PerData
.
AddRange
(
sheetData
);
}
private
void
QueryClinicEmployee
(
int
allotId
,
int
sheetId
,
PerSheet
sheet
)
{
var
data
=
imemployeeclinicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
);
var
sheetData
=
Mapper
.
Map
<
List
<
PerDataClinicEmployee
>>(
data
);
if
(
sheetData
!=
null
&&
sheetData
.
Any
())
sheet
.
PerData
.
AddRange
(
sheetData
);
}
private
void
QueryAccountBasic
(
int
allotId
,
int
sheetId
,
PerSheet
sheet
)
{
var
data
=
imaccountbasicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
);
var
sheetData
=
Mapper
.
Map
<
List
<
PerDataAccountBaisc
>>(
data
);
if
(
sheetData
!=
null
&&
sheetData
.
Any
())
sheet
.
PerData
.
AddRange
(
sheetData
);
}
private
void
QuerySpecialUnit
(
int
allotId
,
int
sheetId
,
PerSheet
sheet
)
{
var
data
=
imspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
);
var
sheetData
=
Mapper
.
Map
<
List
<
PerDataSpecialUnit
>>(
data
);
if
(
sheetData
!=
null
&&
sheetData
.
Any
())
sheet
.
PerData
.
AddRange
(
sheetData
);
}
private
void
QueryCommon
(
int
allotId
,
int
sheetId
,
PerSheet
sheet
)
{
var
data
=
imdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
);
var
sheetData
=
Mapper
.
Map
<
List
<
PerData
>>(
data
);
if
(
sheetData
!=
null
&&
sheetData
.
Any
())
sheet
.
PerData
.
AddRange
(
sheetData
);
}
private
void
QueryHeader
(
int
allotId
,
int
sheetId
,
List
<
im_header
>
allheader
,
PerSheet
sheet
)
{
var
perHeaders
=
new
List
<
PerHeader
>();
var
headers
=
allheader
.
Where
(
t
=>
(
t
.
ParentID
??
0
)
==
0
&&
t
.
SheetID
==
sheetId
).
ToList
();
sheet
.
PerHeader
=
GetHeaderAndChild
(
headers
,
allheader
,
perHeaders
);
}
private
List
<
PerHeader
>
GetHeaderAndChild
(
List
<
im_header
>
headers
,
List
<
im_header
>
allheaders
,
List
<
PerHeader
>
perHeaders
)
{
foreach
(
var
header
in
headers
)
{
var
perHeader
=
Mapper
.
Map
<
PerHeader
>(
header
);
var
children
=
allheaders
.
Where
(
t
=>
t
.
ParentID
==
header
.
ID
);
if
(
children
!=
null
&&
children
.
Any
())
{
perHeader
.
Children
=
GetHeaderAndChild
(
children
.
ToList
(),
allheaders
,
perHeaders
);
}
perHeaders
.
Add
(
perHeader
);
}
return
perHeaders
;
}
}
}
performance/Performance.Services/AllotService.cs
View file @
0b80d627
...
...
@@ -41,6 +41,7 @@ public class AllotService : IAutoInjection
//private readonly IHubContext<AllotLogHub> hubContext;
private
readonly
LogManageService
logManageService
;
private
readonly
ReportService
reportService
;
private
readonly
QueryDataService
queryDataService
;
public
AllotService
(
PerforPerallotRepository
allotRepository
,
BaiscNormService
baiscNormService
,
...
...
@@ -61,7 +62,8 @@ public class AllotService : IAutoInjection
//IHubContext<AllotLogHub> hubContext
LogManageService
logManageService
,
ReportService
reportService
,
PerforCofdirectorRepository
perforCofdirectorRepository
)
PerforCofdirectorRepository
perforCofdirectorRepository
,
QueryDataService
queryDataService
)
{
_allotRepository
=
allotRepository
;
_againallotRepository
=
againallotRepository
;
...
...
@@ -84,6 +86,7 @@ public class AllotService : IAutoInjection
this
.
logManageService
=
logManageService
;
this
.
reportService
=
reportService
;
this
.
perforCofdirectorRepository
=
perforCofdirectorRepository
;
this
.
queryDataService
=
queryDataService
;
}
#
region
基础功能
...
...
@@ -256,19 +259,23 @@ public void Generate(per_allot allot, string mail)
try
{
logManageService
.
WriteMsg
(
"绩效开始执行"
,
$"正在生成
{
allot
.
Year
}
-
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月份绩效!"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
configService
.
Clear
(
allot
.
ID
);
// 导出数据
var
excel
=
importDataService
.
ReadDataAndSave
(
allot
);
//configService.Clear(allot.ID);
//// 导出数据
//var excel = importDataService.ReadDataAndSave(allot);
configService
.
ClearResData
(
allot
.
ID
);
var
excel
=
queryDataService
.
QueryDataAndHeader
(
allot
);
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InCheckData
,
EnumHelper
.
GetDescription
(
AllotStates
.
InCheckData
));
if
(!
checkDataService
.
Check
(
excel
,
allot
))
{
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
CheckFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
CheckFail
));
//SendEmail(allot, mail, 3, time);
logManageService
.
WriteMsg
(
"绩效数据校验失败"
,
"详情可至“更多 -- 查看日志”查看"
,
3
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
return
;
}
//
if (!checkDataService.Check(excel, allot))
//
{
//
UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail));
//
//SendEmail(allot, mail, 3, time);
//
logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true);
//
return;
//
}
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InGenerate
,
EnumHelper
.
GetDescription
(
AllotStates
.
InGenerate
));
...
...
performance/Performance.Services/ConfigService.cs
View file @
0b80d627
...
...
@@ -575,6 +575,16 @@ public void Clear(int allotId)
}
/// <summary>
/// 清除核算数据
/// </summary>
/// <param name="allotId"></param>
public
void
ClearResData
(
int
allotId
)
{
var
count
=
_directorRepository
.
DeleteResData
(
allotId
);
logManageService
.
WriteMsg
(
"清理无效数据"
,
$"清理无效数据,受影响行数:
{
count
}
"
,
1
,
allotId
,
"ReceiveMessage"
,
true
);
}
/// <summary>
/// 清除二次绩效中无效数据
/// </summary>
/// <param name="againId"></param>
...
...
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