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
e7c50011
Commit
e7c50011
authored
3 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
20d178bc
79ef765a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
261 additions
and
9 deletions
+261
-9
RB_Order.cs
Edu.Model/Entity/Sell/RB_Order.cs
+5
-0
RB_Order_ViewModel.cs
Edu.Model/ViewModel/Sell/RB_Order_ViewModel.cs
+10
-0
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+171
-7
OrderModule2.cs
Edu.Module.Course/OrderModule2.cs
+47
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+27
-2
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+1
-0
No files found.
Edu.Model/Entity/Sell/RB_Order.cs
View file @
e7c50011
...
...
@@ -425,5 +425,10 @@ namespace Edu.Model.Entity.Sell
/// 內推续费返佣比例
/// </summary>
public
decimal
InnerRecommendReNewRatio
{
get
;
set
;
}
/// <summary>
/// 订单标识 1产品下单 2客户转订单
/// </summary>
public
int
OrderIdentify
{
get
;
set
;
}
}
}
This diff is collapsed.
Click to expand it.
Edu.Model/ViewModel/Sell/RB_Order_ViewModel.cs
View file @
e7c50011
...
...
@@ -284,5 +284,15 @@ namespace Edu.Model.ViewModel.Sell
/// 课程图标
/// </summary>
public
string
B2BIcon
{
get
;
set
;
}
/// <summary>
/// 预计正常返佣
/// </summary>
public
decimal
NormalCommission
{
get
;
set
;
}
/// <summary>
/// 预计续费返佣
/// </summary>
public
decimal
RenewCommission
{
get
;
set
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Edu.Module.Course/OrderModule.cs
View file @
e7c50011
...
...
@@ -13,6 +13,7 @@ using Edu.Model.Entity.Course;
using
Edu.Model.Entity.Sell
;
using
Edu.Model.ViewModel.Contract
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Model.ViewModel.EduTask
;
using
Edu.Model.ViewModel.Grade
;
using
Edu.Model.ViewModel.Log
;
...
...
@@ -23,6 +24,7 @@ using Edu.Model.ViewModel.StudyAbroad;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Contract
;
using
Edu.Repository.Course
;
using
Edu.Repository.Customer
;
using
Edu.Repository.EduTask
;
using
Edu.Repository.Finance
;
using
Edu.Repository.Grade
;
...
...
@@ -114,6 +116,10 @@ namespace Edu.Module.Course
/// 学生
/// </summary>
private
readonly
RB_StudentRepository
studentRepository
=
new
RB_StudentRepository
();
/// <summary>
/// 同业返佣
/// </summary>
private
readonly
RB_Customer_BalanceDetailRepository
customer_BalanceDetailRepository
=
new
RB_Customer_BalanceDetailRepository
();
/// <summary>
/// 学生关联
...
...
@@ -381,6 +387,12 @@ namespace Edu.Module.Course
{
bool
flag
=
false
;
message
=
""
;
var
orderModel
=
new
RB_Order
();
if
(
demodel
.
OrderId
>
0
)
{
orderModel
=
orderRepository
.
GetEntity
(
demodel
.
OrderId
);
demodel
.
OrderIdentify
=
orderModel
.
OrderIdentify
;
}
//查询班级信息
var
classModel
=
classRepository
.
GetEntity
(
demodel
.
ClassId
);
if
(
classModel
==
null
)
...
...
@@ -410,11 +422,36 @@ namespace Edu.Module.Course
#
endregion
#
region
计算订单优惠信息
List
<
RB_Student_ViewModel
>
StuList
=
new
List
<
RB_Student_ViewModel
>();
List
<
RB_Customer_BalanceDetail_ViewModel
>
BalanceList
=
new
List
<
RB_Customer_BalanceDetail_ViewModel
>();
//返佣 幸福存折
//计算续费订单优惠
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
RenewOrder
&&
demodel
.
OrderId
==
0
)
{
demodel
.
DiscountMoney
=
coursePrice
*
(
courseModel
.
B2CReNewRatio
/
100
);
demodel
.
SaleRemark
=
"续费报名优惠"
+
courseModel
.
B2CReNewRatio
+
"%"
;
if
(
demodel
.
CustomerId
>
0
)
{
if
(
demodel
.
GuestNum
>
0
)
{
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
courseModel
.
B2BReNewRatio
+
"%"
;
decimal
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CReNewRatio
/
100
)
*
(
courseModel
.
B2BReNewRatio
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
Id
=
0
,
RebateType
=
2
,
CustomerId
=
demodel
.
CustomerId
,
BalanceType
=
1
,
Money
=
RenewCommission
,
Description
=
Description
,
PeopleNum
=
demodel
.
GuestNum
,
EmployeeId
=
demodel
.
EnterID
,
Group_Id
=
demodel
.
Group_Id
,
School_Id
=
demodel
.
School_Id
,
ClassId
=
demodel
.
ClassId
,
BalanceState
=
2
,
IsRemit
=
2
,
UpdateTime
=
DateTime
.
Now
,
});
}
}
}
else
if
((
demodel
.
JoinType
==
OrderJoinTypeEnum
.
Normal
||
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
&&
string
.
IsNullOrEmpty
(
demodel
.
StuIds
))
{
...
...
@@ -424,8 +461,34 @@ namespace Edu.Module.Course
message
=
"优惠金额不正确"
;
return
false
;
}
if
(
demodel
.
CustomerId
>
0
)
{
//生成待返佣记录表
if
(
demodel
.
GuestNum
>
0
)
{
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
courseModel
.
B2BRebateRatio
+
"%"
;
decimal
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CRatio
/
100
)
*
(
courseModel
.
B2BRebateRatio
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
Id
=
0
,
RebateType
=
1
,
CustomerId
=
demodel
.
CustomerId
,
BalanceType
=
1
,
Money
=
NormalCommission
,
Description
=
Description
,
PeopleNum
=
demodel
.
GuestNum
,
EmployeeId
=
demodel
.
EnterID
,
Group_Id
=
demodel
.
Group_Id
,
School_Id
=
demodel
.
School_Id
,
ClassId
=
demodel
.
ClassId
,
BalanceState
=
2
,
IsRemit
=
2
,
UpdateTime
=
DateTime
.
Now
,
});
}
}
}
else
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
))
else
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
&&
demodel
.
OrderIdentify
==
2
)
{
//查询学生列表
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
StuIds
=
demodel
.
StuIds
});
...
...
@@ -438,6 +501,10 @@ namespace Edu.Module.Course
message
=
"学生信息有误"
;
return
false
;
}
if
(
StuList
.
FirstOrDefault
().
CustomerId
!=
demodel
.
CustomerId
)
{
message
=
"同业信息有误"
;
return
false
;
}
var
glist
=
order_GuestRepository
.
GetGuestListForMobile
(
StuList
.
Select
(
x
=>
x
.
StuTel
).
ToList
(),
demodel
.
CustomerId
,
demodel
.
Group_Id
);
if
(
glist
.
Any
())
{
foreach
(
var
item
in
StuList
)
{
...
...
@@ -454,6 +521,59 @@ namespace Edu.Module.Course
message
=
"优惠金额不正确"
;
return
false
;
}
if
(
demodel
.
CustomerId
>
0
)
{
//生成待返佣记录表
decimal
RenewCommission
=
0
,
NormalCommission
=
0
;
if
(
RenewNum
>
0
)
{
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
courseModel
.
B2BReNewRatio
+
"%"
;
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CReNewRatio
/
100
)
*
(
courseModel
.
B2BReNewRatio
/
100
)
*
RenewNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
Id
=
0
,
RebateType
=
2
,
CustomerId
=
demodel
.
CustomerId
,
BalanceType
=
1
,
Money
=
RenewCommission
,
Description
=
Description
,
PeopleNum
=
RenewNum
,
EmployeeId
=
demodel
.
EnterID
,
Group_Id
=
demodel
.
Group_Id
,
School_Id
=
demodel
.
School_Id
,
ClassId
=
demodel
.
ClassId
,
BalanceState
=
2
,
IsRemit
=
2
,
UpdateTime
=
DateTime
.
Now
,
});
}
if
(
NormalNum
>
0
)
{
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
courseModel
.
B2BRebateRatio
+
"%"
;
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
(
courseModel
.
B2CRatio
/
100
)
*
(
courseModel
.
B2BRebateRatio
/
100
)
*
NormalNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
Id
=
0
,
RebateType
=
1
,
CustomerId
=
demodel
.
CustomerId
,
BalanceType
=
1
,
Money
=
NormalCommission
,
Description
=
Description
,
PeopleNum
=
NormalNum
,
EmployeeId
=
demodel
.
EnterID
,
Group_Id
=
demodel
.
Group_Id
,
School_Id
=
demodel
.
School_Id
,
ClassId
=
demodel
.
ClassId
,
BalanceState
=
2
,
IsRemit
=
2
,
UpdateTime
=
DateTime
.
Now
,
});
}
if
(
demodel
.
NormalCommission
!=
NormalCommission
||
demodel
.
RenewCommission
!=
RenewCommission
)
{
message
=
"返佣金额不正确"
;
return
false
;
}
}
}
//获取课程优惠
...
...
@@ -492,11 +612,6 @@ namespace Edu.Module.Course
demodel
.
EduOccupation
=
""
;
demodel
.
GeneralOccupation
=
""
;
}
var
orderModel
=
new
RB_Order
();
if
(
demodel
.
OrderId
>
0
)
{
orderModel
=
orderRepository
.
GetEntity
(
demodel
.
OrderId
);
}
if
(
demodel
.
OrderId
>
0
)
{
int
BNum
=
orderRepository
.
GetClassOrderPeopleNumRepository
(
demodel
.
ClassId
.
ToString
()).
FirstOrDefault
()?.
GuestNum
??
0
;
...
...
@@ -686,6 +801,46 @@ namespace Edu.Module.Course
LogContent
+=
$",销售备注由【
{
orderModel
.
SaleRemark
}
】修改为【
{
demodel
.
SaleRemark
}
】"
;
SaleRemark
=
demodel
.
SaleRemark
;
}
#
region
幸福存折
//重置返佣 幸福存折
if
(
orderModel
.
CustomerId
>
0
&&
BalanceList
.
Any
())
{
var
balanceList
=
customer_BalanceDetailRepository
.
GetCustomerBalanceDetailListRepository
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderId
=
demodel
.
OrderId
});
foreach
(
var
item
in
BalanceList
)
{
var
bmodel
=
balanceList
.
Where
(
x
=>
x
.
RebateType
==
item
.
RebateType
).
FirstOrDefault
();
if
(
bmodel
==
null
)
{
item
.
OrderId
=
demodel
.
OrderId
;
item
.
OrderSource
=
(
int
)
demodel
.
OrderSource
;
customer_BalanceDetailRepository
.
Insert
(
item
);
}
else
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_BalanceDetail_ViewModel
.
Money
),
item
.
Money
},
{
nameof
(
RB_Customer_BalanceDetail_ViewModel
.
Description
),
item
.
Description
},
{
nameof
(
RB_Customer_BalanceDetail_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
{
nameof
(
RB_Customer_BalanceDetail_ViewModel
.
PeopleNum
),
item
.
PeopleNum
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Customer_BalanceDetail_ViewModel
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
customer_BalanceDetailRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
var
delBList
=
balanceList
.
Where
(
x
=>
!
BalanceList
.
Select
(
y
=>
y
.
RebateType
).
Contains
(
x
.
RebateType
)).
ToList
();
foreach
(
var
item
in
delBList
)
{
customer_BalanceDetailRepository
.
Delete
(
item
);
}
}
#
endregion
}
else
{
...
...
@@ -840,7 +995,7 @@ namespace Edu.Module.Course
#
endregion
#
region
插入学生名单
(
客户选择转订单
)
if
(
flag
&&
!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
)
{
if
(
flag
&&
demodel
.
OrderIdentify
==
2
)
{
foreach
(
var
item
in
StuList
)
{
var
guestModel
=
new
RB_Order_Guest_ViewModel
()
{
...
...
@@ -884,6 +1039,15 @@ namespace Edu.Module.Course
};
SetOrderGuestInfo
(
guestModel
,
out
string
Nmessage
);
}
//返佣幸福存折
if
(
demodel
.
CustomerId
>
0
&&
BalanceList
.
Any
())
{
foreach
(
var
item
in
BalanceList
)
{
item
.
OrderId
=
OrderId
;
item
.
OrderSource
=
(
int
)
demodel
.
OrderSource
;
customer_BalanceDetailRepository
.
Insert
(
item
);
}
}
}
#
endregion
...
...
This diff is collapsed.
Click to expand it.
Edu.Module.Course/OrderModule2.cs
View file @
e7c50011
...
...
@@ -18,6 +18,7 @@ using Edu.Model.Entity.Contract;
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Contract
;
using
Edu.Common.Enum.Course
;
using
Edu.Model.ViewModel.User
;
namespace
Edu.Module.Course
{
...
...
@@ -298,5 +299,51 @@ namespace Edu.Module.Course
}
return
flag
;
}
/// <summary>
/// 获取客户转订单时客户的续费状态
/// </summary>
/// <param name="stuIds"></param>
/// <param name="userInfo"></param>
/// <param name="msg"></param>
/// <returns></returns>
public
object
GetOrderGuestRenewState
(
string
stuIds
,
UserInfo
userInfo
,
out
string
message
)
{
message
=
""
;
//查询学生列表
var
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StuIds
=
stuIds
});
//根据客人手机号码 验证是否是续费
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
message
=
"只能选择同一同行的客户报名"
;
return
false
;
}
int
CustomerId
=
StuList
.
FirstOrDefault
().
CustomerId
;
var
glist
=
order_GuestRepository
.
GetGuestListForMobile
(
StuList
.
Select
(
x
=>
x
.
StuTel
).
ToList
(),
CustomerId
,
userInfo
.
Group_Id
);
if
(
glist
.
Any
())
{
foreach
(
var
item
in
StuList
)
{
if
(
glist
.
Where
(
x
=>
x
.
Mobile
==
item
.
StuTel
).
Any
())
{
item
.
IsRenewGuest
=
1
;
//是续费的
}
}
}
int
RenewNum
=
glist
.
Select
(
x
=>
x
.
Mobile
).
Distinct
().
Count
();
//续费订单数量
return
new
{
CustomerId
,
RenewNum
,
StuList
=
StuList
.
Select
(
x
=>
new
{
x
.
StuId
,
x
.
StuName
,
x
.
StuTel
,
x
.
IsRenewGuest
})
};
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
e7c50011
...
...
@@ -464,6 +464,27 @@ namespace Edu.WebApi.Controllers.Course
}));
}
/// <summary>
/// 获取客户转订单续费状态
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOrderGuestRenewState
()
{
var
userInfo
=
base
.
UserInfo
;
string
StuIds
=
base
.
ParmJObj
.
GetStringValue
(
"StuIds"
);
if
(
string
.
IsNullOrEmpty
(
StuIds
))
{
return
ApiResult
.
ParamIsNull
(
"请传递学生名单"
);
}
var
Robj
=
orderModule
.
GetOrderGuestRenewState
(
StuIds
,
userInfo
,
out
string
msg
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
(
""
,
Robj
);
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 新增修改订单
...
...
@@ -503,7 +524,8 @@ namespace Edu.WebApi.Controllers.Course
LessPrice
=
base
.
ParmJObj
.
GetDecimal
(
"LessPrice"
),
PerLessMoney
=
base
.
ParmJObj
.
GetDecimal
(
"PerLessMoney"
),
CustomerId
=
base
.
ParmJObj
.
GetInt
(
"CustomerId"
),
StuIds
=
base
.
ParmJObj
.
GetStringValue
(
"StuIds"
)
StuIds
=
base
.
ParmJObj
.
GetStringValue
(
"StuIds"
),
OrderIdentify
=
base
.
ParmJObj
.
GetInt
(
"OrderIdentify"
),
};
var
IsInsertClass
=
base
.
ParmJObj
.
GetInt
(
"IsChaBan"
);
if
(
IsInsertClass
==
1
)
...
...
@@ -526,7 +548,10 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
ParamIsNull
(
"请选择客人来源"
);
}
if
(
demodel
.
OrderIdentify
==
2
&&
string
.
IsNullOrEmpty
(
demodel
.
StuIds
))
{
return
ApiResult
.
ParamIsNull
(
"请传递选择客户"
);
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
))
{
int
gNum
=
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
"["
+
demodel
.
StuIds
+
"]"
).
Count
();
if
(
demodel
.
GuestNum
!=
gNum
)
{
...
...
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/User/UserController.cs
View file @
e7c50011
...
...
@@ -696,6 +696,7 @@ namespace Edu.WebApi.Controllers.User
item
.
StuChannel
,
StuChannelName
=
item
.
StuChannel
.
ToName
(),
item
.
PlatformName
,
item
.
CustomerId
,
AssistList
=
item
.
AssistList
.
Select
(
qitem
=>
new
{
qitem
.
Id
,
...
...
This diff is collapsed.
Click to expand it.
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