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
907c2da6
Commit
907c2da6
authored
Jan 29, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改收入费用、科室类别,工作量的显示和保存
parent
0b525176
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
232 additions
and
0 deletions
+232
-0
performance/Performance.Services/ConfigService.cs
+232
-0
No files found.
performance/Performance.Services/ConfigService.cs
View file @
907c2da6
...
...
@@ -371,6 +371,59 @@ public bool DrugtypeDelete(DrugpropRequest request)
return
_drugtypeRepository
.
Remove
(
entity
);
}
public
HandsonTable
GetDrugtypeHands
(
int
allotId
)
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
DrueType
.
Select
(
c
=>
c
.
Value
).
ToArray
(),
DrueType
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
var
list
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
list
==
null
)
return
handson
;
List
<
HandsonRowData
>
rowDatas
=
new
List
<
HandsonRowData
>();
int
i
=
0
;
foreach
(
var
item
in
list
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
cells
=
(
from
conf
in
DrueType
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
cells
.
Add
(
new
HandsonCellData
(
nameof
(
item
.
ID
),
item
.
ID
));
if
(
item
.
ChargeType
==
null
)
{
cells
.
Add
(
new
HandsonCellData
(
DrueType
.
First
(
c
=>
c
.
Key
==
nameof
(
item
.
ChargeType
)).
Value
,
item
.
ChargeType
));
}
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
i
++;
}
handson
.
SetRowData
(
rowDatas
,
rowDatas
!=
null
);
return
handson
;
}
public
void
SaveDrugtypeHands
(
int
allotId
,
SaveConfigData
request
)
{
var
dicData
=
CreateDataRow
(
allotId
,
request
,
DrueType
);
List
<
cof_drugtype
>
drugs
=
new
List
<
cof_drugtype
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
cof_drugtype
>(
json
);
drugs
.
Add
(
data
);
}
_drugtypeRepository
.
Execute
(
"delete from cof_drugtype where allotid = @allotid"
,
new
{
allotId
});
_drugtypeRepository
.
AddRange
(
drugs
.
ToArray
());
}
#
endregion
#
region
cof_workitem
工作量绩效
...
...
@@ -434,6 +487,72 @@ public bool WorkItemkDelete(WorkItemRequest request)
return
_workitemRepository
.
Remove
(
workyear
);
}
public
HandsonTable
GetWorkItemHands
(
int
allotId
,
int
type
)
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
WorkConfig
.
Select
(
c
=>
c
.
Value
).
ToArray
(),
WorkConfig
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
var
headerArr
=
WorkHeader
(
allotId
).
Select
(
c
=>
c
.
Value
).
ToArray
();
if
(
handson
.
Columns
!=
null
&&
handson
.
Columns
.
Any
())
{
foreach
(
var
column
in
handson
.
Columns
)
{
if
(
column
.
Data
==
"工作量计算项"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
headerArr
;
column
.
Strict
=
true
;
}
}
}
var
list
=
(
type
>
0
)
?
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
Type
==
type
)
:
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
list
==
null
)
return
handson
;
List
<
HandsonRowData
>
rowDatas
=
new
List
<
HandsonRowData
>();
int
i
=
0
;
foreach
(
var
item
in
list
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
cells
=
(
from
conf
in
WorkConfig
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
cells
.
Add
(
new
HandsonCellData
(
nameof
(
item
.
ID
),
item
.
ID
));
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
i
++;
}
handson
.
SetRowData
(
rowDatas
,
rowDatas
!=
null
);
return
handson
;
}
public
void
SaveWorkItemHands
(
int
allotId
,
SaveConfigData
request
)
{
var
dicData
=
CreateDataRow
(
allotId
,
request
,
WorkConfig
);
List
<
cof_workitem
>
works
=
new
List
<
cof_workitem
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
cof_workitem
>(
json
);
works
.
Add
(
data
);
}
_workitemRepository
.
Execute
(
"delete from cof_workitem where allotid = @allotid"
,
new
{
allotId
});
_workitemRepository
.
AddRange
(
works
.
ToArray
());
}
#
endregion
#
region
cof_depttype
科室别配置
...
...
@@ -499,6 +618,67 @@ public bool DepttypeDelete(DrugpropRequest request)
return
perforCofdepttypeRepository
.
Remove
(
entity
);
}
public
HandsonTable
GetDepttypeHands
(
int
allotId
)
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
DeptConfig
.
Select
(
c
=>
c
.
Value
).
ToArray
(),
DeptConfig
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
var
list
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
list
==
null
)
return
handson
;
List
<
HandsonRowData
>
rowDatas
=
new
List
<
HandsonRowData
>();
int
i
=
0
;
foreach
(
var
item
in
list
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
cells
=
(
from
conf
in
DeptConfig
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
cells
.
Add
(
new
HandsonCellData
(
nameof
(
item
.
ID
),
item
.
ID
));
if
(
item
.
Charge
==
null
)
{
cells
.
Add
(
new
HandsonCellData
(
DeptConfig
.
First
(
c
=>
c
.
Key
==
nameof
(
item
.
Charge
)).
Value
,
item
.
Charge
));
}
if
(
item
.
ChargeType
==
null
)
{
cells
.
Add
(
new
HandsonCellData
(
DeptConfig
.
First
(
c
=>
c
.
Key
==
nameof
(
item
.
Charge
)).
Value
,
item
.
Charge
));
}
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
i
++;
}
handson
.
SetRowData
(
rowDatas
,
rowDatas
!=
null
);
return
handson
;
}
public
void
SaveDepttypeHands
(
int
allotId
,
SaveConfigData
request
)
{
var
dicData
=
CreateDataRow
(
allotId
,
request
,
DeptConfig
);
List
<
cof_depttype
>
depts
=
new
List
<
cof_depttype
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
cof_depttype
>(
json
);
if
(
data
.
Charge
!=
null
&&
data
.
ChargeType
!=
null
)
{
depts
.
Add
(
data
);
}
}
perforCofdepttypeRepository
.
Execute
(
"delete from cof_depttype where allotid = @allotid"
,
new
{
allotId
});
perforCofdepttypeRepository
.
AddRange
(
depts
.
ToArray
());
}
#
endregion
#
region
cof_cmi
cmi
...
...
@@ -834,6 +1014,58 @@ private void CopyAprData(int prevAllotId, int allotId)
}
}
private
List
<
Dictionary
<
string
,
string
>>
CreateDataRow
(
int
allotId
,
SaveConfigData
request
,
Dictionary
<
string
,
string
>
config
)
{
List
<
Dictionary
<
string
,
string
>>
allData
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
r
=
0
;
r
<
request
.
Data
.
Length
;
r
++)
{
// 创建固定数据列
Dictionary
<
string
,
string
>
baseData
=
CreateBaseData
(
request
,
config
,
r
);
baseData
.
Add
(
nameof
(
collect_data
.
AllotID
),
allotId
.
ToString
());
allData
.
Add
(
baseData
);
}
return
allData
;
}
private
Dictionary
<
string
,
string
>
CreateBaseData
(
SaveConfigData
request
,
Dictionary
<
string
,
string
>
config
,
int
rownumber
)
{
Dictionary
<
string
,
string
>
result
=
new
Dictionary
<
string
,
string
>();
for
(
int
c
=
0
;
c
<
request
.
ColHeaders
.
Length
;
c
++)
{
var
header
=
request
.
ColHeaders
[
c
];
var
first
=
config
.
FirstOrDefault
(
w
=>
w
.
Value
==
header
);
if
(!
default
(
KeyValuePair
<
string
,
string
>).
Equals
(
first
)
&&
!
result
.
ContainsKey
(
header
)
&&
request
.
Data
[
rownumber
].
Length
>
c
)
{
result
.
Add
(
first
.
Key
,
request
.
Data
[
rownumber
][
c
]);
}
}
return
result
;
}
public
static
Dictionary
<
string
,
string
>
DrueType
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
cof_drugtype
.
Charge
),
"费用名称"
},
{
nameof
(
cof_drugtype
.
ChargeType
),
"费用类别"
}
};
public
static
Dictionary
<
string
,
string
>
DeptConfig
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
cof_depttype
.
Charge
),
"科室名称"
},
{
nameof
(
cof_depttype
.
ChargeType
),
"科室类别"
}
};
public
static
Dictionary
<
string
,
string
>
WorkConfig
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
cof_workitem
.
Item
),
"工作量计算项"
},
{
nameof
(
cof_workitem
.
Type
),
"类型"
}
};
///// <summary>
///// CMI值
///// </summary>
...
...
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