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
8c199dce
Commit
8c199dce
authored
Dec 23, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
f9adb90e
35e18500
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
60 deletions
+139
-60
RB_Personnel_Deduction.cs
Edu.Model/Entity/Bonus/RB_Personnel_Deduction.cs
+14
-4
EmployeeBonusModule.cs
Edu.Module.Course/EmployeeBonusModule.cs
+49
-6
StudentModule.cs
Edu.Module.User/StudentModule.cs
+43
-30
RB_OrderRepository.cs
Edu.Repository/Sell/RB_OrderRepository.cs
+25
-12
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+1
-1
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+7
-7
No files found.
Edu.Model/Entity/Bonus/RB_Personnel_Deduction.cs
View file @
8c199dce
...
...
@@ -23,13 +23,23 @@ namespace Edu.Model.Entity.Bonus
public
int
BonusId
{
get
;
set
;
}
/// <summary>
///
订单人数
///
抵扣金额
/// </summary>
public
int
OrderGuestNum
{
get
;
set
;
}
public
decimal
DeductionMoney
{
get
;
set
;
}
/// <summary>
///
订单金额
///
创建人
/// </summary>
public
decimal
OrderMoney
{
get
;
set
;
}
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 抵扣内容
/// </summary>
public
string
DeductionContent
{
get
;
set
;
}
}
}
Edu.Module.Course/EmployeeBonusModule.cs
View file @
8c199dce
...
...
@@ -121,17 +121,17 @@ namespace Edu.Module.Course
Dictionary
<
string
,
object
>
detailFileds
=
new
Dictionary
<
string
,
object
>();
detailFileds
.
Clear
();
var
tempCurMonthOrder
=
orderModel
;
if
(
dItem
.
Order
State
!=
(
tempCurMonthOrder
?.
OrderState
)
)
if
(
dItem
.
Order
Id
==
orderModel
.
OrderId
)
{
var
newMoney
=
tempCurMonthOrder
.
Income
-
tempCurMonthOrder
.
Refund
-
tempCurMonthOrder
.
PlatformTax
;
dItem
.
OrderGuestNum
=
0
;
dItem
.
OrderMoney
=
newMoney
;
detailFileds
.
Add
(
nameof
(
RB_Personnel_BonusDetail_Extend
.
OrderGuestNum
),
0
);
detailFileds
.
Add
(
nameof
(
RB_Personnel_BonusDetail_Extend
.
OrderMoney
),
newMoney
);
string
_log1
=
$"订单号【
{
dItem
.
OrderId
}
】的订单状态由:
{
dItem
.
OrderState
.
ToName
()}
=>
{
tempCurMonthOrder
?.
OrderState
.
ToName
()}
"
+
$"订单人数由:
{
dItem
.
OrderGuestNum
}
=>0,订单金额由:
{
dItem
.
OrderMoney
}
=>
{
newMoney
}
"
;
personnel_BonusLogRepository
.
AddPersonnelBonusLogRepository
(
sItem
.
Id
,
1
,
dItem
.
OrderId
,
_log1
);
dItem
.
OrderGuestNum
=
0
;
dItem
.
OrderMoney
=
newMoney
;
}
if
(
detailFileds
!=
null
&&
detailFileds
.
Count
>
0
)
{
...
...
@@ -143,7 +143,7 @@ namespace Edu.Module.Course
var
curRewardMoney
=
GetStepAwardAmount
(
planModel
,
sumNum
);
deductionMoney
=
sItem
.
CurRewardMoney
-
curRewardMoney
;
//修改已发放
string
_bonusLog
=
$"订单号变更:
由
:
{
sItem
.
CurGuestNum
}
=>
{
sumNum
}
,订单完成金额由:
{
sItem
.
CurOrderMoney
}
=>
{
sumOrderMoney
}
"
string
_bonusLog
=
$"订单号变更:
完成人数
:
{
sItem
.
CurGuestNum
}
=>
{
sumNum
}
,订单完成金额由:
{
sItem
.
CurOrderMoney
}
=>
{
sumOrderMoney
}
"
+
$"奖励金额由:
{
sItem
.
CurRewardMoney
}
=>
{
curRewardMoney
}
"
;
Dictionary
<
string
,
object
>
bonusFileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -180,6 +180,7 @@ namespace Edu.Module.Course
PlanType
=
item
.
PlanType
,
IsNoBalance
=
1
,
});
//计算差额
var
chaE
=
saleBonusList
?.
Sum
(
qitem
=>
qitem
.
DeductionMoney
-
qitem
.
FinishDeductionMoney
)
??
0
;
decimal
DeductionMoney
=
0
;
...
...
@@ -219,8 +220,50 @@ namespace Edu.Module.Course
}
//写抵扣记录表信息
if
(
pModel
.
BeforeMoney
>
0
)
{
{
decimal
tempChaE
=
chaE
;
foreach
(
var
sItem
in
saleBonusList
)
{
if
(
tempChaE
>
0
)
{
if
(
sItem
.
DeductionMoney
<=
tempChaE
)
{
var
deductionModel
=
new
RB_Personnel_Deduction
()
{
BonusId
=
sItem
.
Id
,
CreateBy
=
1
,
CreateTime
=
DateTime
.
Now
,
DeductionMoney
=
sItem
.
DeductionMoney
,
DeductionContent
=
"抵扣"
+
sItem
.
YearNum
+
"年"
+
sItem
.
MonthNum
+
"月的待抵扣金额"
+
sItem
.
DeductionMoney
,
};
personnel_DeductionRepository
.
Insert
(
deductionModel
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Personnel_Bonus_Extend
.
FinishDeductionMoney
),(
sItem
?.
FinishDeductionMoney
??
0
)+
sItem
.
DeductionMoney
}
};
personnel_BonusRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Personnel_Bonus_Extend
.
Id
),
sItem
.
Id
));
tempChaE
-=
sItem
.
DeductionMoney
;
}
else
{
var
deductionModel
=
new
RB_Personnel_Deduction
()
{
BonusId
=
sItem
.
Id
,
CreateBy
=
1
,
CreateTime
=
DateTime
.
Now
,
DeductionMoney
=
tempChaE
,
DeductionContent
=
"抵扣"
+
sItem
.
YearNum
+
"年"
+
sItem
.
MonthNum
+
"月的待抵扣金额"
+
tempChaE
,
};
personnel_DeductionRepository
.
Insert
(
deductionModel
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Personnel_Bonus_Extend
.
FinishDeductionMoney
),(
sItem
?.
FinishDeductionMoney
??
0
)+
tempChaE
}
};
personnel_BonusRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Personnel_Bonus_Extend
.
Id
),
sItem
.
Id
));
tempChaE
=
0
;
}
}
}
}
var
newId
=
personnel_BonusRepository
.
Insert
(
pModel
);
pModel
.
Id
=
newId
;
...
...
Edu.Module.User/StudentModule.cs
View file @
8c199dce
This diff is collapsed.
Click to expand it.
Edu.Repository/Sell/RB_OrderRepository.cs
View file @
8c199dce
...
...
@@ -52,7 +52,7 @@ namespace Edu.Repository.Sell
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
CourseId
)}
=
{
demodel
.
CourseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassIds
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassIds
))
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
ClassId
)}
in(
{
demodel
.
ClassIds
}
)"
;
}
...
...
@@ -99,7 +99,7 @@ namespace Edu.Repository.Sell
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
LXConfirmDate
)}
<='
{
demodel
.
ConfirmETime
}
23:59:59'"
;
}
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
JoinType
)}
=
{(
int
)
OrderJoinTypeEnum
.
InsertClass
}
"
;
}
...
...
@@ -148,7 +148,7 @@ ORDER BY {orderBy}
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
OrderType
)}
=
{(
int
)
OrderTypeEnum
.
CourseOrder
}
"
;
}
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
...
...
@@ -627,7 +627,7 @@ GROUP BY ClassId;";
/// <param name="courseModel"></param>
/// <param name="FinishHours"></param>
/// <returns></returns>
public
decimal
CalcBackMoneyRepository
(
RB_Order
orderModel
,
RB_Course
courseModel
,
decimal
FinishHours
,
out
decimal
newClassHourPrice
)
public
decimal
CalcBackMoneyRepository
(
RB_Order
orderModel
,
RB_Course
courseModel
,
decimal
FinishHours
,
out
decimal
newClassHourPrice
)
{
newClassHourPrice
=
0
;
//课时单价
...
...
@@ -641,7 +641,7 @@ GROUP BY ClassId;";
decimal
backMoney
=
0
;
//违约金
decimal
breakContractPrice
=
(
courseModel
.
ClassHours
-
FinishHours
)
*
classHourPrice
*
Convert
.
ToDecimal
(
0.1
);
backMoney
=
(
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
)
/
orderModel
.
GuestNum
-
FinishHours
*
classHourPrice
-
breakContractPrice
;
backMoney
=
(
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
)
/
orderModel
.
GuestNum
-
FinishHours
*
classHourPrice
-
breakContractPrice
;
return
backMoney
;
}
...
...
@@ -653,7 +653,7 @@ GROUP BY ClassId;";
/// <param name="eDate">开班时间</param>
/// <param name="courseIds">内部班课程</param>
/// <returns></returns>
public
List
<
RB_Order_ViewModel
>
GetAllMoneyCollectedOrderList
(
int
group_Id
,
string
eDate
,
string
courseIds
,
string
enableDate
)
public
List
<
RB_Order_ViewModel
>
GetAllMoneyCollectedOrderList
(
int
group_Id
,
string
eDate
,
string
courseIds
,
string
enableDate
)
{
string
where
=
""
;
if
(!
string
.
IsNullOrEmpty
(
courseIds
))
...
...
@@ -711,10 +711,12 @@ and LXConfirmState =1 and IFNULL(CommissionMoney,0) = -1 and LXConfirmDate <='{e
public
List
<
RB_Order_ViewModel
>
GetSaleAchievementsRankStatistics
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
int
saleId
,
int
schoolId
,
string
startMonth
,
string
endMonth
,
int
group_Id
)
{
string
where
=
""
;
if
(
saleId
>
0
)
{
if
(
saleId
>
0
)
{
where
+=
$@" and o.EnterID =
{
saleId
}
"
;
}
if
(
schoolId
>=
0
)
{
if
(
schoolId
>=
0
)
{
where
+=
$@" and o.School_Id =
{
schoolId
}
"
;
}
...
...
@@ -984,7 +986,7 @@ left join rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
where
{
where
}
order by
{
orderBy
}
"
;
return
Get
<
RB_Order_ViewModel
>(
sql
).
ToList
();
return
Get
<
RB_Order_ViewModel
>(
sql
).
ToList
();
}
#
endregion
...
...
@@ -1074,7 +1076,7 @@ where {where} order by {orderBy}
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
LXConfirmDate
)}
<='
{
demodel
.
ConfirmETime
}
23:59:59'"
;
}
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
if
(
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
JoinType
)}
=
{(
int
)
OrderJoinTypeEnum
.
InsertClass
}
"
;
}
...
...
@@ -1181,8 +1183,10 @@ group by o.OrderId
/// </summary>
/// <param name="group_Id">集团编号</param>
/// <param name="eDate">结束日期</param>
/// <param name="PlanType">1-市场人员,2-课程顾问</param>
/// <param name="SaleId">员工编号</param>
/// <returns></returns>
public
List
<
RB_Order_ViewModel
>
GetAllBonusOrderListRepository
(
int
group_Id
,
string
eDate
,
int
PlanType
,
int
SaleId
)
public
List
<
RB_Order_ViewModel
>
GetAllBonusOrderListRepository
(
int
group_Id
,
string
eDate
,
int
PlanType
,
int
SaleId
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
...
...
@@ -1206,7 +1210,16 @@ WHERE 1=1
}
if
(
SaleId
>
0
)
{
builder
.
AppendFormat
(
" AND ( EnterID={0} OR CreateBy={0} ) "
,
SaleId
);
//市场人员
if
(
PlanType
==
1
)
{
builder
.
AppendFormat
(
" AND (EnterID={0}) "
,
SaleId
);
}
//课程顾问
else
{
builder
.
AppendFormat
(
" AND (CourseConsultantId={0}) "
,
SaleId
);
}
}
builder
.
AppendFormat
(
" ORDER BY o.CreateTime ASC "
);
return
Get
<
RB_Order_ViewModel
>(
builder
.
ToString
()).
ToList
();
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
8c199dce
...
...
@@ -1288,7 +1288,7 @@ namespace Edu.WebApi.Controllers.Course
int
priceDiscountType
=
param
.
GetInt
(
"PriceDiscountType"
);
if
(
priceDiscountType
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择【优惠类型】"
);
//
return ApiResult.ParamIsNull(message: "请选择【优惠类型】");
}
RB_Course_Preferential_Extend
model
=
new
RB_Course_Preferential_Extend
()
{
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
8c199dce
...
...
@@ -919,7 +919,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员手机号已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
1
);
}
else
{
...
...
@@ -932,7 +932,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员手机号已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
1
);
}
else
{
...
...
@@ -954,7 +954,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员QQ已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
2
);
}
else
{
...
...
@@ -967,7 +967,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员QQ已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
2
);
}
else
{
...
...
@@ -989,7 +989,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员微信号已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
3
);
}
else
{
...
...
@@ -1002,7 +1002,7 @@ namespace Edu.WebApi.Controllers.User
if
(
isB2B
)
{
message
=
"此学员微信号已绑定同行!请重新录入!"
;
studentModule
.
PushMessageModule
(
model
);
studentModule
.
PushMessageModule
(
model
,
3
);
}
else
{
...
...
@@ -1252,7 +1252,7 @@ namespace Edu.WebApi.Controllers.User
if
(
customer
!=
null
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
"查重推送消息"
);
studentModule
.
PushMessageModule
(
extModel
);
studentModule
.
PushMessageModule
(
extModel
,
1
);
}
}
return
ApiResult
.
Success
(
data
:
extModel
);
...
...
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