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
c8c568be
Commit
c8c568be
authored
Nov 25, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
60cc3d4e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
5 deletions
+129
-5
RB_Course_Category_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
+6
-1
RB_Course_Subject_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Subject_ViewModel.cs
+5
-0
RB_Customer_TaskDetails_Extend.cs
...odel/ViewModel/Customer/RB_Customer_TaskDetails_Extend.cs
+10
-3
CustomerTaskModule.cs
Edu.Module.Customer/CustomerTaskModule.cs
+84
-1
RB_Course_CategoryRepository.cs
Edu.Repository/Course/RB_Course_CategoryRepository.cs
+4
-0
RB_Course_SubjectRepository.cs
Edu.Repository/Course/RB_Course_SubjectRepository.cs
+4
-0
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+16
-0
No files found.
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
View file @
c8c568be
...
...
@@ -10,8 +10,13 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_Category_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_Category
public
class
RB_Course_Category_ViewModel
:
Entity
.
Course
.
RB_Course_Category
{
/// <summary>
/// 分类编号(查询使用)
/// </summary>
public
string
QCateIds
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
...
...
Edu.Model/ViewModel/Course/RB_Course_Subject_ViewModel.cs
View file @
c8c568be
...
...
@@ -10,6 +10,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
class
RB_Course_Subject_ViewModel
:
RB_Course_Subject
{
/// <summary>
/// 科目编号【查询使用】
/// </summary>
public
string
QIds
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
...
...
Edu.Model/ViewModel/Customer/RB_Customer_TaskDetails_Extend.cs
View file @
c8c568be
using
Edu.Model.Entity.Customer
;
using
Edu.Common.Plugin
;
using
Edu.Model.Entity.Customer
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
...
...
@@ -16,9 +17,9 @@ namespace Edu.Model.ViewModel.Customer
public
string
QTaskIds
{
get
;
set
;
}
/// <summary>
///
关联目标
名称
///
任务类型
名称
/// </summary>
public
string
Ta
rgetName
{
get
;
set
;
}
public
string
Ta
skTypeName
{
get
{
return
this
.
TaskType
.
ToName
();
}
}
/// <summary>
/// 目标值数组
...
...
@@ -31,5 +32,11 @@ namespace Edu.Model.ViewModel.Customer
return
ids
;
}
}
/// <summary>
/// 目标列表
/// </summary>
public
List
<
object
>
TargetList
{
get
;
set
;
}
}
}
Edu.Module.Customer/CustomerTaskModule.cs
View file @
c8c568be
...
...
@@ -6,6 +6,8 @@ using System.Text;
using
System.Linq
;
using
VT.FW.DB
;
using
Edu.Common.Enum
;
using
Edu.Repository.Course
;
using
Edu.Model.ViewModel.Course
;
namespace
Edu.Module.Customer
{
...
...
@@ -24,6 +26,20 @@ namespace Edu.Module.Customer
/// </summary>
private
readonly
RB_Customer_TaskDetailsRepository
detailsRepository
=
new
RB_Customer_TaskDetailsRepository
();
/// <summary>
/// 课程仓储层对象
/// </summary>
private
readonly
RB_CourseRepository
courseRepository
=
new
RB_CourseRepository
();
/// <summary>
/// 课程系列仓储层对象
/// </summary>
private
readonly
RB_Course_CategoryRepository
course_CategoryRepository
=
new
RB_Course_CategoryRepository
();
/// <summary>
/// 科目仓储层对象
/// </summary>
private
readonly
RB_Course_SubjectRepository
course_SubjectRepository
=
new
RB_Course_SubjectRepository
();
/// <summary>
/// 获取任务分页列表
...
...
@@ -49,11 +65,78 @@ namespace Edu.Module.Customer
if
(
detailsList
!=
null
&&
detailsList
.
Count
>
0
)
{
var
groupList
=
detailsList
.
GroupBy
(
qitem
=>
new
{
qitem
.
TaskType
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
TaskType
});
var
courseList
=
new
List
<
RB_Course_ViewModel
>();
var
cateList
=
new
List
<
RB_Course_Category_ViewModel
>();
var
subjectList
=
new
List
<
RB_Course_Subject_ViewModel
>();
foreach
(
var
item
in
groupList
)
{
if
(
item
.
TaskType
==
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
Course
)
{
string
courseIds
=
string
.
Join
(
","
,
detailsList
.
Where
(
qitem
=>
qitem
.
TaskType
==
item
.
TaskType
).
Select
(
qitem
=>
qitem
.
TargetId
));
string
courseIds
=
string
.
Join
(
","
,
detailsList
.
Where
(
qitem
=>
qitem
.
TaskType
==
item
.
TaskType
).
Select
(
qitem
=>
qitem
.
TargetId
));
courseList
=
courseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
QCourseIds
=
courseIds
});
}
else
if
(
item
.
TaskType
==
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
CourseCate
)
{
string
catdIds
=
string
.
Join
(
","
,
detailsList
.
Where
(
qitem
=>
qitem
.
TaskType
==
item
.
TaskType
).
Select
(
qitem
=>
qitem
.
TargetId
));
cateList
=
course_CategoryRepository
.
GetCourseCategoryListRepository
(
new
RB_Course_Category_ViewModel
()
{
QCateIds
=
catdIds
});
}
else
if
(
item
.
TaskType
==
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
CourseSuject
)
{
string
subjectIds
=
string
.
Join
(
","
,
detailsList
.
Where
(
qitem
=>
qitem
.
TaskType
==
item
.
TaskType
).
Select
(
qitem
=>
qitem
.
TargetId
));
subjectList
=
course_SubjectRepository
.
GetCourseSubjectListRepository
(
new
RB_Course_Subject_ViewModel
()
{
QIds
=
subjectIds
});
}
}
foreach
(
var
item
in
detailsList
)
{
item
.
TargetList
=
new
List
<
object
>();
if
(
item
.
TargetIdList
!=
null
&&
item
.
TargetIdList
.
Count
>
0
)
{
foreach
(
var
subItem
in
item
.
TargetIdList
)
{
switch
(
item
.
TaskType
)
{
case
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
Course
:
var
courseModel
=
courseList
.
Where
(
qitem
=>
qitem
.
CourseId
==
subItem
)?.
FirstOrDefault
();
if
(
courseModel
!=
null
)
{
item
.
TargetList
.
Add
(
new
{
TargetId
=
courseModel
.
CourseId
,
TargetName
=
courseModel
.
CourseName
});
}
break
;
case
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
CourseCate
:
var
cateModel
=
cateList
.
Where
(
qitem
=>
qitem
.
CateId
==
subItem
)?.
FirstOrDefault
();
if
(
cateModel
!=
null
)
{
item
.
TargetList
.
Add
(
new
{
TargetId
=
cateModel
.
CateId
,
TargetName
=
cateModel
.
CateName
});
}
break
;
case
Common
.
Enum
.
Customer
.
TaskTypeEnum
.
CourseSuject
:
var
subjectModel
=
subjectList
.
Where
(
qitem
=>
qitem
.
Id
==
subItem
)?.
FirstOrDefault
();
if
(
subjectModel
!=
null
)
{
item
.
TargetList
.
Add
(
new
{
TargetId
=
subjectModel
.
Id
,
TargetName
=
subjectModel
.
SubjectName
});
}
break
;
}
}
}
}
}
...
...
Edu.Repository/Course/RB_Course_CategoryRepository.cs
View file @
c8c568be
...
...
@@ -42,6 +42,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Course_Category_ViewModel
.
CateId
),
query
.
CateId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCateIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Course_Category_ViewModel
.
CateId
),
query
.
QCateIds
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CateName
))
{
builder
.
AppendFormat
(
" AND {0} LIKE @CateName "
,
nameof
(
RB_Course_Category_ViewModel
.
CateName
));
...
...
Edu.Repository/Course/RB_Course_SubjectRepository.cs
View file @
c8c568be
...
...
@@ -73,6 +73,10 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND A.{0} LIKE @SubjectName "
,
nameof
(
RB_Course_Subject_ViewModel
.
SubjectName
));
parameters
.
Add
(
"SubjectName"
,
"%"
+
query
.
SubjectName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN ({1}) "
,
nameof
(
RB_Course_Subject_ViewModel
.
Id
),
query
.
QIds
);
}
}
return
Get
<
RB_Course_Subject_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
c8c568be
...
...
@@ -252,6 +252,22 @@ namespace Edu.WebApi.Controllers.Customer
}
}
}
if
(
model
.
DetailsList
==
null
||
(
model
.
DetailsList
!=
null
&&
model
.
DetailsList
.
Count
()
==
0
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请添加任务类型!"
);
}
if
(
model
.
DetailsList
!=
null
)
{
var
groupList
=
model
.
DetailsList
.
GroupBy
(
qitem
=>
new
{
qitem
.
TaskType
})
.
Select
(
qitem
=>
new
{
qitem
.
Key
.
TaskType
,
TaskTypeCount
=
qitem
.
Count
()
});
foreach
(
var
item
in
groupList
)
{
if
(
item
.
TaskTypeCount
>
1
)
{
return
ApiResult
.
ParamIsNull
(
message
:
$"已经存在【
{
item
.
TaskType
.
ToName
()}
】类型,请重新选择!"
);
}
}
}
var
flag
=
taskModule
.
SetCustomerTaskModule
(
model
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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