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
1af70e9b
Commit
1af70e9b
authored
Feb 03, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
848ef1f3
06924957
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
17 deletions
+181
-17
Mall.Education.csproj
Mall.Education/Mall.Education.csproj
+4
-5
PointModule.cs
Mall.Module.Education/PointModule.cs
+113
-2
RB_Point_TeacherCourseRepository.cs
Mall.Repository/Point/RB_Point_TeacherCourseRepository.cs
+1
-1
AppletPointController.cs
Mall.WebApi/Controllers/Education/AppletPointController.cs
+63
-9
No files found.
Mall.Education/Mall.Education.csproj
View file @
1af70e9b
...
...
@@ -52,14 +52,13 @@
<HintPath>
..\packages\Aliyun.OSS.SDK.2.11.0\lib\net45\Aliyun.OSS.dll
</HintPath>
</Reference>
<Reference
Include=
"Aspose.Pdf"
>
<HintPath>
lib\Aspose.Pdf.dll
</HintPath>
<HintPath>
..\..\..\Shopping\Mall.Education\
lib\Aspose.Pdf.dll
</HintPath>
</Reference>
<Reference
Include=
"Aspose.Slides"
>
<HintPath>
lib\Aspose.Slides.dll
</HintPath>
<HintPath>
..\..\..\Shopping\Mall.Education\
lib\Aspose.Slides.dll
</HintPath>
</Reference>
<Reference
Include=
"Aspose.Words, Version=16.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
lib\Aspose.Words.dll
</HintPath>
<Reference
Include=
"Aspose.Words"
>
<HintPath>
..\..\..\Shopping\Mall.Education\lib\Aspose.Words.dll
</HintPath>
</Reference>
<Reference
Include=
"COSXML, Version=5.4.13.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Tencent.QCloud.Cos.Sdk.5.4.13\lib\netstandard2.0\COSXML.dll
</HintPath>
...
...
Mall.Module.Education/PointModule.cs
View file @
1af70e9b
...
...
@@ -394,7 +394,8 @@ namespace Mall.Module.Education
model
.
MinDuration
,
model
.
StudyDuration
,
DurationUnit
=
model
.
DurationUnit
.
GetEnumName
(),
OrderList
=
orderList
.
Select
(
x
=>
new
{
OrderList
=
orderList
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
UserId
,
x
.
UserName
,
...
...
@@ -480,7 +481,7 @@ namespace Mall.Module.Education
{
nameof
(
RB_Point_CourseClass_Extend
.
DurationUnit
),
model
.
DurationUnit
},
{
nameof
(
RB_Point_CourseClass_Extend
.
ClassPic
),
model
.
ClassPic
},
{
nameof
(
RB_Point_CourseClass_Extend
.
Title
),
model
.
Title
}
};
IList
<
WhereHelper
>
auditrecordWhereHelpers
=
new
List
<
WhereHelper
>
{
...
...
@@ -853,7 +854,117 @@ namespace Mall.Module.Education
return
flag
;
}
/// <summary>
/// 完成订单
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
CompleteTeacherCourseOrder
(
RB_Point_TeacherCourseOrder_Extend
model
)
{
bool
flag
=
false
;
var
umodel
=
member_UserRepository
.
GetEntity
(
model
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
var
trans
=
pointTeacherCourseOrderRepository
.
DbTransaction
;
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
},
{
nameof
(
RB_Point_TeacherCourseOrder_Extend
.
ActualPointNum
),
model
.
ActualPointNum
}
};
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
&&
model
.
ActualPointNum
!=
model
.
TotalPointNum
)
//判断是否需要扣除或者增加点数
{
RB_Member_PointBalance_Extend
memberBalanceModel
=
new
RB_Member_PointBalance_Extend
{
OrderId
=
model
.
ID
,
UserId
=
model
.
UserId
,
PonitNum
=
model
.
TotalPointNum
,
CreateDate
=
System
.
DateTime
.
Now
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
Remarks
=
"上课时间:"
+
model
.
StudyDate
.
ToString
(
"yyyy-MM-dd HH:mm"
)
+
"时长"
+
model
.
TotalStudyDuration
.
ToString
(
"f2"
)
+
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
model
.
DurationUnit
),
PlatformType
=
umodel
.
Source
};
int
allTotalPointNum
=
0
;
if
(
model
.
ActualPointNum
>
model
.
TotalPointNum
)
{
allTotalPointNum
=
model
.
ActualPointNum
-
model
.
TotalPointNum
;
if
((
umodel
.
PointNum
-
allTotalPointNum
)
<
0
)
{
allTotalPointNum
=
0
;
}
else
{
allTotalPointNum
=
(
umodel
.
PointNum
-
allTotalPointNum
);
}
memberBalanceModel
.
Type
=
Common
.
Enum
.
MarketingCenter
.
RecordTypeEnum
.
Expend
;
memberBalanceModel
.
Description
=
"购买直播课程消费"
+
(
model
.
ActualPointNum
-
model
.
TotalPointNum
)
+
"点"
;
}
else
if
(
model
.
ActualPointNum
<
model
.
TotalPointNum
)
{
allTotalPointNum
=
model
.
TotalPointNum
-
model
.
ActualPointNum
;
allTotalPointNum
=
(
umodel
.
PointNum
+
allTotalPointNum
);
memberBalanceModel
.
Type
=
Common
.
Enum
.
MarketingCenter
.
RecordTypeEnum
.
Income
;
memberBalanceModel
.
Description
=
"购买直播课程退费"
+
(
model
.
TotalPointNum
-
model
.
ActualPointNum
)
+
"点"
;
}
IDictionary
<
string
,
object
>
filedsUser
=
new
Dictionary
<
string
,
object
>
{
{
nameof
(
Model
.
Entity
.
User
.
RB_Member_User
.
PointNum
),
allTotalPointNum
}
};
IList
<
WhereHelper
>
userWhereHelpers
=
new
List
<
WhereHelper
>
{
new
WhereHelper
()
{
FiledName
=
nameof
(
Model
.
Entity
.
User
.
RB_Member_User
.
Id
),
FiledValue
=
umodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
Model
.
Entity
.
User
.
RB_Member_User
.
TenantId
),
FiledValue
=
umodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
()
{
FiledName
=
nameof
(
Model
.
Entity
.
User
.
RB_Member_User
.
MallBaseId
),
FiledValue
=
umodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
memberPointBalanceRepository
.
Insert
(
memberBalanceModel
,
trans
);
member_UserRepository
.
Update
(
filedsUser
,
userWhereHelpers
,
trans
);
}
return
flag
;
}
#
endregion
...
...
Mall.Repository/Point/RB_Point_TeacherCourseRepository.cs
View file @
1af70e9b
...
...
@@ -22,7 +22,7 @@ namespace Mall.Repository.Point
public
List
<
RB_Point_TeacherCourse_Extend
>
GetTeacherCourseList
(
RB_Point_TeacherCourse_Extend
where
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT tc.*,et.`Name` as TeacherName,et.TeacherLogo,cc.CourseClassType,
sb
.
Append
(
$@"SELECT tc.*,et.`Name` as TeacherName,et.TeacherLogo,cc.CourseClassType,
cc.StudentNumType,
cc.StudentNumType,cc.IsPublic,cc.IsFree
from RB_Point_TeacherCourse as tc
LEFT JOIN rb_point_courseclass as cc on tc.CourseClassId=cc.ID
...
...
Mall.WebApi/Controllers/Education/AppletPointController.cs
View file @
1af70e9b
...
...
@@ -280,6 +280,7 @@ namespace Mall.WebApi.Controllers.Education
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSetTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
...
...
@@ -439,6 +440,7 @@ namespace Mall.WebApi.Controllers.Education
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
...
...
@@ -575,6 +577,7 @@ namespace Mall.WebApi.Controllers.Education
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetConfirmTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
...
...
@@ -582,13 +585,16 @@ namespace Mall.WebApi.Controllers.Education
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
userInfo
.
MallBaseId
;
if
(
userInfo
.
UserTeacher
==
0
)
{
return
ApiResult
.
Failed
(
"您当前无权操作"
);
}
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
else
{
if
(
query
.
CourseId
==
0
)
{
return
ApiResult
.
Failed
(
"请选择课程信息"
);
...
...
@@ -602,7 +608,7 @@ namespace Mall.WebApi.Controllers.Education
return
ApiResult
.
Failed
(
"请传入房间信息"
);
}
var
oldcourseOrderList
=
pointModule
.
GetPointOrderList
(
new
RB_Point_TeacherCourseOrder_Extend
{
CourseId
=
query
.
CourseId
,
TeacherId
=
query
.
TeacherId
});
var
oldcourseOrderList
=
pointModule
.
GetPointOrderList
(
new
RB_Point_TeacherCourseOrder_Extend
{
CourseId
=
query
.
CourseId
,
TeacherId
=
userInfo
.
UserTeacher
});
var
updateList
=
new
List
<
RB_Point_TeacherCourseOrder_Extend
>();
if
(
query
.
StudentNumType
==
Common
.
Enum
.
Point
.
StudentNumTypeEnum
.
OneOnOne
)
{
...
...
@@ -610,8 +616,9 @@ namespace Mall.WebApi.Controllers.Education
{
return
ApiResult
.
Failed
(
"请传入订单号id"
);
}
else
{
updateList
=
oldcourseOrderList
.
Where
(
x
=>
x
.
ID
==
query
.
ID
&&
x
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
).
ToList
();
else
{
updateList
=
oldcourseOrderList
.
Where
(
x
=>
x
.
ID
==
query
.
ID
&&
x
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
).
ToList
();
}
}
else
...
...
@@ -622,9 +629,9 @@ namespace Mall.WebApi.Controllers.Education
{
return
ApiResult
.
Failed
(
"订单已确认"
);
}
updateList
.
ForEach
(
x
=>
x
.
OrderStaus
=
Common
.
Enum
.
Point
.
OrderStausEnum
.
Complete
);
updateList
.
ForEach
(
x
=>
x
.
OrderStaus
=
Common
.
Enum
.
Point
.
OrderStausEnum
.
NoClass
);
updateList
.
ForEach
(
x
=>
x
.
UpdateDate
=
System
.
DateTime
.
Now
);
bool
result
=
pointModule
.
ConfirmTeacherCourseOrder
(
updateList
);
if
(
result
)
{
...
...
@@ -638,8 +645,52 @@ namespace Mall.WebApi.Controllers.Education
}
/// <summary>
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CompleteTeacherCourseOrder
()
{
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
;
query
.
TeacherId
=
userInfo
.
UserTeacher
;
if
(
userInfo
.
UserTeacher
==
0
)
{
return
ApiResult
.
Failed
(
"您当前无权操作"
);
}
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
else
{
if
(
query
.
ID
==
0
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
var
oldModel
=
pointModule
.
GetPointOrderList
(
query
).
FirstOrDefault
();
if
(
oldModel
==
null
||
oldModel
.
ID
==
0
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
oldModel
.
ActualPointNum
=
query
.
ActualPointNum
;
oldModel
.
UpdateDate
=
System
.
DateTime
.
Now
;
oldModel
.
OrderStaus
=
Common
.
Enum
.
Point
.
OrderStausEnum
.
Complete
;
bool
result
=
pointModule
.
CompleteTeacherCourseOrder
(
oldModel
);
if
(
result
)
{
return
ApiResult
.
Success
(
"订单确认成功"
);
}
else
{
return
ApiResult
.
Failed
(
"订单确认失败"
);
}
}
}
#
endregion
...
...
@@ -742,6 +793,8 @@ namespace Mall.WebApi.Controllers.Education
model
.
IsFree
,
model
.
IsPublic
,
model
.
MinDuration
,
model
.
StudyDuration
,
DurationUnitName
=
EnumHelper
.
GetEnumName
(
model
.
DurationUnit
),
model
.
PointNum
,
model
.
TeacherId
,
model
.
TeacherLogo
,
...
...
@@ -749,7 +802,8 @@ namespace Mall.WebApi.Controllers.Education
model
.
CourseName
,
model
.
RoomId
,
StudyDateStr
=
model
.
StudyDate
.
ToString
(
"yyyy-MM-dd"
),
orderList
orderList
,
StudentNumTypeName
=
EnumHelper
.
GetEnumName
(
model
.
StudentNumType
)
};
return
ApiResult
.
Success
(
""
,
result
);
}
...
...
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