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
f9adb90e
Commit
f9adb90e
authored
Dec 23, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b103bdb3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
20 deletions
+109
-20
SellAchievementsModule.cs
Edu.Module.Course/SellAchievementsModule.cs
+79
-20
RB_Sell_Achievements_EmpRepository.cs
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
+4
-0
SellAchievementsController.cs
Edu.WebApi/Controllers/Course/SellAchievementsController.cs
+26
-0
No files found.
Edu.Module.Course/SellAchievementsModule.cs
View file @
f9adb90e
...
@@ -725,6 +725,9 @@ namespace Edu.Module.Course
...
@@ -725,6 +725,9 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
teaOrderList
)
foreach
(
var
qitem
in
teaOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
HelpEnterId
,
EmpId
=
qitem
.
HelpEnterId
,
...
@@ -736,11 +739,11 @@ namespace Edu.Module.Course
...
@@ -736,11 +739,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
3
,
Type
=
3
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -770,6 +773,10 @@ namespace Edu.Module.Course
...
@@ -770,6 +773,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
sellOrderList
)
foreach
(
var
qitem
in
sellOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
EnterID
,
EmpId
=
qitem
.
EnterID
,
...
@@ -781,11 +788,11 @@ namespace Edu.Module.Course
...
@@ -781,11 +788,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
1
,
Type
=
1
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -811,6 +818,10 @@ namespace Edu.Module.Course
...
@@ -811,6 +818,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
consultantOrderList
)
foreach
(
var
qitem
in
consultantOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
CourseConsultantId
,
EmpId
=
qitem
.
CourseConsultantId
,
...
@@ -822,11 +833,11 @@ namespace Edu.Module.Course
...
@@ -822,11 +833,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
2
,
Type
=
2
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -855,6 +866,10 @@ namespace Edu.Module.Course
...
@@ -855,6 +866,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
sellOrderList
)
foreach
(
var
qitem
in
sellOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
foreach
(
var
emp
in
EmpList
)
foreach
(
var
emp
in
EmpList
)
{
{
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
...
@@ -868,11 +883,11 @@ namespace Edu.Module.Course
...
@@ -868,11 +883,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
1
,
Type
=
1
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -897,6 +912,10 @@ namespace Edu.Module.Course
...
@@ -897,6 +912,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
consultantOrderList
)
foreach
(
var
qitem
in
consultantOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
foreach
(
var
emp
in
EmpList
)
foreach
(
var
emp
in
EmpList
)
{
{
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
...
@@ -910,11 +929,11 @@ namespace Edu.Module.Course
...
@@ -910,11 +929,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
2
,
Type
=
2
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -993,6 +1012,8 @@ namespace Edu.Module.Course
...
@@ -993,6 +1012,8 @@ namespace Edu.Module.Course
//查询这几个学生累计课时
//查询这几个学生累计课时
decimal
TotalLearn
=
CheckList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
MonthDate
<=
Convert
.
ToDateTime
(
EDate
)).
Sum
(
x
=>
x
.
CurrentDeductionHours
);
//累计消费课时 (要查询当前发放提成日期) ld 07-02调整
decimal
TotalLearn
=
CheckList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
MonthDate
<=
Convert
.
ToDateTime
(
EDate
)).
Sum
(
x
=>
x
.
CurrentDeductionHours
);
//累计消费课时 (要查询当前发放提成日期) ld 07-02调整
decimal
TotalHours
=
g3list
.
Sum
(
x
=>
x
.
TotalHours
);
// 直接根据学生表 总课时计算 (必须签到课时 = 总课时 才发完最后一个月的)
decimal
TotalHours
=
g3list
.
Sum
(
x
=>
x
.
TotalHours
);
// 直接根据学生表 总课时计算 (必须签到课时 = 总课时 才发完最后一个月的)
TotalLearn
=
20
;
#
endregion
#
endregion
if
(
YFCommission
==
SaleCommissioned
)
if
(
YFCommission
==
SaleCommissioned
)
...
@@ -1381,6 +1402,9 @@ namespace Edu.Module.Course
...
@@ -1381,6 +1402,9 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
teaOrderList
)
foreach
(
var
qitem
in
teaOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
HelpEnterId
,
EmpId
=
qitem
.
HelpEnterId
,
...
@@ -1392,11 +1416,11 @@ namespace Edu.Module.Course
...
@@ -1392,11 +1416,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
3
,
Type
=
3
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -1427,6 +1451,10 @@ namespace Edu.Module.Course
...
@@ -1427,6 +1451,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
sellOrderList
)
foreach
(
var
qitem
in
sellOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
EnterID
,
EmpId
=
qitem
.
EnterID
,
...
@@ -1438,11 +1466,11 @@ namespace Edu.Module.Course
...
@@ -1438,11 +1466,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
1
,
Type
=
1
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -1468,6 +1496,10 @@ namespace Edu.Module.Course
...
@@ -1468,6 +1496,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
consultantOrderList
)
foreach
(
var
qitem
in
consultantOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
{
EmpId
=
qitem
.
CourseConsultantId
,
EmpId
=
qitem
.
CourseConsultantId
,
...
@@ -1479,11 +1511,11 @@ namespace Edu.Module.Course
...
@@ -1479,11 +1511,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
2
,
Type
=
2
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -1513,6 +1545,10 @@ namespace Edu.Module.Course
...
@@ -1513,6 +1545,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
sellOrderList
)
foreach
(
var
qitem
in
sellOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
foreach
(
var
emp
in
EmpList
)
foreach
(
var
emp
in
EmpList
)
{
{
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
...
@@ -1526,11 +1562,11 @@ namespace Edu.Module.Course
...
@@ -1526,11 +1562,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
1
,
Type
=
1
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -1556,6 +1592,10 @@ namespace Edu.Module.Course
...
@@ -1556,6 +1592,10 @@ namespace Edu.Module.Course
{
{
foreach
(
var
qitem
in
consultantOrderList
)
foreach
(
var
qitem
in
consultantOrderList
)
{
{
//当前订单的业绩
decimal
bdCommission
=
bdList
.
Where
(
x
=>
x
.
OrderId
==
qitem
.
OrderId
&&
x
.
BalanceType
==
1
).
Sum
(
x
=>
x
.
Money
);
decimal
tCommission
=
AchEmpList
.
Where
(
x
=>
x
.
Type
==
3
&&
x
.
OrderId
==
qitem
.
OrderId
).
Sum
(
x
=>
x
.
PushMoney
);
decimal
orderYj
=
qitem
.
PreferPrice
-
qitem
.
DiscountMoney
-
bdCommission
-
tCommission
;
foreach
(
var
emp
in
EmpList
)
foreach
(
var
emp
in
EmpList
)
{
{
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
AchEmpList
.
Add
(
new
RB_Sell_Achievements_Emp_ViewModel
()
...
@@ -1569,11 +1609,11 @@ namespace Edu.Module.Course
...
@@ -1569,11 +1609,11 @@ namespace Edu.Module.Course
OrderId
=
qitem
.
OrderId
,
OrderId
=
qitem
.
OrderId
,
PeriodsId
=
0
,
PeriodsId
=
0
,
Rate
=
rateModel
.
Rate
,
Rate
=
rateModel
.
Rate
,
PushMoney
=
Math
.
Round
(
YjMoney
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
PushMoney
=
Math
.
Round
(
orderYj
*
rateModel
.
Rate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
RuleId
=
item
.
Id
,
RuleId
=
item
.
Id
,
SaleMoney
=
YjMoney
,
SaleMoney
=
YjMoney
,
Type
=
2
,
Type
=
2
,
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
Remark
=
"当月业绩:"
+
TotalYj
+
";当月B2B返佣:"
+
bdMoney
+
";当月老师提成:"
+
teacherMoney
+
";订单b2b返佣:"
+
bdCommission
+
";订单老师提成:"
+
tCommission
+
";订单业绩:"
+
orderYj
});
});
}
}
}
}
...
@@ -1636,6 +1676,25 @@ namespace Edu.Module.Course
...
@@ -1636,6 +1676,25 @@ namespace Edu.Module.Course
return
true
;
return
true
;
}
}
/// <summary>
/// 获取业绩变更日志
/// </summary>
/// <param name="orderId"></param>
/// <param name="userId"></param>
/// <param name="userType"></param>
/// <param name="isDept"></param>
/// <param name="msg"></param>
/// <returns></returns>
public
string
GetSellAchievementsChangeLog
(
int
orderId
,
int
userId
,
int
userType
,
int
isDept
,
int
groupId
,
out
string
msg
)
{
msg
=
""
;
var
empModel
=
sell_Achievements_EmpRepository
.
GetList
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
Group_Id
=
groupId
,
OrderId
=
orderId
,
EmpId
=
userId
,
Type
=
userType
,
IsDept
=
isDept
}).
FirstOrDefault
();
if
(
empModel
==
null
)
{
msg
=
"未查询到相关信息"
;
return
""
;
}
return
"业绩比例:"
+
empModel
.
Rate
+
";业绩描述:"
+
empModel
.
Remark
;
}
#
endregion
#
endregion
}
}
}
}
Edu.Repository/Sell/RB_Sell_Achievements_EmpRepository.cs
View file @
f9adb90e
...
@@ -41,6 +41,10 @@ namespace Edu.Repository.Sell
...
@@ -41,6 +41,10 @@ namespace Edu.Repository.Sell
{
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
EmpId
)}
=
{
demodel
.
EmpId
}
"
;
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
EmpId
)}
=
{
demodel
.
EmpId
}
"
;
}
}
if
(
demodel
.
IsDept
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
IsDept
)}
=
{
demodel
.
IsDept
}
"
;
}
if
(
demodel
.
PeriodsId
>
0
)
if
(
demodel
.
PeriodsId
>
0
)
{
{
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
PeriodsId
)}
=
{
demodel
.
PeriodsId
}
"
;
where
+=
$@" and r.
{
nameof
(
RB_Sell_Achievements_Emp_ViewModel
.
PeriodsId
)}
=
{
demodel
.
PeriodsId
}
"
;
...
...
Edu.WebApi/Controllers/Course/SellAchievementsController.cs
View file @
f9adb90e
...
@@ -586,6 +586,32 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -586,6 +586,32 @@ namespace Edu.WebApi.Controllers.Course
}
}
}
}
/// <summary>
/// 获取应发提成变更记录
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSellAchievementsChangeLog
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
int
UserType
=
parms
.
GetInt
(
"UserType"
,
0
);
int
IsDept
=
parms
.
GetInt
(
"IsDept"
,
0
);
if
(
OrderId
<=
0
||
UserId
<=
0
||
UserType
<=
0
||
IsDept
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
Robj
=
sellAchievementsModule
.
GetSellAchievementsChangeLog
(
OrderId
,
UserId
,
UserType
,
IsDept
,
userInfo
.
Group_Id
,
out
string
msg
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
(
""
,
Robj
);
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
#
endregion
}
}
}
}
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