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
6652f1c2
Commit
6652f1c2
authored
Dec 07, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的订单列表
parent
7cdf2f51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1103 additions
and
26 deletions
+1103
-26
RB_Order_StepPrice.cs
Edu.Model/Entity/Course/RB_Order_StepPrice.cs
+45
-0
RB_User_ChangeLog.cs
Edu.Model/Entity/Log/RB_User_ChangeLog.cs
+4
-0
RB_Order_StepPrice_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_StepPrice_ViewModel.cs
+18
-0
RB_Order_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
+31
-0
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+431
-14
RB_Class_PlanRepository.cs
Edu.Repository/Course/RB_Class_PlanRepository.cs
+9
-5
RB_OrderRepository.cs
Edu.Repository/Course/RB_OrderRepository.cs
+34
-2
RB_Order_GuestRepository.cs
Edu.Repository/Course/RB_Order_GuestRepository.cs
+49
-0
RB_Order_RemarkRepository.cs
Edu.Repository/Course/RB_Order_RemarkRepository.cs
+2
-2
RB_Order_StepPriceRepository.cs
Edu.Repository/Course/RB_Order_StepPriceRepository.cs
+43
-0
RB_User_ChangeLogRepository.cs
Edu.Repository/Log/RB_User_ChangeLogRepository.cs
+38
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+399
-3
No files found.
Edu.Model/Entity/Course/RB_Order_StepPrice.cs
0 → 100644
View file @
6652f1c2
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 班级阶梯价实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Order_StepPrice
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 人数
/// </summary>
public
int
PersionNum
{
get
;
set
;
}
/// <summary>
/// 价格
/// </summary>
public
decimal
PersionPrice
{
get
;
set
;
}
/// <summary>
/// 订单编号
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
}
}
Edu.Model/Entity/Log/RB_User_ChangeLog.cs
View file @
6652f1c2
...
...
@@ -47,5 +47,9 @@ namespace Edu.Model.Entity.Log
/// </summary>
public
int
Type
{
get
=>
type
;
set
=>
type
=
value
;
}
/// <summary>
/// 来源id
/// </summary>
public
int
SourceId
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Order_StepPrice_ViewModel.cs
0 → 100644
View file @
6652f1c2
using
Edu.Model.Entity.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 订单阶梯价实体类
/// </summary>
public
class
RB_Order_StepPrice_ViewModel
:
RB_Order_StepPrice
{
/// <summary>
/// 订单编号【查询使用】
/// </summary>
public
string
Q_OrderIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Course/RB_Order_ViewModel.cs
View file @
6652f1c2
...
...
@@ -24,6 +24,16 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 客人名称
/// </summary>
public
string
GuestName
{
get
;
set
;
}
/// <summary>
/// 课程id
/// </summary>
public
int
CouseId
{
get
;
set
;
}
/// <summary>
/// 订单查询状态 1正常 2取消
/// </summary>
...
...
@@ -34,6 +44,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
int
Q_OrderBy
{
get
;
set
;
}
/// <summary>
/// 只看未收齐订单 1是
/// </summary>
public
int
Q_NotCollect
{
get
;
set
;
}
/// <summary>
/// 销售备注
/// </summary>
...
...
@@ -54,5 +69,21 @@ namespace Edu.Model.ViewModel.Course
/// 客人列表
/// </summary>
public
List
<
RB_Order_Guest_ViewModel
>
GuestList
{
get
;
set
;
}
/// <summary>
/// 报名开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 报名结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 开班开始时间
/// </summary>
public
string
OPStartTime
{
get
;
set
;
}
/// <summary>
/// 开班结束时间
/// </summary>
public
string
OPEndTime
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/OrderModule.cs
View file @
6652f1c2
This diff is collapsed.
Click to expand it.
Edu.Repository/Course/RB_Class_PlanRepository.cs
View file @
6652f1c2
...
...
@@ -69,16 +69,20 @@ WHERE 1=1
/// </summary>
/// <param name="classIds"></param>
/// <returns></returns>
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanForProduct
(
string
classIds
)
{
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanForProduct
(
string
classIds
)
{
string
sql
=
$@"SELECT p.ClassId,DAYOFWEEK(p.ClassDate) as WeekDay FROM rb_class_plan p
INNER JOIN rb_class c on p.ClassId = c.ClassId
WHERE c.ClassStyle =1 AND p.`Status`=0 and p.ClassId in(
{
classIds
}
) GROUP BY p.ClassId,DAYOFWEEK(p.ClassDate);
UNION ALL
WHERE c.ClassStyle =1 AND p.`Status`=0 and p.ClassId in(
{
classIds
}
) GROUP BY p.ClassId,DAYOFWEEK(p.ClassDate)
"
;
string
sql2
=
$@"
SELECT p.ClassId,DAYOFMONTH(p.ClassDate) as WeekDay FROM rb_class_plan p
INNER JOIN rb_class c on p.ClassId = c.ClassId
WHERE c.ClassStyle =2 AND p.`Status`=0 and p.ClassId in(
{
classIds
}
) GROUP BY p.ClassId,DAYOFMONTH(p.ClassDate)
;
"
;
WHERE c.ClassStyle =2 AND p.`Status`=0 and p.ClassId in(
{
classIds
}
) GROUP BY p.ClassId,DAYOFMONTH(p.ClassDate)"
;
return
Get
<
RB_Class_Plan_ViewModel
>(
sql
).
ToList
();
var
list1
=
Get
<
RB_Class_Plan_ViewModel
>(
sql
).
ToList
();
var
list2
=
Get
<
RB_Class_Plan_ViewModel
>(
sql2
).
ToList
();
list1
.
AddRange
(
list2
);
return
list1
;
}
}
}
Edu.Repository/Course/RB_OrderRepository.cs
View file @
6652f1c2
...
...
@@ -70,10 +70,10 @@ namespace Edu.Repository.Course
}
}
string
orderBy
=
""
;
string
orderBy
=
"
o.OrderId asc
"
;
if
(
demodel
.
Q_OrderBy
==
1
)
{
orderBy
=
" o.Id asc"
;
orderBy
=
" o.
Order
Id asc"
;
}
else
if
(
demodel
.
Q_OrderBy
==
2
)
{
...
...
@@ -147,6 +147,38 @@ where {where} order by {orderBy}
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
OrderState
)}
=3"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassName
))
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassName
)}
like '%
{
demodel
.
ClassName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
where
+=
$@" o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%
{
demodel
.
GuestName
}
%')"
;
}
if
(
demodel
.
CouseId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
CouseId
)}
=
{
demodel
.
CouseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
StartTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
CreateTime
)}
>='
{
demodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
EndTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
CreateTime
)}
<='
{
demodel
.
EndTime
}
23:59:59'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OPStartTime
))
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
OpenTime
)}
>='
{
demodel
.
OPStartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OPEndTime
))
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
OpenTime
)}
<='
{
demodel
.
OPEndTime
}
23:59:59'"
;
}
if
(
demodel
.
Q_NotCollect
==
1
)
{
where
+=
$@" and o.
{
nameof
(
RB_Order_ViewModel
.
PreferPrice
)}
> (o.
{
nameof
(
RB_Order_ViewModel
.
Income
)}
- o.
{
nameof
(
RB_Order_ViewModel
.
Refund
)}
+ o.
{
nameof
(
RB_Order_ViewModel
.
DiscountMoney
)}
) "
;
}
string
orderBy
=
""
;
if
(
demodel
.
Q_OrderBy
==
1
)
...
...
Edu.Repository/Course/RB_Order_GuestRepository.cs
View file @
6652f1c2
...
...
@@ -96,5 +96,54 @@ namespace Edu.Repository.Course
return
GetPage
<
RB_Order_Guest_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取客人数量
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
int
GetGuestNum
(
RB_Order_Guest_ViewModel
demodel
)
{
string
where
=
$@" 1=1 and Status=0"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
School_Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
School_Id
)}
=
{
demodel
.
School_Id
}
"
;
}
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(
demodel
.
ClassId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
ClassId
)}
=
{
demodel
.
ClassId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
OrderIds
))
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
OrderId
)}
in(
{
demodel
.
OrderIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestName
)}
like '%
{
demodel
.
GuestName
}
%'"
;
}
if
(
demodel
.
GuestState
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Guest_ViewModel
.
GuestState
)}
=
{
demodel
.
GuestState
}
"
;
}
string
sql
=
$@" select count(0) from RB_Order_Guest where
{
where
}
"
;
var
obj
=
ExecuteScalar
(
sql
);
if
(
obj
==
null
)
{
return
0
;
}
else
{
return
int
.
Parse
(
obj
.
ToString
());
}
}
}
}
Edu.Repository/Course/RB_Order_RemarkRepository.cs
View file @
6652f1c2
...
...
@@ -36,7 +36,7 @@ namespace Edu.Repository.Course
where
+=
$@" and
{
nameof
(
RB_Order_Remark
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
string
sql
=
$@" select * from RB_Order_Remark where
{
where
}
"
;
string
sql
=
$@" select * from RB_Order_Remark where
{
where
}
order by Id desc
"
;
return
Get
<
RB_Order_Remark_ViewModel
>(
sql
).
ToList
();
}
...
...
@@ -66,7 +66,7 @@ namespace Edu.Repository.Course
where
+=
$@" and
{
nameof
(
RB_Order_Remark
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
string
sql
=
$@" select * from RB_Order_Remark where
{
where
}
"
;
string
sql
=
$@" select * from RB_Order_Remark where
{
where
}
order by Id desc
"
;
return
GetPage
<
RB_Order_Remark_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
}
...
...
Edu.Repository/Course/RB_Order_StepPriceRepository.cs
0 → 100644
View file @
6652f1c2
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 订单阶梯价格仓储层
/// </summary>
public
class
RB_Order_StepPriceRepository
:
BaseRepository
<
RB_Order_StepPrice
>
{
/// <summary>
/// 获取订单阶梯价格列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Order_StepPrice_ViewModel
>
GetList
(
RB_Order_StepPrice_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM RB_Order_StepPrice
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
OrderId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Order_StepPrice_ViewModel
.
OrderId
),
query
.
OrderId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Q_OrderIds
))
{
builder
.
AppendFormat
(
" AND {0} IN ({1}) "
,
nameof
(
RB_Order_StepPrice_ViewModel
.
OrderId
),
query
.
Q_OrderIds
);
}
}
return
Get
<
RB_Order_StepPrice_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.Repository/Log/RB_User_ChangeLogRepository.cs
View file @
6652f1c2
...
...
@@ -41,5 +41,43 @@ WHERE 1=1
}
return
Get
<
RB_User_ChangeLog_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取日志分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_User_ChangeLog_ViewModel
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_User_ChangeLog_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"SELECT * FROM RB_User_ChangeLog WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
Group_Id
)}
=
{
query
.
Group_Id
}
"
);
}
if
(
query
.
School_Id
>
0
)
{
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
School_Id
)}
=
{
query
.
School_Id
}
"
);
}
if
(
query
.
CreateBy
>
0
)
{
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
CreateBy
)}
=
{
query
.
CreateBy
}
"
);
}
if
(
query
.
Type
>
0
)
{
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
Type
)}
=
{
query
.
Type
}
"
);
}
if
(
query
.
SourceId
>
0
)
{
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
SourceId
)}
=
{
query
.
SourceId
}
"
);
}
}
builder
.
AppendFormat
(
$" order by Id desc"
);
return
GetPage
<
RB_User_ChangeLog_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
builder
.
ToString
()).
ToList
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
6652f1c2
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