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
1d5d4ecc
Commit
1d5d4ecc
authored
Dec 13, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段修改
parent
c1bddd90
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
184 additions
and
17 deletions
+184
-17
RB_Course.cs
Edu.Model/Entity/Course/RB_Course.cs
+33
-7
RB_Student_Follow_Extend.cs
Edu.Model/ViewModel/Customer/RB_Student_Follow_Extend.cs
+4
-1
RB_Student_ViewModel.cs
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
+15
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+10
-4
StudentModule.cs
Edu.Module.User/StudentModule.cs
+18
-0
RB_Student_FollowRepository.cs
Edu.Repository/Customer/RB_Student_FollowRepository.cs
+34
-0
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+57
-0
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+10
-5
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+3
-0
No files found.
Edu.Model/Entity/Course/RB_Course.cs
View file @
1d5d4ecc
...
...
@@ -163,19 +163,19 @@ namespace Edu.Model.Entity.Course
public
string
CourseEmphasis
{
get
;
set
;
}
/// <summary>
///
同业价
///
直客首次报名优惠比例
/// </summary>
public
decimal
B2
BPrice
{
get
;
set
;
}
public
decimal
B2
CRatio
{
get
;
set
;
}
/// <summary>
///
一般同行返佣
比例
///
直客续费优惠
比例
/// </summary>
public
decimal
B2
BRebate
Ratio
{
get
;
set
;
}
public
decimal
B2
CReNew
Ratio
{
get
;
set
;
}
/// <summary>
///
校园同行
返佣比例
///
一般同行首次报名
返佣比例
/// </summary>
public
decimal
School
RebateRatio
{
get
;
set
;
}
public
decimal
B2B
RebateRatio
{
get
;
set
;
}
/// <summary>
/// 一般同行续费返佣比例
...
...
@@ -183,8 +183,34 @@ namespace Edu.Model.Entity.Course
public
decimal
B2BReNewRatio
{
get
;
set
;
}
/// <summary>
/// 校园同行返佣比例
/// 校代同行首次报名返佣比例
/// </summary>
public
decimal
SchoolRebateRatio
{
get
;
set
;
}
/// <summary>
/// 校代同行续费返佣比例
/// </summary>
public
decimal
SchoolReNewRatio
{
get
;
set
;
}
/// <summary>
/// 转介首次报名返佣比例
/// </summary>
public
decimal
TransIntroductceRatio
{
get
;
set
;
}
/// <summary>
/// 转介续费返佣比例
/// </summary>
public
decimal
TransIntroductceReNewRatio
{
get
;
set
;
}
/// <summary>
/// 內推首次报名返佣比例
/// </summary>
public
decimal
InnerRecommendRatio
{
get
;
set
;
}
/// <summary>
/// 內推续费返佣比例
/// </summary>
public
decimal
InnerRecommendReNewRatio
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Customer/RB_Student_Follow_Extend.cs
View file @
1d5d4ecc
...
...
@@ -10,6 +10,9 @@ namespace Edu.Model.ViewModel.Customer
/// </summary>
public
class
RB_Student_Follow_Extend
:
RB_Student_Follow
{
/// <summary>
/// 学员编号【查询使用】
/// </summary>
public
string
QStuIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
View file @
1d5d4ecc
...
...
@@ -161,5 +161,20 @@ namespace Edu.Model.ViewModel.User
/// 结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 最好一次跟进时间
/// </summary>
public
string
followUpTime
{
get
;
set
;
}
/// <summary>
/// 本周新增客户数量
/// </summary>
public
int
WeekCount
{
get
;
set
;
}
/// <summary>
/// 本周新增客户数量
/// </summary>
public
int
TodayCount
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
View file @
1d5d4ecc
...
...
@@ -299,10 +299,6 @@ namespace Edu.Module.Course
{
nameof
(
RB_Course_ViewModel
.
B2BIcon
),
model
.
B2BIcon
},
{
nameof
(
RB_Course_ViewModel
.
B2BBackground
),
model
.
B2BBackground
},
{
nameof
(
RB_Course_ViewModel
.
CourseEmphasis
),
model
.
CourseEmphasis
},
{
nameof
(
RB_Course_ViewModel
.
B2BPrice
),
model
.
B2BPrice
},
{
nameof
(
RB_Course_ViewModel
.
B2BRebateRatio
),
model
.
B2BRebateRatio
},
{
nameof
(
RB_Course_ViewModel
.
SchoolReNewRatio
),
model
.
SchoolReNewRatio
},
{
nameof
(
RB_Course_ViewModel
.
SchoolRebateRatio
),
model
.
SchoolRebateRatio
},
};
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
model
.
CourseId
));
}
...
...
@@ -1481,6 +1477,16 @@ namespace Edu.Module.Course
{
{
nameof
(
RB_Course_ViewModel
.
OriginalPrice
),
courseModel
.
OriginalPrice
},
{
nameof
(
RB_Course_ViewModel
.
SellPrice
),
courseModel
.
SellPrice
},
{
nameof
(
RB_Course_ViewModel
.
B2CRatio
),
courseModel
.
B2CRatio
},
{
nameof
(
RB_Course_ViewModel
.
B2CReNewRatio
),
courseModel
.
B2CReNewRatio
},
{
nameof
(
RB_Course_ViewModel
.
B2BRebateRatio
),
courseModel
.
B2BRebateRatio
},
{
nameof
(
RB_Course_ViewModel
.
B2BReNewRatio
),
courseModel
.
B2BReNewRatio
},
{
nameof
(
RB_Course_ViewModel
.
SchoolRebateRatio
),
courseModel
.
SchoolRebateRatio
},
{
nameof
(
RB_Course_ViewModel
.
SchoolReNewRatio
),
courseModel
.
SchoolReNewRatio
},
{
nameof
(
RB_Course_ViewModel
.
InnerRecommendRatio
),
courseModel
.
InnerRecommendRatio
},
{
nameof
(
RB_Course_ViewModel
.
InnerRecommendReNewRatio
),
courseModel
.
InnerRecommendReNewRatio
},
{
nameof
(
RB_Course_ViewModel
.
TransIntroductceRatio
),
courseModel
.
TransIntroductceRatio
},
{
nameof
(
RB_Course_ViewModel
.
TransIntroductceReNewRatio
),
courseModel
.
TransIntroductceReNewRatio
},
};
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
courseModel
.
CourseId
));
}
...
...
Edu.Module.User/StudentModule.cs
View file @
1d5d4ecc
...
...
@@ -53,6 +53,11 @@ namespace Edu.Module.User
private
readonly
RB_Student_OrderGuestRepository
student_OrderGuestRepository
=
new
RB_Student_OrderGuestRepository
();
/// <summary>
/// 学员跟进
/// </summary>
private
readonly
RB_Student_FollowRepository
followRepository
=
new
RB_Student_FollowRepository
();
/// <summary>
/// 获取学生列表
/// </summary>
...
...
@@ -77,10 +82,18 @@ namespace Edu.Module.User
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
string
stuIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
StuId
));
var
followList
=
followRepository
.
GetStudentFollowListRepository
(
new
Model
.
ViewModel
.
Customer
.
RB_Student_Follow_Extend
()
{
QStuIds
=
stuIds
});
var
stuOrderList
=
student_OrderGuestRepository
.
GetStrOrderGuestListRepository
(
new
RB_Student_OrderGuest_ViewModel
()
{
QStudentIds
=
stuIds
});
var
stuList
=
studentRepository
.
GetCustomerStuWeekListRepository
(
new
RB_Student_ViewModel
()
{
CustomerId
=
query
.
CustomerId
});
var
provideList
=
list
.
Where
(
qitem
=>
qitem
.
ProviceId
>
0
).
Select
(
qitem
=>
qitem
.
ProviceId
).
ToList
();
var
cityList
=
list
.
Where
(
qitem
=>
qitem
.
CityId
>
0
).
Select
(
qitem
=>
qitem
.
CityId
).
ToList
();
var
areaList
=
list
.
Where
(
qitem
=>
qitem
.
AreaId
>
0
).
Select
(
qitem
=>
qitem
.
AreaId
).
ToList
();
...
...
@@ -110,12 +123,17 @@ namespace Edu.Module.User
foreach
(
var
item
in
list
)
{
var
tempOrderList
=
stuOrderList
?.
Where
(
qitem
=>
qitem
.
Student_Id
==
item
.
StuId
)?.
ToList
();
var
tempFollow
=
followList
?.
Where
(
qitem
=>
qitem
.
StuId
==
item
.
StuId
)?.
OrderByDescending
(
qitem
=>
qitem
.
Id
)?.
FirstOrDefault
();
item
.
followUpTime
=
Common
.
ConvertHelper
.
FormatTime
(
tempFollow
?.
CreateTime
);
item
.
WeekCount
=
stuList
?.
Count
()??
0
;
item
.
TodayCount
=
stuList
?.
Where
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
CreateTime
)
==
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
))?.
Count
()
??
0
;
item
.
OrderCount
=
tempOrderList
?.
Count
()
??
0
;
item
.
RenewOrderCount
=
tempOrderList
?.
Where
(
qitem
=>
qitem
.
RenewState
==
2
)?.
Count
()??
0
;
item
.
StuGuestState
=
tempOrderList
?.
OrderByDescending
(
qitem
=>
qitem
.
OrderId
)?.
LastOrDefault
()?.
StuGuestState
??
0
;
item
.
AreaName
=
(
destinationList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ID
==
item
.
ProviceId
)?.
Name
??
""
)
+
"/"
+
(
destinationList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ID
==
item
.
CityId
)?.
Name
??
""
)
+
"/"
+
(
destinationList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ID
==
item
.
AreaId
)?.
Name
??
""
);
}
}
return
list
;
...
...
Edu.Repository/Customer/RB_Student_FollowRepository.cs
View file @
1d5d4ecc
...
...
@@ -44,5 +44,39 @@ WHERE 1=1
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Follow_Extend
.
Id
));
return
GetPage
<
RB_Student_Follow_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取学员跟进列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_Follow_Extend
>
GetStudentFollowListRepository
(
RB_Student_Follow_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Student_Follow AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
StuId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_Follow_Extend
.
StuId
),
query
.
StuId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QStuIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Student_Follow_Extend
.
StuId
),
query
.
QStuIds
);
}
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Student_Follow_Extend
.
Id
));
return
Get
<
RB_Student_Follow_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/User/RB_StudentRepository.cs
View file @
1d5d4ecc
...
...
@@ -388,5 +388,62 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
string
sql
=
$@"SELECT StuStage,COUNT(0) as OrderCount FROM rb_student WHERE Group_Id =
{
group_Id
}
and CustomerId =
{
customerId
}
GROUP BY StuStage"
;
return
Get
<
RB_Student_ViewModel
>(
sql
).
ToList
();
}
/// <summary>
/// 获取同行每周新增客户数量
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_ViewModel
>
GetCustomerStuWeekListRepository
(
RB_Student_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT t.*,g.GroupName,s.SName
FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
WHERE 1=1 AND YEARWEEK(date_format(t.CreateTime, '%Y-%m-%d')) = YEARWEEK(now())
"
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
School_Id
>
-
1
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
School_Id
),
query
.
School_Id
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StuName
))
{
builder
.
AppendFormat
(
" AND t.{0} LIKE @StuName "
,
nameof
(
RB_Student_ViewModel
.
StuName
));
parameters
.
Add
(
"StuName"
,
"%"
+
query
.
StuName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StuTel
))
{
builder
.
AppendFormat
(
" AND t.{0} LIKE @StuTel "
,
nameof
(
RB_Student_ViewModel
.
StuTel
));
parameters
.
Add
(
"StuTel"
,
"%"
+
query
.
StuTel
.
Trim
()
+
"%"
);
}
if
(
query
.
ProviceId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
ProviceId
),
query
.
ProviceId
);
}
if
(
query
.
CityId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
CityId
),
query
.
CityId
);
}
if
(
query
.
AreaId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
AreaId
),
query
.
AreaId
);
}
if
(
query
.
CustomerId
>
0
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
CustomerId
),
query
.
CustomerId
);
}
}
return
Get
<
RB_Student_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
1d5d4ecc
...
...
@@ -402,11 +402,6 @@ namespace Edu.WebApi.Controllers.Course
B2BIcon
=
base
.
ParmJObj
.
GetStringValue
(
"B2BIcon"
),
B2BBackground
=
base
.
ParmJObj
.
GetStringValue
(
"B2BBackground"
),
CourseEmphasis
=
base
.
ParmJObj
.
GetStringValue
(
"CourseEmphasis"
),
B2BPrice
=
base
.
ParmJObj
.
GetDecimal
(
"B2BPrice"
),
B2BRebateRatio
=
base
.
ParmJObj
.
GetDecimal
(
"B2BRebateRatio"
),
B2BReNewRatio
=
base
.
ParmJObj
.
GetDecimal
(
"B2BReNewRatio"
),
SchoolRebateRatio
=
base
.
ParmJObj
.
GetDecimal
(
"SchoolRebateRatio"
),
SchoolReNewRatio
=
base
.
ParmJObj
.
GetDecimal
(
"SchoolReNewRatio"
),
};
try
{
...
...
@@ -1226,6 +1221,16 @@ namespace Edu.WebApi.Controllers.Course
CourseId
=
courseObj
.
GetInt
(
"CourseId"
),
OriginalPrice
=
courseObj
.
GetDecimal
(
"OriginalPrice"
),
SellPrice
=
courseObj
.
GetDecimal
(
"SellPrice"
),
B2CRatio
=
courseObj
.
GetDecimal
(
"B2CRatio"
),
B2CReNewRatio
=
courseObj
.
GetDecimal
(
"B2CReNewRatio"
),
B2BRebateRatio
=
courseObj
.
GetDecimal
(
"B2BRebateRatio"
),
B2BReNewRatio
=
courseObj
.
GetDecimal
(
"B2BReNewRatio"
),
SchoolRebateRatio
=
courseObj
.
GetDecimal
(
"SchoolRebateRatio"
),
SchoolReNewRatio
=
courseObj
.
GetDecimal
(
"SchoolReNewRatio"
),
InnerRecommendRatio
=
courseObj
.
GetDecimal
(
"InnerRecommendRatio"
),
InnerRecommendReNewRatio
=
courseObj
.
GetDecimal
(
"InnerRecommendReNewRatio"
),
TransIntroductceRatio
=
courseObj
.
GetDecimal
(
"TransIntroductceRatio"
),
TransIntroductceReNewRatio
=
courseObj
.
GetDecimal
(
"TransIntroductceReNewRatio"
),
};
var
priceObj
=
base
.
ParmJObj
.
GetStringValue
(
"priceList"
);
var
list
=
new
List
<
RB_Course_Preferential_Extend
>();
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
1d5d4ecc
...
...
@@ -866,6 +866,9 @@ namespace Edu.WebApi.Controllers.User
item
.
RenewOrderCount
,
item
.
StuGuestState
,
StuGuestStateStr
=
item
.
StuGuestState
.
ToName
(),
item
.
TodayCount
,
item
.
WeekCount
,
item
.
followUpTime
,
});
}
pageModel
.
Count
=
rowsCount
;
...
...
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