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
15e90cb5
Commit
15e90cb5
authored
Dec 17, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手工录入数据校验及导出
parent
7d4eccb7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
66 deletions
+51
-66
performance/Performance.Api/Controllers/EmployeeController.cs
+5
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+0
-5
performance/Performance.EntityModels/Entity/ex_result_gather.cs
+1
-1
performance/Performance.Services/EmployeeService.cs
+44
-58
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
15e90cb5
...
@@ -789,8 +789,12 @@ public ApiResponse SaveGatherHands([FromRoute] int allotId, [FromBody] SaveGathe
...
@@ -789,8 +789,12 @@ public ApiResponse SaveGatherHands([FromRoute] int allotId, [FromBody] SaveGathe
if
(
string
.
IsNullOrEmpty
(
request
.
Source
)
||
string
.
IsNullOrEmpty
(
request
.
Category
))
if
(
string
.
IsNullOrEmpty
(
request
.
Source
)
||
string
.
IsNullOrEmpty
(
request
.
Category
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
Fail
);
if
(
request
.
Data
==
null
||
!
request
.
Data
.
Any
())
return
new
ApiResponse
(
ResponseType
.
Fail
,
"用户提交数据为空"
);
employeeService
.
CheckGatherData
(
allotId
,
request
);
employeeService
.
SaveGatherHands
(
allotId
,
request
);
employeeService
.
SaveGatherHands
(
allotId
,
request
);
employeeService
.
CheckGatherData
(
allotId
);
employeeService
.
AddCategoryToConfig
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
15e90cb5
...
@@ -3624,11 +3624,6 @@
...
@@ -3624,11 +3624,6 @@
备注
备注
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ex_result_gather.States"
>
<summary>
1 未通过 2 通过
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ex_script"
>
<member
name=
"T:Performance.EntityModels.ex_script"
>
<summary>
<summary>
...
...
performance/Performance.EntityModels/Entity/ex_result_gather.cs
View file @
15e90cb5
...
@@ -49,6 +49,6 @@ public class ex_result_gather
...
@@ -49,6 +49,6 @@ public class ex_result_gather
/// <summary>
/// <summary>
/// 1 未通过 2 通过
/// 1 未通过 2 通过
/// </summary>
/// </summary>
public
int
States
{
get
;
set
;
}
//
public int States { get; set; }
}
}
}
}
performance/Performance.Services/EmployeeService.cs
View file @
15e90cb5
...
@@ -1442,56 +1442,38 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
...
@@ -1442,56 +1442,38 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
#
region
录入校验
#
region
录入校验
public
bool
CheckGatherData
(
int
allotId
)
public
void
CheckGatherData
(
int
allotId
,
SaveGatherData
saveGather
)
{
{
try
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
{
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在"
);
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在"
);
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
if
(
data
==
null
||
!
data
.
Any
())
throw
new
PerformanceException
(
"录入数据为空"
);
SetDataStatesAndRemark
(
data
,
2
,
string
.
Empty
);
var
departments
=
perdeptdicRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
);
if
(
departments
!=
null
&&
departments
.
Any
())
{
var
notExistsDeptData
=
data
.
Where
(
w
=>
!
departments
.
Select
(
t
=>
t
.
Department
).
Contains
(
w
.
Department
));
if
(
notExistsDeptData
!=
null
&&
notExistsDeptData
.
Any
())
SetDataStatesAndRemark
(
notExistsDeptData
,
1
,
"科室字典中不存在科室[{0}]"
,
t
=>
t
.
Department
);
}
var
employees
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
if
(
employees
!=
null
&&
employees
.
Any
())
{
var
notExistNameData
=
data
.
Where
(
w
=>
!
employees
.
Select
(
t
=>
t
.
DoctorName
).
Contains
(
w
.
DoctorName
)
&&
!
string
.
IsNullOrEmpty
(
w
.
DoctorName
));
if
(
notExistNameData
!=
null
&&
notExistNameData
.
Any
())
SetDataStatesAndRemark
(
notExistNameData
,
1
,
"人员字典中不存在医生名称[{0}]"
,
t
=>
t
.
DoctorName
);
var
notExistNumberData
=
data
.
Where
(
w
=>
!
employees
.
Select
(
t
=>
t
.
PersonnelNumber
).
Contains
(
w
.
PersonnelNumber
)
&&
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
));
var
data
=
saveGather
.
Data
;
if
(
notExistNumberData
!=
null
&&
notExistNumberData
.
Any
())
SetDataStatesAndRemark
(
notExistNumberData
,
1
,
"人员字典中不存在工号[{0}]"
,
t
=>
t
.
PersonnelNumber
);
}
var
sheets
=
perforPersheetRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allotId
);
if
(
sheets
!=
null
&&
sheets
.
Any
())
{
var
notExistsSourceData
=
data
.
Where
(
w
=>
!
sheets
.
Select
(
t
=>
t
.
SheetName
).
Contains
(
w
.
Source
));
if
(
notExistsSourceData
!=
null
&&
notExistsSourceData
.
Any
())
SetDataStatesAndRemark
(
notExistsSourceData
,
1
,
"来源中不存在名称[{0}]"
,
t
=>
t
.
Source
);
}
exresultgatherRepository
.
UpdateRange
(
data
.
ToArray
());
var
departments
=
perdeptdicRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
);
if
(
departments
!=
null
&&
departments
.
Any
())
{
var
notExistsDeptData
=
data
.
Where
(
w
=>
!
departments
.
Select
(
t
=>
t
.
Department
).
Contains
(
w
[
0
]));
if
(
notExistsDeptData
!=
null
&&
notExistsDeptData
.
Any
())
throw
new
PerformanceException
(
$"科室字典中不存在科室[
{
string
.
Join
(
","
,
notExistsDeptData
.
Select
(
t
=>
t
[
0
]).
Distinct
())}
]"
);
}
AddCategoryToConfig
(
data
,
allot
.
HospitalId
);
var
employees
=
peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
if
(
employees
!=
null
&&
employees
.
Any
())
{
var
notExistNameData
=
data
.
Where
(
w
=>
!
employees
.
Select
(
t
=>
t
.
DoctorName
).
Contains
(
w
[
1
])
&&
!
string
.
IsNullOrEmpty
(
w
[
1
]));
if
(
notExistNameData
!=
null
&&
notExistNameData
.
Any
())
throw
new
PerformanceException
(
$"人员字典中不存在医生姓名[
{
string
.
Join
(
","
,
notExistNameData
.
Select
(
t
=>
t
[
1
]).
Distinct
())}
]"
);
return
data
.
Any
(
w
=>
w
.
States
==
1
);
var
notExistNumberData
=
data
.
Where
(
w
=>
!
employees
.
Select
(
t
=>
t
.
PersonnelNumber
).
Contains
(
w
[
2
])
&&
!
string
.
IsNullOrEmpty
(
w
[
2
]));
if
(
notExistNumberData
!=
null
&&
notExistNumberData
.
Any
())
throw
new
PerformanceException
(
$"人员字典中不存在工号[
{
string
.
Join
(
","
,
notExistNumberData
.
Select
(
t
=>
t
[
2
]).
Distinct
())}
]"
);
}
}
catch
(
Exception
ex
)
var
sheets
=
perforPersheetRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allotId
);
if
(
sheets
!=
null
&&
sheets
.
Any
())
{
{
logger
.
LogError
(
ex
.
Message
);
if
(!
sheets
.
Select
(
t
=>
t
.
SheetName
).
Any
(
t
=>
t
.
Contains
(
saveGather
.
Source
)))
throw
new
PerformanceException
(
"校验失败
"
);
throw
new
PerformanceException
(
$"来源错误[
{
saveGather
.
Source
}
]
"
);
}
}
}
}
...
@@ -1506,18 +1488,19 @@ private static void SetDataStatesAndRemark(IEnumerable<ex_result_gather> data, i
...
@@ -1506,18 +1488,19 @@ private static void SetDataStatesAndRemark(IEnumerable<ex_result_gather> data, i
if
(
func
!=
null
)
if
(
func
!=
null
)
remark
=
string
.
Format
(
remark
,
func
.
Invoke
(
item
));
remark
=
string
.
Format
(
remark
,
func
.
Invoke
(
item
));
item
.
States
=
states
;
//
item.States = states;
item
.
Remark
=
(!
string
.
IsNullOrEmpty
(
item
.
Remark
)
&&
item
.
Remark
.
Length
>
0
)
?
item
.
Remark
+
", "
+
remark
:
remark
;
item
.
Remark
=
(!
string
.
IsNullOrEmpty
(
item
.
Remark
)
&&
item
.
Remark
.
Length
>
0
)
?
item
.
Remark
+
", "
+
remark
:
remark
;
}
}
}
}
p
rivate
void
AddCategoryToConfig
(
List
<
ex_result_gather
>
data
,
int
hospital
Id
)
p
ublic
void
AddCategoryToConfig
(
int
allot
Id
)
{
{
if
(
data
==
null
||
!
data
.
Any
(
w
=>
w
.
States
==
2
))
return
;
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
)
;
data
=
data
.
Where
(
w
=>
w
.
States
==
2
).
ToList
();
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
if
(
data
==
null
||
!
data
.
Any
())
return
;
var
modules
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
h
ospitalId
&&
w
.
SheetType
!=
(
int
)
SheetType
.
Income
);
var
modules
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
allot
.
H
ospitalId
&&
w
.
SheetType
!=
(
int
)
SheetType
.
Income
);
if
(
modules
==
null
||
!
modules
.
Any
())
return
;
if
(
modules
==
null
||
!
modules
.
Any
())
return
;
var
items
=
exitemRepository
.
GetEntities
(
w
=>
modules
.
Select
(
t
=>
t
.
Id
).
Distinct
().
Contains
(
w
.
ModuleId
??
0
));
var
items
=
exitemRepository
.
GetEntities
(
w
=>
modules
.
Select
(
t
=>
t
.
Id
).
Distinct
().
Contains
(
w
.
ModuleId
??
0
));
...
@@ -1528,16 +1511,16 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
...
@@ -1528,16 +1511,16 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
var
insertList
=
new
List
<
ex_item
>();
var
insertList
=
new
List
<
ex_item
>();
foreach
(
var
module
in
modules
)
foreach
(
var
module
in
modules
)
{
{
var
categories
=
data
.
Where
(
t
=>
t
.
Source
==
module
.
ModuleName
)?.
Select
(
t
=>
t
.
Category
).
Distinct
();
var
categories
=
data
.
Where
(
t
=>
module
.
ModuleName
.
Contains
(
t
.
Source
)
)?.
Select
(
t
=>
t
.
Category
).
Distinct
();
if
(
categories
==
null
||
!
categories
.
Any
())
continue
;
if
(
categories
==
null
||
!
categories
.
Any
())
continue
;
var
moduleItems
=
items
.
Where
(
w
=>
w
.
ModuleId
==
module
.
Id
)?.
Select
(
t
=>
t
.
ItemName
).
Distinct
();
var
moduleItems
=
items
.
Where
(
w
=>
w
.
ModuleId
==
module
.
Id
)?.
Select
(
t
=>
t
.
ItemName
).
Distinct
();
if
(
moduleItems
==
null
||
!
moduleItems
.
Any
())
continue
;
if
(
moduleItems
!=
null
&&
moduleItems
.
Any
())
categories
=
categories
.
Except
(
moduleItems
);
var
exceptCategories
=
categories
.
Except
(
moduleItems
);
if
(
categories
==
null
||
!
categories
.
Any
())
continue
;
if
(
exceptCategories
==
null
||
!
exceptCategories
.
Any
())
continue
;
insertList
.
AddRange
(
exceptC
ategories
.
Select
(
t
=>
new
ex_item
insertList
.
AddRange
(
c
ategories
.
Select
(
t
=>
new
ex_item
{
{
ModuleId
=
module
.
Id
,
ModuleId
=
module
.
Id
,
ItemName
=
t
,
ItemName
=
t
,
...
@@ -1553,15 +1536,18 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
...
@@ -1553,15 +1536,18 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
var
speacialCategories
=
data
.
Where
(
t
=>
t
.
Source
.
Contains
(
"特殊核算单元"
))?.
Select
(
t
=>
new
{
t
.
Category
,
t
.
Department
}).
Distinct
();
var
speacialCategories
=
data
.
Where
(
t
=>
t
.
Source
.
Contains
(
"特殊核算单元"
))?.
Select
(
t
=>
new
{
t
.
Category
,
t
.
Department
}).
Distinct
();
if
(
speacialCategories
==
null
||
!
speacialCategories
.
Any
())
return
;
if
(
speacialCategories
==
null
||
!
speacialCategories
.
Any
())
return
;
var
specials
=
exspecialRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
h
ospitalId
);
var
specials
=
exspecialRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
allot
.
H
ospitalId
);
if
(
specials
==
null
||
!
specials
.
Any
())
return
;
if
(
specials
==
null
||
!
specials
.
Any
())
return
;
var
list
=
speacialCategories
.
Where
(
w
=>
!
specials
.
Select
(
t
=>
t
.
Target
+
t
.
Department
).
Contains
(
w
.
Category
+
w
.
Department
));
var
list
=
(
specials
==
null
||
!
specials
.
Any
())
?
speacialCategories
:
speacialCategories
.
Where
(
w
=>
!
specials
.
Select
(
t
=>
t
.
Target
+
t
.
Department
).
Contains
(
w
.
Category
+
w
.
Department
));
if
(
list
==
null
||
!
list
.
Any
())
return
;
if
(
list
==
null
||
!
list
.
Any
())
return
;
exspecialRepository
.
AddRange
(
list
.
Select
(
t
=>
new
ex_special
exspecialRepository
.
AddRange
(
list
.
Select
(
t
=>
new
ex_special
{
{
HospitalId
=
h
ospitalId
,
HospitalId
=
allot
.
H
ospitalId
,
Department
=
t
.
Department
,
Department
=
t
.
Department
,
Target
=
t
.
Category
Target
=
t
.
Category
}).
ToArray
());
}).
ToArray
());
...
@@ -1575,10 +1561,10 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
...
@@ -1575,10 +1561,10 @@ private void AddCategoryToConfig(List<ex_result_gather> data, int hospitalId)
public
void
SyncDataToResult
(
int
allotId
)
public
void
SyncDataToResult
(
int
allotId
)
{
{
var
sheets
=
perforPersheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
new
[]
{
3
,
4
,
7
}.
Contains
(
t
.
SheetType
.
Value
));
var
sheets
=
perforPersheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
new
[]
{
3
,
4
,
7
}.
Contains
(
t
.
SheetType
.
Value
));
if
(
sheets
==
null
||
sheets
.
Any
())
return
;
if
(
sheets
==
null
||
!
sheets
.
Any
())
return
;
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
if
(
data
==
null
||
!
data
.
Any
()
||
data
.
Any
(
w
=>
w
.
States
==
1
)
)
return
;
if
(
data
==
null
||
!
data
.
Any
())
return
;
var
syncData
=
_mapper
.
Map
<
List
<
ex_result
>>(
data
);
var
syncData
=
_mapper
.
Map
<
List
<
ex_result
>>(
data
);
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
15e90cb5
...
@@ -197,7 +197,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
...
@@ -197,7 +197,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
{
{
var
departments
=
data
.
Select
(
s
=>
s
.
Department
??
""
)
/*.Where(w => !string.IsNullOrEmpty(w))*/
.
Distinct
().
ToList
();
var
departments
=
data
.
Select
(
s
=>
s
.
Department
??
""
)
/*.Where(w => !string.IsNullOrEmpty(w))*/
.
Distinct
().
ToList
();
var
filed
=
new
Dictionary
<
string
,
Func
<
ExtractTransDto
,
string
>>()
;
var
filed
=
fieldOut
;
if
(
sheetType
==
SheetType
.
Income
)
if
(
sheetType
==
SheetType
.
Income
)
{
{
if
(
sheet
.
SheetName
.
Contains
(
"住院"
)
||
sheet
.
SheetName
.
Contains
(
"门诊"
))
if
(
sheet
.
SheetName
.
Contains
(
"住院"
)
||
sheet
.
SheetName
.
Contains
(
"门诊"
))
...
...
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