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
dd4cd599
Commit
dd4cd599
authored
Mar 05, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HRP保存
parent
ff53294f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
4 deletions
+57
-4
performance/Performance.Api/Controllers/ConfigController.cs
+2
-2
performance/Performance.Services/ConfigService.cs
+55
-2
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
dd4cd599
...
@@ -569,8 +569,8 @@ public ApiResponse SaveHrpDept(int hospitalId, int allotId, [FromBody] SaveColle
...
@@ -569,8 +569,8 @@ public ApiResponse SaveHrpDept(int hospitalId, int allotId, [FromBody] SaveColle
if
(
hospitalId
<=
0
)
if
(
hospitalId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"HospitalId无效"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"HospitalId无效"
);
if
(
allotId
<=
0
)
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"allotid无效"
);
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"allotid无效"
);
_configService
.
SaveDepttypeHands
(
hospitalId
,
allotId
,
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
#
endregion
#
endregion
...
...
performance/Performance.Services/ConfigService.cs
View file @
dd4cd599
...
@@ -866,8 +866,61 @@ public HandsonTable GetHrpDeptHands(int HospitalId,int AllotId)
...
@@ -866,8 +866,61 @@ public HandsonTable GetHrpDeptHands(int HospitalId,int AllotId)
return
result
;
return
result
;
}
}
public
void
SaveDepttypeHands
(
int
hospitalId
,
int
allotId
,
SaveCollectData
request
)
{
var
dicData
=
CreateDataRow
(
allotId
,
request
,
HrpDept
);
List
<
cof_hrp_department
>
depts
=
new
List
<
cof_hrp_department
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
cof_hrp_department
>(
json
);
if
(!
string
.
IsNullOrEmpty
(
data
.
HRPDepartment
))
{
data
.
HospitalId
=
hospitalId
;
data
.
AllotId
=
allotId
;
depts
.
Add
(
data
);
}
}
perforCofHrpDeptRepository
.
Execute
(
"delete from cof_hrp_department where HospitalId=@hospitalId and allotid = @allotid"
,
new
{
hospitalId
,
allotId
});
perforCofHrpDeptRepository
.
AddRange
(
depts
.
ToArray
());
}
private
List
<
Dictionary
<
string
,
string
>>
CreateDataRow
(
int
allotId
,
SaveCollectData
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
(
SaveCollectData
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
>
HrpDept
{
get
;
}
=
new
Dictionary
<
string
,
string
>
public
static
Dictionary
<
string
,
string
>
HrpDept
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
{
nameof
(
cof_hrp_department
.
HRPDepartment
),
"HRP人员科室"
},
{
nameof
(
cof_hrp_department
.
HRPDepartment
),
"HRP人员科室"
},
...
...
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