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
46997536
Commit
46997536
authored
Jun 30, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
cd8530e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
18 deletions
+51
-18
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+51
-18
No files found.
Edu.Module.Course/OrderModule.cs
View file @
46997536
...
...
@@ -238,7 +238,7 @@ namespace Edu.Module.Course
var
planList
=
class_PlanRepository
.
GetClassPlanListExtRepository
(
new
RB_Class_Plan_ViewModel
()
{
ClassId
=
classId
,
EndTime
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
)
});
var
totalMinutes
=
planList
?.
Sum
(
qitem
=>
qitem
.
ClassMinutes
)
??
0
;
//查询基础课时时长
var
BasicMinutes
=
class_ConfigRepository
.
GetBasicMinutesRepository
(
Group_Id
);
var
BasicMinutes
=
class_ConfigRepository
.
GetBasicMinutesRepository
(
Group_Id
);
var
finishHours
=
totalMinutes
/
BasicMinutes
;
fileds
.
Add
(
"finishHours"
,
finishHours
);
var
classModel
=
classRepository
.
GetEntity
(
classId
);
...
...
@@ -358,7 +358,7 @@ namespace Edu.Module.Course
{
disMoney
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
}
var
b2bCommissionType
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
var
b2bCommissionType
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
if
(
b2bCommissionType
==
0
)
{
var
tempMoney
=
(
courseModel
?.
SellPrice
??
0
)
*
(
coursePreferentialModel
?.
B2BCommissionMoney
??
0
);
...
...
@@ -369,17 +369,18 @@ namespace Edu.Module.Course
disMoney
=
coursePreferentialModel
?.
B2BCommissionMoney
??
0
;
}
var
priceCommissionType
=
coursePreferentialModel
?.
PriceType
??
0
;
var
priceCommissionType
=
coursePreferentialModel
?.
PriceType
??
0
;
if
(
priceCommissionType
==
0
)
{
coursePrice
=
coursePrice
*
(
100
-
(
coursePreferentialModel
?.
PriceMoney
??
0
))
/
100
;
coursePrice
=
coursePrice
*
(
100
-
(
coursePreferentialModel
?.
PriceMoney
??
0
))
/
100
;
}
else
{
coursePrice
-=
(
coursePreferentialModel
?.
PriceMoney
??
0
);
}
#
region
记录提成信息
if
(
coursePreferentialModel
==
null
)
{
if
(
coursePreferentialModel
==
null
)
{
coursePreferentialModel
=
coursePreferentialList
.
FirstOrDefault
();
}
demodel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
...
...
@@ -465,7 +466,7 @@ namespace Edu.Module.Course
}
if
(
demodel
.
IsChaBan
==
1
)
{
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
.
LessPrice
))
{
flag
=
false
;
...
...
@@ -507,12 +508,12 @@ namespace Edu.Module.Course
demodel
.
EffectStatus
=
orderModel
.
EffectStatus
;
}
}
else
else
{
demodel
.
EffectStatus
=
2
;
demodel
.
EffectTime
=
DateTime
.
Now
;
}
if
(
orderModel
==
null
)
{
flag
=
false
;
...
...
@@ -736,9 +737,11 @@ namespace Edu.Module.Course
/// 更新订单提成比例
/// </summary>
/// <returns></returns>
public
bool
UpdateClassOrderCommissionRate
()
{
public
bool
UpdateClassOrderCommissionRate
()
{
var
orderList
=
orderRepository
.
GetOrderListRepository
(
new
RB_Order_ViewModel
()
{
Group_Id
=
100000
,
OrderType
=
OrderTypeEnum
.
CourseOrder
,
Q_OrderState
=
1
});
foreach
(
var
item
in
orderList
)
{
foreach
(
var
item
in
orderList
)
{
//根据班级查询课程
var
classModel
=
classRepository
.
GetEntity
(
item
.
ClassId
);
...
...
@@ -767,7 +770,8 @@ namespace Edu.Module.Course
coursePreferentialModel
=
coursePreferentialList
?.
Where
(
qitem
=>
qitem
.
PriceDiscountType
==
CoursePriceDiscountEnum
.
DoubleJoin
)?.
FirstOrDefault
();
}
}
if
(
coursePreferentialModel
==
null
)
{
if
(
coursePreferentialModel
==
null
)
{
//随便取一个了
coursePreferentialModel
=
coursePreferentialList
.
FirstOrDefault
();
}
...
...
@@ -968,7 +972,7 @@ namespace Edu.Module.Course
{
if
(
model
.
OrderType
==
Common
.
Enum
.
Sale
.
OrderTypeEnum
.
CourseOrder
)
{
var
classModel
=
classRepository
.
GetEntity
(
model
.
ClassId
);
var
classModel
=
classRepository
.
GetEntity
(
model
.
ClassId
);
if
(
classModel
!=
null
)
{
model
.
ClassName
=
classModel
?.
ClassName
??
""
;
...
...
@@ -1162,7 +1166,7 @@ namespace Edu.Module.Course
{
string
orderIds
=
string
.
Join
(
","
,
orderList
.
Select
(
x
=>
x
.
OrderId
));
//获取备注列表
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
//获取名单列表
var
guestList
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderIds
=
orderIds
});
//获取合同列表
...
...
@@ -1590,7 +1594,8 @@ namespace Edu.Module.Course
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_ViewModel
.
PreferPrice
),
preferPrice
}
};
if
(
orderModel
.
PreferPrice
!=
preferPrice
){
if
(
orderModel
.
PreferPrice
!=
preferPrice
)
{
keyValues
.
Add
(
nameof
(
RB_Order_ViewModel
.
IsCommissionGiveOK
),
0
);
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
@@ -2014,7 +2019,7 @@ namespace Edu.Module.Course
{
string
orderIds
=
string
.
Join
(
","
,
orderList
.
Select
(
x
=>
x
.
OrderId
));
//获取备注列表
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
//获取名单列表
var
guestList
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderIds
=
orderIds
});
//获取合同列表
...
...
@@ -2080,7 +2085,7 @@ namespace Edu.Module.Course
{
string
orderIds
=
string
.
Join
(
","
,
orderList
.
Select
(
x
=>
x
.
OrderId
));
//获取备注列表
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
var
remarkList
=
order_RemarkRepository
.
GetOrderRemarkListRepository
(
new
RB_Order_Remark_ViewModel
()
{
QOrderIds
=
orderIds
});
//获取名单列表
var
guestList
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderIds
=
orderIds
});
//获取合同列表
...
...
@@ -2348,13 +2353,13 @@ namespace Edu.Module.Course
if
(
list
.
Any
())
{
var
model
=
list
.
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
AdjustPrice
),
dmodel
.
AdjustPrice
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
{
nameof
(
RB_Education_ContractAdjust_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
...
...
@@ -2381,5 +2386,33 @@ namespace Edu.Module.Course
}
}
#
endregion
#
region
个人中心
/// <summary>
/// 获取我的未完成的订单
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Order_ViewModel
>
GetOrderNoComplete
(
RB_Order_ViewModel
demodel
)
{
return
orderRepository
.
GetOrderNoComplete
(
demodel
);
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public
List
<
RB_Order_Guest_ViewModel
>
GetOrderGuestListByEnterID
(
RB_Order_Guest_ViewModel
demodel
)
{
return
order_GuestRepository
.
GetOrderGuestListByEnterID
(
demodel
);
}
#
endregion
}
}
\ No newline at end of file
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