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
765e1e6f
Commit
765e1e6f
authored
May 05, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审核通过后同步数据到ex_result
parent
0214a744
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
17 deletions
+45
-17
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+10
-0
performance/Performance.DtoModels/Enum.cs
+9
-1
performance/Performance.EntityModels/Entity/ex_result.cs
+7
-3
performance/Performance.Services/EmployeeService.cs
+19
-13
No files found.
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
765e1e6f
...
...
@@ -3594,6 +3594,16 @@
创建时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ex_result.IsDelete"
>
<summary>
1 删除 0 未删除
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ex_result.FromSource"
>
<summary>
数据来源 0 提取 1 录入
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ex_result_gather.Id"
>
<summary>
...
...
performance/Performance.DtoModels/Enum.cs
View file @
765e1e6f
...
...
@@ -129,10 +129,18 @@ public enum Status
}
}
public
enum
AuditGatherEnum
public
class
EnumResult
{
public
enum
AuditGather
{
未审核
=
0
,
未通过
=
1
,
已通过
=
2
,
}
public
enum
FromSource
{
提取
=
0
,
录入
=
1
,
}
}
}
performance/Performance.EntityModels/Entity/ex_result.cs
View file @
765e1e6f
...
...
@@ -76,9 +76,13 @@ public class ex_result
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
//
//
/ <summary>
//
//
/ 1 删除 0 未删除
//
//
/ </summary>
/// <summary>
/// 1 删除 0 未删除
/// </summary>
public
int
IsDelete
{
get
;
set
;
}
/// <summary>
/// 数据来源 0 提取 1 录入
/// </summary>
public
int
FromSource
{
get
;
set
;
}
}
}
performance/Performance.Services/EmployeeService.cs
View file @
765e1e6f
...
...
@@ -1412,14 +1412,14 @@ public GatherResponse GetGatherTotal(Gather gather)
exp
=
exp
.
And
(
t
=>
t
.
Category
.
Contains
(
gather
.
SearchQuery
)
||
t
.
Source
.
Contains
(
gather
.
SearchQuery
)
||
t
.
Department
.
Contains
(
gather
.
SearchQuery
));
}
var
user
=
userRepository
.
GetEntities
();
var
userLogin
=
user
.
FirstOrDefault
(
t
=>
t
.
ID
==
gather
.
UserId
);
var
userLogin
=
user
.
FirstOrDefault
(
t
=>
t
.
ID
==
gather
.
UserId
);
if
(
userLogin
.
Login
!=
"admin"
)
{
var
userSource
=
perforcollectpermissionRepository
.
GetEntities
(
t
=>
t
.
UserId
==
gather
.
UserId
)
.
Select
(
s
=>
Regex
.
Replace
(
s
.
SheetName
.
Replace
(
" "
,
""
).
Replace
(
"."
,
""
),
"[0-9]"
,
""
))
.
Distinct
().
ToList
();
exp
=
exp
.
And
(
t
=>
userSource
.
Contains
(
t
.
Source
));
var
hasDepartment
=
perdeptdicRepository
.
GetEntities
(
p
=>
p
.
AccountingUnit
.
Contains
(
userLogin
.
Department
)).
Select
(
s
=>
s
.
HISDeptName
).
Distinct
().
ToList
();
var
hasDepartment
=
perdeptdicRepository
.
GetEntities
(
p
=>
p
.
AccountingUnit
.
Contains
(
userLogin
.
Department
)).
Select
(
s
=>
s
.
HISDeptName
).
Distinct
().
ToList
();
exp
=
exp
.
And
(
t
=>
hasDepartment
.
Contains
(
t
.
Department
));
}
...
...
@@ -1435,9 +1435,9 @@ public GatherResponse GetGatherTotal(Gather gather)
Login
=
user
.
FirstOrDefault
(
t
=>
t
.
ID
==
s
.
Key
.
Submitter
).
Login
,
CreateTime
=
s
.
Max
(
t
=>
t
.
CreateTime
).
ToString
(
"d"
),
AuditTime
=
s
.
Max
(
t
=>
t
.
AuditTime
)?.
ToString
(
"d"
),
States
=
s
.
Any
(
w
=>
w
.
States
==
(
int
)
AuditGatherEnum
.
未通过
)
?
"未通过"
:
s
.
Count
()
==
s
.
Where
(
w
=>
w
.
States
==
(
int
)
AuditGatherEnum
.
已通过
).
Count
()
?
"已通过"
:
s
.
Count
()
==
s
.
Where
(
w
=>
w
.
States
==
(
int
)
AuditGatherEnum
.
未审核
).
Count
()
?
"未审核"
:
"未知"
,
States
=
s
.
Any
(
w
=>
w
.
States
==
(
int
)
EnumResult
.
AuditGather
.
未通过
)
?
"未通过"
:
s
.
Count
()
==
s
.
Where
(
w
=>
w
.
States
==
(
int
)
EnumResult
.
AuditGather
.
已通过
).
Count
()
?
"已通过"
:
s
.
Count
()
==
s
.
Where
(
w
=>
w
.
States
==
(
int
)
EnumResult
.
AuditGather
.
未审核
).
Count
()
?
"未审核"
:
"未知"
,
Remark
=
s
.
FirstOrDefault
()?.
Remark
,
});
...
...
@@ -1602,7 +1602,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
var
ExistsDeptData
=
departments
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
(
w
.
Department
!=
null
&&
w
.
Department
.
Contains
(
newGather
[
i
].
Department
))
||
(
w
.
HISDeptName
!=
null
&&
w
.
HISDeptName
.
Contains
(
newGather
[
i
].
Department
))
||
(
w
.
HISDeptName
!=
null
&&
w
.
HISDeptName
.
Contains
(
newGather
[
i
].
Department
))
);
if
(
ExistsDeptData
==
null
)
error
.
Add
(
new
Dictionary
<
string
,
string
>
...
...
@@ -1616,7 +1616,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{
"错误原因"
,
$"科室字典中不存在科室[
{
newGather
[
i
].
Department
}
]"
},
});
var
ExistNameData
=
employees
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
(
w
.
DoctorName
!=
null
&&
w
.
DoctorName
==
newGather
[
i
].
DoctorName
));
var
ExistNameData
=
employees
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
(
w
.
DoctorName
!=
null
&&
w
.
DoctorName
==
newGather
[
i
].
DoctorName
));
if
(
ExistNameData
==
null
)
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
...
...
@@ -1629,7 +1629,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{
"错误原因"
,
$"人员字典中不存在医生姓名[
{
newGather
[
i
].
DoctorName
}
]"
},
});
var
ExistNumberData
=
employees
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
(
w
.
PersonnelNumber
!=
null
&&
w
.
PersonnelNumber
==
newGather
[
i
].
PersonnelNumber
));
var
ExistNumberData
=
employees
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
(
w
.
PersonnelNumber
!=
null
&&
w
.
PersonnelNumber
==
newGather
[
i
].
PersonnelNumber
));
if
(
ExistNumberData
==
null
)
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
...
...
@@ -1642,7 +1642,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{
"错误原因"
,
$"人员字典中不存在工号[
{
newGather
[
i
].
PersonnelNumber
}
]"
},
});
if
((
ExistNumberData
==
null
||
ExistNumberData
.
DoctorName
!=
newGather
[
i
].
DoctorName
)
if
((
ExistNumberData
==
null
||
ExistNumberData
.
DoctorName
!=
newGather
[
i
].
DoctorName
)
||
(
ExistNameData
==
null
||
ExistNameData
.
PersonnelNumber
!=
newGather
[
i
].
PersonnelNumber
))
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
...
...
@@ -1763,14 +1763,15 @@ public void SyncDataToResult(int allotId)
var
sheets
=
perforPersheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
new
[]
{
3
,
4
,
7
}.
Contains
(
t
.
SheetType
.
Value
));
if
(
sheets
==
null
||
!
sheets
.
Any
())
return
;
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
var
data
=
exresultgatherRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
States
==
(
int
)
EnumResult
.
AuditGather
.
已通过
);
if
(
data
==
null
||
!
data
.
Any
())
return
;
exresultRepository
.
DeleteFromQuery
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
FromSource
==
(
int
)
EnumResult
.
FromSource
.
录入
);
var
syncData
=
_mapper
.
Map
<
List
<
ex_result
>>(
data
);
syncData
.
ForEach
(
x
=>
{
x
.
Id
=
0
;
x
.
FromSource
=
(
int
)
EnumResult
.
FromSource
.
录入
;
x
.
Source
=
sheets
.
FirstOrDefault
(
t
=>
t
.
SheetName
.
Contains
(
x
.
Source
))?.
SheetName
??
x
.
Source
;
});
exresultRepository
.
AddRange
(
syncData
.
ToArray
());
...
...
@@ -1811,17 +1812,22 @@ public void AuditGather(List<Gather> gather)
datas
.
ForEach
(
d
=>
{
d
.
AuditTime
=
DateTime
.
Now
;
d
.
States
=
(
int
)
AuditGatherEnum
.
已通过
;
d
.
States
=
(
int
)
EnumResult
.
AuditGather
.
已通过
;
d
.
Remark
=
null
;
});
else
if
(
gatherFirst
.
Status
==
"失败"
)
datas
.
ForEach
(
d
=>
{
d
.
AuditTime
=
DateTime
.
Now
;
d
.
States
=
(
int
)
AuditGatherEnum
.
未通过
;
d
.
States
=
(
int
)
EnumResult
.
AuditGather
.
未通过
;
d
.
Remark
=
gatherFirst
.
Remark
;
});
exresultgatherRepository
.
UpdateRange
(
datas
.
ToArray
());
if
(
gatherFirst
.
Status
==
"通过"
)
{
SyncDataToResult
(
gatherFirst
.
AllotId
);
}
}
}
...
...
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