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
d9945f8a
Commit
d9945f8a
authored
May 27, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
核算单元修改
parent
11c4b9c9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
20 deletions
+31
-20
performance/Performance.Api/Controllers/ConfigController.cs
+14
-9
performance/Performance.DtoModels/Request/AccoungingRequest.cs
+10
-1
performance/Performance.Services/ConfigService.cs
+7
-10
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
d9945f8a
...
@@ -533,19 +533,24 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
...
@@ -533,19 +533,24 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
GetAccountingList
([
FromBody
]
AccoungingRequest
request
)
public
ApiResponse
GetAccountingList
([
FromBody
]
AccoungingRequest
request
)
{
{
if
(
request
.
AllotId
==
0
||
!
new
int
[]
{
1
,
2
,
3
}.
Contains
(
request
.
Type
))
var
enumItems
=
EnumHelper
.
GetItems
<
AccountTypeEnum
>();
if
(
request
.
AllotId
==
0
||
!
enumItems
.
Select
(
t
=>
t
.
Value
).
Contains
(
request
.
Type
))
return
new
ApiResponse
(
ResponseType
.
ParameterError
);
return
new
ApiResponse
(
ResponseType
.
ParameterError
);
var
list
=
_configService
.
GetAccountingList
(
request
)
??
new
List
<
cof_accounting
>(
);
var
result
=
_configService
.
GetAccountingList
(
request
);
switch
(
request
.
Type
)
switch
(
request
.
Type
)
{
{
case
1
:
case
(
int
)
AccountTypeEnum
.
List
:
//返回accounting列表
default
:
//返回accounting列表
default
:
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
AccountTypeEnum
.
List
.
ToString
(),
result
);
case
3
:
//返回核算单元类型
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
UnitType
,
Value
=
t
.
UnitType
}).
ToDistinct
());
case
(
int
)
AccountTypeEnum
.
UnitType
:
//返回核算单元类型
case
2
:
//返回核算单元
var
unittypes
=
result
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
UnitType
,
Value
=
t
.
UnitType
}).
ToDistinct
();
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
());
return
new
ApiResponse
(
ResponseType
.
OK
,
AccountTypeEnum
.
UnitType
.
ToString
(),
unittypes
);
case
(
int
)
AccountTypeEnum
.
AccountingUnit
:
//返回核算单元
var
accountingunits
=
result
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
();
return
new
ApiResponse
(
ResponseType
.
OK
,
AccountTypeEnum
.
AccountingUnit
.
ToString
(),
accountingunits
);
}
}
}
}
...
...
performance/Performance.DtoModels/Request/AccoungingRequest.cs
View file @
d9945f8a
...
@@ -8,7 +8,7 @@ public class AccoungingRequest
...
@@ -8,7 +8,7 @@ public class AccoungingRequest
public
int
AllotId
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 1 返回accounting列表 2 返回核算单元
3 返回核算单元类型
/// 1 返回accounting列表 2 返回核算单元
类型 3 返回核算单元
/// </summary>
/// </summary>
public
int
Type
{
get
;
set
;
}
public
int
Type
{
get
;
set
;
}
...
@@ -17,4 +17,13 @@ public class AccoungingRequest
...
@@ -17,4 +17,13 @@ public class AccoungingRequest
/// </summary>
/// </summary>
public
string
UnitType
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
}
}
public
enum
AccountTypeEnum
{
List
=
1
,
UnitType
=
2
,
AccountingUnit
=
3
}
}
}
performance/Performance.Services/ConfigService.cs
View file @
d9945f8a
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
using
System.Text
;
using
System.Text
;
using
Performance.EntityModels.Entity
;
using
Performance.EntityModels.Entity
;
using
Performance.Repository.Repository
;
using
Performance.Repository.Repository
;
using
System.Linq.Expressions
;
namespace
Performance.Services
namespace
Performance.Services
{
{
...
@@ -643,15 +644,11 @@ public bool AgainDelete(CofAgainRequest request)
...
@@ -643,15 +644,11 @@ public bool AgainDelete(CofAgainRequest request)
/// <returns></returns>
/// <returns></returns>
public
List
<
cof_accounting
>
GetAccountingList
(
AccoungingRequest
request
)
public
List
<
cof_accounting
>
GetAccountingList
(
AccoungingRequest
request
)
{
{
switch
(
request
.
Type
)
Expression
<
Func
<
cof_accounting
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
request
.
AllotId
;
{
if
(
request
.
Type
==
(
int
)
AccountTypeEnum
.
AccountingUnit
&&
!
string
.
IsNullOrEmpty
(
request
.
UnitType
))
case
1
:
//返回accounting列表
exp
=
exp
.
And
(
t
=>
t
.
UnitType
==
request
.
UnitType
);
case
3
:
//返回核算单元类型
default
:
return
cofaccountingRepository
.
GetEntities
(
exp
)
??
new
List
<
cof_accounting
>();
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
case
2
:
//返回核算单元
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
UnitType
==
request
.
UnitType
);
}
}
}
/// <summary>
/// <summary>
...
@@ -743,7 +740,7 @@ public bool BatchSaveAccounting(int allotId, SaveCollectData request)
...
@@ -743,7 +740,7 @@ public bool BatchSaveAccounting(int allotId, SaveCollectData request)
if
(!
unitType
.
Contains
(
data
?.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
data
?.
UnitType
))
return
false
;
if
(!
unitType
.
Contains
(
data
?.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
data
?.
UnitType
))
return
false
;
if
(
getAccounts
!=
null
)
if
(
getAccounts
!=
null
)
if
(
getAccounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
))
continue
;
if
(
getAccounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
))
continue
;
var
any
=
accounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
);
var
any
=
accounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
);
if
(!
string
.
IsNullOrEmpty
(
data
.
AccountingUnit
)
&&
!
string
.
IsNullOrEmpty
(
data
.
UnitType
)
&&
!
any
)
if
(!
string
.
IsNullOrEmpty
(
data
.
AccountingUnit
)
&&
!
string
.
IsNullOrEmpty
(
data
.
UnitType
)
&&
!
any
)
...
...
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