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
009d3a92
Commit
009d3a92
authored
Jun 18, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改字段名称
parent
673ca699
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
37 deletions
+53
-37
performance/Performance.DtoModels/Request/CostTransferRequest.cs
+4
-4
performance/Performance.EntityModels/Entity/cost_transfer.cs
+4
-4
performance/Performance.Services/CostTransfer/CostTransferService.cs
+6
-6
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
+39
-23
No files found.
performance/Performance.DtoModels/Request/CostTransferRequest.cs
View file @
009d3a92
...
@@ -9,18 +9,18 @@ public class CostTransferRequest
...
@@ -9,18 +9,18 @@ public class CostTransferRequest
{
{
public
int
AllotId
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
Department
Applicant
{
get
;
set
;
}
public
Department
Detail
Applicant
{
get
;
set
;
}
public
Department
Adopted
{
get
;
set
;
}
public
Department
Detail
Adopted
{
get
;
set
;
}
public
List
<
CostTransferItemRequest
>
Items
{
get
;
set
;
}
public
List
<
CostTransferItemRequest
>
Items
{
get
;
set
;
}
}
}
public
class
Department
public
class
Department
Detail
{
{
public
string
UnitType
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
string
AccountingUni
t
{
get
;
set
;
}
public
string
Departmen
t
{
get
;
set
;
}
}
}
public
class
CostTransferUpdateRequest
:
CostTransferRequest
public
class
CostTransferUpdateRequest
:
CostTransferRequest
...
...
performance/Performance.EntityModels/Entity/cost_transfer.cs
View file @
009d3a92
...
@@ -31,9 +31,9 @@ public class cost_transfer
...
@@ -31,9 +31,9 @@ public class cost_transfer
public
string
ApplicantUnitType
{
get
;
set
;
}
public
string
ApplicantUnitType
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 申请者
核算单元
/// 申请者
科室
/// </summary>
/// </summary>
public
string
Applicant
AccountingUni
t
{
get
;
set
;
}
public
string
Applicant
Departmen
t
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 审核者核算单元类型
/// 审核者核算单元类型
...
@@ -41,9 +41,9 @@ public class cost_transfer
...
@@ -41,9 +41,9 @@ public class cost_transfer
public
string
AdoptedUnitType
{
get
;
set
;
}
public
string
AdoptedUnitType
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 审核者
核算单元
/// 审核者
科室
/// </summary>
/// </summary>
public
string
Adopted
AccountingUni
t
{
get
;
set
;
}
public
string
Adopted
Departmen
t
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 0 未审核 1 部分审核 2 全部审核 3 未含有划拨明细
/// 0 未审核 1 部分审核 2 全部审核 3 未含有划拨明细
...
...
performance/Performance.Services/CostTransfer/CostTransferService.cs
View file @
009d3a92
...
@@ -37,18 +37,18 @@ public bool Applicat(CostTransferRequest request)
...
@@ -37,18 +37,18 @@ public bool Applicat(CostTransferRequest request)
if
(
request
.
Applicant
==
null
||
request
.
Adopted
==
null
)
if
(
request
.
Applicant
==
null
||
request
.
Adopted
==
null
)
throw
new
PerformanceException
(
"参数错误,申请/被划拨科室信息缺失"
);
throw
new
PerformanceException
(
"参数错误,申请/被划拨科室信息缺失"
);
if
(
string
.
IsNullOrEmpty
(
request
.
Applicant
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Applicant
.
AccountingUni
t
))
if
(
string
.
IsNullOrEmpty
(
request
.
Applicant
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Applicant
.
Departmen
t
))
throw
new
PerformanceException
(
"参数错误,申请科室信息缺失"
);
throw
new
PerformanceException
(
"参数错误,申请科室信息缺失"
);
if
(
string
.
IsNullOrEmpty
(
request
.
Adopted
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Adopted
.
AccountingUni
t
))
if
(
string
.
IsNullOrEmpty
(
request
.
Adopted
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Adopted
.
Departmen
t
))
throw
new
PerformanceException
(
"参数错误,被划拨科室信息缺失"
);
throw
new
PerformanceException
(
"参数错误,被划拨科室信息缺失"
);
var
transfer
=
new
cost_transfer
var
transfer
=
new
cost_transfer
{
{
AllotId
=
request
.
AllotId
,
AllotId
=
request
.
AllotId
,
Applicant
AccountingUnit
=
request
.
Applicant
.
AccountingUni
t
,
Applicant
Department
=
request
.
Applicant
.
Departmen
t
,
ApplicantUnitType
=
request
.
Applicant
.
UnitType
,
ApplicantUnitType
=
request
.
Applicant
.
UnitType
,
Adopted
AccountingUnit
=
request
.
Adopted
.
AccountingUni
t
,
Adopted
Department
=
request
.
Adopted
.
Departmen
t
,
AdoptedUnitType
=
request
.
Adopted
.
UnitType
,
AdoptedUnitType
=
request
.
Adopted
.
UnitType
,
Status
=
(
request
.
Items
!=
null
&&
request
.
Items
.
Any
())
?
0
:
3
Status
=
(
request
.
Items
!=
null
&&
request
.
Items
.
Any
())
?
0
:
3
};
};
...
@@ -90,9 +90,9 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -90,9 +90,9 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
throw
new
PerformanceException
(
"划拨申请记录不存在"
);
throw
new
PerformanceException
(
"划拨申请记录不存在"
);
transfer
.
AllotId
=
request
.
AllotId
;
transfer
.
AllotId
=
request
.
AllotId
;
transfer
.
Applicant
AccountingUnit
=
request
.
Applicant
.
AccountingUni
t
;
transfer
.
Applicant
Department
=
request
.
Applicant
.
Departmen
t
;
transfer
.
ApplicantUnitType
=
request
.
Applicant
.
UnitType
;
transfer
.
ApplicantUnitType
=
request
.
Applicant
.
UnitType
;
transfer
.
Adopted
AccountingUnit
=
request
.
Adopted
.
AccountingUni
t
;
transfer
.
Adopted
Department
=
request
.
Adopted
.
Departmen
t
;
transfer
.
AdoptedUnitType
=
request
.
Adopted
.
UnitType
;
transfer
.
AdoptedUnitType
=
request
.
Adopted
.
UnitType
;
var
result
=
costtransferRepository
.
Update
(
transfer
);
var
result
=
costtransferRepository
.
Update
(
transfer
);
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
View file @
009d3a92
...
@@ -23,7 +23,7 @@ public class CostTransferDataWrite
...
@@ -23,7 +23,7 @@ public class CostTransferDataWrite
this
.
costtransferitemRepository
=
costtransferitemRepository
;
this
.
costtransferitemRepository
=
costtransferitemRepository
;
}
}
public
void
WriteSheetData
(
ISheet
sheet
,
PerSheetPoint
point
,
SheetType
sheetType
,
ExcelStyle
style
,
int
allotId
)
public
void
WriteSheetData
(
ISheet
sheet
,
PerSheetPoint
point
,
ExcelStyle
style
,
int
allotId
)
{
{
try
try
{
{
...
@@ -33,37 +33,53 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
...
@@ -33,37 +33,53 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
var
costTransferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costTransfers
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
TransferId
));
var
costTransferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costTransfers
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
TransferId
));
if
(
costTransferItems
==
null
||
!
costTransferItems
.
Any
())
return
;
if
(
costTransferItems
==
null
||
!
costTransferItems
.
Any
())
return
;
var
header
=
sheet
.
GetRow
(
point
.
HeaderFirstRowNum
.
Value
);
var
columns
=
SupplySheetHeader
(
sheet
,
point
);
if
(
header
==
null
)
return
;
if
(
columns
==
null
||
!
columns
.
Any
()
)
return
;
List
<
string
>
fixedColumns
=
new
List
<
string
>
{
"划拨(出)收入"
,
"划拨(入)收入"
,
"划拨收入(医技)"
,
"划拨收入(医生)"
,
"划拨收入(护理)"
}
;
var
departments
=
costTransfers
.
Select
(
t
=>
t
.
AdoptedDepartment
??
""
).
Union
(
costTransfers
.
Select
(
t
=>
t
.
ApplicantDepartment
??
""
)).
Distinct
()
;
for
(
int
i
=
point
.
HeaderFirstCellNum
.
Value
;
i
<
header
.
LastCellNum
;
i
++)
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
"写入划拨数据异常:"
+
ex
);
}
}
private
Dictionary
<
string
,
int
>
SupplySheetHeader
(
ISheet
sheet
,
PerSheetPoint
point
)
{
Dictionary
<
string
,
int
>
pairs
=
new
Dictionary
<
string
,
int
>();
var
header
=
sheet
.
GetRow
(
point
.
HeaderFirstRowNum
.
Value
);
if
(
header
==
null
)
return
pairs
;
List
<
string
>
fixedColumns
=
new
List
<
string
>
{
"划拨(出)收入"
,
"划拨(入)收入"
,
"划拨收入(医技)"
,
"划拨收入(医生)"
,
"划拨收入(护理)"
};
for
(
int
i
=
point
.
HeaderFirstCellNum
.
Value
;
i
<
header
.
LastCellNum
;
i
++)
{
var
column
=
header
.
GetCell
(
i
)?.
GetDecodeEscapes
().
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
if
(!
string
.
IsNullOrEmpty
(
column
)
&&
fixedColumns
.
Any
(
t
=>
t
==
column
))
{
{
var
column
=
header
.
GetCell
(
i
)?.
GetDecodeEscapes
().
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
if
(
pairs
.
ContainsKey
(
column
))
if
(!
string
.
IsNullOrEmpty
(
column
)
&&
fixedColumns
.
Any
(
t
=>
t
==
column
))
pairs
.
Add
(
column
,
i
);
{
fixedColumns
.
Remove
(
column
);
fixedColumns
.
Remove
(
column
);
}
}
}
}
if
(
fixedColumns
!=
null
&&
fixedColumns
.
Any
())
if
(
fixedColumns
!=
null
&&
fixedColumns
.
Any
())
{
var
index
=
header
.
LastCellNum
+
1
;
foreach
(
var
column
in
fixedColumns
)
{
{
var
index
=
point
.
HeaderFirstCellNum
.
Value
+
1
;
var
cell
=
header
.
CreateCell
(
index
);
foreach
(
var
column
in
fixedColumns
)
cell
.
SetCellValue
(
column
);
{
var
cell
=
header
.
CreateCell
(
index
);
cell
.
SetCellValue
(
column
);
}
}
var
columns
=
header
.
GetCellValues
(
);
if
(
pairs
.
ContainsKey
(
column
))
pairs
.
Add
(
column
,
index
);
index
++;
}
}
}
catch
(
Exception
ex
)
{
return
pairs
;
logger
.
LogError
(
"写入划拨数据异常:"
+
ex
);
}
}
}
}
}
}
}
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