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
95479c92
Commit
95479c92
authored
Feb 18, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
adf2c004
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
4 deletions
+152
-4
RB_Student_ViewModel.cs
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
+5
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+99
-0
RB_Course_ChapterRepository.cs
Edu.Repository/Course/RB_Course_ChapterRepository.cs
+12
-0
RB_StudentRepository.cs
Edu.Repository/User/RB_StudentRepository.cs
+8
-3
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+3
-0
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+25
-1
No files found.
Edu.Model/ViewModel/User/RB_Student_ViewModel.cs
View file @
95479c92
...
...
@@ -294,6 +294,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public
List
<
int
>
CreateIds
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
string
QCreateBys
{
get
;
set
;
}
/// <summary>
/// 课程图标
/// </summary>
...
...
Edu.Module.Course/CourseModule.cs
View file @
95479c92
...
...
@@ -1087,6 +1087,105 @@ namespace Edu.Module.Course
bool
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
ChapterId
));
return
flag
;
}
/// <summary>
/// 重新更新课程章节
/// </summary>
public
void
RunCourseChapterModule
()
{
var
courseList
=
courseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
QCourseIds
=
"97"
});
if
(
courseList
!=
null
&&
courseList
.
Count
>
0
)
{
foreach
(
var
item
in
courseList
)
{
List
<
RB_Course_Chapter_ViewModel
>
result
=
new
List
<
RB_Course_Chapter_ViewModel
>();
var
sourceList
=
GetChapterListModule
(
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
});
var
treeList
=
GetChapterTreeListModule
(
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
});
if
(
treeList
!=
null
&&
treeList
.
Count
>
0
)
{
foreach
(
var
tItem
in
treeList
)
{
var
rootModel
=
sourceList
.
Where
(
qitem
=>
qitem
.
ChapterId
==
tItem
.
ChapterId
).
FirstOrDefault
();
rootModel
.
ChapterId
=
0
;
if
(
tItem
.
ChildList
==
null
||
(
tItem
.
ChildList
!=
null
&&
tItem
.
ChildList
.
Count
==
0
))
{
var
rootModel1
=
JsonHelper
.
DeserializeObject
<
RB_Course_Chapter_ViewModel
>(
JsonHelper
.
Serialize
(
rootModel
));
rootModel1
.
ChapterName
+=
"(1)"
;
rootModel1
.
StudyHours
=
2
;
rootModel1
.
StudyMinutes
=
90
;
rootModel1
.
ChapterId
=
0
;
result
.
Add
(
rootModel1
);
var
rootModel2
=
JsonHelper
.
DeserializeObject
<
RB_Course_Chapter_ViewModel
>(
JsonHelper
.
Serialize
(
rootModel
));
rootModel2
.
ChapterName
+=
"(2)"
;
rootModel2
.
StudyHours
=
2
;
rootModel2
.
StudyMinutes
=
90
;
rootModel1
.
ChapterId
=
0
;
result
.
Add
(
rootModel2
);
}
else
{
var
tempList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
GetCourseChildList
(
tItem
,
sourceList
,
tempList
);
if
(
tempList
!=
null
)
{
result
.
AddRange
(
tempList
);
}
}
}
}
if
(
result
!=
null
&&
result
.
Count
>
0
)
{
int
index
=
1
;
foreach
(
var
sItem
in
result
)
{
sItem
.
ChapterNo
=
index
.
ToString
();
index
++;
}
chapterRepository
.
DeleteByCourseIdRepository
(
item
.
CourseId
);
chapterRepository
.
SetBatchInsertCourseChapterRepository
(
result
);
}
//string str = Common.Plugin.JsonHelper.Serialize(result);
}
}
}
/// <summary>
/// 获取课程章节列表
/// </summary>
/// <param name="treeList"></param>
/// <param name="chapterList"></param>
public
void
GetCourseChildList
(
ChapterTree_ViewModel
item
,
List
<
RB_Course_Chapter_ViewModel
>
sourceList
,
List
<
RB_Course_Chapter_ViewModel
>
resultList
)
{
if
(
item
!=
null
)
{
if
(
item
.
ChildList
!=
null
&&
item
.
ChildList
.
Count
>
0
)
{
foreach
(
var
subItem
in
item
.
ChildList
)
{
if
(
subItem
.
ChildList
==
null
||
(
subItem
.
ChildList
!=
null
&&
subItem
.
ChildList
.
Count
==
0
))
{
var
tempModel
=
sourceList
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
subItem
.
ChapterId
)?.
FirstOrDefault
();
if
(
tempModel
!=
null
)
{
tempModel
.
ChapterName
=
item
.
ChapterName
+
" "
+
tempModel
.
ChapterName
;
tempModel
.
StudyHours
=
2
;
tempModel
.
StudyMinutes
=
90
;
tempModel
.
ParentId
=
0
;
tempModel
.
ChapterId
=
0
;
resultList
.
Add
(
tempModel
);
}
}
else
{
GetCourseChildList
(
subItem
,
sourceList
,
resultList
);
}
}
}
}
}
#
endregion
#
region
课程讨论管理
...
...
Edu.Repository/Course/RB_Course_ChapterRepository.cs
View file @
95479c92
...
...
@@ -65,6 +65,18 @@ namespace Edu.Repository.Course
return
base
.
Execute
(
builder
.
ToString
())
>
0
;
}
/// <summary>
/// 根据课程编号删除章节信息
/// </summary>
/// <param name="CourseId"></param>
/// <returns></returns>
public
bool
DeleteByCourseIdRepository
(
int
CourseId
)
{
string
sql
=
" DELETE FROM rb_course_chapter WHERE CourseId="
+
CourseId
;
return
base
.
Execute
(
sql
)
>
0
;
}
/// <summary>
/// 批量更新编号
/// </summary>
...
...
Edu.Repository/User/RB_StudentRepository.cs
View file @
95479c92
...
...
@@ -342,11 +342,16 @@ WHERE 1=1
//全部
if
(
query
.
BelongType
==
1
)
{
string
tempCreateIds
=
query
.
CreateBy
.
ToString
();
if
(!
string
.
IsNullOrEmpty
(
query
.
QCreateBys
))
{
tempCreateIds
+=
","
+
query
.
QCreateBys
;
}
builder
.
AppendFormat
(
@"
AND ( t.CreateBy
={0}
OR t.StuId IN (SELECT StuId FROM rb_student_assist WHERE AssistId
={0}
AND `Status`=0)
AND ( t.CreateBy
IN({0})
OR t.StuId IN (SELECT StuId FROM rb_student_assist WHERE AssistId
IN({0})
AND `Status`=0)
)
"
,
query
.
CreateBy
);
"
,
tempCreateIds
.
TrimStart
(
','
).
TrimEnd
(
','
)
);
}
//我负责的
if
(
query
.
BelongType
==
2
&&
query
.
CreateBy
>
0
)
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
95479c92
...
...
@@ -56,11 +56,14 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private
readonly
DepartmentModule
departmentModule
=
new
DepartmentModule
();
private
readonly
CourseModule
courseModule
=
new
CourseModule
();
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
Test
()
{
courseModule
.
RunCourseChapterModule
();
return
ApiResult
.
Success
();
}
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
95479c92
...
...
@@ -18,6 +18,7 @@ using Edu.Module.Course;
using
Edu.Module.Customer
;
using
Edu.Module.Duty
;
using
Edu.Module.Log
;
using
Edu.Module.OKR
;
using
Edu.Module.User
;
using
Edu.ThirdCore.TenCloud
;
using
Edu.WebApi.Filter
;
...
...
@@ -107,6 +108,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private
readonly
DutyPlanModule
dutyPlanModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
DutyPlanModule
>();
/// <summary>
/// OKR处理类
/// </summary>
private
readonly
OKRPeriodModule
okrPeriodModule
=
new
OKRPeriodModule
();
#
region
用户账户管理
/// <summary>
...
...
@@ -683,17 +689,35 @@ namespace Edu.WebApi.Controllers.User
QStudentStatus
=
base
.
ParmJObj
.
GetInt
(
"QStudentStatus"
),
AdvisorStatus
=
base
.
ParmJObj
.
GetInt
(
"AdvisorStatus"
),
StuChannel
=
base
.
ParmJObj
.
GetInt
(
"StuChannel"
),
};
if
(
query
.
IsQueryMyStu
==
1
)
{
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
}
string
CreateIds
=
base
.
ParmJObj
.
GetStringValue
(
"CreateIds"
);
if
(!
string
.
IsNullOrEmpty
(
CreateIds
))
{
query
.
CreateIds
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
CreateIds
);
}
if
(
query
.
BelongType
==
1
)
{
var
tempList
=
okrPeriodModule
.
GetOKRPersonalDimensionListModule
(
base
.
UserInfo
.
Group_Id
,
base
.
UserInfo
.
Id
,
base
.
UserInfo
.
DeptId
);
string
QCreateBys
=
""
;
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
foreach
(
var
jItem
in
tempList
)
{
JObject
jObj
=
JObject
.
Parse
(
JsonHelper
.
Serialize
(
jItem
));
QCreateBys
+=
jObj
.
GetStringValue
(
"Id"
)+
","
;
}
}
if
(!
string
.
IsNullOrEmpty
(
QCreateBys
))
{
query
.
QCreateBys
=
QCreateBys
.
TrimStart
(
','
).
TrimEnd
(
','
);
}
}
int
PlanId
=
base
.
ParmJObj
.
GetInt
(
"PlanId"
);
if
(
PlanId
>
0
)
...
...
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