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
6cee8eb3
Commit
6cee8eb3
authored
Jul 14, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科室来源更改为 字典,生成时无sheet5.1兼容
parent
7e4c9653
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
42 deletions
+66
-42
performance/Performance.Api/Controllers/SecondAllotController.cs
+2
-0
performance/Performance.DtoModels/Request/UserRequest.cs
+2
-2
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+12
-9
performance/Performance.Services/DFExtractService - 副本.cs
+5
-3
performance/Performance.Services/SecondAllotService.cs
+17
-1
performance/Performance.Services/UserService.cs
+28
-27
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
6cee8eb3
...
...
@@ -38,6 +38,8 @@ public ApiResponse List()
{
var
userId
=
claimService
.
GetUserId
();
var
result
=
secondAllotService
.
GetSecondList
(
userId
);
if
(
result
!=
null
&&
result
.
Any
())
result
=
result
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
ToList
();
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
...
...
performance/Performance.DtoModels/Request/UserRequest.cs
View file @
6cee8eb3
...
...
@@ -63,7 +63,7 @@ public UserRequestValidator()
RuleFor
(
x
=>
x
.
RealName
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
Login
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
Mobile
).
NotNull
().
NotEmpty
().
Must
((
pre
)
=>
{
return
CustomValidator
.
IsMobile
(
pre
);
});
RuleFor
(
x
=>
x
.
Mail
).
EmailAddress
().
When
(
pre
=>
{
return
!
string
.
IsNullOrEmpty
(
pre
.
Mail
);
});
//
RuleFor(x => x.Mail).EmailAddress().When(pre => { return !string.IsNullOrEmpty(pre.Mail); });
};
RuleSet
(
"Insert"
,
()
=>
...
...
@@ -98,7 +98,7 @@ public UserRequestValidator()
return
CustomValidator
.
IsMobile
(
pre
);
return
true
;
});
RuleFor
(
x
=>
x
.
Mail
).
EmailAddress
().
When
(
pre
=>
{
return
!
string
.
IsNullOrEmpty
(
pre
.
Mail
);
});
//
RuleFor(x => x.Mail).EmailAddress().When(pre => { return !string.IsNullOrEmpty(pre.Mail); });
});
}
}
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
6cee8eb3
...
...
@@ -246,18 +246,21 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
var
deptAccounting
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
AccountBasic
);
var
accountList
=
deptAccounting
.
PerData
.
Select
(
t
=>
(
PerDataAccountBaisc
)
t
);
var
deptAccountAssess
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
AccountAssess
);
var
assessList
=
deptAccountAssess
.
PerData
.
Select
(
t
=>
(
PerData
)
t
);
var
deptExtra
=
new
List
<
PerData
>();
if
(
isFirst
&&
assessList
!=
null
&&
assessList
.
Any
())
var
deptAccountAssess
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
AccountAssess
);
if
(
deptAccountAssess
!=
null
&&
deptAccountAssess
.
PerData
!=
null
)
{
deptExtra
=
assessList
.
GroupBy
(
t
=>
new
{
t
.
UnitType
,
t
.
AccountingUnit
,
t
.
Department
}).
Select
(
t
=>
new
PerData
var
assessList
=
deptAccountAssess
.
PerData
?.
Select
(
t
=>
(
PerData
)
t
);
if
(
isFirst
&&
assessList
!=
null
&&
assessList
.
Any
())
{
UnitType
=
t
.
Key
.
UnitType
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
Department
=
t
.
Key
.
Department
,
CellValue
=
t
.
Sum
(
g
=>
g
.
CellValue
)
}).
ToList
();
deptExtra
=
assessList
.
GroupBy
(
t
=>
new
{
t
.
UnitType
,
t
.
AccountingUnit
,
t
.
Department
}).
Select
(
t
=>
new
PerData
{
UnitType
=
t
.
Key
.
UnitType
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
Department
=
t
.
Key
.
Department
,
CellValue
=
t
.
Sum
(
g
=>
g
.
CellValue
)
}).
ToList
();
}
}
var
economicData
=
perSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
ComputeEconomic
)?.
PerData
.
Select
(
t
=>
(
PerData
)
t
);
...
...
performance/Performance.Services/DFExtractService - 副本.cs
View file @
6cee8eb3
usin
g
Dapper
;
usin
g
Dapper
;
...
...
@@ -128,7 +128,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
}
return
lastAllot
==
null
?
TemplateExecute
(
email
,
hospital
,
configs
,
modules
,
items
,
specials
,
data
)
:
AlllotExecute
(
email
,
hospital
,
configs
,
modules
,
items
,
specials
,
data
,
lastAllot
,
filePath
);
:
AlllotExecute
(
email
,
hospital
,
configs
,
modules
,
items
,
specials
,
data
,
lastAllot
,
filePath
);
}
catch
(
Exception
ex
)
{
...
...
@@ -917,7 +917,9 @@ private void WriteAccountBasic(ISheet sheet, IPerSheetDataRead sheetRead, bool i
{
if
(
pair
.
Value
==
-
1
)
continue
;
var
cell
=
GetOrCreate
(
row
,
pair
.
Value
);
cell
.
SetCellValue
(
""
);
var
func
=
dict
[
pair
.
Key
];
if
(
func
!=
null
)
OutToExcelCell
(
cell
,
func
.
Invoke
(
data
));
}
data
.
IsDelete
=
1
;
}
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
6cee8eb3
...
...
@@ -34,6 +34,7 @@ public class SecondAllotService : IAutoInjection
private
readonly
PerforAgworkloadtypeRepository
perforAgworkloadtypeRepository
;
private
readonly
PerforRoleRepository
roleRepository
;
private
readonly
PerforResspecialunitRepository
resspecialunitRepository
;
private
readonly
PersonService
personService
;
private
readonly
List
<
ag_tempitem
>
tempitems
=
new
List
<
ag_tempitem
>();
public
SecondAllotService
(
IOptions
<
Application
>
application
,
...
...
@@ -53,7 +54,8 @@ public class SecondAllotService : IAutoInjection
PerforAgothersourceRepository
perforAgothersourceRepository
,
PerforAgworkloadtypeRepository
perforAgworkloadtypeRepository
,
PerforRoleRepository
roleRepository
,
PerforResspecialunitRepository
resspecialunitRepository
)
PerforResspecialunitRepository
resspecialunitRepository
,
PersonService
personService
)
{
this
.
application
=
application
.
Value
;
this
.
perforUserRepository
=
perforUserRepository
;
...
...
@@ -73,6 +75,7 @@ public class SecondAllotService : IAutoInjection
this
.
perforAgworkloadtypeRepository
=
perforAgworkloadtypeRepository
;
this
.
roleRepository
=
roleRepository
;
this
.
resspecialunitRepository
=
resspecialunitRepository
;
this
.
personService
=
personService
;
this
.
tempitems
=
perforAgtempitemRepository
.
GetEntities
();
}
...
...
@@ -327,6 +330,19 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
};
}
private
void
GetEmployees
(
int
allotId
,
int
userId
)
{
Dictionary
<
int
,
Func
<
per_employee
,
object
>>
dict
=
new
Dictionary
<
int
,
Func
<
per_employee
,
object
>>
{
{
19
,
(
t
)
=>
t
.
DoctorName
},
{
20
,
(
t
)
=>
t
.
JobTitle
},
{
22
,
(
t
)
=>
t
.
AttendanceDay
},
};
var
employees
=
personService
.
GetPersons
(
allotId
,
userId
);
var
list
=
new
List
<
BodyItem
>();
}
/// <summary>
/// 根据已保存的数据返回
/// </summary>
...
...
performance/Performance.Services/UserService.cs
View file @
6cee8eb3
...
...
@@ -335,33 +335,34 @@ public List<sys_role> RoleList(int userId)
/// <returns></returns>
public
List
<
TitleValue
>
Department
(
int
hospitalId
)
{
var
allotList
=
_perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
result
=
new
List
<
string
>();
if
(
allotList
!=
null
)
{
var
idList
=
allotList
.
Select
(
s
=>
s
.
ID
).
ToList
();
//var department = _employeeRepository.GetEntities(t => t.Department != "" && idList.Contains(t.AllotID.Value)).Select(t => t.Department);
//if (department != null && department.Count() > 0)
// result.AddRange(department);
var
department
=
_imaccountbasicRepository
.
GetEntities
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
DoctorAccountingUnit
)
&&
idList
.
Contains
(
t
.
AllotID
.
Value
))?.
Select
(
t
=>
t
.
DoctorAccountingUnit
);
if
(
department
!=
null
&&
department
.
Count
()
>
0
)
result
.
AddRange
(
department
);
// 特殊科室
department
=
_imspecialunitRepository
.
GetEntities
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
AccountingUnit
)
&&
idList
.
Contains
(
t
.
AllotID
.
Value
))?.
Select
(
t
=>
t
.
AccountingUnit
);
if
(
department
!=
null
&&
department
.
Count
()
>
0
)
result
.
AddRange
(
department
);
if
(
result
!=
null
&&
result
.
Any
())
{
result
=
result
.
Distinct
().
OrderBy
(
t
=>
t
).
ToList
();
}
}
//var list = _perdeptdicRepository.GetEntities(t => t.HospitalId == hospitalId);
//if (list == null || !list.Any()) return new List<TitleValue>();
//var result = list.Select(t => t.AccountingUnit).Distinct().OrderBy(t => t);
//var allotList = _perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId);
//var result = new List<string>();
//if (allotList != null)
//{
// var idList = allotList.Select(s => s.ID).ToList();
// //var department = _employeeRepository.GetEntities(t => t.Department != "" && idList.Contains(t.AllotID.Value)).Select(t => t.Department);
// //if (department != null && department.Count() > 0)
// // result.AddRange(department);
// var department = _imaccountbasicRepository.GetEntities(t => !string.IsNullOrEmpty(t.DoctorAccountingUnit) && idList.Contains(t.AllotID.Value))?.Select(t => t.DoctorAccountingUnit);
// if (department != null && department.Count() > 0)
// result.AddRange(department);
// // 特殊科室
// department = _imspecialunitRepository.GetEntities(t => !string.IsNullOrEmpty(t.AccountingUnit) && idList.Contains(t.AllotID.Value))?.Select(t => t.AccountingUnit);
// if (department != null && department.Count() > 0)
// result.AddRange(department);
// if (result != null && result.Any())
// {
// result = result.Distinct().OrderBy(t => t).ToList();
// }
//}
var
list
=
_perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
list
==
null
||
!
list
.
Any
())
return
new
List
<
TitleValue
>();
var
result
=
list
.
Select
(
t
=>
t
.
AccountingUnit
).
Distinct
().
OrderBy
(
t
=>
t
);
return
result
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
}).
ToList
();
}
...
...
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