Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
8dc79790
Commit
8dc79790
authored
Feb 02, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
2faac006
dd4d4b62
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
355 additions
and
34 deletions
+355
-34
RB_Point_TeacherCourseOrder.cs
Mall.Model/Entity/Point/RB_Point_TeacherCourseOrder.cs
+1
-1
RB_Point_TeacherCourseOrder_Extend.cs
....Model/Extend/Point/RB_Point_TeacherCourseOrder_Extend.cs
+5
-0
PointModule.cs
Mall.Module.Education/PointModule.cs
+106
-0
RB_Point_TeacherCourseOrderRepository.cs
...Repository/Point/RB_Point_TeacherCourseOrderRepository.cs
+27
-5
AppletPointController.cs
Mall.WebApi/Controllers/Education/AppletPointController.cs
+150
-3
PointController.cs
Mall.WebApi/Controllers/Education/PointController.cs
+66
-25
No files found.
Mall.Model/Entity/Point/RB_Point_TeacherCourseOrder.cs
View file @
8dc79790
...
@@ -68,7 +68,7 @@ namespace Mall.Model.Entity.Point
...
@@ -68,7 +68,7 @@ namespace Mall.Model.Entity.Point
/// <summary>
/// <summary>
/// 是否推送
放假
信息0-否,1-是
/// 是否推送
房间
信息0-否,1-是
/// </summary>
/// </summary>
public
int
IsSendRoom
{
get
;
set
;
}
public
int
IsSendRoom
{
get
;
set
;
}
...
...
Mall.Model/Extend/Point/RB_Point_TeacherCourseOrder_Extend.cs
View file @
8dc79790
...
@@ -45,5 +45,10 @@ namespace Mall.Model.Extend.Point
...
@@ -45,5 +45,10 @@ namespace Mall.Model.Extend.Point
/// 结束时间
/// 结束时间
/// </summary>
/// </summary>
public
string
EndTime
{
get
;
set
;
}
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 用户openid
/// </summary>
public
string
OpenId
{
get
;
set
;
}
}
}
}
}
Mall.Module.Education/PointModule.cs
View file @
8dc79790
...
@@ -34,6 +34,14 @@ namespace Mall.Module.Education
...
@@ -34,6 +34,14 @@ namespace Mall.Module.Education
private
readonly
RB_Education_TeacherRepository
education_TeacherRepository
=
new
RB_Education_TeacherRepository
();
private
readonly
RB_Education_TeacherRepository
education_TeacherRepository
=
new
RB_Education_TeacherRepository
();
#
region
用户基本信息
public
Model
.
Entity
.
User
.
RB_Member_User
GetUserEntity
(
int
UserId
)
{
return
member_UserRepository
.
GetEntity
(
UserId
);
}
#
endregion
#
region
点数商品
#
region
点数商品
/// <summary>
/// <summary>
/// 获取列表
/// 获取列表
...
@@ -282,6 +290,7 @@ namespace Mall.Module.Education
...
@@ -282,6 +290,7 @@ namespace Mall.Module.Education
};
};
member_UserRepository
.
Update
(
filedsUser
,
userWhereHelpers
,
trans
);
member_UserRepository
.
Update
(
filedsUser
,
userWhereHelpers
,
trans
);
}
}
pointOrderRepository
.
DBSession
.
Commit
();
return
flag
;
return
flag
;
}
}
else
else
...
@@ -704,10 +713,38 @@ namespace Mall.Module.Education
...
@@ -704,10 +713,38 @@ namespace Mall.Module.Education
if
(
model
.
ID
==
0
)
if
(
model
.
ID
==
0
)
{
{
orderId
=
pointTeacherCourseOrderRepository
.
Insert
(
model
,
trans
);
orderId
=
pointTeacherCourseOrderRepository
.
Insert
(
model
,
trans
);
flag
=
orderId
>
0
;
}
}
else
else
{
{
orderId
=
model
.
ID
;
orderId
=
model
.
ID
;
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>
{
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
OrderStaus
),
(
int
)
model
.
OrderStaus
},
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
UpdateDate
),
model
.
UpdateDate
}
};
IList
<
WhereHelper
>
auditrecordWhereHelpers
=
new
List
<
WhereHelper
>
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
ID
),
FiledValue
=
model
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
TenantId
),
FiledValue
=
model
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
MallBaseId
),
FiledValue
=
model
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
pointTeacherCourseOrderRepository
.
Update
(
fileds
,
auditrecordWhereHelpers
,
trans
);
}
}
if
(
model
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
&&
model
.
TotalPointNum
>
0
)
if
(
model
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
&&
model
.
TotalPointNum
>
0
)
{
{
...
@@ -752,14 +789,83 @@ namespace Mall.Module.Education
...
@@ -752,14 +789,83 @@ namespace Mall.Module.Education
}
}
};
};
member_UserRepository
.
Update
(
filedsUser
,
userWhereHelpers
,
trans
);
member_UserRepository
.
Update
(
filedsUser
,
userWhereHelpers
,
trans
);
}
pointTeacherCourseOrderRepository
.
DBSession
.
Commit
();
return
flag
;
}
/// <summary>
/// 确认订单
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
ConfirmTeacherCourseOrder
(
List
<
RB_Point_TeacherCourseOrder_Extend
>
list
)
{
bool
flag
=
false
;
var
trans
=
pointTeacherCourseOrderRepository
.
DbTransaction
;
foreach
(
var
model
in
list
)
{
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>
{
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
OrderStaus
),
(
int
)
model
.
OrderStaus
},
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
IsSendRoom
),
1
},
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
UpdateDate
),
model
.
UpdateDate
},
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
RoomInfo
),
model
.
RoomInfo
}
};
IList
<
WhereHelper
>
auditrecordWhereHelpers
=
new
List
<
WhereHelper
>
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
ID
),
FiledValue
=
model
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
TenantId
),
FiledValue
=
model
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
MallBaseId
),
FiledValue
=
model
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
pointTeacherCourseOrderRepository
.
Update
(
fileds
,
auditrecordWhereHelpers
,
trans
);
}
if
(
flag
)
//推送房间信息
{
}
}
return
flag
;
return
flag
;
}
}
#
endregion
#
region
公用
public
bool
GetTimeSpan
(
DateTime
timeStr
,
string
StartTime
,
string
EndTime
)
{
//判断当前时间是否在工作时间段内
TimeSpan
dspWorkingDayAM
=
DateTime
.
Parse
(
StartTime
).
TimeOfDay
;
TimeSpan
dspWorkingDayPM
=
DateTime
.
Parse
(
EndTime
).
TimeOfDay
;
TimeSpan
dspNow
=
timeStr
.
TimeOfDay
;
if
(
dspNow
>
dspWorkingDayAM
&&
dspNow
<
dspWorkingDayPM
)
{
return
true
;
}
return
false
;
}
#
endregion
#
endregion
}
}
}
}
Mall.Repository/Point/RB_Point_TeacherCourseOrderRepository.cs
View file @
8dc79790
...
@@ -22,20 +22,34 @@ namespace Mall.Repository.Point
...
@@ -22,20 +22,34 @@ namespace Mall.Repository.Point
public
List
<
RB_Point_TeacherCourseOrder_Extend
>
GetPointOrderList
(
RB_Point_TeacherCourseOrder_Extend
where
)
public
List
<
RB_Point_TeacherCourseOrder_Extend
>
GetPointOrderList
(
RB_Point_TeacherCourseOrder_Extend
where
)
{
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT * from RB_Point_TeacherCourseOrder where state=0"
);
sb
.
Append
(
$@"SELECT a.*, b.`Name` as UserName, t.CourseName, c.CourseClassType, d.Name as TeacherName, d.TeacherLogo, b.OpenId
from RB_Point_TeacherCourseOrder as a
Left join rb_point_teachercourse t on a.CourseId = t.ID
Left Join rb_point_courseclass c on a.CourseClassId = c.ID
Left JOin rb_education_teacher d on a.TeacherId = d.ID
LEFT JOIN rb_member_user as b on a.UserId = b.Id
where a.state = 0"
);
if
(
where
!=
null
)
if
(
where
!=
null
)
{
{
if
(
where
.
TenantId
>
0
)
if
(
where
.
TenantId
>
0
)
{
{
sb
.
AppendFormat
(
" and TenantId={0}"
,
where
.
TenantId
);
sb
.
AppendFormat
(
" and a.TenantId={0}"
,
where
.
TenantId
);
}
if
(
where
.
MallBaseId
>
0
)
{
sb
.
AppendFormat
(
" and a.MallBaseId={0}"
,
where
.
MallBaseId
);
}
if
(
where
.
CourseId
>
0
)
{
sb
.
AppendFormat
(
" and a.CourseId={0}"
,
where
.
CourseId
);
}
}
if
(
where
.
MallBaseId
>
0
)
if
(
where
.
MallBaseId
>
0
)
{
{
sb
.
AppendFormat
(
" and MallBaseId={0}"
,
where
.
MallBaseId
);
sb
.
AppendFormat
(
" and
a.
MallBaseId={0}"
,
where
.
MallBaseId
);
}
}
if
(
where
.
ID
>
0
)
if
(
where
.
ID
>
0
)
{
{
sb
.
AppendFormat
(
" and ID={0}"
,
where
.
ID
);
sb
.
AppendFormat
(
" and
a.
ID={0}"
,
where
.
ID
);
}
}
}
}
return
Get
<
RB_Point_TeacherCourseOrder_Extend
>(
sb
.
ToString
()).
ToList
();
return
Get
<
RB_Point_TeacherCourseOrder_Extend
>(
sb
.
ToString
()).
ToList
();
...
@@ -107,7 +121,7 @@ where a.state=0 and a.OrderStaus in(2,3,4)");
...
@@ -107,7 +121,7 @@ where a.state=0 and a.OrderStaus in(2,3,4)");
public
List
<
RB_Point_TeacherCourseOrder_Extend
>
GetPointOrderPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Point_TeacherCourseOrder_Extend
where
)
public
List
<
RB_Point_TeacherCourseOrder_Extend
>
GetPointOrderPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Point_TeacherCourseOrder_Extend
where
)
{
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT a.*,b.`Name` as UserName , t.CourseName,c.CourseClassType, d.Name as TeacherName ,d.TeacherLogo
sb
.
Append
(
$@"SELECT a.*,b.`Name` as UserName , t.CourseName,c.CourseClassType, d.Name as TeacherName ,d.TeacherLogo
,b.OpenId
from RB_Point_TeacherCourseOrder as a
from RB_Point_TeacherCourseOrder as a
Left join rb_point_teachercourse t on a.CourseId = t.ID
Left join rb_point_teachercourse t on a.CourseId = t.ID
Left Join rb_point_courseclass c on a.CourseClassId = c.ID
Left Join rb_point_courseclass c on a.CourseClassId = c.ID
...
@@ -128,6 +142,14 @@ where a.state=0 ");
...
@@ -128,6 +142,14 @@ where a.state=0 ");
{
{
sb
.
AppendFormat
(
" and a.ID={0}"
,
where
.
ID
);
sb
.
AppendFormat
(
" and a.ID={0}"
,
where
.
ID
);
}
}
if
(
where
.
CourseId
>
0
)
{
sb
.
AppendFormat
(
" and a.CourseId={0}"
,
where
.
CourseId
);
}
if
(
where
.
TeacherId
>
0
)
{
sb
.
AppendFormat
(
" and a.TeacherId={0}"
,
where
.
TeacherId
);
}
if
(
where
.
OrderStaus
>
0
)
if
(
where
.
OrderStaus
>
0
)
{
{
sb
.
AppendFormat
(
" and a.OrderStaus={0}"
,
where
.
OrderStaus
);
sb
.
AppendFormat
(
" and a.OrderStaus={0}"
,
where
.
OrderStaus
);
...
...
Mall.WebApi/Controllers/Education/AppletPointController.cs
View file @
8dc79790
...
@@ -34,7 +34,8 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -34,7 +34,8 @@ namespace Mall.WebApi.Controllers.Education
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetAppletUserPointDetailPageList
()
{
public
ApiResult
GetAppletUserPointDetailPageList
()
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
...
@@ -63,7 +64,6 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -63,7 +64,6 @@ namespace Mall.WebApi.Controllers.Education
}
}
#
endregion
#
endregion
#
region
老师课程
#
region
老师课程
/// <summary>
/// <summary>
...
@@ -129,7 +129,6 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -129,7 +129,6 @@ namespace Mall.WebApi.Controllers.Education
#
endregion
#
endregion
#
region
订单列表
#
region
订单列表
/// <summary>
/// <summary>
/// 获取订单列表分页列表
/// 获取订单列表分页列表
/// </summary>
/// </summary>
...
@@ -233,6 +232,154 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -233,6 +232,154 @@ namespace Mall.WebApi.Controllers.Education
Id
=
Convert
.
ToInt32
(
x
.
Value
)
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}));
}
}
#
endregion
#
region
课程订单下单
/// <summary>
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
public
ApiResult
GetSetTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
userInfo
.
MallBaseId
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
else
{
if
(
query
.
CourseId
==
0
)
{
return
ApiResult
.
Failed
(
"请选择您要购买的课程"
);
}
if
(
query
.
ID
==
0
)
{
query
.
CreateDate
=
System
.
DateTime
.
Now
;
}
//查询课程信息
var
courseModel
=
pointModule
.
GetTeacherCourseList
(
new
RB_Point_TeacherCourse_Extend
{
TeacherId
=
query
.
TeacherId
,
ID
=
query
.
CourseId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
var
courseClassModel
=
pointModule
.
GetPointCourseClassList
(
new
RB_Point_CourseClass_Extend
{
ID
=
query
.
CourseClassId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
query
.
TeacherId
=
courseModel
.
TeacherId
;
//判断时长是否一致
if
((
query
.
TotalStudyDuration
%
courseModel
.
StudyDuration
)
!=
0
)
{
return
ApiResult
.
Failed
(
"约课总时长必须课时时长的整数倍"
);
}
//判断时长是否一致
if
(
query
.
StudyDuration
!=
courseModel
.
StudyDuration
)
{
return
ApiResult
.
Failed
(
"约课时长与课时时长不等"
);
}
if
(
query
.
BasePointNum
!=
courseModel
.
PointNum
)
{
return
ApiResult
.
Failed
(
"约课点数错误"
);
}
if
(
query
.
TotalPointNum
!=
(
query
.
BasePointNum
*
(
query
.
TotalStudyDuration
/
courseModel
.
StudyDuration
)))
{
return
ApiResult
.
Failed
(
"约课总点数错误"
);
}
if
(
query
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
)
{
var
userModel
=
pointModule
.
GetUserEntity
(
userInfo
.
UserId
);
if
(
userModel
==
null
)
{
return
ApiResult
.
Failed
(
"用户信息不存在"
);
}
else
{
if
(
userModel
.
PointNum
<
query
.
TotalPointNum
)
{
return
ApiResult
.
Failed
(
"点数不够,请先购买点数"
);
}
}
}
courseModel
.
StudyStartTime
=
Convert
.
ToDateTime
(
courseModel
.
StudyDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
courseModel
.
StudyStartDate
);
if
(
courseModel
.
StudentNumType
==
Common
.
Enum
.
Point
.
StudentNumTypeEnum
.
OneToMany
)
//一对多的时候判断开始时间是否和课程一样
{
if
(
courseModel
.
StudyDate
!=
courseModel
.
StudyStartTime
)
{
return
ApiResult
.
Failed
(
"预约时间与课程时间不一致"
);
}
}
else
{
var
orderList
=
pointModule
.
GetPointOrderList
(
new
RB_Point_TeacherCourseOrder_Extend
{
TeacherId
=
query
.
TeacherId
,
CourseId
=
query
.
CourseId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
DateTime
nowOrderDate
=
query
.
StudyDate
;
if
(
query
.
DurationUnit
==
Common
.
Enum
.
Point
.
DurationUnitEnum
.
Hour
)
{
nowOrderDate
=
query
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
query
.
TotalStudyDuration
*
60
));
}
else
{
nowOrderDate
=
query
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
query
.
TotalStudyDuration
));
}
//判断同一时间是否重复预约
if
(
query
.
StudyDate
<
courseModel
.
StudyStartTime
)
{
return
ApiResult
.
Failed
(
"预约时间不能小于开始时间"
);
}
if
(
nowOrderDate
>
Convert
.
ToDateTime
(
courseModel
.
StudyDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
courseModel
.
StudyEndDate
))
{
return
ApiResult
.
Failed
(
"预约结束时间不能大于课程预约结束时间"
);
}
foreach
(
var
item
in
orderList
)
{
DateTime
endTime
=
item
.
StudyDate
;
if
(
item
.
DurationUnit
==
Common
.
Enum
.
Point
.
DurationUnitEnum
.
Hour
)
{
endTime
=
item
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
item
.
TotalStudyDuration
*
60
));
}
else
{
endTime
=
item
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
item
.
TotalStudyDuration
));
}
if
(
query
.
StudyDate
==
item
.
StudyDate
)
{
return
ApiResult
.
Failed
(
"当前预约时间已预约"
);
}
if
(
pointModule
.
GetTimeSpan
(
query
.
StudyDate
,
item
.
StudyDate
.
ToString
(
"HH:mm"
),
endTime
.
ToString
(
"HH:mm"
)))
{
return
ApiResult
.
Failed
(
"当前预约时间已预约"
);
}
if
(
pointModule
.
GetTimeSpan
(
nowOrderDate
,
item
.
StudyDate
.
ToString
(
"HH:mm"
),
endTime
.
ToString
(
"HH:mm"
)))
{
return
ApiResult
.
Failed
(
"当前预约时间已预约"
);
}
}
}
query
.
ActualPointNum
=
query
.
TotalPointNum
;
query
.
State
=
0
;
query
.
UserId
=
userInfo
.
UserId
;
query
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
result
=
pointModule
.
SetTeacherCourseOrder
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"预约成功"
);
}
else
{
return
ApiResult
.
Failed
(
"预约失败"
);
}
}
}
#
endregion
#
endregion
}
}
...
...
Mall.WebApi/Controllers/Education/PointController.cs
View file @
8dc79790
...
@@ -151,8 +151,41 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -151,8 +151,41 @@ namespace Mall.WebApi.Controllers.Education
#
endregion
#
endregion
#
region
个人中心
-
点数记录
#
region
点数记录
/// <summary>
/// 小程序获取点数记录
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletUserPointDetailPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Member_PointBalance_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_PointBalance_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
var
list
=
pointModule
.
GetUserPointDetailPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
int
PointNum
=
pointModule
.
GetUserPointBalance
(
userInfo
.
UserId
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
new
{
PointNum
,
List
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Type
,
TypeName
=
x
.
Type
.
GetEnumName
(),
x
.
Description
,
x
.
PonitNum
,
x
.
Remarks
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
})
};
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// <summary>
/// 后台获取点数记录
/// 后台获取点数记录
...
@@ -199,7 +232,8 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -199,7 +232,8 @@ namespace Mall.WebApi.Controllers.Education
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetPointOrderPageList
()
{
public
ApiResult
GetPointOrderPageList
()
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
var
userInfo
=
UserInfo
;
var
userInfo
=
UserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
...
@@ -241,16 +275,18 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -241,16 +275,18 @@ namespace Mall.WebApi.Controllers.Education
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetPointOrderInfo
()
{
public
ApiResult
GetPointOrderInfo
()
{
var
userInfo
=
UserInfo
;
var
userInfo
=
UserInfo
;
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
if
(
OrderId
<=
0
)
{
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
}
var
model
=
pointModule
.
GetPointOrderInfo
(
OrderId
,
userInfo
.
TenantId
);
var
model
=
pointModule
.
GetPointOrderInfo
(
OrderId
,
userInfo
.
TenantId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);}
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);
}
return
ApiResult
.
Success
(
""
,
new
return
ApiResult
.
Success
(
""
,
new
{
{
model
.
ID
,
model
.
ID
,
...
@@ -278,6 +314,24 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -278,6 +314,24 @@ namespace Mall.WebApi.Controllers.Education
});
});
}
}
/// <summary>
/// 获取订单状态枚举
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOrderStausEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
Common
.
Enum
.
Point
.
OrderStausEnum
));
return
ApiResult
.
Success
(
""
,
list
.
OrderBy
(
x
=>
Convert
.
ToInt32
(
x
.
Value
)).
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
#
endregion
#
endregion
#
region
在线课程分类
#
region
在线课程分类
...
@@ -622,10 +676,14 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -622,10 +676,14 @@ namespace Mall.WebApi.Controllers.Education
{
{
return
ApiResult
.
Failed
(
"请选择老师"
);
return
ApiResult
.
Failed
(
"请选择老师"
);
}
}
if
(
query
.
PointNum
==
0
)
if
(
query
.
IsPublic
==
0
)
{
{
return
ApiResult
.
Failed
(
"请输入点数"
);
if
(
query
.
PointNum
==
0
)
{
return
ApiResult
.
Failed
(
"请输入点数"
);
}
}
}
if
(
query
.
StudyDuration
==
0
)
if
(
query
.
StudyDuration
==
0
)
{
{
return
ApiResult
.
Failed
(
"请输入课时时长"
);
return
ApiResult
.
Failed
(
"请输入课时时长"
);
...
@@ -657,7 +715,7 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -657,7 +715,7 @@ namespace Mall.WebApi.Controllers.Education
oldPointGoodsList
.
ForEach
(
x
=>
x
.
StudyEndTime
=
Convert
.
ToDateTime
(
x
.
StudyDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
x
.
StudyEndDate
));
oldPointGoodsList
.
ForEach
(
x
=>
x
.
StudyEndTime
=
Convert
.
ToDateTime
(
x
.
StudyDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
x
.
StudyEndDate
));
foreach
(
var
item
in
oldPointGoodsList
)
foreach
(
var
item
in
oldPointGoodsList
)
{
{
if
(
GetTimeSpan
(
query
.
StudyStartTime
,
item
.
StudyStartDate
,
item
.
StudyEndDate
))
if
(
pointModule
.
GetTimeSpan
(
query
.
StudyStartTime
,
item
.
StudyStartDate
,
item
.
StudyEndDate
))
{
{
return
ApiResult
.
Failed
(
"排课时间不能交叉,已存在"
+
item
.
StudyStartDate
+
"~"
+
item
.
StudyEndDate
);
return
ApiResult
.
Failed
(
"排课时间不能交叉,已存在"
+
item
.
StudyStartDate
+
"~"
+
item
.
StudyEndDate
);
}
}
...
@@ -678,23 +736,6 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -678,23 +736,6 @@ namespace Mall.WebApi.Controllers.Education
}
}
}
}
public
bool
GetTimeSpan
(
DateTime
timeStr
,
string
StartTime
,
string
EndTime
)
{
//判断当前时间是否在工作时间段内
TimeSpan
dspWorkingDayAM
=
DateTime
.
Parse
(
StartTime
).
TimeOfDay
;
TimeSpan
dspWorkingDayPM
=
DateTime
.
Parse
(
EndTime
).
TimeOfDay
;
TimeSpan
dspNow
=
timeStr
.
TimeOfDay
;
if
(
dspNow
>
dspWorkingDayAM
&&
dspNow
<
dspWorkingDayPM
)
{
return
true
;
}
return
false
;
}
/// <summary>
/// <summary>
/// 删除老师排课
/// 删除老师排课
/// </summary>
/// </summary>
...
...
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