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
c01fe8c6
Commit
c01fe8c6
authored
Feb 10, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c4dab0dc
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
101 additions
and
28 deletions
+101
-28
RB_Order.cs
Edu.Model/Entity/Sell/RB_Order.cs
+1
-1
RB_Student.cs
Edu.Model/Entity/User/RB_Student.cs
+1
-1
RB_Order_ViewModel.cs
Edu.Model/ViewModel/Sell/RB_Order_ViewModel.cs
+5
-0
RB_Student_ViewModel.cs
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
+5
-0
CustomerCommissionModule.cs
Edu.Module.Customer/CustomerCommissionModule.cs
+2
-2
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+2
-2
MarketConsultantModule.cs
Edu.Module.Customer/MarketConsultantModule.cs
+2
-0
RB_CustomerRepository.cs
Edu.Repository/Customer/RB_CustomerRepository.cs
+4
-0
RB_OrderRepository.cs
Edu.Repository/Sell/RB_OrderRepository.cs
+11
-4
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+19
-2
RB_User_ReturnComissionRepository.cs
Edu.Repository/User/RB_User_ReturnComissionRepository.cs
+29
-7
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+2
-1
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+12
-4
CustomerCommissionController.cs
...bApi/Controllers/Customer/CustomerCommissionController.cs
+5
-4
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+1
-0
No files found.
Edu.Model/Entity/Sell/RB_Order.cs
View file @
c01fe8c6
...
...
@@ -347,7 +347,7 @@ namespace Edu.Model.Entity.Sell
public
int
IsBackClass
{
get
;
set
;
}
/// <summary>
/// 同业ID
/// 同业
联系人编号
ID
/// </summary>
public
int
CustomerId
{
get
;
set
;
}
...
...
Edu.Model/Entity/User/RB_Student.cs
View file @
c01fe8c6
...
...
@@ -118,7 +118,7 @@ namespace Edu.Model.Entity.User
public
GuestBasicsEnum
JapanBaseInfo
{
get
;
set
;
}
/// <summary>
/// 同业
客户
编号
/// 同业
联系人
编号
/// </summary>
public
int
CustomerId
{
get
;
set
;
}
...
...
Edu.Model/ViewModel/Sell/RB_Order_ViewModel.cs
View file @
c01fe8c6
...
...
@@ -335,5 +335,10 @@ namespace Edu.Model.ViewModel.Sell
/// </summary>
public
string
StuSourceIdName
{
get
;
set
;
}
/// <summary>
/// 同业编号
/// </summary>
public
int
CategoryId
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
View file @
c01fe8c6
...
...
@@ -375,5 +375,10 @@ namespace Edu.Model.ViewModel.User
/// 订单编号
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 同业编号
/// </summary>
public
int
CategoryId
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Customer/CustomerCommissionModule.cs
View file @
c01fe8c6
...
...
@@ -268,9 +268,9 @@ namespace Edu.Module.Course
/// <param name="commissionType"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
object
GetCustomerCommissionStat
(
int
orderSourceType
,
int
orderSourceId
,
int
commissionType
,
UserInfo
userInfo
)
public
object
GetCustomerCommissionStat
(
int
orderSourceType
,
int
orderSourceId
,
int
CategoryId
,
int
commissionType
,
UserInfo
userInfo
)
{
var
model
=
user_ReturnComissionRepository
.
GetCustomerCommissionStat
(
userInfo
.
Group_Id
,
orderSourceType
,
orderSourceId
,
commissionType
);
var
model
=
user_ReturnComissionRepository
.
GetCustomerCommissionStat
(
userInfo
.
Group_Id
,
orderSourceType
,
orderSourceId
,
CategoryId
,
commissionType
);
return
new
{
model
?.
UnSettlementMoney
,
...
...
Edu.Module.Customer/CustomerModule.cs
View file @
c01fe8c6
...
...
@@ -378,10 +378,10 @@ namespace Edu.Module.Customer
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public
object
GetCustomerStuStageStatistics
(
int
customerId
,
int
group_Id
)
public
object
GetCustomerStuStageStatistics
(
int
customerId
,
int
CategoryId
,
int
group_Id
)
{
List
<
object
>
RList
=
new
List
<
object
>();
var
list
=
studentRepository
.
GetCustomerStuStageStatistics
(
customerId
,
group_Id
);
var
list
=
studentRepository
.
GetCustomerStuStageStatistics
(
customerId
,
CategoryId
,
group_Id
);
var
elist
=
stageRepository
.
GetStageListRepostory
(
new
Model
.
Entity
.
System
.
RB_Stage
()
{
Group_Id
=
group_Id
...
...
Edu.Module.Customer/MarketConsultantModule.cs
View file @
c01fe8c6
...
...
@@ -1386,6 +1386,7 @@ namespace Edu.Module.Customer
{
ChannelName
=
"(企业)"
+
(
customerList
?.
FirstOrDefault
(
qitem
=>
qitem
.
CustomerId
==
subItem
.
StuSourceId
)?.
CustomerName
??
""
),
ChannelId
=
subItem
.
StuSourceId
,
sItem
.
CustomerType
,
ClueCount
=
tempCusList
?.
Count
(),
VisitCount
=
tempCusList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
),
OrderCount
=
tempCusList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
),
...
...
@@ -1399,6 +1400,7 @@ namespace Edu.Module.Customer
{
ChannelName
=
"(校代)"
+
(
customerList
?.
FirstOrDefault
(
qitem
=>
qitem
.
CustomerId
==
subItem
.
StuSourceId
)?.
CustomerName
??
""
),
ChannelId
=
subItem
.
StuSourceId
,
sItem
.
CustomerType
,
ClueCount
=
tempCusList
?.
Count
(),
VisitCount
=
tempCusList
?.
Sum
(
qitem
=>
qitem
.
VisitCount
),
OrderCount
=
tempCusList
?.
Sum
(
qitem
=>
qitem
.
OrderCount
),
...
...
Edu.Repository/Customer/RB_CustomerRepository.cs
View file @
c01fe8c6
...
...
@@ -91,6 +91,10 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND B.{0} LIKE @CategoryName "
,
nameof
(
RB_Customer_Extend
.
CategoryName
));
parameters
.
Add
(
"CategoryName"
,
"%"
+
query
.
CategoryName
.
Trim
()
+
"%"
);
}
if
(
query
.
CategoryId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Customer_Extend
.
CategoryId
),
query
.
CategoryId
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Customer_Extend
.
CustomerId
));
return
GetPage
<
RB_Customer_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
...
...
Edu.Repository/Sell/RB_OrderRepository.cs
View file @
c01fe8c6
...
...
@@ -271,6 +271,10 @@ ORDER BY {orderBy}
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
if
(
demodel
.
CategoryId
>
0
)
{
where
+=
$@" and cu.
{
nameof
(
RB_Order_ViewModel
.
CategoryId
)}
=
{
demodel
.
CategoryId
}
"
;
}
string
orderBy
=
" o.OrderId asc"
;
if
(
demodel
.
Q_OrderBy
==
1
)
{
...
...
@@ -401,6 +405,10 @@ WHERE {where} ORDER BY {orderBy}
{
where
+=
$@" and course.
{
nameof
(
RB_Order_ViewModel
.
CourseSubject
)}
=
{(
int
)
demodel
.
CourseSubject
}
"
;
}
if
(
demodel
.
CategoryId
>
0
)
{
where
+=
$@" and cus.
{
nameof
(
RB_Order_ViewModel
.
CategoryId
)}
=
{
demodel
.
CategoryId
}
"
;
}
string
sql
=
$@"
SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
...
...
@@ -411,10 +419,9 @@ SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferP
CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END END) AS CommissionMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN (
SELECT em.OrderId,SUM(em.GiveOutMoney) as GiveOutMoney FROM rb_sell_achievements_emp em GROUP BY em.OrderId
) ea on ea.OrderId = o.OrderId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN (SELECT em.OrderId,SUM(em.GiveOutMoney) as GiveOutMoney FROM rb_sell_achievements_emp em GROUP BY em.OrderId) ea on ea.OrderId = o.OrderId
LEFT JOIN rb_customer AS cus ON O.CustomerId=cus.CustomerId
WHERE
{
where
}
"
;
return
Get
<
RB_Order_ViewModel
>(
sql
).
FirstOrDefault
();
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
c01fe8c6
...
...
@@ -396,6 +396,10 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND NOT Exists (SELECT StuId FROM rb_student_assist WHERE AssistType=2 AND `Status`=0 AND t.StuId=StuId) "
);
}
}
if
(
query
.
CategoryId
>
0
)
{
builder
.
AppendFormat
(
" AND C.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
CategoryId
),
query
.
CategoryId
);
}
}
builder
.
AppendFormat
(
" ORDER BY t.{0} DESC "
,
nameof
(
RB_Student_ViewModel
.
StuId
));
return
GetPage
<
RB_Student_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
...
...
@@ -771,9 +775,22 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState <>2
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public
List
<
RB_Student_ViewModel
>
GetCustomerStuStageStatistics
(
int
customerId
,
int
group_Id
)
public
List
<
RB_Student_ViewModel
>
GetCustomerStuStageStatistics
(
int
customerId
,
int
CategoryId
,
int
group_Id
)
{
string
sql
=
$@"SELECT StuStage,COUNT(0) AS OrderCount FROM rb_student WHERE Group_Id =
{
group_Id
}
and CustomerId =
{
customerId
}
GROUP BY StuStage"
;
StringBuilder
builder
=
new
StringBuilder
();
if
(
customerId
>
0
)
{
builder
.
AppendFormat
(
" AND A.StuSourceId = {0}"
,
customerId
);
}
if
(
CategoryId
>
0
)
{
builder
.
AppendFormat
(
" AND B.CategoryId = {0}"
,
CategoryId
);
}
string
sql
=
$@"
SELECT A.StuStage,COUNT(0) AS OrderCount
FROM rb_student AS A INNER JOIN rb_customer AS B ON (A.CreateType=2 AND A.StuSourceId=B.CustomerId)
WHERE A.Group_Id =
{
group_Id
}
AND A.CreateType=2
{
builder
.
ToString
()}
GROUP BY A.StuStage "
;
return
Get
<
RB_Student_ViewModel
>(
sql
).
ToList
();
}
...
...
Edu.Repository/User/RB_User_ReturnComissionRepository.cs
View file @
c01fe8c6
...
...
@@ -52,14 +52,36 @@ from RB_User_ReturnCommission where GroupId ={group_Id} and UserId={id} and User
/// <param name="orderSourceId"></param>
/// <param name="commissionType"></param>
/// <returns></returns>
public
RB_User_ReturnComission_ViewModel
GetCustomerCommissionStat
(
int
group_Id
,
int
orderSourceType
,
int
orderSourceId
,
int
commissionType
)
public
RB_User_ReturnComission_ViewModel
GetCustomerCommissionStat
(
int
group_Id
,
int
orderSourceType
,
int
orderSourceId
,
int
CategoryId
,
int
commissionType
)
{
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=
{
orderSourceId
}
and UserType =
{
orderSourceType
}
and CommissionType =
{
commissionType
}
"
;
return
Get
<
RB_User_ReturnComission_ViewModel
>(
sql
).
FirstOrDefault
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT sum(A.UnSettlementMoney)as UnSettlementMoney,sum(A.SttlementMoney) as SttlementMoney
,sum(A.CashOutMoney)as CashOutMoney,sum(A.CanCashOutMoney)as CanCashOutMoney
FROM RB_User_ReturnCommission AS A INNER JOIN rb_customer AS B ON (A.UserType=2 AND A.UserId=B.CustomerId)
WHERE 1=1
"
);
if
(
group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_User_ReturnComission_ViewModel
.
GroupId
),
group_Id
);
}
if
(
orderSourceType
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_User_ReturnComission_ViewModel
.
UserType
),
orderSourceType
);
}
if
(
commissionType
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_User_ReturnComission_ViewModel
.
CommissionType
),
commissionType
);
}
if
(
orderSourceId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_User_ReturnComission_ViewModel
.
UserId
),
orderSourceId
);
}
if
(
CategoryId
>
0
)
{
builder
.
AppendFormat
(
" AND B.CategoryId={0} "
,
CategoryId
);
}
return
Get
<
RB_User_ReturnComission_ViewModel
>(
builder
.
ToString
()).
FirstOrDefault
();
}
/// <summary>
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
c01fe8c6
...
...
@@ -1548,7 +1548,8 @@ namespace Edu.WebApi.Controllers.Course
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
,
0
),
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
),
CourseSubject
=
base
.
ParmJObj
.
GetInt
(
"CourseSubject"
),
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
,
0
)
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
,
0
),
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
),
};
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
c01fe8c6
...
...
@@ -634,13 +634,14 @@ namespace Edu.WebApi.Controllers.Customer
public
ApiResult
GetCustomerStuStageStatistics
()
{
var
userInfo
=
base
.
UserInfo
;
int
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
,
0
);
//同业ID
if
(
CustomerId
<=
0
)
int
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
,
0
);
//同业联系人编号ID
int
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
,
0
);
//同业编号
if
(
CustomerId
<=
0
&&
CategoryId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
Robj
=
customerModule
.
GetCustomerStuStageStatistics
(
CustomerId
,
userInfo
.
Group_Id
);
var
Robj
=
customerModule
.
GetCustomerStuStageStatistics
(
CustomerId
,
CategoryId
,
userInfo
.
Group_Id
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
...
...
@@ -972,7 +973,14 @@ namespace Edu.WebApi.Controllers.Customer
{
var
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
);
var
extModel
=
customerModule
.
GetCustomerCategoryModule
(
CategoryId
);
return
ApiResult
.
Success
(
data
:
extModel
);
var
obj
=
new
{
extModel
?.
CategoryId
,
extModel
?.
CategoryName
,
extModel
?.
CatetoryType
,
CatetoryTypeName
=
extModel
?.
CatetoryType
.
ToName
()??
""
,
};
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
...
...
Edu.WebApi/Controllers/Customer/CustomerCommissionController.cs
View file @
c01fe8c6
...
...
@@ -268,13 +268,14 @@ namespace Edu.WebApi.Controllers.Course
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
base
.
RequestParm
.
Msg
.
ToString
());
int
OrderSourceType
=
parms
.
GetInt
(
"OrderSourceType"
,
1
);
//来源
int
OrderSourceId
=
parms
.
GetInt
(
"OrderSourceId"
,
0
);
//来源对应ID (内部 同行 学生)
int
OrderSourceId
=
parms
.
GetInt
(
"OrderSourceId"
,
0
);
//来源对应ID (内部 同行联系人 学生)
int
CategoryId
=
parms
.
GetInt
(
"CategoryId"
,
0
);
//同行编号
int
CommissionType
=
parms
.
GetInt
(
"CommissionType"
,
0
);
//类型
if
(
OrderSourceType
<=
0
||
OrderSourceId
<=
0
||
CommissionType
<=
0
)
{
if
(
OrderSourceType
<=
0
||
OrderSourceId
<=
0
||
CommissionType
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
Robj
=
customerCommissionModule
.
GetCustomerCommissionStat
(
OrderSourceType
,
OrderSourceId
,
CommissionType
,
userInfo
);
var
Robj
=
customerCommissionModule
.
GetCustomerCommissionStat
(
OrderSourceType
,
OrderSourceId
,
CategoryId
,
CommissionType
,
userInfo
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
c01fe8c6
...
...
@@ -679,6 +679,7 @@ namespace Edu.WebApi.Controllers.User
WeChatNo
=
base
.
ParmJObj
.
GetStringValue
(
"WeChatNo"
),
StuType
=
base
.
ParmJObj
.
GetInt
(
"StuType"
),
ExistCourseConsultant
=
base
.
ParmJObj
.
GetInt
(
"ExistCourseConsultant"
),
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
),
};
if
(
query
.
IsQueryMyStu
==
1
)
{
...
...
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