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
64d3d841
Commit
64d3d841
authored
May 26, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
6540d2da
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
49 deletions
+37
-49
IExam_ScoreRepository.cs
EduSpider.IRepository/IExam_ScoreRepository.cs
+0
-7
Exam_ScoreRepository.cs
EduSpider.Repository/Exam_ScoreRepository.cs
+1
-6
ExamService.cs
EduSpider.Services/ExamService.cs
+21
-21
ExamController.cs
EduSpider.WebApi/Controllers/Student/ExamController.cs
+3
-3
UploadController.cs
EduSpider.WebApi/Controllers/Upload/UploadController.cs
+3
-3
LoginController.cs
EduSpider.WebApi/Controllers/User/LoginController.cs
+8
-8
Startup.cs
EduSpider.WebApi/Startup.cs
+1
-1
No files found.
EduSpider.IRepository/IExam_ScoreRepository.cs
View file @
64d3d841
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
<<<<<<<
.
merge_file_a14452
using
EduSpider.Model.Query
;
=======
>>>>>>>
.
merge_file_a12592
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
...
...
EduSpider.Repository/Exam_ScoreRepository.cs
View file @
64d3d841
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
<<<<<<<
HEAD
using
EduSpider.Model.Query
;
=======
>>>>>>>
6d0347
e0f3f9e8ee506c9ab8673669368baa27d7
using
EduSpider.Repository.Base
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Repository
{
...
...
@@ -26,7 +21,7 @@ namespace EduSpider.Repository
/// <returns></returns>
public
List
<
RB_Exam_Score_Extend
>
GetExamScoreListRepository
(
CourseQuery
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.ExamName,B.CreateTime AS ExamCreateTime
FROM RB_Exam_Score AS A INNER JOIN rb_exam AS B ON A.ExamId=B.ExamId
...
...
EduSpider.Services/ExamService.cs
View file @
64d3d841
...
...
@@ -23,27 +23,27 @@ namespace EduSpider.Services
/// 帐号仓储接口
/// </summary>
[
Autowired
]
private
IAccountRepository
a
ccountRepository
{
get
;
set
;
}
private
IAccountRepository
A
ccountRepository
{
get
;
set
;
}
/// <summary>
/// 考试
/// </summary>
[
Autowired
]
private
IExamRepository
e
xamRepository
{
get
;
set
;
}
private
IExamRepository
E
xamRepository
{
get
;
set
;
}
/// <summary>
/// 考试题目
/// </summary>
[
Autowired
]
private
IExam_QuestionsRepository
e
xam_QuestionsRepository
{
get
;
set
;
}
private
IExam_QuestionsRepository
E
xam_QuestionsRepository
{
get
;
set
;
}
/// <summary>
/// 考试得分
/// </summary>
[
Autowired
]
private
IExam_ScoreRepository
e
xam_ScoreRepository
{
get
;
set
;
}
private
IExam_ScoreRepository
E
xam_ScoreRepository
{
get
;
set
;
}
/// <summary>
/// 学生
/// </summary>
[
Autowired
]
private
IStudentRepository
s
tudentRepository
{
get
;
set
;
}
private
IStudentRepository
S
tudentRepository
{
get
;
set
;
}
/// <summary>
/// 获取考试分页列表
...
...
@@ -55,7 +55,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
List
<
RB_Exam_Extend
>
GetExamPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Exam_Extend
demodel
)
{
return
e
xamRepository
.
GetExamPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
return
E
xamRepository
.
GetExamPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
}
/// <summary>
...
...
@@ -66,14 +66,14 @@ namespace EduSpider.Services
/// <returns></returns>
public
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
)
{
var
stuModel
=
s
tudentRepository
.
GetEntity
(
stuId
);
var
stuModel
=
S
tudentRepository
.
GetEntity
(
stuId
);
if
(
stuModel
==
null
)
{
return
""
;
}
var
examModel
=
e
xamRepository
.
GetEntity
(
examId
);
var
examModel
=
E
xamRepository
.
GetEntity
(
examId
);
if
(
examModel
==
null
)
{
return
""
;
}
//考试题目
var
qlist
=
e
xam_QuestionsRepository
.
GetList
(
new
RB_Exam_Questions_Extend
()
{
ExamId
=
examId
});
var
qlist
=
E
xam_QuestionsRepository
.
GetList
(
new
RB_Exam_Questions_Extend
()
{
ExamId
=
examId
});
//考试成绩
var
sExamModel
=
e
xam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
StuId
=
stuId
}).
FirstOrDefault
();
var
sExamModel
=
E
xam_ScoreRepository
.
GetList
(
new
RB_Exam_Score_Extend
()
{
ExamId
=
examId
,
StuId
=
stuId
}).
FirstOrDefault
();
if
(
sExamModel
!=
null
)
{
sExamModel
.
ScoreList
=
JsonHelper
.
Deserialize
<
List
<
ExamQScoreModel
>>(
sExamModel
.
Content
);
foreach
(
var
qitem
in
sExamModel
.
ScoreList
)
{
...
...
@@ -90,7 +90,7 @@ namespace EduSpider.Services
{
StuId
=
stuModel
.
StudId
,
StuName
=
stuModel
.
StudentName
,
ExamName
=
examModel
.
ExamName
,
examModel
.
ExamName
,
sExamModel
?.
TScore
,
sExamModel
?.
Rank
,
sExamModel
?.
RankRate
,
...
...
@@ -137,7 +137,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
string
ImportExcelForStuExamScore
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
)
{
var
umodel
=
a
ccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
var
umodel
=
A
ccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
if
(
umodel
==
null
||
umodel
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
||
umodel
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
"没有权限操作"
;
}
var
EQlist
=
StuExamScoreHelper
.
GetStuExamScoreData
(
path_server
,
out
List
<
StuScoreModel
>
StuList
);
if
(
EQlist
.
Any
())
...
...
@@ -146,10 +146,10 @@ namespace EduSpider.Services
StuList
=
StuList
.
Where
(
x
=>
x
.
Name
!=
"平均分"
&&
!
string
.
IsNullOrWhiteSpace
(
x
.
Name
)).
ToList
();
//根据学生姓名 查询所有的学生账号
string
StuNames
=
"'"
+
string
.
Join
(
"','"
,
StuList
.
Select
(
x
=>
x
.
Name
).
Distinct
())
+
"'"
;
var
sList
=
s
tudentRepository
.
GetListForStuName
(
StuNames
);
var
sList
=
S
tudentRepository
.
GetListForStuName
(
StuNames
);
//插入考试
int
ExamId
=
e
xamRepository
.
Insert
(
new
Model
.
Entity
.
RB_Exam
()
int
ExamId
=
E
xamRepository
.
Insert
(
new
Model
.
Entity
.
RB_Exam
()
{
ExamId
=
0
,
CourseId
=
courseId
,
...
...
@@ -174,7 +174,7 @@ namespace EduSpider.Services
Sort
=
item
.
Id
});
}
e
xam_QuestionsRepository
.
BatchInsert
(
InsertEQ
);
E
xam_QuestionsRepository
.
BatchInsert
(
InsertEQ
);
decimal
ExamScore
=
InsertEQ
.
Sum
(
x
=>
x
.
Score
);
List
<
Model
.
Entity
.
RB_Exam_Score
>
InsertScore
=
new
();
...
...
@@ -201,7 +201,7 @@ namespace EduSpider.Services
});
}
//InsertScore = InsertScore.Where(x => x.StuId > 0).ToList();//暂时只插入匹配到学生的
e
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
E
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
}
return
""
;
...
...
@@ -222,7 +222,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
string
ImportExcelForStuExamScore_V2
(
string
path_server
,
int
courseId
,
string
examName
,
int
userId
)
{
var
umodel
=
a
ccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
var
umodel
=
A
ccountRepository
.
GetAccountList
(
new
Model
.
Extend
.
RB_Account_Extend
()
{
Id
=
userId
}).
FirstOrDefault
();
if
(
umodel
==
null
||
umodel
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
||
umodel
.
AccountType
!=
Utility
.
Enum
.
AccountTypeEnum
.
Teacher
)
{
return
"没有权限操作"
;
}
var
EQlist
=
StuExamScoreHelper
.
GetStuExamScoreData
(
path_server
,
out
List
<
StuScoreModel
>
StuList
);
if
(
EQlist
.
Any
())
...
...
@@ -231,10 +231,10 @@ namespace EduSpider.Services
StuList
=
StuList
.
Where
(
x
=>
x
.
Name
!=
"平均分"
&&
!
string
.
IsNullOrWhiteSpace
(
x
.
Name
)).
ToList
();
//根据学生姓名 查询所有的学生账号
string
StuNames
=
"'"
+
string
.
Join
(
"','"
,
StuList
.
Select
(
x
=>
x
.
Name
).
Distinct
())
+
"'"
;
var
sList
=
s
tudentRepository
.
GetListForStuName
(
StuNames
);
var
sList
=
S
tudentRepository
.
GetListForStuName
(
StuNames
);
//插入考试
int
ExamId
=
e
xamRepository
.
Insert
(
new
Model
.
Entity
.
RB_Exam
()
int
ExamId
=
E
xamRepository
.
Insert
(
new
Model
.
Entity
.
RB_Exam
()
{
ExamId
=
0
,
CourseId
=
courseId
,
...
...
@@ -260,7 +260,7 @@ namespace EduSpider.Services
Sort
=
item
.
Id
});
}
e
xam_QuestionsRepository
.
BatchInsert
(
InsertEQ
);
E
xam_QuestionsRepository
.
BatchInsert
(
InsertEQ
);
List
<
Model
.
Entity
.
RB_Exam_Score
>
InsertScore
=
new
();
//开始插入得分
...
...
@@ -277,7 +277,7 @@ namespace EduSpider.Services
StuName
=
item
.
Name
});
}
e
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
E
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
}
return
""
;
...
...
EduSpider.WebApi/Controllers/Student/ExamController.cs
View file @
64d3d841
...
...
@@ -20,7 +20,7 @@ namespace EduSpider.WebApi.Controllers
/// 考试
/// </summary>
[
Autowired
]
public
IExamService
e
xamService
{
get
;
set
;
}
public
IExamService
E
xamService
{
get
;
set
;
}
/// <summary>
/// 获取考试分页列表
...
...
@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers
ResultPageModel
pmodel
=
JsonHelper
.
Deserialize
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
RB_Exam_Extend
demodel
=
JsonHelper
.
Deserialize
<
RB_Exam_Extend
>(
RequestParm
.
Msg
.
ToString
());
var
list
=
e
xamService
.
GetExamPageList
(
pmodel
.
PageIndex
,
pmodel
.
PageSize
,
out
long
count
,
demodel
);
var
list
=
E
xamService
.
GetExamPageList
(
pmodel
.
PageIndex
,
pmodel
.
PageSize
,
out
long
count
,
demodel
);
pmodel
.
RowsCount
=
count
;
pmodel
.
PageData
=
list
.
Select
(
x
=>
new
{
...
...
@@ -69,7 +69,7 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
ParamIsNull
();
}
var
robj
=
e
xamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
);
var
robj
=
E
xamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
);
return
ApiResult
.
Success
(
""
,
robj
);
}
...
...
EduSpider.WebApi/Controllers/Upload/UploadController.cs
View file @
64d3d841
...
...
@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers
/// 考试
/// </summary>
[
Autowired
]
public
IExamService
e
xamService
{
get
;
set
;
}
public
IExamService
E
xamService
{
get
;
set
;
}
/// <summary>
...
...
@@ -89,7 +89,7 @@ namespace EduSpider.WebApi.Controllers
}
#
region
解析文档数据并保存
string
rmsg
=
e
xamService
.
ImportExcelForStuExamScore
(
path_server
,
CourseId
,
ExamName
,
UserId
);
string
rmsg
=
E
xamService
.
ImportExcelForStuExamScore
(
path_server
,
CourseId
,
ExamName
,
UserId
);
if
(
rmsg
==
""
)
{
return
ApiResult
.
Success
();
...
...
@@ -121,7 +121,7 @@ namespace EduSpider.WebApi.Controllers
string
path_server
=
"C:/Users/Administrator/Desktop/TempFile/化学成绩查询表.xlsx"
;
#
region
解析文档数据并保存
string
rmsg
=
e
xamService
.
ImportExcelForStuExamScore
(
path_server
,
44977497
,
"测试考试化学2"
,
11759328
);
string
rmsg
=
E
xamService
.
ImportExcelForStuExamScore
(
path_server
,
44977497
,
"测试考试化学2"
,
11759328
);
if
(
rmsg
==
""
)
{
return
ApiResult
.
Success
();
...
...
EduSpider.WebApi/Controllers/User/LoginController.cs
View file @
64d3d841
...
...
@@ -28,7 +28,7 @@ namespace EduSpider.WebApi.Controllers
/// 账号仓储接口
/// </summary>
[
Autowired
]
public
IAccountService
a
ccountService
{
get
;
set
;
}
public
IAccountService
A
ccountService
{
get
;
set
;
}
#
region
账号密码登录
/// <summary>
...
...
@@ -46,7 +46,7 @@ namespace EduSpider.WebApi.Controllers
string
UnionId
=
jobj
.
GetString
(
"UnionId"
);
string
OpenId
=
jobj
.
GetString
(
"OpenId"
);
var
model
=
a
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
var
model
=
A
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
{
Account
=
account
.
Trim
()
}).
FirstOrDefault
();
...
...
@@ -68,7 +68,7 @@ namespace EduSpider.WebApi.Controllers
{
model
.
UnionId
=
UnionId
;
model
.
OpenId
=
OpenId
;
a
ccountService
.
UpdateAccountUnionId
(
model
);
A
ccountService
.
UpdateAccountUnionId
(
model
);
}
if
(
model
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
)
{
...
...
@@ -117,7 +117,7 @@ namespace EduSpider.WebApi.Controllers
{
return
ApiResult
.
Failed
(
message
:
"手机号码登录失败、跳转至账号登录"
,
new
{
Error
=
-
1
});
}
var
model
=
a
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
var
model
=
A
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
{
Account
=
account
.
Trim
()
})?.
FirstOrDefault
();
...
...
@@ -138,7 +138,7 @@ namespace EduSpider.WebApi.Controllers
{
model
.
UnionId
=
UnionId
;
model
.
OpenId
=
OpenId
;
a
ccountService
.
UpdateAccountUnionId
(
model
);
A
ccountService
.
UpdateAccountUnionId
(
model
);
}
if
(
model
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
)
{
...
...
@@ -181,7 +181,7 @@ namespace EduSpider.WebApi.Controllers
string
code
=
parms
.
GetString
(
"code"
);
string
encryptedData
=
parms
.
GetString
(
"encryptedData"
);
string
iv
=
parms
.
GetString
(
"iv"
);
result
res
=
new
result
()
result
res
=
new
()
{
phoneNumber
=
""
,
openid
=
""
...
...
@@ -293,7 +293,7 @@ namespace EduSpider.WebApi.Controllers
{
return
ApiResult
.
Failed
(
message
:
"手机号码登录失败、跳转至账号登录"
,
new
{
Error
=
-
1
});
}
var
model
=
a
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
var
model
=
A
ccountService
.
GetAccountList
(
new
RB_Account_Extend
()
{
Account
=
account
.
Trim
()
})?.
FirstOrDefault
();
...
...
@@ -314,7 +314,7 @@ namespace EduSpider.WebApi.Controllers
{
model
.
UnionId
=
UnionId
;
model
.
OpenId
=
OpenId
;
a
ccountService
.
UpdateAccountUnionId
(
model
);
A
ccountService
.
UpdateAccountUnionId
(
model
);
}
if
(
model
.
Status
==
Utility
.
Enum
.
DateStateEnum
.
Delete
)
{
...
...
EduSpider.WebApi/Startup.cs
View file @
64d3d841
...
...
@@ -34,7 +34,7 @@ namespace EduSpider.WebApi
//ActoFac注入
services
.
Replace
(
ServiceDescriptor
.
Transient
<
IControllerActivator
,
ServiceBasedControllerActivator
>());
List
<
string
>
corsArray
=
new
List
<
string
>
()
List
<
string
>
corsArray
=
new
()
{
"http://localhost:7100"
,
"http://localhost:7200"
,
...
...
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