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
698a7786
Commit
698a7786
authored
May 12, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cof_accounting实体、仓储、数据操作
parent
a8f0381f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
234 additions
and
18 deletions
+234
-18
performance/Performance.Api/Controllers/ConfigController.cs
+75
-1
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+2
-0
performance/Performance.EntityModels/Entity/cof_accounting.cs
+39
-0
performance/Performance.Repository/PerforCofdirectorRepository.cs
+1
-0
performance/Performance.Repository/Repository/PerforCofaccountingRepository.cs
+21
-0
performance/Performance.Services/ConfigService.cs
+96
-17
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
698a7786
...
...
@@ -258,7 +258,7 @@ public ConfigController(ConfigService configService, AllotService allotService)
[
HttpPost
]
public
ApiResponse
GetDrugtypeList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
DrugpropRequest
request
)
{
var
list
=
_configService
.
GetDrugtypeList
(
request
.
HospitalId
,
request
.
AllotID
);
var
list
=
_configService
.
GetDrugtypeList
(
request
.
HospitalId
,
request
.
AllotID
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
...
...
@@ -523,6 +523,80 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
//}
#
endregion
#
region
accounting
/// <summary>
/// 获取cof_accounting列表
/// </summary>
/// <param name="allotId"></param>
/// <param name="type"></param>
/// <returns></returns>
[
Route
(
"accountinglist/{allotId/{type}}"
)]
[
HttpPost
]
public
ApiResponse
GetAccountingList
([
FromRoute
]
int
allotId
,
int
type
)
{
if
(
allotId
==
0
||
!
new
int
[]
{
1
,
2
,
3
}.
Contains
(
type
))
return
new
ApiResponse
(
ResponseType
.
ParameterError
);
var
list
=
_configService
.
GetAccountingList
(
allotId
)
??
new
List
<
cof_accounting
>();
switch
(
type
)
{
case
1
:
default
:
//返回accounting列表
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
case
2
:
//返回核算单元类型
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
UnitType
,
Value
=
t
.
UnitType
}).
ToDistinct
());
case
3
:
//返回核算单元
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
());
}
}
/// <summary>
/// 新增cof_accounting
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"accountinginsert"
)]
[
HttpPost
]
public
ApiResponse
AccountingInsert
([
FromBody
]
cof_accounting
request
)
{
if
(
request
.
AllotId
==
0
||
string
.
IsNullOrEmpty
(
request
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
AccountingUnit
))
return
new
ApiResponse
(
ResponseType
.
ParameterError
);
var
drugprop
=
_configService
.
AccountingInsert
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
drugprop
);
}
/// <summary>
/// 修改cof_accounting
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"accountingupdate"
)]
[
HttpPost
]
public
ApiResponse
AccountingUpdate
([
FromBody
]
cof_accounting
request
)
{
if
(
request
.
AllotId
==
0
||
string
.
IsNullOrEmpty
(
request
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
AccountingUnit
))
return
new
ApiResponse
(
ResponseType
.
ParameterError
);
var
drugprop
=
_configService
.
AccountingUpdate
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
drugprop
);
}
/// <summary>
/// 删除cof_accounting
/// </summary>
/// <param name="accountingId"></param>
/// <returns></returns>
[
Route
(
"accountingdelete/{accountingId}"
)]
[
HttpPost
]
public
ApiResponse
AccountingDelete
([
FromRoute
]
int
accountingId
)
{
if
(!
_configService
.
AccountingDelete
(
accountingId
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
/// <summary>
/// 获取工作量绩效列头
/// </summary>
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
698a7786
...
...
@@ -60,6 +60,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 考核列头 </summary>
public
virtual
DbSet
<
as_tempcolumns
>
as_tempcolumns
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
cof_accounting
>
cof_accounting
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
cof_again
>
cof_again
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
cof_alias
>
cof_alias
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Entity/cof_accounting.cs
0 → 100644
View file @
698a7786
//-----------------------------------------------------------------------
// <copyright file=" cof_accounting.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
///
/// </summary>
[
Table
(
"cof_accounting"
)]
public
class
cof_accounting
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 绩效Id
/// </summary>
public
int
AllotId
{
get
;
set
;
}
/// <summary>
/// 核算单元类型
/// </summary>
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 核算单元
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
698a7786
...
...
@@ -56,6 +56,7 @@ public int DeleteAllotData(int allotId)
List
<
string
>
tableArray
=
new
List
<
string
>
{
"ag_secondallot"
,
"cof_accounting"
,
"cof_again"
,
"cof_check"
,
"cof_cmi"
,
...
...
performance/Performance.Repository/Repository/PerforCofaccountingRepository.cs
0 → 100644
View file @
698a7786
//-----------------------------------------------------------------------
// <copyright file=" cof_accounting.cs">
// * FileName: cof_accounting.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// cof_accounting Repository
/// </summary>
public
class
PerforCofaccountingRepository
:
PerforRepository
<
cof_accounting
>
{
public
PerforCofaccountingRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/ConfigService.cs
View file @
698a7786
...
...
@@ -17,23 +17,24 @@ namespace Performance.Services
public
class
ConfigService
:
IAutoInjection
{
#
region
private
PerforCofdirectorRepository
_directorRepository
;
//private PerforCofdrugpropRepository _drugpropRepository;
private
PerforCofworkitemRepository
_workitemRepository
;
private
PerforCofagainRepository
_againRepository
;
private
PerforCofdrugtypeRepository
_drugtypeRepository
;
private
PerforPerallotRepository
perforPerAllotRepository
;
private
PerforHospitalRepository
perforHospitalRepository
;
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforImheaderRepository
perforImheaderRepository
;
private
PerforCofdepttypeRepository
perforCofdepttypeRepository
;
private
PerforPerapramountRepository
perapramountRepository
;
//private PerforCofcmiRepository perforCofcmiRepository;
private
PerforCofHrpDeptRepository
perforCofHrpDeptRepository
;
private
PerforCofaliasRepository
perforCofaliasRepository
;
private
PersonService
personService
;
private
LogManageService
logManageService
;
private
ILogger
<
ConfigService
>
logger
;
private
readonly
PerforCofdirectorRepository
_directorRepository
;
//private readonly PerforCofdrugpropRepository _drugpropRepository;
private
readonly
PerforCofworkitemRepository
_workitemRepository
;
private
readonly
PerforCofagainRepository
_againRepository
;
private
readonly
PerforCofdrugtypeRepository
_drugtypeRepository
;
private
readonly
PerforPerallotRepository
perforPerAllotRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
PerforPersheetRepository
perforPersheetRepository
;
private
readonly
PerforImheaderRepository
perforImheaderRepository
;
private
readonly
PerforCofdepttypeRepository
perforCofdepttypeRepository
;
private
readonly
PerforPerapramountRepository
perapramountRepository
;
//private readonly PerforCofcmiRepository perforCofcmiRepository;
private
readonly
PerforCofHrpDeptRepository
perforCofHrpDeptRepository
;
private
readonly
PerforCofaliasRepository
perforCofaliasRepository
;
private
readonly
PerforCofaccountingRepository
cofaccountingRepository
;
private
readonly
PersonService
personService
;
private
readonly
LogManageService
logManageService
;
private
readonly
ILogger
<
ConfigService
>
logger
;
public
ConfigService
(
PerforCofdirectorRepository
cofdirectorRepository
,
//PerforCofdrugpropRepository cofdrugpropRepository,
...
...
@@ -49,6 +50,7 @@ public class ConfigService : IAutoInjection
//PerforCofcmiRepository perforCofcmiRepository,
PerforCofHrpDeptRepository
perforCofHrpDeptRepository
,
PerforCofaliasRepository
perforCofaliasRepository
,
PerforCofaccountingRepository
cofaccountingRepository
,
PersonService
personService
,
LogManageService
logManageService
,
ILogger
<
ConfigService
>
logger
)
...
...
@@ -67,6 +69,7 @@ public class ConfigService : IAutoInjection
//this.perforCofcmiRepository = perforCofcmiRepository;
this
.
perforCofHrpDeptRepository
=
perforCofHrpDeptRepository
;
this
.
perforCofaliasRepository
=
perforCofaliasRepository
;
this
.
cofaccountingRepository
=
cofaccountingRepository
;
this
.
personService
=
personService
;
this
.
logManageService
=
logManageService
;
this
.
logger
=
logger
;
...
...
@@ -632,6 +635,72 @@ public bool AgainDelete(CofAgainRequest request)
#
endregion
#
region
cof_accounting
核算单元及类别(
4.1
)配置
/// <summary>
/// 获取cof_accounting列表
/// </summary>
/// <returns></returns>
public
List
<
cof_accounting
>
GetAccountingList
(
int
allotId
)
{
var
list
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
return
list
;
}
/// <summary>
/// 添加数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_accounting
AccountingInsert
(
cof_accounting
request
)
{
var
entity
=
new
cof_accounting
{
AllotId
=
request
.
AllotId
,
UnitType
=
request
.
UnitType
,
AccountingUnit
=
request
.
AccountingUnit
};
if
(!
cofaccountingRepository
.
Add
(
entity
))
throw
new
PerformanceException
(
"保存失败"
);
return
entity
;
}
/// <summary>
/// 更新数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_accounting
AccountingUpdate
(
cof_accounting
request
)
{
var
entity
=
cofaccountingRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
if
(
null
==
entity
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
Id
}
"
);
entity
.
AllotId
=
request
.
AllotId
;
entity
.
UnitType
=
request
.
UnitType
;
entity
.
AccountingUnit
=
request
.
AccountingUnit
;
if
(!
cofaccountingRepository
.
Update
(
entity
))
throw
new
PerformanceException
(
"保存失败"
);
return
entity
;
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="accountingId"></param>
/// <returns></returns>
public
bool
AccountingDelete
(
int
accountingId
)
{
var
entity
=
cofaccountingRepository
.
GetEntity
(
t
=>
t
.
Id
==
accountingId
);
if
(
null
==
entity
)
throw
new
PerformanceException
(
$"ID不存在 :
{
accountingId
}
"
);
return
cofaccountingRepository
.
Remove
(
entity
);
}
#
endregion
#
region
Copy
/// <summary>
...
...
@@ -745,6 +814,16 @@ public void Copy(per_allot allot)
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Department
=
t
.
Department
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
TypeName
==
"满勤天数"
?
days
:
t
.
Value
});
_againRepository
.
AddRange
(
newAgains
.
ToArray
());
}
logger
.
LogInformation
(
$"accounting"
);
var
accountings
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
accountings
==
null
||
accountings
.
Count
==
0
)
{
var
prevData
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
newData
=
prevData
?.
Select
(
t
=>
new
cof_accounting
{
AllotId
=
allot
.
ID
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
});
if
(
newData
!=
null
&&
newData
.
Any
())
cofaccountingRepository
.
AddRange
(
newData
.
ToArray
());
}
}
#
endregion
...
...
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