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
68314148
Commit
68314148
authored
Mar 15, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
6e3d7884
6f42368a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
1 deletion
+117
-1
RB_Order.cs
Edu.Model/Entity/Course/RB_Order.cs
+5
-0
RB_Course_OfferDetails_ViewModel.cs
...odel/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
+4
-0
CourseOfferModule.cs
Edu.Module.Course/CourseOfferModule.cs
+104
-0
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+1
-1
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+3
-0
No files found.
Edu.Model/Entity/Course/RB_Order.cs
View file @
68314148
...
...
@@ -148,5 +148,10 @@ namespace Edu.Model.Entity.Course
/// 续费订单号
/// </summary>
public
int
RenewOrderId
{
get
;
set
;
}
/// <summary>
/// 报价单id
/// </summary>
public
int
OfferId
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
View file @
68314148
...
...
@@ -26,6 +26,10 @@ namespace Edu.Model.ViewModel.Course
public
string
QOfferIds
{
get
;
set
;
}
/// <summary>
/// 班级id
/// </summary>
public
int
ClassId
{
get
;
set
;
}
/// 课程源数据
/// </summary>
public
object
SourceData
{
get
;
set
;
}
...
...
Edu.Module.Course/CourseOfferModule.cs
View file @
68314148
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Log
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
VT.FW.DB
;
...
...
@@ -23,6 +27,22 @@ namespace Edu.Module.Course
private
readonly
RB_Course_OfferDetailsRepository
course_OfferDetailsRepository
=
new
RB_Course_OfferDetailsRepository
();
/// <summary>
/// 订单
/// </summary>
private
readonly
RB_OrderRepository
orderRepository
=
new
RB_OrderRepository
();
/// <summary>
/// 订单备注
/// </summary>
private
readonly
RB_Order_RemarkRepository
order_RemarkRepository
=
new
RB_Order_RemarkRepository
();
/// <summary>
/// 用户日志
/// </summary>
private
readonly
RB_User_ChangeLogRepository
changeLogRepository
=
new
RB_User_ChangeLogRepository
();
/// <summary>
/// 账号
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// 课程处理类对象
/// </summary>
private
readonly
CourseModule
courseModule
=
new
CourseModule
();
...
...
@@ -225,5 +245,89 @@ namespace Edu.Module.Course
var
flag
=
course_OfferRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Offer_ViewModel
.
Id
),
Id
));
return
flag
;
}
#
region
报价单创建订单
/// <summary>
/// 创建订单
/// </summary>
/// <param name="offerId"></param>
/// <param name="detailList"></param>
/// <param name="createBy"></param>
/// <returns></returns>
public
bool
SetOfferCreateOrder
(
int
offerId
,
List
<
RB_Course_OfferDetails_ViewModel
>
detailList
,
int
createBy
)
{
var
emModel
=
accountRepository
.
GetEmployeeInfo
(
createBy
);
foreach
(
var
item
in
detailList
)
{
try
{
decimal
uPrice
=
item
.
OriginalPrice
/
item
.
JoinNum
;
int
OrderId
=
orderRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order
()
{
ClassId
=
item
.
ClassId
,
Class_Price
=
uPrice
,
CommissionMoney
=
-
1
,
CreateBy
=
createBy
,
CreateTime
=
DateTime
.
Now
,
Dept_Id
=
emModel
?.
Dept_Id
??
0
,
School_Id
=
emModel
?.
School_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
DirectorRemark
=
""
,
DiscountMoney
=
item
.
DiscountPrice
,
EnterID
=
createBy
,
ExtraDeductMoney
=
0
,
ExtraRewardMoney
=
0
,
GuestNum
=
item
.
JoinNum
,
Income
=
0
,
IsCommissionGive
=
0
,
OrderForm
=
Common
.
Enum
.
Course
.
OrderFormEnum
.
Computer
,
OrderId
=
0
,
OrderSource
=
Common
.
Enum
.
Course
.
OrderSourceEnum
.
Employee
,
OrderState
=
Common
.
Enum
.
Course
.
OrderStateEnum
.
Normal
,
PlatformTax
=
0
,
PreferPrice
=
item
.
OriginalPrice
,
RectorRemark
=
""
,
Refund
=
0
,
RenewOrderId
=
0
,
SaleRemark
=
item
.
Remark
,
TeacherRemark
=
""
,
TradeWay
=
Common
.
Enum
.
Course
.
TradeWayEnum
.
OnLine
,
Unit_Price
=
uPrice
,
UpdateBy
=
createBy
,
UpdateTime
=
DateTime
.
Now
,
OfferId
=
offerId
});
if
(
OrderId
>
0
)
{
order_RemarkRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order_Remark
()
{
Id
=
0
,
OrderId
=
OrderId
,
Type
=
1
,
Content
=
item
.
Remark
,
CreateBy
=
createBy
,
CreateTime
=
DateTime
.
Now
});
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
AccountType
=
emModel
?.
AccountType
??
0
,
Type
=
2
,
SourceId
=
OrderId
,
LogContent
=
"由报价单自动创建订单"
,
School_Id
=
emModel
?.
School_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
CreateBy
=
createBy
,
CreateTime
=
DateTime
.
Now
});
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"报价单创建订单失败,offerId:"
+
offerId
+
",DetailsId:"
+
item
.
DetailsId
+
",ClassId:"
+
item
.
ClassId
);
}
}
return
true
;
}
#
endregion
}
}
Edu.Repository/User/RB_AccountRepository.cs
View file @
68314148
...
...
@@ -488,7 +488,7 @@ WHERE 1=1 {4}
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon
SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon
,A.AccountType
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName
FROM
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
68314148
...
...
@@ -158,6 +158,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
TeacherRemark
,
x
.
RectorRemark
,
x
.
DirectorRemark
,
x
.
OfferId
,
SaleRemarkList
=
x
.
SaleRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
...
...
@@ -219,6 +220,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
TeacherRemark
,
x
.
RectorRemark
,
x
.
DirectorRemark
,
x
.
OfferId
,
SaleRemarkList
=
x
.
SaleRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
...
...
@@ -900,6 +902,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
TeacherRemark
,
x
.
RectorRemark
,
x
.
DirectorRemark
,
x
.
OfferId
,
SaleRemarkList
=
x
.
SaleRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
...
...
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