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
49f43117
Commit
49f43117
authored
Dec 24, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
4288c3e2
6cf43737
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
15 deletions
+81
-15
RB_Sell_Achievements_Details_ViewModel.cs
.../ViewModel/Sell/RB_Sell_Achievements_Details_ViewModel.cs
+5
-0
RB_Sell_Achievements_Emp_ViewModel.cs
...odel/ViewModel/Sell/RB_Sell_Achievements_Emp_ViewModel.cs
+5
-0
OrderModule2.cs
Edu.Module.Course/OrderModule2.cs
+27
-15
FinanceModule.cs
Edu.Module.Finance/FinanceModule.cs
+29
-0
RB_Sell_Achievements_DetailsRepository.cs
...Repository/Sell/RB_Sell_Achievements_DetailsRepository.cs
+4
-0
RB_Sell_Achievements_EmpRepository.cs
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
+4
-0
FinanceController.cs
Edu.WebApi/Controllers/Finance/FinanceController.cs
+7
-0
No files found.
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Details_ViewModel.cs
View file @
49f43117
...
...
@@ -49,6 +49,11 @@ namespace Edu.Model.ViewModel.Sell
/// </summary>
public
string
ClassTypeName
{
get
;
set
;
}
/// <summary>
/// 班级Ids
/// </summary>
public
string
ClassIds
{
get
;
set
;
}
/// <summary>
/// 订单ids
/// </summary>
...
...
Edu.Model/ViewModel/Sell/RB_Sell_Achievements_Emp_ViewModel.cs
View file @
49f43117
...
...
@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Sell
/// 只查询正常的
/// </summary>
public
int
IsSelectNor
{
get
;
set
;
}
/// <summary>
/// 订单ids
/// </summary>
public
string
OrderIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/OrderModule2.cs
View file @
49f43117
...
...
@@ -336,25 +336,37 @@ namespace Edu.Module.Course
int
EnterId
=
0
;
string
EnterName
=
""
;
var
empModel
=
accountRepository
.
GetEmployeeInfo
(
userInfo
.
Id
)
;
if
(
empModel
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
int
SaleId
=
StuList
.
FirstOrDefault
().
CreateBy
;
if
(
SaleId
>
0
)
{
EnterId
=
empModel
.
Id
;
EnterName
=
empModel
.
EmployeeName
;
}
else
{
int
SaleId
=
StuList
.
FirstOrDefault
().
CreateBy
;
if
(
SaleId
!=
userInfo
.
Id
)
//自己负责的
var
empModel
=
accountRepository
.
GetEmployeeInfo
(
SaleId
);
if
(
empModel
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
{
//自己负责的
empModel
=
accountRepository
.
GetEmployeeInfo
(
SaleId
);
if
(
empModel
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
{
EnterId
=
empModel
.
Id
;
EnterName
=
empModel
.
EmployeeName
;
}
EnterId
=
empModel
.
Id
;
EnterName
=
empModel
.
EmployeeName
;
}
}
//2021-12-24 取消
//var empModel = accountRepository.GetEmployeeInfo(userInfo.Id);
//if (empModel.UserRole == UserRoleEnum.MarketPersion)
//{
// EnterId = empModel.Id;
// EnterName = empModel.EmployeeName;
//}
//else {
// int SaleId = StuList.FirstOrDefault().CreateBy;
// if (SaleId != userInfo.Id)
// {
// //自己负责的
// empModel = accountRepository.GetEmployeeInfo(SaleId);
// if (empModel.UserRole == UserRoleEnum.MarketPersion)
// {
// EnterId = empModel.Id;
// EnterName = empModel.EmployeeName;
// }
// }
//}
return
new
{
CustomerId
,
...
...
Edu.Module.Finance/FinanceModule.cs
View file @
49f43117
...
...
@@ -123,6 +123,10 @@ namespace Edu.Module.Finance
/// </summary>
private
readonly
RB_Sell_Commission_DetailsRepository
sell_Commission_DetailsRepository
=
new
RB_Sell_Commission_DetailsRepository
();
/// <summary>
/// 业绩提成
/// </summary>
private
readonly
RB_Sell_Achievements_EmpRepository
sell_Achievements_EmpRepository
=
new
RB_Sell_Achievements_EmpRepository
();
/// <summary>
/// 学校仓储层对象
/// </summary>
private
readonly
RB_SchoolRepository
schoolRepository
=
new
RB_SchoolRepository
();
...
...
@@ -342,6 +346,7 @@ namespace Edu.Module.Finance
List
<
RB_Teaching_Perf_ViewModel
>
meritsProfitList
=
new
List
<
RB_Teaching_Perf_ViewModel
>();
List
<
RB_Class_Check_ViewModel
>
classHoursList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Class_Check_ViewModel
>
classStuList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Sell_Achievements_Emp_ViewModel
>
AchDetailList
=
new
List
<
RB_Sell_Achievements_Emp_ViewModel
>();
if
(
classList
.
Any
())
{
string
classIds
=
string
.
Join
(
","
,
classList
.
Select
(
x
=>
x
.
ClassId
));
...
...
@@ -355,6 +360,13 @@ namespace Edu.Module.Finance
classHoursList
=
class_CheckRepository
.
GetClassLearnHoursList
(
GroupId
,
classIds
);
//查询班级下所有学生的上课金额
classStuList
=
class_CheckRepository
.
GetClassStuLearnMoneyList
(
GroupId
,
classIds
);
#
region
查询订单下所有的业绩提成
if
(
orderAllList
.
Any
())
{
string
orderIds
=
string
.
Join
(
","
,
orderAllList
.
Select
(
x
=>
x
.
OrderId
));
AchDetailList
=
sell_Achievements_EmpRepository
.
GetList
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
Group_Id
=
GroupId
,
OrderIds
=
orderIds
});
}
#
endregion
}
//排序取消/删除班级
var
oldlist
=
edu_RevenueReportRepository
.
GetList
(
new
RB_Edu_RevenueReport_Extend
()
{
StartTime
=
STime
,
EndTime
=
ETime
,
DateType
=
1
,
Rb_Group_Id
=
GroupId
});
...
...
@@ -421,6 +433,10 @@ namespace Edu.Module.Finance
demodel
.
QTShouRu
-=
cfinanceList
.
Where
(
x
=>
x
.
Is_Cashier
==
1
&&
x
.
Fee
>
0
).
GroupBy
(
x
=>
new
{
x
.
FrID
,
x
.
Fee
}).
Sum
(
x
=>
x
.
Key
.
Fee
??
0
);
//支出
demodel
.
TiCheng
=
orderList
.
Where
(
x
=>
x
.
IsCommissionGive
==
1
).
Sum
(
x
=>
x
.
CommissionMoney
+
x
.
ExtraCommissionMoney
);
//销售提成
var
achList
=
AchDetailList
.
Where
(
x
=>
orderList
.
Select
(
x
=>
x
.
OrderId
).
Contains
(
x
.
OrderId
)).
ToList
();
if
(
achList
.
Any
())
{
demodel
.
TiCheng
+=
achList
.
Sum
(
x
=>
x
.
GiveOutMoney
);
// 业绩提成
}
demodel
.
ClassFee
=
teacherBonusList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
).
Sum
(
x
=>
x
.
Money
);
//老师提成
demodel
.
JiXiaoMoney
=
meritsProfitList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
&&
x
.
PerfState
==
Common
.
Enum
.
Course
.
PerfStateEnum
.
Confirmed
).
OrderByDescending
(
x
=>
x
.
CreateTime
).
FirstOrDefault
()?.
Money
??
0
;
//绩效提成
...
...
@@ -2889,6 +2905,19 @@ namespace Edu.Module.Finance
#
endregion
#
region
业绩提成
/// <summary>
/// 获取订单提成明细
/// </summary>
/// <param name="orderIds"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public
List
<
RB_Sell_Achievements_Emp_ViewModel
>
GetAchListForOrderIds
(
string
orderIds
,
int
group_Id
)
{
return
sell_Achievements_EmpRepository
.
GetList
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
Group_Id
=
group_Id
,
OrderIds
=
orderIds
});
}
#
endregion
#
region
月结窗口
...
...
Edu.Repository/Sell/RB_Sell_Achievements_DetailsRepository.cs
View file @
49f43117
...
...
@@ -45,6 +45,10 @@ namespace Edu.Repository.Sell
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Details_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Details_ViewModel
.
ClassId
)}
in(
{
demodel
.
ClassIds
}
)"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Details_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
...
...
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
View file @
49f43117
...
...
@@ -57,6 +57,10 @@ namespace Edu.Repository.Sell
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
PeriodsId
)}
>0"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OrderIds
))
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
OrderId
)}
in(
{
demodel
.
OrderIds
}
)"
;
}
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.WebApi/Controllers/Finance/FinanceController.cs
View file @
49f43117
...
...
@@ -97,6 +97,13 @@ namespace Edu.WebApi.Controllers.Finance
//提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Where
(
x
=>
x
.
IsCommissionGive
==
1
).
Sum
(
x
=>
x
.
CommissionMoney
+
x
.
ExtraCommissionMoney
)
:
0
;
//销售提成
if
(
orderList
.
Any
())
{
string
OrderIds
=
string
.
Join
(
","
,
orderList
.
Select
(
x
=>
x
.
OrderId
));
var
achList
=
financeModule
.
GetAchListForOrderIds
(
OrderIds
,
base
.
UserInfo
.
Group_Id
);
if
(
achList
.
Any
())
{
SaleCommission
+=
achList
.
Sum
(
x
=>
x
.
GiveOutMoney
);
// 业绩提成
}
}
decimal
TeacherProfitNow
=
0
,
MeritsProfit
=
0
;
if
(
classId
>
0
)
...
...
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