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
a2c7c234
Commit
a2c7c234
authored
Aug 07, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上次绩效更改调整
parent
e0b7db57
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
22 deletions
+62
-22
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.EntityModels/Other/AccountUnitEntity.cs
+14
-0
performance/Performance.Repository/BaseRepository.cs
+9
-0
performance/Performance.Repository/PerforImdataRepository.cs
+10
-0
performance/Performance.Services/NewExtractService.cs
+24
-22
No files found.
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
a2c7c234
...
@@ -1238,6 +1238,11 @@
...
@@ -1238,6 +1238,11 @@
使用方案
使用方案
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.ExtractRequest.Email"
>
<summary>
邮箱
</summary>
</member>
<member
name=
"T:Performance.DtoModels.HospitalRequest"
>
<member
name=
"T:Performance.DtoModels.HospitalRequest"
>
<summary>
<summary>
登录请求
登录请求
...
...
performance/Performance.EntityModels/Other/AccountUnitEntity.cs
0 → 100644
View file @
a2c7c234
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.EntityModels
{
public
class
AccountUnitEntity
{
public
string
SheetName
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
int
UnitType
{
get
;
set
;
}
}
}
performance/Performance.Repository/BaseRepository.cs
View file @
a2c7c234
...
@@ -31,6 +31,15 @@ public IEnumerable<TEntity> DapperQuery(string sql, object param, int? commandTi
...
@@ -31,6 +31,15 @@ public IEnumerable<TEntity> DapperQuery(string sql, object param, int? commandTi
{
{
return
context
.
Database
.
GetDbConnection
().
Query
<
TEntity
>(
sql
,
param
,
commandTimeout
:
commandTimeout
);
return
context
.
Database
.
GetDbConnection
().
Query
<
TEntity
>(
sql
,
param
,
commandTimeout
:
commandTimeout
);
}
}
public
IEnumerable
<
T
>
DapperQuery
<
T
>(
string
sql
,
object
param
)
where
T
:
class
,
new
()
{
return
context
.
Database
.
GetDbConnection
().
Query
<
T
>(
sql
,
param
);
}
public
IEnumerable
<
T
>
DapperQuery
<
T
>(
string
sql
,
object
param
,
int
?
commandTimeout
=
null
)
{
return
context
.
Database
.
GetDbConnection
().
Query
<
T
>(
sql
,
param
,
commandTimeout
:
commandTimeout
);
}
public
int
Execute
(
string
sql
,
object
param
)
public
int
Execute
(
string
sql
,
object
param
)
{
{
...
...
performance/Performance.Repository/PerforImdataRepository.cs
View file @
a2c7c234
...
@@ -29,5 +29,15 @@ public IEnumerable<im_data> GetAccountingUnit(int hospitalid, int sheettype, Lis
...
@@ -29,5 +29,15 @@ public IEnumerable<im_data> GetAccountingUnit(int hospitalid, int sheettype, Lis
"where allot.hospitalid = @hospitalid and sheet.sheettype = @sheettype and im.department in @deptList"
;
"where allot.hospitalid = @hospitalid and sheet.sheettype = @sheettype and im.department in @deptList"
;
return
DapperQuery
(
sql
,
new
{
hospitalid
,
sheettype
,
deptList
},
1000
*
60
*
5
);
return
DapperQuery
(
sql
,
new
{
hospitalid
,
sheettype
,
deptList
},
1000
*
60
*
5
);
}
}
/// <summary>
/// 삿혤뵙炬데禱
/// </summary>
/// <returns></returns>
public
IEnumerable
<
AccountUnitEntity
>
GetAccountUnit
(
int
allotId
)
{
string
sql
=
"select distinct SheetName,AccountingUnit,Department,UnitType from per_sheet st join im_data dt on st.ID = dt.SheetID where st.AllotID = @allotId"
;
return
DapperQuery
<
AccountUnitEntity
>(
sql
,
new
{
allotId
},
1000
*
60
*
5
);
}
}
}
}
}
performance/Performance.Services/NewExtractService.cs
View file @
a2c7c234
...
@@ -134,6 +134,10 @@ public string ExtractData(int allotId, string email, int hospitalId)
...
@@ -134,6 +134,10 @@ public string ExtractData(int allotId, string email, int hospitalId)
style
.
VerticalAlignment
=
VerticalAlignment
.
Center
;
//垂直居中
style
.
VerticalAlignment
=
VerticalAlignment
.
Center
;
//垂直居中
#
endregion
#
endregion
List
<
AccountUnitEntity
>
unitList
=
new
List
<
AccountUnitEntity
>();
if
(
allotLast
!=
null
)
unitList
=
perforImdataRepository
.
GetAccountUnit
(
allotLast
.
ID
).
ToList
();
for
(
int
i
=
0
;
i
<
workbook
.
NumberOfSheets
;
i
++)
for
(
int
i
=
0
;
i
<
workbook
.
NumberOfSheets
;
i
++)
{
{
var
sheet
=
workbook
.
GetSheetAt
(
i
);
var
sheet
=
workbook
.
GetSheetAt
(
i
);
...
@@ -144,16 +148,18 @@ public string ExtractData(int allotId, string email, int hospitalId)
...
@@ -144,16 +148,18 @@ public string ExtractData(int allotId, string email, int hospitalId)
switch
(
sheetType
)
switch
(
sheetType
)
{
{
case
SheetType
.
Employee
:
case
SheetType
.
Employee
:
if
(
allotLast
!=
null
)
WriteEmployee
(
sheet
,
allotLast
.
ID
,
sheetRead
);
WriteEmployee
(
sheet
,
allotLast
.
ID
,
sheetRead
);
break
;
break
;
case
SheetType
.
AccountBasic
:
case
SheetType
.
AccountBasic
:
if
(
allotLast
!=
null
)
WriteAccountBasic
(
sheet
,
allotLast
.
ID
,
sheetRead
);
WriteAccountBasic
(
sheet
,
allotLast
.
ID
,
sheetRead
);
break
;
break
;
case
SheetType
.
SpecialUnit
:
case
SheetType
.
SpecialUnit
:
WriteSpecialUnit
(
sheet
,
hospital
.
ID
,
allotLast
.
ID
,
sheetRead
);
WriteSpecialUnit
(
sheet
,
hospital
.
ID
,
allotLast
,
sheetRead
);
break
;
break
;
case
SheetType
.
Income
:
case
SheetType
.
Income
:
WriteIncome
(
sheet
,
allotLast
.
ID
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
WriteIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
break
;
case
SheetType
.
OtherIncome
:
case
SheetType
.
OtherIncome
:
WriteOtherIncome
(
sheet
,
hospital
.
ID
,
sheetRead
);
WriteOtherIncome
(
sheet
,
hospital
.
ID
,
sheetRead
);
...
@@ -162,7 +168,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
...
@@ -162,7 +168,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
WriteExpend
(
sheet
,
hospital
.
ID
,
sheetRead
);
WriteExpend
(
sheet
,
hospital
.
ID
,
sheetRead
);
break
;
break
;
case
SheetType
.
Workload
:
case
SheetType
.
Workload
:
WriteWorkload
(
sheet
,
allotLast
.
ID
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
WriteWorkload
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
break
;
}
}
}
}
...
@@ -240,9 +246,9 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sh
...
@@ -240,9 +246,9 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sh
}
}
}
}
private
void
WriteIncome
(
ISheet
sheet
,
int
allotLastId
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
private
void
WriteIncome
(
ISheet
sheet
,
int
hospitalId
,
List
<
AccountUnitEntity
>
unitList
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
{
{
var
module
=
moduleList
.
FirstOrDefault
(
t
=>
t
.
ModuleName
==
sheet
.
SheetName
);
var
module
=
moduleList
.
FirstOrDefault
(
t
=>
t
.
ModuleName
==
sheet
.
SheetName
&&
t
.
HospitalId
==
hospitalId
);
if
(
module
==
null
)
return
;
if
(
module
==
null
)
return
;
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
...
@@ -275,9 +281,6 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
...
@@ -275,9 +281,6 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
allExtract
.
AddRange
(
result
);
allExtract
.
AddRange
(
result
);
}
}
//写入数据
//写入数据
var
importSheet
=
perforPersheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotLastId
&&
t
.
SheetType
==
(
int
)
SheetType
.
Income
);
var
importSheetId
=
importSheet
.
Select
(
t
=>
t
.
ID
).
ToList
();
var
importData
=
perforImdataRepository
.
GetEntities
(
t
=>
importSheetId
.
Contains
(
t
.
SheetID
.
Value
));
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
;
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
{
{
...
@@ -288,23 +291,22 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
...
@@ -288,23 +291,22 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
var
newCell
=
row
.
CreateCell
(
i
);
var
newCell
=
row
.
CreateCell
(
i
);
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医生组)"
)
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医生组)"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
&&
t
.
UnitType
==
1
)?.
AccountingUnit
;
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
1
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(护理组)"
)
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(护理组)"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
&&
t
.
UnitType
==
2
)?.
AccountingUnit
;
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
2
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医技组)"
)
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医技组)"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
&&
t
.
UnitType
==
3
)?.
AccountingUnit
;
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
3
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
if
(
headName
==
"科室名称"
)
else
if
(
headName
==
"科室名称"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
)?.
Department
;
newCell
.
SetCellValue
(
department
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
else
{
{
...
@@ -348,9 +350,9 @@ private IRow GetOrCreate(ISheet sheet, int index)
...
@@ -348,9 +350,9 @@ private IRow GetOrCreate(ISheet sheet, int index)
return
pairs
;
return
pairs
;
}
}
private
void
WriteWorkload
(
ISheet
sheet
,
int
allotLastId
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
private
void
WriteWorkload
(
ISheet
sheet
,
int
hospitalId
,
List
<
AccountUnitEntity
>
unitList
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
{
{
var
module
=
moduleList
.
FirstOrDefault
(
t
=>
t
.
ModuleName
==
sheet
.
SheetName
);
var
module
=
moduleList
.
FirstOrDefault
(
t
=>
t
.
ModuleName
==
sheet
.
SheetName
&&
t
.
HospitalId
==
hospitalId
);
if
(
module
==
null
)
return
;
if
(
module
==
null
)
return
;
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
...
@@ -385,8 +387,6 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee
...
@@ -385,8 +387,6 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee
}
}
}
}
//写入数据
//写入数据
var
importSheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotLastId
&&
t
.
SheetName
==
module
.
ModuleName
);
var
importData
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
SheetID
==
importSheet
.
ID
);
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
2
;
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
2
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
{
{
...
@@ -397,13 +397,12 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee
...
@@ -397,13 +397,12 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee
var
newCell
=
row
.
CreateCell
(
i
);
var
newCell
=
row
.
CreateCell
(
i
);
if
(
headName
==
"核算单元"
)
if
(
headName
==
"核算单元"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
)?.
AccountingUnit
;
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
if
(
headName
==
"科室名称"
)
else
if
(
headName
==
"科室名称"
)
{
{
var
dept
=
importData
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
)?.
Department
;
newCell
.
SetCellValue
(
department
??
""
);
newCell
.
SetCellValue
(
dept
??
""
);
}
}
else
else
{
{
...
@@ -517,7 +516,7 @@ private void WriteEmployee(ISheet sheet, int allotLastId, IPerSheetDataRead shee
...
@@ -517,7 +516,7 @@ private void WriteEmployee(ISheet sheet, int allotLastId, IPerSheetDataRead shee
}
}
}
}
private
void
WriteSpecialUnit
(
ISheet
sheet
,
int
hospitalId
,
int
allotLastId
,
IPerSheetDataRead
sheetRead
)
private
void
WriteSpecialUnit
(
ISheet
sheet
,
int
hospitalId
,
per_allot
allotLast
,
IPerSheetDataRead
sheetRead
)
{
{
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
im_specialunit
>,
object
>>
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
im_specialunit
>,
object
>>
{
{
...
@@ -529,9 +528,12 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe
...
@@ -529,9 +528,12 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe
};
};
var
modDataList
=
perforModspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
)?.
OrderBy
(
t
=>
t
.
Department
).
ToList
();
var
modDataList
=
perforModspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
)?.
OrderBy
(
t
=>
t
.
Department
).
ToList
();
var
allotDataList
=
perforImspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotLastId
);
if
(
modDataList
==
null
||
modDataList
.
Count
==
0
)
return
;
if
(
modDataList
==
null
||
modDataList
.
Count
==
0
)
return
;
List
<
im_specialunit
>
allotDataList
=
new
List
<
im_specialunit
>();
if
(
allotLast
!=
null
)
allotDataList
=
perforImspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotLast
.
ID
);
//取消合并单元格
//取消合并单元格
int
mergedCount
=
sheet
.
NumMergedRegions
;
int
mergedCount
=
sheet
.
NumMergedRegions
;
for
(
int
i
=
mergedCount
-
1
;
i
>=
0
;
i
--)
for
(
int
i
=
mergedCount
-
1
;
i
>=
0
;
i
--)
...
...
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