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
3ed95802
Commit
3ed95802
authored
Aug 05, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增绩效copy数据时方法调整
parent
3fcacf6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
64 deletions
+77
-64
performance/Performance.Services/ConfigService.cs
+77
-64
No files found.
performance/Performance.Services/ConfigService.cs
View file @
3ed95802
...
...
@@ -890,25 +890,25 @@ public bool BatchSaveAccounting(int allotId, SaveCollectData request)
/// <param name="iD"></param>
public
void
Copy
(
per_allot
allot
)
{
var
list
=
perforPerAllotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
)
.
OrderBy
(
t
=>
t
.
Year
).
ThenBy
(
t
=>
t
.
Month
).
ToList
();
int
allotId
=
0
;
for
(
int
i
=
0
;
i
<
list
.
Count
;
i
++)
{
if
(
list
[
i
].
ID
==
allot
.
ID
&&
(
i
-
1
)
>=
0
)
allotId
=
list
[
i
-
1
].
ID
;
}
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
var
list
=
perforPerAllotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
list
==
null
||
!
list
.
Any
(
t
=>
t
.
ID
==
allot
.
ID
))
return
;
logger
.
LogInformation
(
$"apramount
{
allotId
}
{
allot
.
ID
}
"
);
//CopyAprData(allotId, allot.ID);
list
=
list
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
ToList
();
personService
.
CreateAllotPersons
(
allot
.
HospitalId
,
allot
.
ID
,
allotId
);
var
index
=
list
.
IndexOf
(
list
.
First
(
t
=>
t
.
ID
==
allot
.
ID
)
);
//CopyCMIData(allotId, allot.ID);
// 先取上一个月的绩效Id,若没有取最后一个月的绩效Id,若都不存在则获取allotId为-1的数据
int
allotId
=
index
==
list
.
Count
-
1
?
list
.
First
().
ID
:
list
[
index
-
1
].
ID
;
if
(
allotId
==
allot
.
ID
)
allotId
=
-
1
;
#
region
弃用
//var hospital = perforHospitalRepository.GetEntity(t => t.ID == allot.HospitalId);
//logger.LogInformation($"apramount{allotId} {allot.ID}");
//CopyAprData(allotId, allot.ID);
//CopyCMIData(allotId, allot.ID);
//var orgDirector = _directorRepository.GetEntities(t => t.AllotID == allot.ID);
//if (orgDirector == null || orgDirector.Count == 0)
//{
...
...
@@ -939,8 +939,6 @@ public void Copy(per_allot allot)
// _workyearRepository.AddRange(newWorkyears.ToArray());
//}
#
endregion
//logger.LogInformation($"orgDurgprop");
//var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID);
//if (orgDurgprop == null || orgDurgprop.Count == 0)
...
...
@@ -953,44 +951,54 @@ public void Copy(per_allot allot)
// _drugpropRepository.AddRange(newDurgprops.ToArray());
//}
logger
.
LogInformation
(
$"workItem"
);
var
workItem
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
workItem
==
null
||
workItem
.
Count
==
0
)
#
endregion
personService
.
CreateAllotPersons
(
allot
.
HospitalId
,
allot
.
ID
,
allotId
);
logger
.
LogInformation
(
$"copy workItems"
);
var
workItems
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
workItems
==
null
||
!
workItems
.
Any
())
{
workItem
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
workItem
!=
null
&&
workItem
.
Count
>
0
)
workItem
s
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
workItem
s
!=
null
&&
workItems
.
Any
()
)
{
var
newWorkItem
=
workItem
.
Select
(
t
=>
new
cof_workitem
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Item
=
t
.
Item
});
_workitemRepository
.
AddRange
(
newWorkItem
.
ToArray
());
var
newWorkItem
s
=
workItems
.
Select
(
t
=>
new
cof_workitem
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Item
=
t
.
Item
});
_workitemRepository
.
AddRange
(
newWorkItem
s
.
ToArray
());
}
}
logger
.
LogInformation
(
$"cofDrugtype"
);
var
cofDrugtype
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
cofDrugtype
==
null
||
cofDrugtype
.
Count
==
0
)
logger
.
LogInformation
(
$"copy drugTypes"
);
var
drugTypes
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
drugTypes
==
null
||
!
drugTypes
.
Any
())
{
drugTypes
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypes
!=
null
&&
drugTypes
.
Any
())
{
var
drugtype
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newAgains
=
drugtype
.
Select
(
t
=>
new
cof_drugtype
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
}
);
_drugtypeRepository
.
AddRange
(
newAgains
.
ToArray
());
var
newDrugTypes
=
drugTypes
.
Select
(
t
=>
new
cof_drugtype
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
}
);
_drugtypeRepository
.
AddRange
(
newDrugTypes
.
ToArray
()
);
}
}
logger
.
LogInformation
(
$"co
fDrugtypeDisburse
"
);
var
cofDrugtypeDisburse
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
cofDrugtypeDisburse
==
null
||
cofDrugtypeDisburse
.
Count
==
0
)
logger
.
LogInformation
(
$"co
py drugTypeDisburses
"
);
var
drugTypeDisburses
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
drugTypeDisburses
==
null
||
!
drugTypeDisburses
.
Any
()
)
{
var
Disburse
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newAgains
=
Disburse
.
Select
(
t
=>
new
cof_drugtype_disburse
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
drugtypeDisburseRepository
.
AddRange
(
newAgains
.
ToArray
());
drugTypeDisburses
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypeDisburses
!=
null
&&
drugTypeDisburses
.
Any
())
{
var
newDrugTypeDisburses
=
drugTypeDisburses
.
Select
(
t
=>
new
cof_drugtype_disburse
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
drugtypeDisburseRepository
.
AddRange
(
newDrugTypeDisburses
.
ToArray
());
}
}
logger
.
LogInformation
(
$"cofDrugtypefactor"
);
var
cofDrugtypeFactor
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
cofDrugtypeFactor
==
null
||
cofDrugtypeFactor
.
Count
==
0
)
logger
.
LogInformation
(
$"copy drugTypeFactors"
);
var
drugTypeFactors
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
drugTypeFactors
==
null
||
!
drugTypeFactors
.
Any
())
{
drugTypeFactors
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypeFactors
!=
null
&&
drugTypeFactors
.
Any
())
{
var
drugtypefactor
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newdrugtypefactor
=
drugtypefactor
?.
Select
(
t
=>
new
cof_drugtype_factor
var
newDrugtypeFactors
=
drugTypeFactors
.
Select
(
t
=>
new
cof_drugtype_factor
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
...
...
@@ -998,42 +1006,47 @@ public void Copy(per_allot allot)
Charge
=
t
.
Charge
,
YSZ
=
t
.
YSZ
,
HLZ
=
t
.
HLZ
,
YJZ
=
t
.
YJZ
,
YJZ
=
t
.
YJZ
});
if
(
newdrugtypefactor
!=
null
&&
newdrugtypefactor
.
Any
())
cofdrugtypefactorRepository
.
AddRange
(
newdrugtypefactor
.
ToArray
());
cofdrugtypefactorRepository
.
AddRange
(
newDrugtypeFactors
.
ToArray
());
}
}
logger
.
LogInformation
(
$"cofDepttype"
);
var
cofDepttype
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
cofDepttype
==
null
||
cofDepttype
.
Count
==
0
)
logger
.
LogInformation
(
$"copy deptTypes"
);
var
deptTypes
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
deptTypes
==
null
||
!
deptTypes
.
Any
())
{
deptTypes
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
deptTypes
!=
null
&&
deptTypes
.
Any
())
{
var
depttype
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newAgains
=
depttype
?.
Select
(
t
=>
new
cof_depttype
{
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
if
(
newAgains
!=
null
&&
newAgains
.
Any
())
perforCofdepttypeRepository
.
AddRange
(
newAgains
.
ToArray
());
var
newDeptTypes
=
deptTypes
.
Select
(
t
=>
new
cof_depttype
{
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
perforCofdepttypeRepository
.
AddRange
(
newDeptTypes
.
ToArray
());
}
}
logger
.
LogInformation
(
$"again"
);
var
data
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
data
==
null
||
data
.
Count
==
0
)
logger
.
LogInformation
(
$"copy agains"
);
var
agains
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
agains
==
null
||
!
agains
.
Any
())
{
agains
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
agains
!=
null
&&
agains
.
Any
())
{
var
again
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
days
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
var
newAgains
=
again
.
Select
(
t
=>
new
cof_again
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Department
=
t
.
Department
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
TypeName
==
"满勤天数"
?
days
:
t
.
Value
});
var
newAgains
=
agains
.
Select
(
t
=>
new
cof_again
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Department
=
t
.
Department
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
TypeName
==
"满勤天数"
?
days
:
t
.
Value
});
_againRepository
.
AddRange
(
newAgains
.
ToArray
());
}
}
logger
.
LogInformation
(
$"
accounting
"
);
logger
.
LogInformation
(
$"
copy accountings
"
);
var
accountings
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
accountings
==
null
||
accountings
.
Count
==
0
)
if
(
accountings
==
null
||
!
accountings
.
Any
())
{
accountings
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
-
1
);
if
(
accountings
!=
null
&&
accountings
.
Any
())
{
var
prevData
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
newData
=
prevData
?.
Select
(
t
=>
new
cof_accounting
{
AllotId
=
allot
.
ID
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
});
if
(
newData
!=
null
&&
newData
.
Any
())
cofaccountingRepository
.
AddRange
(
newData
.
ToArray
());
var
newAccountings
=
accountings
.
Select
(
t
=>
new
cof_accounting
{
AllotId
=
allot
.
ID
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
});
cofaccountingRepository
.
AddRange
(
newAccountings
.
ToArray
());
}
}
}
...
...
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