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
790c1541
Commit
790c1541
authored
Dec 27, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
047504a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
813 additions
and
4 deletions
+813
-4
RB_Order_ReturnComission.cs
Edu.Model/Entity/Sell/RB_Order_ReturnComission.cs
+3
-2
RB_User_ReturnCommission.cs
Edu.Model/Entity/User/RB_User_ReturnCommission.cs
+3
-2
RB_Order_ReturnComission_ViewModel.cs
...odel/ViewModel/Sell/RB_Order_ReturnComission_ViewModel.cs
+45
-0
RB_ReturnMoney_Batch_ViewModel.cs
Edu.Model/ViewModel/Sell/RB_ReturnMoney_Batch_ViewModel.cs
+5
-0
CustomerCommissionModule.cs
Edu.Module.Customer/CustomerCommissionModule.cs
+268
-0
RB_Order_ReturnComissionRepository.cs
Edu.Repository/Sell/RB_Order_ReturnComissionRepository.cs
+179
-0
RB_ReturnMoney_BatchRepository.cs
Edu.Repository/Sell/RB_ReturnMoney_BatchRepository.cs
+22
-0
RB_User_ReturnComissionRepository.cs
Edu.Repository/User/RB_User_ReturnComissionRepository.cs
+16
-0
CustomerCommissionController.cs
...bApi/Controllers/Customer/CustomerCommissionController.cs
+272
-0
No files found.
Edu.Model/Entity/Sell/RB_Order_ReturnComission.cs
View file @
790c1541
using
System
;
using
Edu.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -31,7 +32,7 @@ namespace Edu.Model.Entity.Sell
/// <summary>
/// 学员来源
/// </summary>
public
int
OrderSourceType
{
get
;
set
;
}
public
StuCreateTypeEnum
OrderSourceType
{
get
;
set
;
}
/// <summary>
/// 关联来源编号
...
...
Edu.Model/Entity/User/RB_User_ReturnCommission.cs
View file @
790c1541
using
System
;
using
Edu.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -20,7 +21,7 @@ namespace Edu.Model.Entity.User
/// <summary>
/// 用户类型
/// </summary>
public
int
UserType
{
get
;
set
;
}
public
StuCreateTypeEnum
UserType
{
get
;
set
;
}
/// <summary>
/// 未结算佣金
...
...
Edu.Model/ViewModel/Sell/RB_Order_ReturnComission_ViewModel.cs
View file @
790c1541
...
...
@@ -8,5 +8,50 @@ namespace Edu.Model.ViewModel.Sell
public
class
RB_Order_ReturnComission_ViewModel
:
RB_Order_ReturnComission
{
public
string
StuSourceName
{
get
;
set
;
}
/// <summary>
/// 查询正常返佣 1正常 2已返佣
/// </summary>
public
int
Q_SelectNormal
{
get
;
set
;
}
/// <summary>
/// 学生数量
/// </summary>
public
int
StudentCount
{
get
;
set
;
}
/// <summary>
/// 校区名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// 用户名称
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 返佣期数
/// </summary>
public
string
BatchName
{
get
;
set
;
}
/// <summary>
/// 班级
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 班号
/// </summary>
public
string
ClassNo
{
get
;
set
;
}
/// <summary>
/// 班级ID
/// </summary>
public
int
ClassId
{
get
;
set
;
}
/// <summary>
/// 学生
/// </summary>
public
string
StuName
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Sell/RB_ReturnMoney_Batch_ViewModel.cs
View file @
790c1541
...
...
@@ -10,5 +10,10 @@ namespace Edu.Model.ViewModel.Sell
public
string
CreateByName
{
get
;
set
;
}
public
string
CreateDateStr
{
get
;
set
;
}
/// <summary>
/// 月份
/// </summary>
public
string
Month
{
get
;
set
;
}
}
}
Edu.Module.Customer/CustomerCommissionModule.cs
0 → 100644
View file @
790c1541
This diff is collapsed.
Click to expand it.
Edu.Repository/Sell/RB_Order_ReturnComissionRepository.cs
View file @
790c1541
...
...
@@ -58,5 +58,184 @@ namespace Edu.Repository.Sell
return
Execute
(
sql
,
null
)
>
0
;
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Order_ReturnComission_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Order_ReturnComission_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
GroupId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
GroupId
)}
=
{
demodel
.
GroupId
}
"
;
}
if
(
demodel
.
SchoolId
>=
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
SchoolId
)}
=
{
demodel
.
SchoolId
}
"
;
}
if
(
demodel
.
BatchId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
BatchId
)}
=
{
demodel
.
BatchId
}
"
;
}
if
(
demodel
.
CommissionType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
CommissionType
)}
=
{
demodel
.
CommissionType
}
"
;
}
if
(
demodel
.
Status
>
-
2
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
ClassId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(
demodel
.
OrderSourceType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceType
)}
=
{
demodel
.
OrderSourceType
}
"
;
}
if
(
demodel
.
OrderSourceId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceId
)}
=
{
demodel
.
OrderSourceId
}
"
;
}
if
(
demodel
.
Q_SelectNormal
==
1
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
in(0,1,2)"
;
}
else
if
(
demodel
.
Q_SelectNormal
==
2
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
in(1,2)"
;
}
string
sql
=
$@" select r.*,b.BatchName,o.ClassId,c.ClassName,c.ClassNo,s.StuName from RB_Order_ReturnComission r
left join rb_returnmoney_batch b on r.BatchId = b.Id
left join rb_order o on r.OrderId = o.OrderId
left join rb_class c on o.ClassId = c.ClassId
left join rb_student s on s.StuId = r.StuId
where
{
where
}
order by r.Id desc"
;
return
GetPage
<
RB_Order_ReturnComission_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取用户返佣列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Order_ReturnComission_ViewModel
>
GetCommissionUserList
(
RB_Order_ReturnComission_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
GroupId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
GroupId
)}
=
{
demodel
.
GroupId
}
"
;
}
if
(
demodel
.
SchoolId
>=
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
SchoolId
)}
=
{
demodel
.
SchoolId
}
"
;
}
if
(
demodel
.
BatchId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
BatchId
)}
=
{
demodel
.
BatchId
}
"
;
}
if
(
demodel
.
CommissionType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
CommissionType
)}
=
{
demodel
.
CommissionType
}
"
;
}
if
(
demodel
.
Status
>
-
2
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
OrderSourceType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceType
)}
=
{
demodel
.
OrderSourceType
}
"
;
}
if
(
demodel
.
OrderSourceId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceId
)}
=
{
demodel
.
OrderSourceId
}
"
;
}
if
(
demodel
.
Q_SelectNormal
==
1
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
in(0,1,2)"
;
}
string
sql
=
$@" select r.OrderSourceType,r.OrderSourceId,r.SchoolId,count(0) as StudentCount,sum(r.CommissionMoeny) as CommissionMoeny
from RB_Order_ReturnComission r where
{
where
}
group by r.OrderSourceType,r.OrderSourceId,r.SchoolId"
;
return
Get
<
RB_Order_ReturnComission_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取累积佣金金额
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
decimal
GetCommissionStatistics
(
RB_Order_ReturnComission_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
GroupId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
GroupId
)}
=
{
demodel
.
GroupId
}
"
;
}
if
(
demodel
.
SchoolId
>=
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
SchoolId
)}
=
{
demodel
.
SchoolId
}
"
;
}
if
(
demodel
.
BatchId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
BatchId
)}
=
{
demodel
.
BatchId
}
"
;
}
if
(
demodel
.
CommissionType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
CommissionType
)}
=
{
demodel
.
CommissionType
}
"
;
}
if
(
demodel
.
Status
>
-
2
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
ClassId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(
demodel
.
OrderSourceType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceType
)}
=
{
demodel
.
OrderSourceType
}
"
;
}
if
(
demodel
.
OrderSourceId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
OrderSourceId
)}
=
{
demodel
.
OrderSourceId
}
"
;
}
if
(
demodel
.
Q_SelectNormal
==
1
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
in(0,1,2)"
;
}
else
if
(
demodel
.
Q_SelectNormal
==
2
)
{
where
+=
$@" and r.
{
nameof
(
RB_Order_ReturnComission_ViewModel
.
Status
)}
in(1,2)"
;
}
string
sql
=
$@" select sum(r.CommissionMoeny) from RB_Order_ReturnComission r
left join rb_order o on r.OrderId = o.OrderId
where
{
where
}
"
;
var
obj
=
ExecuteScalar
(
sql
);
return
obj
==
null
?
0
:
Convert
.
ToDecimal
(
obj
);
}
}
}
Edu.Repository/Sell/RB_ReturnMoney_BatchRepository.cs
View file @
790c1541
...
...
@@ -46,6 +46,28 @@ namespace Edu.Repository.Sell
return
GetPage
<
RB_ReturnMoney_Batch_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_ReturnMoney_Batch_ViewModel
>
GetList
(
RB_ReturnMoney_Batch_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
GroupId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_ReturnMoney_Batch_ViewModel
.
GroupId
)}
=
{
demodel
.
GroupId
}
"
;
}
if
(
demodel
.
CommissionType
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_ReturnMoney_Batch_ViewModel
.
CommissionType
)}
=
{
demodel
.
CommissionType
}
"
;
}
string
sql
=
$@" select r.* from RB_ReturnMoney_Batch r where
{
where
}
order by r.CreateDate desc"
;
return
Get
<
RB_ReturnMoney_Batch_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 查询当月份是否存在提成
/// </summary>
...
...
Edu.Repository/User/RB_User_ReturnComissionRepository.cs
View file @
790c1541
...
...
@@ -27,5 +27,21 @@ namespace Edu.Repository.User
return
Get
<
RB_User_ReturnComission_ViewModel
>(
sql
,
parameters
).
ToList
().
FirstOrDefault
();
}
/// <summary>
/// 获取个人返佣情况
/// </summary>
/// <param name="group_Id"></param>
/// <param name="id"></param>
/// <returns></returns>
public
RB_User_ReturnComission_ViewModel
GetCenterCommissionStatistics
(
int
group_Id
,
int
id
)
{
string
sql
=
$@"select sum(UnSettlementMoney)as UnSettlementMoney,
sum(SttlementMoney)as SttlementMoney,
sum(CashOutMoney)as CashOutMoney,
sum(CanCashOutMoney)as CanCashOutMoney
from RB_User_ReturnCommission where GroupId =
{
group_Id
}
and UserId=
{
id
}
and UserType in(1,3)"
;
return
Get
<
RB_User_ReturnComission_ViewModel
>(
sql
).
FirstOrDefault
();
}
}
}
Edu.WebApi/Controllers/Customer/CustomerCommissionController.cs
0 → 100644
View file @
790c1541
This diff is collapsed.
Click to expand it.
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