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
e84a58e2
Commit
e84a58e2
authored
Mar 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b95c3c34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+14
-5
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+8
-6
No files found.
Edu.Module.Course/CourseModule.cs
View file @
e84a58e2
...
...
@@ -150,8 +150,8 @@ namespace Edu.Module.Course
{
nameof
(
RB_Course_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Course_ViewModel
.
Teacher_Ids
),
model
.
Teacher_Ids
},
{
nameof
(
RB_Course_ViewModel
.
CourseFeature
),
model
.
CourseFeature
},
{
nameof
(
RB_Course_ViewModel
.
OriginalPrice
),
model
.
OriginalPrice
},
{
nameof
(
RB_Course_ViewModel
.
SellPrice
),
model
.
SellPrice
},
//
{nameof(RB_Course_ViewModel.OriginalPrice),model.OriginalPrice },
//
{nameof(RB_Course_ViewModel.SellPrice),model.SellPrice },
{
nameof
(
RB_Course_ViewModel
.
IsOpenStepPrice
),
model
.
IsOpenStepPrice
},
{
nameof
(
RB_Course_ViewModel
.
IsRenew
),
model
.
IsRenew
},
{
nameof
(
RB_Course_ViewModel
.
RenewOgPrice
),
model
.
RenewOgPrice
},
...
...
@@ -940,10 +940,19 @@ namespace Edu.Module.Course
/// <param name="list"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetCoursePreferentialListModule
(
int
CourseId
,
List
<
RB_Course_Preferential_Extend
>
list
)
public
virtual
bool
SetCoursePreferentialListModule
(
RB_Course_ViewModel
courseModel
,
List
<
RB_Course_Preferential_Extend
>
list
)
{
bool
flag
=
false
;
var
oldList
=
GetCoursePreferentialListModule
(
new
RB_Course_Preferential_Extend
()
{
CourseId
=
CourseId
});
if
(
courseModel
.
CourseId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_ViewModel
.
OriginalPrice
),
courseModel
.
OriginalPrice
},
{
nameof
(
RB_Course_ViewModel
.
SellPrice
),
courseModel
.
SellPrice
},
};
flag
=
courseRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_ViewModel
.
CourseId
),
courseModel
.
CourseId
));
}
var
oldList
=
GetCoursePreferentialListModule
(
new
RB_Course_Preferential_Extend
()
{
CourseId
=
courseModel
.
CourseId
});
//原来没有优惠数据
if
(
oldList
==
null
||
(
oldList
!=
null
&&
oldList
.
Count
==
0
))
{
...
...
@@ -957,7 +966,7 @@ namespace Edu.Module.Course
{
if
(
list
==
null
||
(
list
!=
null
&&
list
.
Count
==
0
))
{
flag
=
course_PreferentialRepository
.
DeleteCoursePreferentialRepostory
(
CourseId
);
flag
=
course_PreferentialRepository
.
DeleteCoursePreferentialRepostory
(
courseModel
.
CourseId
);
}
//找出差异的数据
var
deleteList
=
oldList
.
Where
(
qitem
=>
!
list
.
Any
(
oldItem
=>
qitem
.
Id
==
oldItem
.
Id
)).
ToList
();
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
e84a58e2
...
...
@@ -26,7 +26,7 @@ namespace Edu.WebApi.Controllers.Course
/// <summary>
/// 课程处理类对象
/// </summary>
private
readonly
CourseModule
courseModule
=
new
CourseModule
();
private
readonly
CourseModule
courseModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
CourseModule
>
();
#
region
课程分类管理
/// <summary>
...
...
@@ -774,7 +774,7 @@ namespace Edu.WebApi.Controllers.Course
{
var
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
,
0
);
var
list
=
courseModule
.
GetCoursePreferentialListModule
(
new
RB_Course_Preferential_Extend
()
{
CourseId
=
CourseId
});
return
ApiResult
.
Success
();
return
ApiResult
.
Success
(
data
:
list
);
}
...
...
@@ -784,8 +784,10 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
public
ApiResult
SetBeatchCoursePreferential
()
{
var
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
,
0
);
var
list
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Course_Preferential_Extend
>>(
RequestParm
.
Msg
.
ToString
());
var
courseObj
=
base
.
ParmJObj
.
GetStringValue
(
"courseObj"
);
var
courseModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Course_ViewModel
>(
courseObj
);
var
priceObj
=
base
.
ParmJObj
.
GetStringValue
(
"priceList"
);
var
list
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Course_Preferential_Extend
>>(
priceObj
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
extModel
in
list
)
...
...
@@ -796,10 +798,10 @@ namespace Edu.WebApi.Controllers.Course
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
this
.
UserInfo
.
Group_Id
;
extModel
.
School_Id
=
this
.
UserInfo
.
School_Id
;
extModel
.
CourseId
=
CourseId
;
extModel
.
CourseId
=
courseModel
.
CourseId
;
}
}
var
flag
=
courseModule
.
SetCoursePreferentialListModule
(
CourseId
,
list
);
var
flag
=
courseModule
.
SetCoursePreferentialListModule
(
courseModel
,
list
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
...
...
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