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
8ff3a8a6
Commit
8ff3a8a6
authored
Jun 14, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
合并梧州版
parents
f9311a0e
9dc0c4ab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
48 deletions
+67
-48
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.EntityModels/Entity/ex_script.cs
+5
-0
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+5
-1
performance/Performance.Services/ExtractExcelService/ExtractJobService.cs
+2
-1
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+47
-43
performance/Performance.Services/ExtractExcelService/QueryService.cs
+2
-2
performance/Performance.Services/PersonService.cs
+1
-1
No files found.
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
8ff3a8a6
...
@@ -3719,6 +3719,11 @@
...
@@ -3719,6 +3719,11 @@
语句执行完成所需时间
语句执行完成所需时间
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ex_script.IsOrgDepartment"
>
<summary>
是否使用原始科室 1 是 2 否
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ex_special"
>
<member
name=
"T:Performance.EntityModels.ex_special"
>
<summary>
<summary>
...
...
performance/Performance.EntityModels/Entity/ex_script.cs
View file @
8ff3a8a6
...
@@ -59,5 +59,10 @@ public class ex_script
...
@@ -59,5 +59,10 @@ public class ex_script
/// 语句执行完成所需时间
/// 语句执行完成所需时间
/// </summary>
/// </summary>
public
decimal
TimeConsuming
{
get
;
set
;
}
=
0
;
public
decimal
TimeConsuming
{
get
;
set
;
}
=
0
;
/// <summary>
/// 是否使用原始科室 1 是 2 否
/// </summary>
public
int
IsOrgDepartment
{
get
;
set
;
}
}
}
}
}
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
8ff3a8a6
...
@@ -234,7 +234,11 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
...
@@ -234,7 +234,11 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
var
row
=
sheet
.
GetOrCreate
(
dataFirstRowNum
);
var
row
=
sheet
.
GetOrCreate
(
dataFirstRowNum
);
for
(
int
cellIndex
=
point
.
HeaderFirstCellNum
.
Value
;
cellIndex
<
columnHeader
.
LastCellNum
;
cellIndex
++)
for
(
int
cellIndex
=
point
.
HeaderFirstCellNum
.
Value
;
cellIndex
<
columnHeader
.
LastCellNum
;
cellIndex
++)
{
{
var
column
=
columnHeader
.
GetCell
(
cellIndex
).
GetDecodeEscapes
()?.
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
var
column
=
columnHeader
.
GetCell
(
cellIndex
).
GetDecodeEscapes
();
List
<
string
>
uts
=
new
List
<
string
>
{
"核算单元(医技组)"
,
"核算单元(医生组)"
,
"核算单元(护理组)"
};
if
(
uts
.
Contains
(
column
))
column
=
column
?.
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
var
cell
=
row
.
CreateCell
(
cellIndex
);
var
cell
=
row
.
CreateCell
(
cellIndex
);
if
(
filed
.
ContainsKey
(
column
))
if
(
filed
.
ContainsKey
(
column
))
...
...
performance/Performance.Services/ExtractExcelService/ExtractJobService.cs
View file @
8ff3a8a6
...
@@ -79,10 +79,11 @@ public void Execute()
...
@@ -79,10 +79,11 @@ public void Execute()
if
(
allot
==
null
||
allot
.
ID
==
0
)
continue
;
if
(
allot
==
null
||
allot
.
ID
==
0
)
continue
;
var
dict
=
new
Dictionary
<
ExDataDict
,
object
>();
var
dict
=
new
Dictionary
<
ExDataDict
,
object
>();
var
scripts
=
new
List
<
ex_script
>();
var
isSingle
=
hospital
.
IsSingleProject
==
1
;
var
isSingle
=
hospital
.
IsSingleProject
==
1
;
dictionaryService
.
Handler
(
hospital
.
ID
,
allot
,
""
,
isSingle
);
dictionaryService
.
Handler
(
hospital
.
ID
,
allot
,
""
,
isSingle
);
var
data
=
queryService
.
Handler
(
hospital
.
ID
,
allot
,
""
,
isSingle
,
ref
dict
);
var
data
=
queryService
.
Handler
(
hospital
.
ID
,
allot
,
""
,
isSingle
,
ref
dict
,
ref
scripts
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
8ff3a8a6
...
@@ -97,6 +97,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
...
@@ -97,6 +97,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
allot
=
allots
.
First
(
t
=>
t
.
ID
==
allotId
);
allot
=
allots
.
First
(
t
=>
t
.
ID
==
allotId
);
var
dict
=
new
Dictionary
<
ExDataDict
,
object
>();
var
dict
=
new
Dictionary
<
ExDataDict
,
object
>();
var
scripts
=
new
List
<
ex_script
>();
logService
.
ReturnTheLog
(
allotId
,
groupName
,
3
,
""
,
5
,
1
,
isSingle
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
3
,
""
,
5
,
1
,
isSingle
);
...
@@ -106,8 +107,9 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
...
@@ -106,8 +107,9 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
employeeService
.
SyncDataToResult
(
allotId
);
employeeService
.
SyncDataToResult
(
allotId
);
var
data
=
exresultRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
data
=
exresultRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
data
.
AddRange
(
queryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
,
ref
dict
));
var
standData
=
StandDataFormat
(
hospitalId
,
allotId
,
data
);
data
.
AddRange
(
queryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
,
ref
dict
,
ref
scripts
));
var
standData
=
StandDataFormat
(
hospitalId
,
allotId
,
scripts
,
data
);
dictionaryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
);
dictionaryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
);
...
@@ -279,7 +281,7 @@ private object GetDataBySheetType(int hospitalId, SheetType sheetType, List<Extr
...
@@ -279,7 +281,7 @@ private object GetDataBySheetType(int hospitalId, SheetType sheetType, List<Extr
/// <param name="hospitalId"></param>
/// <param name="hospitalId"></param>
/// <param name="results"></param>
/// <param name="results"></param>
/// <returns></returns>
/// <returns></returns>
private
List
<
ExtractTransDto
>
StandDataFormat
(
int
hospitalId
,
int
allotId
,
List
<
ex_result
>
results
)
private
List
<
ExtractTransDto
>
StandDataFormat
(
int
hospitalId
,
int
allotId
,
List
<
ex_
script
>
scripts
,
List
<
ex_
result
>
results
)
{
{
if
(
results
==
null
||
!
results
.
Any
())
return
new
List
<
ExtractTransDto
>();
if
(
results
==
null
||
!
results
.
Any
())
return
new
List
<
ExtractTransDto
>();
...
@@ -306,51 +308,53 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, int allotId, List<
...
@@ -306,51 +308,53 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, int allotId, List<
dict
.
ForEach
(
t
=>
dict
.
ForEach
(
t
=>
{
{
t
.
HISDeptName
=
WriteDataHelper
.
HasValue
(
t
.
HISDeptName
,
t
.
Department
);
t
.
Department
=
WriteDataHelper
.
HasValue
(
t
.
Department
,
t
.
HISDeptName
);
});
});
var
data
=
new
List
<
ExtractTransDto
>();
foreach
(
var
item
in
results
)
{
var
firstDic
=
dict
.
FirstOrDefault
(
w
=>
w
.
HISDeptName
==
item
.
Department
)
??
dict
.
FirstOrDefault
(
w
=>
w
.
Department
==
item
.
Department
);
var
dept
=
!
string
.
IsNullOrEmpty
(
firstDic
?.
Department
)
?
firstDic
?.
Department
:
item
.
Department
;
var
d
=
new
ExtractTransDto
{
SheetName
=
item
.
Source
,
Department
=
dept
,
Category
=
item
.
Category
,
DoctorName
=
item
.
DoctorName
,
PersonnelNumber
=
item
.
PersonnelNumber
,
Value
=
item
.
Fee
??
0
,
OutDoctorAccounting
=
firstDic
?.
OutDoctorAccounting
?.
AccountingUnit
,
OutNurseAccounting
=
firstDic
?.
OutNurseAccounting
?.
AccountingUnit
,
OutTechnicAccounting
=
firstDic
?.
OutTechnicAccounting
?.
AccountingUnit
,
InpatDoctorAccounting
=
firstDic
?.
InpatDoctorAccounting
?.
AccountingUnit
,
InpatNurseAccounting
=
firstDic
?.
InpatNurseAccounting
?.
AccountingUnit
,
InpatTechnicAccounting
=
firstDic
?.
InpatTechnicAccounting
?.
AccountingUnit
,
SpecialAccounting
=
firstDic
?.
SpecialAccounting
?.
AccountingUnit
??
dept
,
EName
=
types
.
FirstOrDefault
(
w
=>
w
.
Id
==
item
.
TypeId
)?.
EName
,
};
data
.
Add
(
d
);
}
var
groupdata
=
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
Category
,
t
.
SheetName
})
var
data
=
results
.
Select
(
t
=>
new
ExtractTransDto
.
GroupJoin
(
dict
,
outer
=>
new
{
Department
=
outer
.
Department
},
inner
=>
new
{
Department
=
inner
.
HISDeptName
},
(
outer
,
inner
)
=>
new
{
outer
,
inner
})
.
Select
(
t
=>
{
{
SheetName
=
t
.
Key
.
SheetName
,
var
dept
=
!
string
.
IsNullOrEmpty
(
t
.
inner
.
FirstOrDefault
()?.
Department
)
?
t
.
inner
.
FirstOrDefault
()?.
Department
:
t
.
outer
.
Department
;
Department
=
t
.
Key
.
Department
,
if
(
scripts
.
Any
(
w
=>
w
.
TypeId
==
t
.
outer
.
TypeId
&&
w
.
IsOrgDepartment
==
1
))
Category
=
t
.
Key
.
Category
,
dept
=
t
.
outer
.
Department
;
Value
=
t
.
Sum
(
group
=>
group
.
Value
)
==
0
?
null
:
t
.
Sum
(
group
=>
group
.
Value
),
OutDoctorAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutDoctorAccounting
))?.
OutDoctorAccounting
,
return
new
ExtractTransDto
OutNurseAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutNurseAccounting
))?.
OutNurseAccounting
,
{
OutTechnicAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutTechnicAccounting
))?.
OutTechnicAccounting
,
SheetName
=
t
.
outer
.
Source
,
InpatDoctorAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatDoctorAccounting
))?.
InpatDoctorAccounting
,
Department
=
dept
,
InpatNurseAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatNurseAccounting
))?.
InpatNurseAccounting
,
Category
=
t
.
outer
.
Category
,
InpatTechnicAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatTechnicAccounting
))?.
InpatTechnicAccounting
,
DoctorName
=
t
.
outer
.
DoctorName
,
SpecialAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
SpecialAccounting
))?.
SpecialAccounting
,
PersonnelNumber
=
t
.
outer
.
PersonnelNumber
,
EName
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
EName
))?.
EName
Value
=
t
.
outer
.
Fee
??
0
,
OutDoctorAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutDoctorAccounting
?.
AccountingUnit
,
OutNurseAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutNurseAccounting
?.
AccountingUnit
,
OutTechnicAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutTechnicAccounting
?.
AccountingUnit
,
InpatDoctorAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatDoctorAccounting
?.
AccountingUnit
,
InpatNurseAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatNurseAccounting
?.
AccountingUnit
,
InpatTechnicAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatTechnicAccounting
?.
AccountingUnit
,
SpecialAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
SpecialAccounting
?.
AccountingUnit
??
dept
,
EName
=
types
.
FirstOrDefault
(
w
=>
w
.
Id
==
t
.
outer
.
TypeId
)?.
EName
,
};
});
});
return
groupdata
.
ToList
();
var
groupdata
=
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
Category
,
t
.
SheetName
}).
Select
(
t
=>
new
ExtractTransDto
{
SheetName
=
t
.
Key
.
SheetName
,
Department
=
t
.
Key
.
Department
,
Category
=
t
.
Key
.
Category
,
Value
=
t
.
Sum
(
group
=>
group
.
Value
)
==
0
?
null
:
t
.
Sum
(
group
=>
group
.
Value
),
OutDoctorAccounting
=
t
.
FirstOrDefault
()?.
OutDoctorAccounting
,
OutNurseAccounting
=
t
.
FirstOrDefault
()?.
OutNurseAccounting
,
OutTechnicAccounting
=
t
.
FirstOrDefault
()?.
OutTechnicAccounting
,
InpatDoctorAccounting
=
t
.
FirstOrDefault
()?.
InpatDoctorAccounting
,
InpatNurseAccounting
=
t
.
FirstOrDefault
()?.
InpatNurseAccounting
,
InpatTechnicAccounting
=
t
.
FirstOrDefault
()?.
InpatTechnicAccounting
,
SpecialAccounting
=
t
.
FirstOrDefault
()?.
SpecialAccounting
,
EName
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
EName
))?.
EName
});
return
groupdata
.
Where
(
w
=>
w
.
Value
.
HasValue
&&
w
.
Value
!=
0
).
ToList
();
}
}
private
void
UpdateAllot
(
IDbConnection
connection
,
per_allot
allot
)
private
void
UpdateAllot
(
IDbConnection
connection
,
per_allot
allot
)
...
...
performance/Performance.Services/ExtractExcelService/QueryService.cs
View file @
8ff3a8a6
...
@@ -75,7 +75,7 @@ public void ClearConnectionPools()
...
@@ -75,7 +75,7 @@ public void ClearConnectionPools()
/// <param name="hospitalId"></param>
/// <param name="hospitalId"></param>
/// <param name="allot"></param>
/// <param name="allot"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
ex_result
>
Handler
(
int
hospitalId
,
per_allot
allot
,
string
groupName
,
bool
isSingle
,
ref
Dictionary
<
ExDataDict
,
object
>
dict
)
public
List
<
ex_result
>
Handler
(
int
hospitalId
,
per_allot
allot
,
string
groupName
,
bool
isSingle
,
ref
Dictionary
<
ExDataDict
,
object
>
dict
,
ref
List
<
ex_script
>
scripts
)
{
{
try
try
{
{
...
@@ -94,7 +94,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
...
@@ -94,7 +94,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"开始提取数据"
,
isSingle
:
isSingle
);
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"开始提取数据"
,
isSingle
:
isSingle
);
var
scripts
=
exscriptRepository
.
GetEntities
(
t
=>
extypeIds
.
Contains
(
t
.
TypeId
));
scripts
=
exscriptRepository
.
GetEntities
(
t
=>
extypeIds
.
Contains
(
t
.
TypeId
));
if
(
scripts
!=
null
&&
scripts
.
Any
())
if
(
scripts
!=
null
&&
scripts
.
Any
())
{
{
var
allmodules
=
dict
[
ExDataDict
.
ExModule
]
as
List
<
ex_module
>;
var
allmodules
=
dict
[
ExDataDict
.
ExModule
]
as
List
<
ex_module
>;
...
...
performance/Performance.Services/PersonService.cs
View file @
8ff3a8a6
...
@@ -450,7 +450,7 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam
...
@@ -450,7 +450,7 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam
CreateTime
=
t
.
Max
(
group
=>
group
.
CreateTime
),
CreateTime
=
t
.
Max
(
group
=>
group
.
CreateTime
),
IsVerify
=
t
.
Min
(
w
=>
w
.
IsVerify
)
??
1
,
IsVerify
=
t
.
Min
(
w
=>
w
.
IsVerify
)
??
1
,
});
});
return
result
.
OrderBy
(
w
=>
w
.
IsVerify
).
ThenByDescending
(
t
=>
t
.
CreateTime
).
ThenBy
(
t
=>
t
.
Department
);
return
result
.
OrderBy
(
w
=>
w
.
IsVerify
).
ThenByDescending
(
t
=>
t
.
CreateTime
).
ThenBy
(
t
=>
t
.
Department
);
}
}
...
...
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