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
1964832e
Commit
1964832e
authored
Nov 02, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增提取日志显示,自定义加载上次配置
parent
18e7c8b9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
245 additions
and
2 deletions
+245
-2
performance/Performance.Api/Controllers/ConfigController.cs
+39
-0
performance/Performance.Api/Controllers/TemplateController.cs
+17
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+20
-0
performance/Performance.DtoModels/Request/CopyRequest.cs
+19
-0
performance/Performance.Services/ConfigService.cs
+141
-1
performance/Performance.Services/LogManageService.cs
+8
-0
performance/Performance.Services/UserService.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
1964832e
...
@@ -813,5 +813,43 @@ public ApiResponse SaveDrugtypeFactor([FromBody] DrugtypeFactorRequest request)
...
@@ -813,5 +813,43 @@ public ApiResponse SaveDrugtypeFactor([FromBody] DrugtypeFactorRequest request)
}
}
#
endregion
#
endregion
/// <summary>
/// 加载上次
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"loadthelasttime"
)]
public
ApiResponse
LoadTheLastTime
([
FromBody
]
CopyRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"AllotID错误"
);
_configService
.
NewCopy
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"保存成功!"
);
}
/// <summary>
/// 下拉
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"copydropdown"
)]
public
ApiResponse
CopyDropDown
()
{
var
result
=
new
List
<
CopyDrop
>
{
new
CopyDrop
{
Label
=
"工作量配置"
,
Value
=
"workItems"
},
new
CopyDrop
{
Label
=
"收入费用类别"
,
Value
=
"drugTypes"
},
new
CopyDrop
{
Label
=
"支出费用类别"
,
Value
=
"drugTypeDisburses"
},
new
CopyDrop
{
Label
=
"费用类别系数"
,
Value
=
"drugTypeFactors"
},
new
CopyDrop
{
Label
=
"科室类型"
,
Value
=
"deptTypes"
},
new
CopyDrop
{
Label
=
"二次绩效配置"
,
Value
=
"agains"
},
new
CopyDrop
{
Label
=
"核算单元及组别"
,
Value
=
"accountings"
},
};
;
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
}
}
}
\ No newline at end of file
performance/Performance.Api/Controllers/TemplateController.cs
View file @
1964832e
...
@@ -285,6 +285,21 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
...
@@ -285,6 +285,21 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
// B 使用配置作为模板
// B 使用配置作为模板
}
}
/// <summary>
/// 提取日志
/// </summary>
/// <returns></returns>
[
HttpPost
(
"PrejudgeLog/{allotId}"
)]
public
ApiResponse
PrejudgeLog
([
FromRoute
]
int
allotId
)
{
var
allot
=
allotService
.
GetAllot
(
allotId
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"AllotID错误"
);
var
result
=
logService
.
GetLogDbug
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
endregion
新版提取
#
endregion
新版提取
/// <summary>
/// <summary>
...
@@ -439,5 +454,7 @@ public IActionResult ExtractIncome(int allotId)
...
@@ -439,5 +454,7 @@ public IActionResult ExtractIncome(int allotId)
var
memi
=
provider
.
Mappings
[
fileExt
];
var
memi
=
provider
.
Mappings
[
fileExt
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
filepath
));
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
filepath
));
}
}
}
}
}
}
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
1964832e
...
@@ -843,6 +843,20 @@
...
@@ -843,6 +843,20 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.LoadTheLastTime(Performance.DtoModels.CopyRequest)"
>
<summary>
加载上次
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CopyDropDown"
>
<summary>
下拉
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.SubmitApplications(Performance.DtoModels.CostTransferRequest)"
>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.SubmitApplications(Performance.DtoModels.CostTransferRequest)"
>
<summary>
<summary>
申请划拨
申请划拨
...
@@ -1946,6 +1960,12 @@
...
@@ -1946,6 +1960,12 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.TemplateController.PrejudgeLog(System.Int32)"
>
<summary>
提取日志
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.TemplateController.DownFile(Performance.DtoModels.AllotRequest)"
>
<member
name=
"M:Performance.Api.Controllers.TemplateController.DownFile(Performance.DtoModels.AllotRequest)"
>
<summary>
<summary>
从WebAPI下载文件
从WebAPI下载文件
...
...
performance/Performance.DtoModels/Request/CopyRequest.cs
0 → 100644
View file @
1964832e
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
CopyRequest
{
public
int
AllotId
{
get
;
set
;
}
public
string
[]
Type
{
get
;
set
;
}
}
public
class
CopyDrop
{
public
string
Label
{
get
;
set
;
}
public
string
Value
{
get
;
set
;
}
}
}
performance/Performance.Services/ConfigService.cs
View file @
1964832e
...
@@ -40,6 +40,7 @@ public class ConfigService : IAutoInjection
...
@@ -40,6 +40,7 @@ public class ConfigService : IAutoInjection
private
readonly
ILogger
<
ConfigService
>
logger
;
private
readonly
ILogger
<
ConfigService
>
logger
;
private
readonly
PerforExmoduleRepository
perforExmoduleRepository
;
private
readonly
PerforExmoduleRepository
perforExmoduleRepository
;
private
readonly
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
;
private
readonly
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
public
ConfigService
(
PerforCofdirectorRepository
cofdirectorRepository
,
public
ConfigService
(
PerforCofdirectorRepository
cofdirectorRepository
,
//PerforCofdrugpropRepository cofdrugpropRepository,
//PerforCofdrugpropRepository cofdrugpropRepository,
...
@@ -63,7 +64,8 @@ public class ConfigService : IAutoInjection
...
@@ -63,7 +64,8 @@ public class ConfigService : IAutoInjection
ILogger
<
ConfigService
>
logger
,
ILogger
<
ConfigService
>
logger
,
ExConfigService
exConfigService
,
ExConfigService
exConfigService
,
PerforExmoduleRepository
perforExmoduleRepository
,
PerforExmoduleRepository
perforExmoduleRepository
,
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
)
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
,
PerforPerallotRepository
perallotRepository
)
{
{
this
.
_directorRepository
=
cofdirectorRepository
;
this
.
_directorRepository
=
cofdirectorRepository
;
//this._drugpropRepository = cofdrugpropRepository;
//this._drugpropRepository = cofdrugpropRepository;
...
@@ -88,6 +90,7 @@ public class ConfigService : IAutoInjection
...
@@ -88,6 +90,7 @@ public class ConfigService : IAutoInjection
this
.
logger
=
logger
;
this
.
logger
=
logger
;
this
.
perforExmoduleRepository
=
perforExmoduleRepository
;
this
.
perforExmoduleRepository
=
perforExmoduleRepository
;
this
.
cofdrugtypefactorRepository
=
cofdrugtypefactorRepository
;
this
.
cofdrugtypefactorRepository
=
cofdrugtypefactorRepository
;
this
.
perallotRepository
=
perallotRepository
;
}
}
#
endregion
#
endregion
...
@@ -1050,6 +1053,143 @@ public void Copy(per_allot allot)
...
@@ -1050,6 +1053,143 @@ public void Copy(per_allot allot)
}
}
}
}
//todo:新copy
/// <summary>
///
/// </summary>
/// <param name="allotId"></param>
/// <param name="type"></param>
public
void
NewCopy
(
CopyRequest
request
)
{
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
AllotId
);
var
list
=
perforPerAllotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
list
==
null
||
!
list
.
Any
(
t
=>
t
.
ID
==
allot
.
ID
))
return
;
list
=
list
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
ToList
();
var
index
=
list
.
IndexOf
(
list
.
First
(
t
=>
t
.
ID
==
allot
.
ID
));
// 先取上一个月的绩效Id,若没有取最后一个月的绩效Id,若都不存在则获取allotId为-1的数据
int
allotId
=
index
+
1
<
list
.
Count
?
list
[
index
+
1
].
ID
:
list
.
First
().
ID
;
if
(
allotId
==
allot
.
ID
)
request
.
AllotId
=
-
1
;
if
(
request
.
Type
.
Length
<
1
)
return
;
foreach
(
var
item
in
request
.
Type
)
{
switch
(
item
)
{
case
"workItems"
:
logger
.
LogInformation
(
$"copy workItems"
);
var
workItems
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
workItems
==
null
||
!
workItems
.
Any
())
{
workItems
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
workItems
!=
null
&&
workItems
.
Any
())
{
var
newWorkItems
=
workItems
.
Select
(
t
=>
new
cof_workitem
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Item
=
t
.
Item
});
_workitemRepository
.
AddRange
(
newWorkItems
.
ToArray
());
}
}
break
;
case
"drugTypes"
:
logger
.
LogInformation
(
$"copy drugTypes"
);
var
drugTypes
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
drugTypes
==
null
||
!
drugTypes
.
Any
())
{
drugTypes
=
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypes
!=
null
&&
drugTypes
.
Any
())
{
var
newDrugTypes
=
drugTypes
.
Select
(
t
=>
new
cof_drugtype
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
_drugtypeRepository
.
AddRange
(
newDrugTypes
.
ToArray
());
}
}
break
;
case
"drugTypeDisburses"
:
logger
.
LogInformation
(
$"copy drugTypeDisburses"
);
var
drugTypeDisburses
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
drugTypeDisburses
==
null
||
!
drugTypeDisburses
.
Any
())
{
drugTypeDisburses
=
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
drugtypeDisburseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypeDisburses
!=
null
&&
drugTypeDisburses
.
Any
())
{
var
newDrugTypeDisburses
=
drugTypeDisburses
.
Select
(
t
=>
new
cof_drugtype_disburse
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
drugtypeDisburseRepository
.
AddRange
(
newDrugTypeDisburses
.
ToArray
());
}
}
break
;
case
"drugTypeFactors"
:
logger
.
LogInformation
(
$"copy drugTypeFactors"
);
var
drugTypeFactors
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
drugTypeFactors
==
null
||
!
drugTypeFactors
.
Any
())
{
drugTypeFactors
=
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
cofdrugtypefactorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
drugTypeFactors
!=
null
&&
drugTypeFactors
.
Any
())
{
var
newDrugtypeFactors
=
drugTypeFactors
.
Select
(
t
=>
new
cof_drugtype_factor
{
HospitalId
=
allot
.
HospitalId
,
AllotID
=
allot
.
ID
,
ExModuleId
=
t
.
ExModuleId
,
Charge
=
t
.
Charge
,
YSZ
=
t
.
YSZ
,
HLZ
=
t
.
HLZ
,
YJZ
=
t
.
YJZ
});
cofdrugtypefactorRepository
.
AddRange
(
newDrugtypeFactors
.
ToArray
());
}
}
break
;
case
"deptTypes"
:
logger
.
LogInformation
(
$"copy deptTypes"
);
var
deptTypes
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
deptTypes
==
null
||
!
deptTypes
.
Any
())
{
deptTypes
=
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
perforCofdepttypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
deptTypes
!=
null
&&
deptTypes
.
Any
())
{
var
newDeptTypes
=
deptTypes
.
Select
(
t
=>
new
cof_depttype
{
AllotID
=
allot
.
ID
,
Charge
=
t
.
Charge
,
ChargeType
=
t
.
ChargeType
});
perforCofdepttypeRepository
.
AddRange
(
newDeptTypes
.
ToArray
());
}
}
break
;
case
"agains"
:
logger
.
LogInformation
(
$"copy agains"
);
var
agains
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
agains
==
null
||
!
agains
.
Any
())
{
agains
=
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_againRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
if
(
agains
!=
null
&&
agains
.
Any
())
{
var
days
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
var
newAgains
=
agains
.
Select
(
t
=>
new
cof_again
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Department
=
t
.
Department
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
TypeName
==
"满勤天数"
?
days
:
t
.
Value
});
_againRepository
.
AddRange
(
newAgains
.
ToArray
());
}
}
break
;
case
"accountings"
:
logger
.
LogInformation
(
$"copy accountings"
);
var
accountings
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
accountings
==
null
||
!
accountings
.
Any
())
{
accountings
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
-
1
);
if
(
accountings
!=
null
&&
accountings
.
Any
())
{
var
newAccountings
=
accountings
.
Select
(
t
=>
new
cof_accounting
{
AllotId
=
allot
.
ID
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
});
cofaccountingRepository
.
AddRange
(
newAccountings
.
ToArray
());
}
}
break
;
default
:
break
;
}
}
//personService.CreateAllotPersons(allot.HospitalId, allot.ID, allotId);
}
#
endregion
#
endregion
#
region
清楚无效数据
Clear
#
region
清楚无效数据
Clear
...
...
performance/Performance.Services/LogManageService.cs
View file @
1964832e
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Repository
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
Performance.Services
namespace
Performance.Services
...
@@ -130,5 +132,11 @@ public bool ClearExtractLog(int allotId)
...
@@ -130,5 +132,11 @@ public bool ClearExtractLog(int allotId)
{
{
return
logdbug
.
ClearExtractLog
(
allotId
);
return
logdbug
.
ClearExtractLog
(
allotId
);
}
}
//todo:log信息展示
public
List
<
log_dbug
>
GetLogDbug
(
int
allotId
)
{
return
logdbug
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
Type
==
2
);
}
}
}
}
}
performance/Performance.Services/UserService.cs
View file @
1964832e
...
@@ -760,7 +760,7 @@ public string SaveUserHandsFlat(UserCollectData request)
...
@@ -760,7 +760,7 @@ public string SaveUserHandsFlat(UserCollectData request)
var
getUsers
=
_userRepository
.
GetEntities
();
var
getUsers
=
_userRepository
.
GetEntities
();
var
roles
=
_roleRepository
.
GetEntities
();
var
roles
=
_roleRepository
.
GetEntities
();
var
hospitals
=
_hospitalRepository
.
GetEntities
();
var
hospitals
=
_hospitalRepository
.
GetEntities
();
//hack:后续修改为accounting中的数据
var
accounts
=
perforCofaccountingRepository
.
GetEntities
();
var
accounts
=
perforCofaccountingRepository
.
GetEntities
();
//var allot = _perallotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
//var allot = _perallotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
//var res = accounts?.Join(allot, t => t.AllotId, w => w.ID, (t, w) => new cof_accounting { AccountingUnit = t.AccountingUnit }).Distinct();
//var res = accounts?.Join(allot, t => t.AllotId, w => w.ID, (t, w) => new cof_accounting { AccountingUnit = t.AccountingUnit }).Distinct();
...
...
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