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
b650a5cf
Commit
b650a5cf
authored
Dec 21, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a11d5223
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1832 additions
and
47 deletions
+1832
-47
RB_Sell_Achievements_Deduction.cs
Edu.Model/Entity/Sell/RB_Sell_Achievements_Deduction.cs
+66
-0
RB_Sell_Achievements_Details.cs
Edu.Model/Entity/Sell/RB_Sell_Achievements_Details.cs
+146
-0
RB_Sell_Achievements_Emp.cs
Edu.Model/Entity/Sell/RB_Sell_Achievements_Emp.cs
+85
-0
RB_Sell_Achievements_Periods.cs
Edu.Model/Entity/Sell/RB_Sell_Achievements_Periods.cs
+66
-0
RB_Sell_Achievements_Rule.cs
Edu.Model/Entity/Sell/RB_Sell_Achievements_Rule.cs
+15
-5
RB_Sell_Achievements_Deduction_ViewModel.cs
...iewModel/Sell/RB_Sell_Achievements_Deduction_ViewModel.cs
+23
-0
RB_Sell_Achievements_Details_ViewModel.cs
.../ViewModel/Sell/RB_Sell_Achievements_Details_ViewModel.cs
+72
-0
RB_Sell_Achievements_Emp_ViewModel.cs
...odel/ViewModel/Sell/RB_Sell_Achievements_Emp_ViewModel.cs
+18
-0
RB_Sell_Achievements_Periods_ViewModel.cs
.../ViewModel/Sell/RB_Sell_Achievements_Periods_ViewModel.cs
+28
-0
RB_Sell_Achievements_Rule_ViewModel.cs
...del/ViewModel/Sell/RB_Sell_Achievements_Rule_ViewModel.cs
+6
-1
SellAchievementsModule.cs
Edu.Module.Course/SellAchievementsModule.cs
+728
-28
RB_OrderRepository.cs
Edu.Repository/Sell/RB_OrderRepository.cs
+8
-2
RB_Sell_Achievements_DeductionRepository.cs
...pository/Sell/RB_Sell_Achievements_DeductionRepository.cs
+57
-0
RB_Sell_Achievements_DetailsRepository.cs
...Repository/Sell/RB_Sell_Achievements_DetailsRepository.cs
+331
-0
RB_Sell_Achievements_EmpRepository.cs
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
+61
-0
RB_Sell_Achievements_PeriodsRepository.cs
...Repository/Sell/RB_Sell_Achievements_PeriodsRepository.cs
+74
-0
RB_Sell_Achievements_RuleRepository.cs
Edu.Repository/Sell/RB_Sell_Achievements_RuleRepository.cs
+1
-1
SellAchievementsController.cs
Edu.WebApi/Controllers/Course/SellAchievementsController.cs
+47
-10
No files found.
Edu.Model/Entity/Sell/RB_Sell_Achievements_Deduction.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Sell
{
/// <summary>
/// 业绩提成抵扣明细实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Sell_Achievements_Deduction
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 订单id
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 来源id
/// </summary>
public
int
SourceId
{
get
;
set
;
}
/// <summary>
/// 类型 1抵扣
/// </summary>
public
int
Type
{
get
;
set
;
}
/// <summary>
/// 抵扣金额
/// </summary>
public
decimal
DeductionMoney
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建日期
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 集团id
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 周期id
/// </summary>
public
int
PeriodsId
{
get
;
set
;
}
}
}
Edu.Model/Entity/Sell/RB_Sell_Achievements_Details.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Sell
{
/// <summary>
/// 业绩提成发放明细实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Sell_Achievements_Details
{
/// <summary>
/// 编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 关联用户
/// </summary>
public
int
UserId
{
get
;
set
;
}
/// <summary>
/// 班级id
/// </summary>
public
int
ClassId
{
get
;
set
;
}
/// <summary>
/// 班级类型 1学生班 2社会班
/// </summary>
public
int
ClassType
{
get
;
set
;
}
/// <summary>
/// 订单ID
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 父级ID
/// </summary>
public
int
PeriodId
{
get
;
set
;
}
/// <summary>
/// 期号
/// </summary>
public
string
Periods
{
get
;
set
;
}
/// <summary>
/// 提成总金额
/// </summary>
public
decimal
CommissionMoney
{
get
;
set
;
}
/// <summary>
/// 部门id
/// </summary>
public
int
Depart_Id
{
get
;
set
;
}
/// <summary>
/// 校区id
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 集团id
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 备注, 记录抵扣金额等等
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 学生数量
/// </summary>
public
int
StudentCount
{
get
;
set
;
}
/// <summary>
/// 当期提成金额
/// </summary>
public
decimal
CurrentPeriodMoney
{
get
;
set
;
}
/// <summary>
/// 是否首次提成 1是 2否
/// </summary>
public
int
IsFirstCommission
{
get
;
set
;
}
/// <summary>
/// 总课时
/// </summary>
public
int
TotalHours
{
get
;
set
;
}
/// <summary>
/// 累计消费课时
/// </summary>
public
int
TotalLearn
{
get
;
set
;
}
/// <summary>
/// 当期课时消耗
/// </summary>
public
int
CurrentHours
{
get
;
set
;
}
/// <summary>
/// 累计已发放金额
/// </summary>
public
decimal
GiveOutMoney
{
get
;
set
;
}
/// <summary>
/// 抵扣订单
/// </summary>
public
int
DeductionOrder
{
get
;
set
;
}
/// <summary>
/// 抵扣金额
/// </summary>
public
decimal
DeductionMoney
{
get
;
set
;
}
/// <summary>
/// 确认状态 0-未确认,1-已确认
/// </summary>
public
int
SureStatus
{
get
;
set
;
}
/// <summary>
/// 类型 1市场、2顾问、3教师
/// </summary>
public
int
UserType
{
get
;
set
;
}
/// <summary>
/// 相关的 achempId(订单人员表)
/// </summary>
public
int
RelatedId
{
get
;
set
;
}
/// <summary>
/// 是否部门提成 1是 2否
/// </summary>
public
int
IsDept
{
get
;
set
;
}
/// <summary>
/// 首次发放比例
/// </summary>
public
decimal
FirstRate
{
get
;
set
;
}
}
}
Edu.Model/Entity/Sell/RB_Sell_Achievements_Emp.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Sell
{
/// <summary>
/// 订单关联提成实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Sell_Achievements_Emp
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 订单ID
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 类型 1市场、2顾问、3教师
/// </summary>
public
int
Type
{
get
;
set
;
}
/// <summary>
/// 使用规则ID
/// </summary>
public
int
RuleId
{
get
;
set
;
}
/// <summary>
/// 提成人
/// </summary>
public
int
EmpId
{
get
;
set
;
}
/// <summary>
/// 提成比例
/// </summary>
public
decimal
Rate
{
get
;
set
;
}
/// <summary>
/// 集团id
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 订单应发提成
/// </summary>
public
decimal
PushMoney
{
get
;
set
;
}
/// <summary>
/// 累计已发放金额
/// </summary>
public
decimal
GiveOutMoney
{
get
;
set
;
}
/// <summary>
/// 状态 1发放完毕 2未发放完毕
/// </summary>
public
int
GiveOutState
{
get
;
set
;
}
/// <summary>
/// 是否部门提成 1是 2否
/// </summary>
public
int
IsDept
{
get
;
set
;
}
/// <summary>
/// 开始的周期ID
/// </summary>
public
int
PeriodsId
{
get
;
set
;
}
/// <summary>
/// 销售额
/// </summary>
public
decimal
SaleMoney
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
}
}
Edu.Model/Entity/Sell/RB_Sell_Achievements_Periods.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Sell
{
/// <summary>
/// 业绩提成发放期数实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Sell_Achievements_Periods
{
/// <summary>
/// 编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 期数
/// </summary>
public
string
Periods
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建日期
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 累计金额
/// </summary>
public
decimal
SumPrice
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 关联财务单据ids
/// </summary>
public
string
Financials
{
get
;
set
;
}
/// <summary>
/// 已发放人员的列表
/// </summary>
public
string
EmpIds
{
get
;
set
;
}
/// <summary>
/// 这一期对应的所有的规则列表(防止退费后 比例变更)
/// </summary>
public
string
AdminRemark
{
get
;
set
;
}
}
}
Edu.Model/Entity/Sell/RB_Sell_Achievements_Rule.cs
View file @
b650a5cf
...
...
@@ -37,11 +37,6 @@ namespace Edu.Model.Entity.Sell
/// </summary>
public
string
CourseIds
{
get
;
set
;
}
/// <summary>
/// 提成方式 1课耗提成 2次月全提 3课程比例
/// </summary>
public
int
CommissionType
{
get
;
set
;
}
/// <summary>
/// 提成人员
/// </summary>
...
...
@@ -52,6 +47,11 @@ namespace Edu.Model.Entity.Sell
/// </summary>
public
string
ChildEmpIds
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
...
...
@@ -82,10 +82,20 @@ namespace Edu.Model.Entity.Sell
/// </summary>
public
decimal
CourseRate
{
get
;
set
;
}
/// <summary>
/// 首次发放比例
/// </summary>
public
decimal
FirstRate
{
get
;
set
;
}
/// <summary>
/// 业绩提成比例 json格式
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 使用的校区
/// </summary>
public
string
SchoolIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Deduction_ViewModel.cs
0 → 100644
View file @
b650a5cf
using
Edu.Model.Entity.Sell
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Sell
{
/// <summary>
/// 业绩提成抵扣扩展类
/// </summary>
[
Serializable
]
public
class
RB_Sell_Achievements_Deduction_ViewModel
:
RB_Sell_Achievements_Deduction
{
/// <summary>
/// 订单ids
/// </summary>
public
string
OrderIds
{
get
;
set
;
}
/// <summary>
/// 来源ids
/// </summary>
public
string
SourceIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Details_ViewModel.cs
0 → 100644
View file @
b650a5cf
using
Edu.Model.Entity.Sell
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Sell
{
/// <summary>
/// 业绩提成期数明细实体类
/// </summary>
[
Serializable
]
public
class
RB_Sell_Achievements_Details_ViewModel
:
RB_Sell_Achievements_Details
{
/// <summary>
/// 用户名称
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 当前发放次数
/// </summary>
public
int
IssueNum
{
get
;
set
;
}
/// <summary>
/// 用户ids
/// </summary>
public
string
UserIds
{
get
;
set
;
}
/// <summary>
/// 部门名称
/// </summary>
public
string
DeptName
{
get
;
set
;
}
/// <summary>
/// 校区名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// 班级名称
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 班号
/// </summary>
public
string
ClassNo
{
get
;
set
;
}
/// <summary>
/// 班级类型
/// </summary>
public
string
ClassTypeName
{
get
;
set
;
}
/// <summary>
/// 订单ids
/// </summary>
public
string
OrderIds
{
get
;
set
;
}
/// <summary>
/// 是否需抵扣 1是
/// </summary>
public
int
IsDeduction
{
get
;
set
;
}
/// <summary>
/// 期数
/// </summary>
public
string
PeriodsTime
{
get
;
set
;
}
/// <summary>
/// 总提成数
/// </summary>
public
decimal
TotalMoney
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Emp_ViewModel.cs
0 → 100644
View file @
b650a5cf
using
Edu.Model.Entity.Sell
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Sell
{
/// <summary>
/// 业绩提成关联扩展类
/// </summary>
[
Serializable
]
public
class
RB_Sell_Achievements_Emp_ViewModel
:
RB_Sell_Achievements_Emp
{
/// <summary>
/// 只查询正常的
/// </summary>
public
int
IsSelectNor
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Periods_ViewModel.cs
0 → 100644
View file @
b650a5cf
using
Edu.Model.Entity.Sell
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Sell
{
/// <summary>
/// 业绩提成期数实体类
/// </summary>
[
Serializable
]
public
class
RB_Sell_Achievements_Periods_ViewModel
:
RB_Sell_Achievements_Periods
{
/// <summary>
/// 校区id
/// </summary>
public
int
SchoolId
{
get
;
set
;
}
/// <summary>
/// 该校区提成
/// </summary>
public
decimal
SchooldCommission
{
get
;
set
;
}
/// <summary>
/// 周期ids
/// </summary>
public
string
PeriodsIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Rule_ViewModel.cs
View file @
b650a5cf
...
...
@@ -31,6 +31,11 @@ namespace Edu.Model.ViewModel.Sell
/// 部门下人员列表
/// </summary>
public
List
<
Employee_ViewModel
>
ChildEmpList
{
get
;
set
;
}
/// <summary>
/// 校区名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
}
/// <summary>
...
...
@@ -46,7 +51,7 @@ namespace Edu.Model.ViewModel.Sell
/// </summary>
public
decimal
EndValue
{
get
;
set
;
}
/// <summary>
/// 提成比例
/// 提成比例
百分比
/// </summary>
public
decimal
Rate
{
get
;
set
;
}
}
...
...
Edu.Module.Course/SellAchievementsModule.cs
View file @
b650a5cf
This diff is collapsed.
Click to expand it.
Edu.Repository/Sell/RB_OrderRepository.cs
View file @
b650a5cf
...
...
@@ -1143,7 +1143,7 @@ GROUP BY o.OrderId";
/// <param name="courseType">类型 1包含 2不包含</param>
/// <param name="courseIds"></param>
/// <returns></returns>
public
List
<
RB_Order_ViewModel
>
GetAllAchievementsSendOrderList
(
int
group_Id
,
string
eDate
,
int
courseType
,
string
courseIds
)
public
List
<
RB_Order_ViewModel
>
GetAllAchievementsSendOrderList
(
int
group_Id
,
string
eDate
,
int
courseType
,
string
courseIds
,
string
schoolIds
)
{
string
where
=
""
;
if
(!
string
.
IsNullOrEmpty
(
courseIds
))
...
...
@@ -1157,7 +1157,13 @@ GROUP BY o.OrderId";
where
+=
$" and c.CourseId not in (
{
courseIds
}
)"
;
}
}
string
sql
=
$@"SELECT o.* FROM rb_order o
if
(!
string
.
IsNullOrEmpty
(
schoolIds
))
{
where
+=
$" and c.School_Id in (
{
schoolIds
}
)"
;
}
string
sql
=
$@"SELECT o.*,c.School_Id as ClassSchoolId FROM rb_order o
left join rb_class c on o.ClassId = c.ClassId
left join rb_sell_achievements_emp e on o.OrderId = e.OrderId
WHERE o.Group_Id =
{
group_Id
}
and o.OrderState =1 and o.CreateTime >='2021-12-01' and o.CreateTime <= '
{
eDate
}
23:59:59'
and e.Id is null
...
...
Edu.Repository/Sell/RB_Sell_Achievements_DeductionRepository.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Sell
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Sell
{
/// <summary>
/// 业绩提成抵扣仓储层
/// </summary>
public
class
RB_Sell_Achievements_DeductionRepository
:
BaseRepository
<
RB_Sell_Achievements_Deduction
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Deduction_ViewModel
>
GetList
(
RB_Sell_Achievements_Deduction_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
SourceId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
SourceId
)}
=
{
demodel
.
SourceId
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OrderIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
OrderId
)}
in(
{
demodel
.
OrderIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
SourceIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Deduction_ViewModel
.
SourceId
)}
in(
{
demodel
.
SourceIds
}
)"
;
}
string
sql
=
$@" select r.* from RB_Sell_Achievements_Deduction r where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Sell_Achievements_Deduction_ViewModel
>(
sql
).
ToList
();
}
}
}
Edu.Repository/Sell/RB_Sell_Achievements_DetailsRepository.cs
0 → 100644
View file @
b650a5cf
This diff is collapsed.
Click to expand it.
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Sell
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Sell
{
/// <summary>
/// 业绩提成相关仓储层
/// </summary>
public
class
RB_Sell_Achievements_EmpRepository
:
BaseRepository
<
RB_Sell_Achievements_Emp
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Emp_ViewModel
>
GetList
(
RB_Sell_Achievements_Emp_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
if
(
demodel
.
EmpId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
EmpId
)}
=
{
demodel
.
EmpId
}
"
;
}
if
(
demodel
.
PeriodsId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
PeriodsId
)}
=
{
demodel
.
PeriodsId
}
"
;
}
if
(
demodel
.
GiveOutState
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
GiveOutState
)}
=
{
demodel
.
GiveOutState
}
"
;
}
if
(
demodel
.
IsSelectNor
==
1
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
PeriodsId
)}
>0"
;
}
string
sql
=
$@" select r.* from RB_Sell_Achievements_Emp r where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Sell_Achievements_Emp_ViewModel
>(
sql
).
ToList
();
}
}
}
Edu.Repository/Sell/RB_Sell_Achievements_PeriodsRepository.cs
0 → 100644
View file @
b650a5cf
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Sell
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Sell
{
/// <summary>
/// 业绩提成期数仓储层
/// </summary>
public
class
RB_Sell_Achievements_PeriodsRepository
:
BaseRepository
<
RB_Sell_Achievements_Periods
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Periods_ViewModel
>
GetList
(
RB_Sell_Achievements_Periods_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Name
)}
like '%
{
demodel
.
Name
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
Periods
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Periods
)}
='
{
demodel
.
Periods
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
PeriodsIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Id
)}
in(
{
demodel
.
PeriodsIds
}
)"
;
}
string
sql
=
$@" select r.* from RB_Sell_Achievements_Periods r where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Sell_Achievements_Periods_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Periods_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Sell_Achievements_Periods_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Periods_ViewModel
.
Name
)}
like '%
{
demodel
.
Name
}
%'"
;
}
string
sql
=
$@" select r.* from RB_Sell_Achievements_Periods r where
{
where
}
order by r.Id desc"
;
return
GetPage
<
RB_Sell_Achievements_Periods_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Edu.Repository/Sell/RB_Sell_Achievements_RuleRepository.cs
View file @
b650a5cf
...
...
@@ -22,7 +22,7 @@ namespace Edu.Repository.Sell
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Rule_ViewModel
>
GetList
(
RB_Sell_Achievements_Rule_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
string
where
=
$@" 1=1
and Status =0
"
;
if
(
demodel
.
Group_Id
>
0
)
{
...
...
Edu.WebApi/Controllers/Course/SellAchievementsController.cs
View file @
b650a5cf
...
...
@@ -54,7 +54,6 @@ namespace Edu.WebApi.Controllers.Course
y
.
CourseId
,
y
.
CourseName
}),
x
.
CommissionType
,
x
.
EmpIds
,
EmpList
=
x
.
EmpList
.
Select
(
y
=>
new
{
...
...
@@ -68,7 +67,10 @@ namespace Edu.WebApi.Controllers.Course
y
.
EmployeeName
}),
x
.
CourseRate
,
x
.
FirstRate
,
x
.
RateList
,
x
.
SchoolIds
,
x
.
SchoolName
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}));
}
...
...
@@ -85,6 +87,10 @@ namespace Edu.WebApi.Controllers.Course
if
(
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
return
ApiResult
.
ParamIsNull
(
"请传递方案名称"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
SchoolIds
))
{
return
ApiResult
.
ParamIsNull
(
"请传递校区"
);
}
if
(
demodel
.
CourseList
!=
null
&&
demodel
.
CourseList
.
Any
())
{
demodel
.
CourseIds
=
string
.
Join
(
","
,
demodel
.
CourseList
.
Select
(
x
=>
x
.
CourseId
));
}
...
...
@@ -95,12 +101,18 @@ namespace Edu.WebApi.Controllers.Course
if
(
demodel
.
ChildEmpList
!=
null
&&
demodel
.
ChildEmpList
.
Any
())
{
demodel
.
ChildEmpIds
=
string
.
Join
(
","
,
demodel
.
ChildEmpList
.
Select
(
x
=>
x
.
Id
));
}
if
(
demodel
.
CommissionType
==
3
)
{
if
(
demodel
.
CourseRate
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递课程比例"
);
}
if
(
demodel
.
CourseRate
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递课程比例"
);
}
if
(
demodel
.
FirstRate
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递首次发放比例"
);
}
if
(
demodel
.
RateList
==
null
||
!
demodel
.
RateList
.
Any
())
{
if
(
demodel
.
RateList
==
null
||
!
demodel
.
RateList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递业绩提成比例"
);
}
int
length
=
demodel
.
RateList
.
Count
();
...
...
@@ -116,6 +128,7 @@ namespace Edu.WebApi.Controllers.Course
}
demodel
.
Content
=
JsonHelper
.
Serialize
(
demodel
.
RateList
);
demodel
.
Status
=
0
;
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
demodel
.
CreateBy
=
userInfo
.
Id
;
demodel
.
CreateTime
=
DateTime
.
Now
;
...
...
@@ -131,6 +144,29 @@ namespace Edu.WebApi.Controllers.Course
}
}
/// <summary>
/// 删除规则
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DelSellAchievementsRule
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
base
.
RequestParm
.
Msg
.
ToString
());
int
RuleId
=
parms
.
GetInt
(
"RuleId"
,
0
);
if
(
RuleId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
sellAchievementsModule
.
DelSellAchievementsRule
(
RuleId
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
#
region
提成列表
...
...
@@ -494,15 +530,16 @@ namespace Edu.WebApi.Controllers.Course
}
/// <summary>
/// 创建
销售
提成
/// 创建
业绩
提成
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
Set
Sell
CommissionInfo
()
{
public
ApiResult
Set
Achievements
CommissionInfo
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
string
Month
=
parms
.
GetStringValue
(
"Month"
);
//月份
if
(
string
.
IsNullOrEmpty
(
Month
))
{
if
(
string
.
IsNullOrEmpty
(
Month
))
{
return
ApiResult
.
ParamIsNull
();
}
try
...
...
@@ -514,7 +551,7 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Failed
(
"日期格式有误"
);
}
string
msg
=
sell
CommissionModule
.
SetSell
CommissionInfo
(
Month
,
userInfo
);
string
msg
=
sell
AchievementsModule
.
SetAchievements
CommissionInfo
(
Month
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
...
...
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