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
e0dddd80
Commit
e0dddd80
authored
May 16, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
药占比计算,系数设置
parent
750d69b2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
performance/Performance.Api/Controllers/AllotController.cs
+1
-1
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+9
-2
performance/Performance.Services/ConfigService.cs
+3
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
e0dddd80
...
...
@@ -156,7 +156,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
if
(
null
==
allot
||
string
.
IsNullOrEmpty
(
allot
.
Path
))
throw
new
PerformanceException
(
"当前绩效记录不存在或没有上传数据文件"
);
var
user
=
_claim
.
At
(
request
);
//_allotService.Generate(allot, user);
//_allotService.Generate(allot, user
.Mail
);
BackgroundJob
.
Enqueue
(()
=>
_allotService
.
Generate
(
allot
,
user
.
Mail
));
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
e0dddd80
...
...
@@ -270,14 +270,21 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var
drugtype
=
perforCofdrugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
)?.
Select
(
t
=>
t
.
Charge
).
ToList
();
var
drugData
=
datalist
.
Where
(
t
=>
drugtype
.
Contains
(
t
.
TypeName
)).
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
if
(
drugtype
==
null
)
{
drugData
=
null
;
//throw new PerformanceException("未配置药占比类型");
}
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
cofList
=
perforCofdrugpropRepository
.
GetEntities
();
var
unitList
=
drugData
.
Select
(
t
=>
t
.
AccountingUnit
).
Union
(
allData
.
Select
(
t
=>
t
.
AccountingUnit
));
var
unitList
=
(
drugData
?.
Select
(
t
=>
t
.
AccountingUnit
)
??
new
List
<
string
>()).
Union
(
allData
.
Select
(
t
=>
t
.
AccountingUnit
));
foreach
(
var
unit
in
unitList
)
{
var
dsv
=
drugData
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
unit
)?.
SumValue
;
var
dsv
=
drugData
?
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
unit
)?.
SumValue
;
var
asv
=
allData
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
unit
)?.
SumValue
;
var
prop
=
asv
.
HasValue
&&
asv
.
Value
>
0
?
Math
.
Round
((
dsv
??
0
)
/
asv
.
Value
,
2
)
:
0
;
...
...
performance/Performance.Services/ConfigService.cs
View file @
e0dddd80
...
...
@@ -385,7 +385,7 @@ public void Copy(per_allot allot)
var
durgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDurgprops
=
durgprop
.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
if
(
hospital
!=
null
&&
hospital
?.
IsOpenDrugprop
==
2
)
newDurgprops
=
durgprop
.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
1
})
;
newDurgprops
=
new
List
<
cof_drugprop
>
{
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
1000
,
MinRange
=
0
,
Value
=
1
}
}
;
_drugpropRepository
.
AddRange
(
newDurgprops
.
ToArray
());
}
...
...
@@ -405,12 +405,12 @@ public void Copy(per_allot allot)
var
workyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
if
(
hospital
!=
null
&&
hospital
?.
IsOpenWorkYear
==
2
)
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
1
})
;
newWorkyears
=
new
List
<
cof_workyear
>
{
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
1000
,
MinRange
=
0
,
Value
=
1
}
}
;
_workyearRepository
.
AddRange
(
newWorkyears
.
ToArray
());
}
var
cofDrugtype
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
cofDrugtype
==
null
||
cofDrugtype
.
Count
==
0
)
if
(
hospital
!=
null
&&
hospital
?.
IsOpenDrugprop
==
1
&&
(
cofDrugtype
==
null
||
cofDrugtype
.
Count
==
0
)
)
{
var
drugtype
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newAgains
=
drugtype
.
Select
(
t
=>
new
cof_drugtype
{
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
});
...
...
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