Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
c7aaf2a0
Commit
c7aaf2a0
authored
Dec 20, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增控制器
parent
b88f8427
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
3 deletions
+124
-3
BonusConfigModule.cs
Edu.Module.Course/BonusConfigModule.cs
+2
-2
RB_Bonus_PlanRepository.cs
Edu.Repository/Sell/RB_Bonus_PlanRepository.cs
+1
-1
BonusController.cs
Edu.WebApi/Controllers/Bonus/BonusController.cs
+121
-0
No files found.
Edu.Module.Course/BonusConfigModule.cs
View file @
c7aaf2a0
...
@@ -32,9 +32,9 @@ namespace Edu.Module.Course
...
@@ -32,9 +32,9 @@ namespace Edu.Module.Course
/// <param name="rowsCount"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Bonus_PlanExtend
>
GetBounsPlan
ListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Bonus_PlanExtend
query
)
public
List
<
RB_Bonus_PlanExtend
>
GetBounsPlan
PageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Bonus_PlanExtend
query
)
{
{
var
list
=
bonus_PlanRepository
.
GetBounsPlan
List
Repository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
var
list
=
bonus_PlanRepository
.
GetBounsPlan
Page
Repository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
...
...
Edu.Repository/Sell/RB_Bonus_PlanRepository.cs
View file @
c7aaf2a0
...
@@ -21,7 +21,7 @@ namespace Edu.Repository.Sell
...
@@ -21,7 +21,7 @@ namespace Edu.Repository.Sell
/// <param name="rowsCount"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Bonus_PlanExtend
>
GetBounsPlan
List
Repository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Bonus_PlanExtend
query
)
public
List
<
RB_Bonus_PlanExtend
>
GetBounsPlan
Page
Repository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Bonus_PlanExtend
query
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
...
...
Edu.WebApi/Controllers/Bonus/BonusController.cs
0 → 100644
View file @
c7aaf2a0
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Sell
;
using
Edu.Module.Course
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Edu.WebApi.Controllers.Bonus
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
BonusController
:
BaseController
{
/// <summary>
/// 获取课程顾问、市场达标奖金配置处理类对象
/// </summary>
private
readonly
BonusConfigModule
bonusConfigModule
=
new
BonusConfigModule
();
/// <summary>
/// 获取课程顾问、市场达标奖金配置分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetBounsPlanPage
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Bonus_PlanExtend
()
{
PlanName
=
base
.
ParmJObj
.
GetStringValue
(
"PlanName"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
List
<
object
>
result
=
new
List
<
object
>();
var
list
=
bonusConfigModule
.
GetBounsPlanPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
string
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
result
.
Add
(
new
{
item
.
Id
,
item
.
PlanName
,
item
.
BasicSalary
,
item
.
OpenBonus
,
item
.
WorkAgeSalary
,
item
.
ClueNumSalary
,
item
.
SaleIds
,
item
.
UseCourseIds
,
item
.
NotUseCourseIds
,
CreateByName
,
CreateTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
),
});
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
result
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 新增修改课程顾问、市场达标奖金配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetBounsPlan
()
{
var
query
=
new
RB_Bonus_PlanExtend
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
PlanName
=
base
.
ParmJObj
.
GetStringValue
(
"PlanName"
),
BasicSalary
=
base
.
ParmJObj
.
GetDecimal
(
"BasicSalary"
),
OpenBonus
=
base
.
ParmJObj
.
GetDecimal
(
"OpenBonus"
),
WorkAgeSalary
=
base
.
ParmJObj
.
GetDecimal
(
"WorkAgeSalary"
),
ClueNumSalary
=
base
.
ParmJObj
.
GetDecimal
(
"ClueNumSalary"
),
SaleIds
=
base
.
ParmJObj
.
GetStringValue
(
"SaleIds"
),
UseCourseIds
=
base
.
ParmJObj
.
GetStringValue
(
"UseCourseIds"
),
NotUseCourseIds
=
base
.
ParmJObj
.
GetStringValue
(
"NotUseCourseIds"
),
};
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
CreateTime
=
DateTime
.
Now
;
query
.
UpdateTime
=
DateTime
.
Now
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
bool
flag
=
bonusConfigModule
.
SetBonusPlanModule
(
query
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 根据编号获取课程顾问、市场达标奖金配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetBonusPlan
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
model
=
bonusConfigModule
.
GetBonusPlanModule
(
Id
);
return
ApiResult
.
Success
(
data
:
model
);
}
/// <summary>
/// 根据编号删除课程顾问、市场达标奖金配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RemoveBonusPlan
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
flag
=
bonusConfigModule
.
RemoveBonusPlanModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
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