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
50865acc
Commit
50865acc
authored
Dec 14, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
12b48e44
ef477746
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
234 additions
and
23 deletions
+234
-23
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+111
-22
OrderModule2.cs
Edu.Module.Course/OrderModule2.cs
+1
-1
CustomerStudentModule.cs
Edu.Module.Customer/CustomerStudentModule.cs
+65
-0
VisitorReserveModule.cs
Edu.Module.Duty/VisitorReserveModule.cs
+43
-0
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+4
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+10
-0
No files found.
Edu.Module.Course/OrderModule.cs
View file @
50865acc
...
@@ -117,6 +117,10 @@ namespace Edu.Module.Course
...
@@ -117,6 +117,10 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// <summary>
/// 学生日志
/// </summary>
private
readonly
RB_Student_LogRepository
student_LogRepository
=
new
RB_Student_LogRepository
();
/// <summary>
/// 同行
/// 同行
/// </summary>
/// </summary>
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
...
@@ -413,6 +417,8 @@ namespace Edu.Module.Course
...
@@ -413,6 +417,8 @@ namespace Edu.Module.Course
var
courseModel
=
courseRepository
.
GetEntity
(
demodel
.
CourseId
);
var
courseModel
=
courseRepository
.
GetEntity
(
demodel
.
CourseId
);
decimal
coursePrice
=
courseModel
.
SellPrice
;
//课程最低单价
decimal
coursePrice
=
courseModel
.
SellPrice
;
//课程最低单价
#
region
课程比例赋值
#
region
课程比例赋值
if
(
demodel
.
OrderId
<=
0
)
{
demodel
.
B2CRatio
=
courseModel
.
B2CRatio
;
demodel
.
B2CRatio
=
courseModel
.
B2CRatio
;
demodel
.
B2CReNewRatio
=
courseModel
.
B2CReNewRatio
;
demodel
.
B2CReNewRatio
=
courseModel
.
B2CReNewRatio
;
demodel
.
B2BRebateRatio
=
courseModel
.
B2BRebateRatio
;
demodel
.
B2BRebateRatio
=
courseModel
.
B2BRebateRatio
;
...
@@ -423,6 +429,20 @@ namespace Edu.Module.Course
...
@@ -423,6 +429,20 @@ namespace Edu.Module.Course
demodel
.
TransIntroductceReNewRatio
=
courseModel
.
TransIntroductceReNewRatio
;
demodel
.
TransIntroductceReNewRatio
=
courseModel
.
TransIntroductceReNewRatio
;
demodel
.
InnerRecommendRatio
=
courseModel
.
InnerRecommendRatio
;
demodel
.
InnerRecommendRatio
=
courseModel
.
InnerRecommendRatio
;
demodel
.
InnerRecommendReNewRatio
=
courseModel
.
InnerRecommendReNewRatio
;
demodel
.
InnerRecommendReNewRatio
=
courseModel
.
InnerRecommendReNewRatio
;
}
else
{
//使用订单的比例
courseModel
.
B2CRatio
=
orderModel
.
B2CRatio
;
courseModel
.
B2CReNewRatio
=
orderModel
.
B2CReNewRatio
;
courseModel
.
B2BRebateRatio
=
orderModel
.
B2BRebateRatio
;
courseModel
.
B2BReNewRatio
=
orderModel
.
B2BReNewRatio
;
courseModel
.
SchoolRebateRatio
=
orderModel
.
SchoolRebateRatio
;
courseModel
.
SchoolReNewRatio
=
orderModel
.
SchoolReNewRatio
;
courseModel
.
TransIntroductceRatio
=
orderModel
.
TransIntroductceRatio
;
courseModel
.
TransIntroductceReNewRatio
=
orderModel
.
TransIntroductceReNewRatio
;
courseModel
.
InnerRecommendRatio
=
orderModel
.
InnerRecommendRatio
;
courseModel
.
InnerRecommendReNewRatio
=
orderModel
.
InnerRecommendReNewRatio
;
}
#
endregion
#
endregion
#
region
计算订单优惠信息
#
region
计算订单优惠信息
List
<
RB_Student_ViewModel
>
StuList
=
new
List
<
RB_Student_ViewModel
>();
List
<
RB_Student_ViewModel
>
StuList
=
new
List
<
RB_Student_ViewModel
>();
...
@@ -437,7 +457,7 @@ namespace Edu.Module.Course
...
@@ -437,7 +457,7 @@ namespace Edu.Module.Course
{
{
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
decimal
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CReNewRatio
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
(
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -473,7 +493,7 @@ namespace Edu.Module.Course
...
@@ -473,7 +493,7 @@ namespace Edu.Module.Course
{
{
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
decimal
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CRatio
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
(
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -497,7 +517,7 @@ namespace Edu.Module.Course
...
@@ -497,7 +517,7 @@ namespace Edu.Module.Course
else
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
&&
demodel
.
OrderIdentify
==
2
)
else
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
&&
demodel
.
OrderIdentify
==
2
)
{
{
//查询学生列表
//查询学生列表
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
StuIds
=
demodel
.
StuIds
});
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
StuIds
=
demodel
.
StuIds
,
School_Id
=
-
1
});
//根据客人手机号码 验证是否是续费
//根据客人手机号码 验证是否是续费
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
message
=
"只能选择同一同行的客户报名"
;
message
=
"只能选择同一同行的客户报名"
;
...
@@ -535,7 +555,7 @@ namespace Edu.Module.Course
...
@@ -535,7 +555,7 @@ namespace Edu.Module.Course
if
(
RenewNum
>
0
)
if
(
RenewNum
>
0
)
{
{
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CReNewRatio
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
RenewNum
,
2
,
MidpointRounding
.
AwayFromZero
);
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
(
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
RenewNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -557,7 +577,7 @@ namespace Edu.Module.Course
...
@@ -557,7 +577,7 @@ namespace Edu.Module.Course
if
(
NormalNum
>
0
)
if
(
NormalNum
>
0
)
{
{
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CRatio
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
NormalNum
,
2
,
MidpointRounding
.
AwayFromZero
);
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
(
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
NormalNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -639,8 +659,8 @@ namespace Edu.Module.Course
...
@@ -639,8 +659,8 @@ namespace Edu.Module.Course
return
flag
;
return
flag
;
}
}
}
}
//没有总经理修改订单权限
//没有总经理修改订单权限
if (!isEditOrder)
if
(
!
isEditOrder
)
if
(
true
)
{
{
//if (demodel.Unit_Price < coursePrice)
//if (demodel.Unit_Price < coursePrice)
//{
//{
...
@@ -651,7 +671,7 @@ namespace Edu.Module.Course
...
@@ -651,7 +671,7 @@ namespace Edu.Module.Course
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
{
{
var
newPreferPrice
=
Math
.
Round
(
coursePrice
/
courseModel
.
ClassHours
*
(
courseModel
.
ClassHours
-
demodel
.
StartClassHours
)
*
demodel
.
GuestNum
,
2
);
var
newPreferPrice
=
Math
.
Round
(
coursePrice
/
courseModel
.
ClassHours
*
(
courseModel
.
ClassHours
-
demodel
.
StartClassHours
)
*
demodel
.
GuestNum
,
2
);
if
(
demodel
.
PreferPrice
!=
(
newPreferPrice
-
demodel
.
DiscountMoney
)
)
if
(
demodel
.
PreferPrice
!=
newPreferPrice
)
{
{
flag
=
false
;
flag
=
false
;
message
=
"应收总额不正确"
;
message
=
"应收总额不正确"
;
...
@@ -664,7 +684,7 @@ namespace Edu.Module.Course
...
@@ -664,7 +684,7 @@ namespace Edu.Module.Course
}
}
else
else
{
{
if
(
demodel
.
PreferPrice
!=
(
coursePrice
*
demodel
.
GuestNum
-
demodel
.
DiscountMoney
))
if
(
demodel
.
PreferPrice
!=
(
coursePrice
*
demodel
.
GuestNum
))
{
{
flag
=
false
;
flag
=
false
;
message
=
"应收总额不正确"
;
message
=
"应收总额不正确"
;
...
@@ -934,7 +954,8 @@ namespace Edu.Module.Course
...
@@ -934,7 +954,8 @@ namespace Edu.Module.Course
TotalHours
=
Convert
.
ToInt32
(
courseModel
.
ClassHours
),
TotalHours
=
Convert
.
ToInt32
(
courseModel
.
ClassHours
),
CompleteHours
=
0
,
CompleteHours
=
0
,
MakeUpHours
=
0
,
MakeUpHours
=
0
,
StuIcon
=
""
StuIcon
=
""
,
RenewState
=
1
};
};
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
}
}
...
@@ -980,11 +1001,13 @@ namespace Edu.Module.Course
...
@@ -980,11 +1001,13 @@ namespace Edu.Module.Course
StudyRemark
=
""
,
StudyRemark
=
""
,
CompleteHours
=
0
,
CompleteHours
=
0
,
MakeUpHours
=
0
,
MakeUpHours
=
0
,
StuIcon
=
""
StuIcon
=
""
,
RenewState
=
1
};
};
if
(
demodel
.
RenewOrderId
>
0
)
if
(
demodel
.
RenewOrderId
>
0
)
{
{
guestModel
.
TotalHours
=
Convert
.
ToInt32
(
courseModel
.
ClassHours
);
guestModel
.
TotalHours
=
Convert
.
ToInt32
(
courseModel
.
ClassHours
);
guestModel
.
RenewState
=
2
;
}
}
else
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
TransOrder
)
else
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
TransOrder
)
{
{
...
@@ -1045,6 +1068,62 @@ namespace Edu.Module.Course
...
@@ -1045,6 +1068,62 @@ namespace Edu.Module.Course
RenewState
=
item
.
IsRenewGuest
==
1
?
2
:
1
RenewState
=
item
.
IsRenewGuest
==
1
?
2
:
1
};
};
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
#
region
更新客人阶段
if
(
item
.
IsRenewGuest
==
1
&&
item
.
StuStage
==
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
Common
.
Enum
.
User
.
StuStageEnum
.
MultipleClinch
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Student_ViewModel
.
StuId
),
FiledValue
=
item
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
studentRepository
.
Update
(
keyValues
,
wheres
);
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
LogId
=
0
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
1
,
Group_Id
=
userInfo
.
Group_Id
,
LogContent
=
"首次续课,客户阶段由'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
.
ToName
())
+
"'自动转换为'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
MultipleClinch
.
ToName
())
+
"'"
,
LogTitle
=
"客户阶段变更"
,
LogType
=
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
StuId
=
item
.
StuId
});
}
else
if
(
item
.
StuStage
<
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Student_ViewModel
.
StuId
),
FiledValue
=
item
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
studentRepository
.
Update
(
keyValues
,
wheres
);
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
LogId
=
0
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
1
,
Group_Id
=
userInfo
.
Group_Id
,
LogContent
=
"首次生成订单,客户阶段由'"
+
(
item
.
StuStage
.
ToName
())
+
"'自动转换为'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
.
ToName
())
+
"'"
,
LogTitle
=
"客户阶段变更"
,
LogType
=
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
StuId
=
item
.
StuId
});
}
#
endregion
}
}
//返佣幸福存折
//返佣幸福存折
if
(
demodel
.
CustomerId
>
0
&&
BalanceList
.
Any
())
{
if
(
demodel
.
CustomerId
>
0
&&
BalanceList
.
Any
())
{
...
@@ -2274,6 +2353,15 @@ namespace Edu.Module.Course
...
@@ -2274,6 +2353,15 @@ namespace Edu.Module.Course
//新增学员信息
//新增学员信息
else
else
{
{
#
region
验证电话是否已是他人客户
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
))
{
var
slist
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
StuTel
=
dmodel
.
Mobile
,
School_Id
=
-
1
});
if
(
slist
.
Where
(
x
=>
x
.
CustomerId
!=
ordermodel
.
CustomerId
).
Any
())
{
message
=
"学员'"
+
dmodel
.
GuestName
+
"'已被他人注册"
;
return
false
;
}
}
#
endregion
dmodel
.
ClassId
=
ordermodel
.
ClassId
;
dmodel
.
ClassId
=
ordermodel
.
ClassId
;
dmodel
.
SourceId
=
ordermodel
.
SourceId
;
dmodel
.
SourceId
=
ordermodel
.
SourceId
;
int
GuestNum
=
order_GuestRepository
.
GetOrderGuestNumRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
dmodel
.
OrderId
,
GuestState
=
GuestStateEnum
.
Normal
});
int
GuestNum
=
order_GuestRepository
.
GetOrderGuestNumRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderId
=
dmodel
.
OrderId
,
GuestState
=
GuestStateEnum
.
Normal
});
...
@@ -2359,7 +2447,8 @@ namespace Edu.Module.Course
...
@@ -2359,7 +2447,8 @@ namespace Edu.Module.Course
StuTel
=
dmodel
.
Mobile
,
StuTel
=
dmodel
.
Mobile
,
UpdateBy
=
dmodel
.
CreateBy
,
UpdateBy
=
dmodel
.
CreateBy
,
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
CustomerId
=
ordermodel
.
CustomerId
CustomerId
=
ordermodel
.
CustomerId
,
StuStage
=
Common
.
Enum
.
User
.
StuStageEnum
.
Clinch
};
};
studentRepository
.
SetStudentRepository
(
stuModel
);
studentRepository
.
SetStudentRepository
(
stuModel
);
...
...
Edu.Module.Course/OrderModule2.cs
View file @
50865acc
...
@@ -311,7 +311,7 @@ namespace Edu.Module.Course
...
@@ -311,7 +311,7 @@ namespace Edu.Module.Course
{
{
message
=
""
;
message
=
""
;
//查询学生列表
//查询学生列表
var
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StuIds
=
stuIds
});
var
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StuIds
=
stuIds
,
School_Id
=
-
1
});
//根据客人手机号码 验证是否是续费
//根据客人手机号码 验证是否是续费
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
{
...
...
Edu.Module.Customer/CustomerStudentModule.cs
View file @
50865acc
...
@@ -32,6 +32,11 @@ namespace Edu.Module.Customer
...
@@ -32,6 +32,11 @@ namespace Edu.Module.Customer
/// </summary>
/// </summary>
private
readonly
RB_Student_VisitRepository
student_VisitRepository
=
new
RB_Student_VisitRepository
();
private
readonly
RB_Student_VisitRepository
student_VisitRepository
=
new
RB_Student_VisitRepository
();
/// <summary>
/// 学生
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// <summary>
/// 学员日志仓储层对象
/// 学员日志仓储层对象
/// </summary>
/// </summary>
...
@@ -225,6 +230,36 @@ namespace Edu.Module.Customer
...
@@ -225,6 +230,36 @@ namespace Edu.Module.Customer
flag
=
newId
>
0
;
flag
=
newId
>
0
;
logTitle
=
"新增跟进"
;
logTitle
=
"新增跟进"
;
logContent
=
model
.
Remark
;
logContent
=
model
.
Remark
;
if
(
flag
)
{
//获取学生信息
var
smodel
=
studentRepository
.
GetEntity
(
model
.
StuId
);
if
(
smodel
!=
null
&&
smodel
.
StuStage
==
Common
.
Enum
.
User
.
StuStageEnum
.
NewStu
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
Common
.
Enum
.
User
.
StuStageEnum
.
PreliminaryCommunication
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Student_ViewModel
.
StuId
),
FiledValue
=
model
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
studentRepository
.
Update
(
keyValues
,
wheres
);
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
LogId
=
0
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
1
,
Group_Id
=
model
.
Group_Id
,
LogContent
=
"首次跟进,客户阶段由'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
NewStu
.
ToName
())
+
"'自动转换为'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
PreliminaryCommunication
.
ToName
())
+
"'"
,
LogTitle
=
"客户阶段变更"
,
LogType
=
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
StuId
=
model
.
StuId
});
}
}
}
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
logTitle
,
logContent
,
model
.
CreateBy
);
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Follow
,
logTitle
,
logContent
,
model
.
CreateBy
);
return
flag
;
return
flag
;
...
@@ -387,6 +422,36 @@ namespace Edu.Module.Customer
...
@@ -387,6 +422,36 @@ namespace Edu.Module.Customer
flag
=
newId
>
0
;
flag
=
newId
>
0
;
logTitle
=
"新增到访"
;
logTitle
=
"新增到访"
;
logContent
=
model
.
Remark
;
logContent
=
model
.
Remark
;
if
(
flag
)
{
//获取学生信息
var
smodel
=
studentRepository
.
GetEntity
(
model
.
StuId
);
if
(
smodel
!=
null
&&
smodel
.
StuStage
==
Common
.
Enum
.
User
.
StuStageEnum
.
NewStu
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
Common
.
Enum
.
User
.
StuStageEnum
.
PreliminaryCommunication
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Student_ViewModel
.
StuId
),
FiledValue
=
model
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
studentRepository
.
Update
(
keyValues
,
wheres
);
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
LogId
=
0
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
1
,
Group_Id
=
model
.
Group_Id
,
LogContent
=
"首次拜访,客户阶段由'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
NewStu
.
ToName
())
+
"'自动转换为'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
PreliminaryCommunication
.
ToName
())
+
"'"
,
LogTitle
=
"客户阶段变更"
,
LogType
=
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
StuId
=
model
.
StuId
});
}
}
}
}
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Visit
,
logTitle
,
logContent
,
model
.
CreateBy
);
student_LogRepository
.
AddStuLogRepository
(
model
.
StuId
,
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
Visit
,
logTitle
,
logContent
,
model
.
CreateBy
);
return
flag
;
return
flag
;
...
...
Edu.Module.Duty/VisitorReserveModule.cs
View file @
50865acc
...
@@ -15,6 +15,9 @@ using Edu.Repository.User;
...
@@ -15,6 +15,9 @@ using Edu.Repository.User;
using
Edu.Common.Message
;
using
Edu.Common.Message
;
using
Edu.Model.ViewModel.Grade
;
using
Edu.Model.ViewModel.Grade
;
using
Edu.Repository.Grade
;
using
Edu.Repository.Grade
;
using
Edu.Repository.Customer
;
using
Edu.Model.ViewModel.User
;
using
Edu.Common.Plugin
;
namespace
Edu.Module.Duty
namespace
Edu.Module.Duty
{
{
...
@@ -38,6 +41,16 @@ namespace Edu.Module.Duty
...
@@ -38,6 +41,16 @@ namespace Edu.Module.Duty
/// </summary>
/// </summary>
private
readonly
RB_Class_PlanRepository
class_PlanRepository
=
new
RB_Class_PlanRepository
();
private
readonly
RB_Class_PlanRepository
class_PlanRepository
=
new
RB_Class_PlanRepository
();
/// <summary>
/// 学生
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private
readonly
RB_Student_LogRepository
student_LogRepository
=
new
RB_Student_LogRepository
();
/// <summary>
/// <summary>
/// 账号管理仓储层对象
/// 账号管理仓储层对象
/// </summary>
/// </summary>
...
@@ -126,6 +139,36 @@ namespace Edu.Module.Duty
...
@@ -126,6 +139,36 @@ namespace Edu.Module.Duty
var
newId
=
visitor_ReserveRepository
.
Insert
(
model
);
var
newId
=
visitor_ReserveRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
model
.
Id
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
if
(
flag
)
{
//获取学生信息
var
smodel
=
studentRepository
.
GetEntity
(
model
.
Visitor_Id
);
if
(
smodel
!=
null
&&
smodel
.
StuStage
<=
Common
.
Enum
.
User
.
StuStageEnum
.
PreliminaryCommunication
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_ViewModel
.
StuStage
),
Common
.
Enum
.
User
.
StuStageEnum
.
Audition
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Student_ViewModel
.
StuId
),
FiledValue
=
model
.
Visitor_Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
studentRepository
.
Update
(
keyValues
,
wheres
);
student_LogRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Log
()
{
LogId
=
0
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
CreateType
=
1
,
Group_Id
=
model
.
Group_Id
,
LogContent
=
"首次试听,客户阶段由'"
+
(
smodel
.
StuStage
.
ToName
())
+
"'自动转换为'"
+
(
Common
.
Enum
.
User
.
StuStageEnum
.
Audition
.
ToName
())
+
"'"
,
LogTitle
=
"客户阶段变更"
,
LogType
=
Common
.
Enum
.
Log
.
StudentLogTypeEnum
.
BasicInfo
,
StuId
=
model
.
Visitor_Id
});
}
}
}
}
return
flag
;
return
flag
;
}
}
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
50865acc
...
@@ -79,6 +79,10 @@ WHERE 1=1
...
@@ -79,6 +79,10 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Student_ViewModel
.
AreaId
),
query
.
AreaId
);
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
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StuIds
))
if
(!
string
.
IsNullOrEmpty
(
query
.
StuIds
))
{
{
builder
.
AppendFormat
(
" AND t.{0} in({1}) "
,
nameof
(
RB_Student_ViewModel
.
StuId
),
query
.
StuIds
);
builder
.
AppendFormat
(
" AND t.{0} in({1}) "
,
nameof
(
RB_Student_ViewModel
.
StuId
),
query
.
StuIds
);
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
50865acc
...
@@ -536,6 +536,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -536,6 +536,7 @@ namespace Edu.WebApi.Controllers.Course
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
),
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
),
StuIds
=
base
.
ParmJObj
.
GetStringValue
(
"StuIds"
),
StuIds
=
base
.
ParmJObj
.
GetStringValue
(
"StuIds"
),
OrderIdentify
=
base
.
ParmJObj
.
GetInt
(
"OrderIdentify"
),
OrderIdentify
=
base
.
ParmJObj
.
GetInt
(
"OrderIdentify"
),
CourseConsultantId
=
base
.
ParmJObj
.
GetInt
(
"CourseConsultantId"
),
};
};
var
IsInsertClass
=
base
.
ParmJObj
.
GetInt
(
"IsChaBan"
);
var
IsInsertClass
=
base
.
ParmJObj
.
GetInt
(
"IsChaBan"
);
if
(
IsInsertClass
==
1
)
if
(
IsInsertClass
==
1
)
...
@@ -694,6 +695,15 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -694,6 +695,15 @@ namespace Edu.WebApi.Controllers.Course
model
.
TargetJoinType
,
model
.
TargetJoinType
,
model
.
SourceOrderId
,
model
.
SourceOrderId
,
model
.
TargetOrderId
,
model
.
TargetOrderId
,
model
.
CustomerId
,
model
.
CourseConsultantId
,
model
.
OrderIdentify
,
model
.
B2CRatio
,
model
.
B2CReNewRatio
,
model
.
B2BRebateRatio
,
model
.
B2BReNewRatio
,
model
.
SchoolRebateRatio
,
model
.
SchoolReNewRatio
},
},
StepPriceList
=
list
.
Select
(
x
=>
new
StepPriceList
=
list
.
Select
(
x
=>
new
{
{
...
...
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