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
0f2c8884
Commit
0f2c8884
authored
Jul 13, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提成发放次数
parent
b8678149
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
1 deletion
+90
-1
RB_Sell_Commission_Details_ViewModel.cs
.../ViewModel/Course/RB_Sell_Commission_Details_ViewModel.cs
+5
-0
SellCommissionModule.cs
Edu.Module.Course/SellCommissionModule.cs
+38
-0
RB_Sell_Commission_DetailsRepository.cs
...Repository/Course/RB_Sell_Commission_DetailsRepository.cs
+45
-0
SellCommissionController.cs
Edu.WebApi/Controllers/Course/SellCommissionController.cs
+2
-1
No files found.
Edu.Model/ViewModel/Course/RB_Sell_Commission_Details_ViewModel.cs
View file @
0f2c8884
...
...
@@ -14,6 +14,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 当前发放次数
/// </summary>
public
int
IssueNum
{
get
;
set
;
}
/// <summary>
/// 用户ids
/// </summary>
...
...
Edu.Module.Course/SellCommissionModule.cs
View file @
0f2c8884
...
...
@@ -399,6 +399,44 @@ namespace Edu.Module.Course
return
list
;
}
/// <summary>
/// 获取用户提成明细列表 (有当前发放次数的)
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Commission_Details_ViewModel
>
GetSellCommissionUserDetailList_V2
(
RB_Sell_Commission_Details_ViewModel
dmodel
)
{
var
list
=
sell_Commission_DetailsRepository
.
GetSellCommissionUserDetailList
(
dmodel
);
if
(
list
.
Any
())
{
//查询用户 部门 校区
string
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
UserId
).
Distinct
());
string
deptIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Depart_Id
).
Distinct
());
string
schoolIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
School_Id
).
Distinct
());
var
ulist
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
QIds
=
userIds
});
var
dlist
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
QDeptIds
=
deptIds
});
var
slist
=
schoolRepository
.
GetSchoolListRepository
(
new
RB_School_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
QSIds
=
schoolIds
});
//查询出所属班级信息
string
classIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
ClassId
).
Distinct
());
var
clist
=
classRepository
.
GetClassListRepository
(
new
RB_Class_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
Q_ClassIds
=
classIds
});
//查询班级类型
string
classTypeIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
ClassType
).
Distinct
());
var
ctlist
=
class_TypeRepository
.
GetClassTypeListRepository
(
new
RB_Class_Type_ViewModel
()
{
Q_CTypeIds
=
classTypeIds
,
Group_Id
=
dmodel
.
Group_Id
});
foreach
(
var
item
in
list
)
{
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
item
.
UserName
=
umodel
.
EmployeeName
+
(
umodel
.
LeaveStatus
==
Common
.
Enum
.
User
.
LeaveStatusEnum
.
Departure
?
"离职"
:
""
);
item
.
DeptName
=
dlist
.
Where
(
x
=>
x
.
DeptId
==
item
.
Depart_Id
).
FirstOrDefault
()?.
DeptName
??
""
;
item
.
SchoolName
=
slist
.
Where
(
x
=>
x
.
SId
==
item
.
School_Id
).
FirstOrDefault
()?.
SName
??
""
;
item
.
ClassName
=
clist
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
).
FirstOrDefault
()?.
ClassName
??
""
;
item
.
ClassNo
=
clist
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
).
FirstOrDefault
()?.
ClassNo
??
""
;
item
.
ClassTypeName
=
ctlist
.
Where
(
x
=>
x
.
CTypeId
==
item
.
ClassType
).
FirstOrDefault
()?.
CTypeName
??
""
;
}
}
return
list
;
}
/// <summary>
/// 创建提成s
/// </summary>
...
...
Edu.Repository/Course/RB_Sell_Commission_DetailsRepository.cs
View file @
0f2c8884
...
...
@@ -57,6 +57,51 @@ namespace Edu.Repository.Course
return
Get
<
RB_Sell_Commission_Details_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取用户明细统计
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Sell_Commission_Details_ViewModel
>
GetSellCommissionUserDetailList
(
RB_Sell_Commission_Details_ViewModel
demodel
)
{
string
where
=
$@" 1=1"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
PeriodId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
PeriodId
)}
=
{
demodel
.
PeriodId
}
"
;
}
if
(
demodel
.
UserId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
UserId
)}
=
{
demodel
.
UserId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
UserIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
UserId
)}
in(
{
demodel
.
UserIds
}
)"
;
}
if
(
demodel
.
ClassId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OrderIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Commission_Details_ViewModel
.
OrderId
)}
in(
{
demodel
.
OrderIds
}
)"
;
}
string
sql
=
$@" select r.*,
(select count(0) from RB_Sell_Commission_Details r1 where r1.UserId = r.UserId and r1.OrderId = r.OrderId and r1.Id <= r.Id) as IssueNum
from RB_Sell_Commission_Details r where
{
where
}
order by r.Id asc"
;
return
Get
<
RB_Sell_Commission_Details_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取分页列表
/// </summary>
...
...
Edu.WebApi/Controllers/Course/SellCommissionController.cs
View file @
0f2c8884
...
...
@@ -202,7 +202,7 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
ParamIsNull
(
"请传递期数id"
);
}
var
list
=
sellCommissionModule
.
GetSellCommissionUserDetailList
(
dmodel
);
var
list
=
sellCommissionModule
.
GetSellCommissionUserDetailList
_V2
(
dmodel
);
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
x
.
School_Id
,
...
...
@@ -217,6 +217,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
ClassType
,
x
.
ClassTypeName
,
x
.
OrderId
,
x
.
IssueNum
,
x
.
StudentCount
,
x
.
Periods
,
TotalCommissionMoney
=
x
.
CommissionMoney
+
x
.
OtherMoney
+
x
.
BackMoney
,
...
...
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