Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
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
viitto
EduSpider
Commits
4b7cf449
Commit
4b7cf449
authored
Jun 14, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
cc63eca2
5661bfca
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
38 deletions
+18
-38
CourseQuery.cs
EduSpider.Model/Query/CourseQuery.cs
+5
-0
StuCommentDetailsRepository.cs
EduSpider.Repository/StuCommentDetailsRepository.cs
+2
-2
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+11
-36
No files found.
EduSpider.Model/Query/CourseQuery.cs
View file @
4b7cf449
...
...
@@ -71,5 +71,10 @@ namespace EduSpider.Model.Query
/// 默认评价编号
/// </summary>
public
int
DefaultCommentId
{
get
;
set
;
}
/// <summary>
/// 学员作业编号
/// </summary>
public
long
Stu_HomeWork_Id
{
get
;
set
;
}
}
}
EduSpider.Repository/StuCommentDetailsRepository.cs
View file @
4b7cf449
...
...
@@ -32,6 +32,7 @@ namespace EduSpider.Repository
StuUid
=
item
.
StuUid
,
HomeWorkId
=
item
.
HomeWorkId
,
}).
FirstOrDefault
();
string
createTimeStr
=
""
;
if
(
defaultModel
!=
null
)
{
...
...
@@ -42,7 +43,7 @@ namespace EduSpider.Repository
var
homeWorkModel
=
new
StuHomeWorkRepository
().
GetStuHomeWorkDetailsListRepository
(
new
CourseQuery
()
{
CourseId
=
item
.
CourseId
,
HomeWork
Id
=
item
.
HomeWorkId
,
Stu_HomeWork_
Id
=
item
.
HomeWorkId
,
StuIds
=
item
.
StuUid
.
ToString
()
}).
FirstOrDefault
();
if
(
homeWorkModel
!=
null
)
...
...
@@ -58,7 +59,6 @@ namespace EduSpider.Repository
{
item
.
CreateTime
=
DateTime
.
Now
;
}
// flag = base.Insert(item) > 0;
}
bool
flag
=
BatchInsert
(
list
);
return
flag
;
...
...
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
4b7cf449
...
...
@@ -61,6 +61,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
HomeWorkId
);
}
if
(
query
.
Stu_HomeWork_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
stu_homework_id
),
query
.
Stu_HomeWork_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QHomeWorkIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
homework_id
),
query
.
QHomeWorkIds
);
...
...
@@ -139,17 +143,7 @@ WHERE 1=1
var
First_Stu_HomeWork_Id
=
firstList
.
LastOrDefault
().
Stu_HomeWork_Id
;
var
tempModel
=
GetSystemCreateComment
(
commentList
,
cItem
.
course_id
,
First_Stu_HomeWork_Id
);
var
firstNum
=
CreateRandomNum
();
var
firstStartTime
=
firstList
.
LastOrDefault
().
CreateTime
;
var
secondModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
6
).
FirstOrDefault
();
if
(
secondModel
!=
null
)
{
var
newSeconds
=
CreateRandomSecondNum
(
firstStartTime
,
secondModel
.
CreateTime
);
firstStartTime
=
firstStartTime
.
AddSeconds
(
newSeconds
);
}
else
{
firstStartTime
=
firstStartTime
.
AddMinutes
(
firstNum
);
}
var
firstStartTime
=
firstList
.
LastOrDefault
().
CreateTime
.
AddSeconds
(
1
);
if
(
tempModel
==
null
||
(
tempModel
!=
null
&&
tempModel
.
Id
<=
0
))
{
var
f_model
=
new
RB_Stu_Comment_Extend
()
...
...
@@ -199,17 +193,7 @@ WHERE 1=1
var
Second_Stu_HomeWork_Id
=
secondList
.
LastOrDefault
().
Stu_HomeWork_Id
;
var
secondModel
=
GetSystemCreateComment
(
commentList
,
cItem
.
course_id
,
Second_Stu_HomeWork_Id
);
var
secondNum
=
CreateRandomNum
();
var
secondTime
=
secondList
.
LastOrDefault
().
CreateTime
;
var
thirdModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
10
).
FirstOrDefault
();
if
(
thirdModel
!=
null
)
{
var
newSeconds
=
CreateRandomSecondNum
(
secondTime
,
thirdModel
.
CreateTime
);
secondTime
=
secondTime
.
AddSeconds
(
newSeconds
);
}
else
{
secondTime
=
secondTime
.
AddMinutes
(
secondNum
);
}
var
secondTime
=
secondList
.
LastOrDefault
().
CreateTime
.
AddSeconds
(
1
);
if
(
secondModel
==
null
||
(
secondModel
!=
null
&&
secondModel
.
Id
<=
0
))
{
...
...
@@ -259,17 +243,8 @@ WHERE 1=1
var
Third_Stu_HomeWork_Id
=
thirdList
.
LastOrDefault
().
Stu_HomeWork_Id
;
var
thirdModel
=
GetSystemCreateComment
(
commentList
,
cItem
.
course_id
,
Third_Stu_HomeWork_Id
);
var
thirdNum
=
CreateRandomNum
();
var
thirdTime
=
thirdList
.
LastOrDefault
().
CreateTime
;
var
fourthModel
=
homeWorkList
.
Where
(
qitem
=>
qitem
.
RowNum
==
14
).
FirstOrDefault
();
if
(
fourthModel
!=
null
)
{
var
newSeconds
=
CreateRandomSecondNum
(
thirdTime
,
fourthModel
.
CreateTime
);
thirdTime
=
thirdTime
.
AddSeconds
(
newSeconds
);
}
else
{
thirdTime
=
thirdTime
.
AddMinutes
(
thirdNum
);
}
var
thirdTime
=
thirdList
.
LastOrDefault
().
CreateTime
.
AddSeconds
(
1
);
if
(
thirdModel
==
null
||
(
thirdModel
!=
null
&&
thirdModel
.
Id
<=
0
))
{
var
t_model
=
new
RB_Stu_Comment_Extend
()
...
...
@@ -279,7 +254,7 @@ WHERE 1=1
CourseId
=
cItem
.
course_id
,
CreateType
=
1
,
CreateByName
=
thirdList
.
LastOrDefault
().
ThName
,
CreateTime
=
third
List
.
LastOrDefault
().
CreateTime
.
AddMinutes
(
thirdNum
)
,
CreateTime
=
third
Time
,
ShowType
=
3
,
Details
=
new
List
<
RB_Stu_CommentDetails
>()
};
...
...
@@ -295,7 +270,7 @@ WHERE 1=1
Info
=
info
,
CreateType
=
1
,
CreateByName
=
thirdList
.
LastOrDefault
().
ThName
,
CreateTime
=
third
List
.
LastOrDefault
().
CreateTime
.
AddMinutes
(
thirdNum
)
,
CreateTime
=
third
Time
,
ShowType
=
3
,
});
new
StuCommentRepository
().
SetStuCommentRepository
(
t_model
);
...
...
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