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
ef1fbd79
Commit
ef1fbd79
authored
May 27, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
3449bf12
dbc12ecd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
215 additions
and
102 deletions
+215
-102
IExam_ScoreRepository.cs
EduSpider.IRepository/IExam_ScoreRepository.cs
+11
-5
ExamWorkResult.cs
EduSpider.Model/Extend/ExamWorkResult.cs
+10
-0
RB_Exam_Score_Extend.cs
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
+57
-46
Exam_ScoreRepository.cs
EduSpider.Repository/Exam_ScoreRepository.cs
+30
-2
CourseService.cs
EduSpider.Services/CourseService.cs
+66
-8
ExamService.cs
EduSpider.Services/ExamService.cs
+24
-24
ExamController.cs
EduSpider.WebApi/Controllers/Student/ExamController.cs
+5
-5
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 @
ef1fbd79
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
System
;
using
EduSpider.Model.Query
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
...
...
@@ -15,6 +12,15 @@ namespace EduSpider.Repository
/// </summary>
public
interface
IExam_ScoreRepository
:
IDBRepository
<
RB_Exam_Score
>,
IDependency
{
List
<
RB_Exam_Score_Extend
>
GetList
(
RB_Exam_Score_Extend
rB_Exam_Score_Extend
);
/// <summary>
/// 学生考试查询
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Exam_Score_Extend
>
GetExamScoreListRepository
(
CourseQuery
query
);
public
List
<
RB_Exam_Score_Extend
>
GetList
(
RB_Exam_Score_Extend
rB_Exam_Score_Extend
);
}
}
EduSpider.Model/Extend/ExamWorkResult.cs
View file @
ef1fbd79
...
...
@@ -116,5 +116,15 @@ namespace EduSpider.Model.Extend
return
str
;
}
}
/// <summary>
/// 考试排名
/// </summary>
public
int
ExamRank
{
get
;
set
;
}
/// <summary>
/// 考试领先度
/// </summary>
public
decimal
ExamRankRate
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Exam_Score_Extend.cs
View file @
ef1fbd79
...
...
@@ -5,50 +5,61 @@ using VTX.FW.Attr;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 考试分数扩展
/// </summary>
public
class
RB_Exam_Score_Extend
:
RB_Exam_Score
{
public
List
<
ExamQScoreModel
>
ScoreList
{
get
;
set
;
}
}
/// <summary>
/// 学生单项分数
/// </summary>
public
class
ExamQScoreModel
{
/// <summary>
/// 题号
/// </summary>
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 得分
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 平均得分
/// </summary>
public
decimal
AvgScore
{
get
;
set
;
}
/// <summary>
/// 难度
/// </summary>
public
string
Difficulty
{
get
;
set
;
}
/// <summary>
/// 知识点
/// </summary>
public
string
KnowledgePoint
{
get
;
set
;
}
/// <summary>
/// 归属模块
/// </summary>
public
string
Module
{
get
;
set
;
}
/// <summary>
/// 题目分数
/// </summary>
public
decimal
QScore
{
get
;
set
;
}
}
/// <summary>
/// 考试分数扩展
/// </summary>
public
class
RB_Exam_Score_Extend
:
RB_Exam_Score
{
/// <summary>
/// 考试名称
/// </summary>
public
string
ExamName
{
get
;
set
;
}
public
List
<
ExamQScoreModel
>
ScoreList
{
get
;
set
;
}
/// <summary>
/// 考试导入时间
/// </summary>
public
DateTime
ExamCreateTime
{
get
;
set
;
}
}
/// <summary>
/// 学生单项分数
/// </summary>
public
class
ExamQScoreModel
{
/// <summary>
/// 题号
/// </summary>
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 得分
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 平均得分
/// </summary>
public
decimal
AvgScore
{
get
;
set
;
}
/// <summary>
/// 难度
/// </summary>
public
string
Difficulty
{
get
;
set
;
}
/// <summary>
/// 知识点
/// </summary>
public
string
KnowledgePoint
{
get
;
set
;
}
/// <summary>
/// 归属模块
/// </summary>
public
string
Module
{
get
;
set
;
}
/// <summary>
/// 题目分数
/// </summary>
public
decimal
QScore
{
get
;
set
;
}
}
}
EduSpider.Repository/Exam_ScoreRepository.cs
View file @
ef1fbd79
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository.Base
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VTX.FW.DB.Dapper
;
namespace
EduSpider.Repository
...
...
@@ -15,6 +14,35 @@ namespace EduSpider.Repository
/// </summary>
public
class
Exam_ScoreRepository
:
BaseRepository
<
RB_Exam_Score
>,
IExam_ScoreRepository
{
/// <summary>
/// 学生考试查询
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Exam_Score_Extend
>
GetExamScoreListRepository
(
CourseQuery
query
)
{
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
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND B.{0}={1} "
,
nameof
(
RB_Exam
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StuIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Exam_Score_Extend
.
StuUId
),
query
.
StuIds
);
}
}
return
Get
<
RB_Exam_Score_Extend
>(
builder
.
ToString
()).
ToList
();
}
public
List
<
RB_Exam_Score_Extend
>
GetList
(
RB_Exam_Score_Extend
dmodel
)
{
var
parameters
=
new
DynamicParameters
();
...
...
EduSpider.Services/CourseService.cs
View file @
ef1fbd79
...
...
@@ -49,6 +49,12 @@ namespace EduSpider.Services
[
Autowired
]
public
IHomeWorkRepository
HomeWorkRepository
{
get
;
set
;
}
/// <summary>
/// 学生考试仓储接口
/// </summary>
[
Autowired
]
public
IExam_ScoreRepository
Exam_ScoreRepository
{
get
;
set
;
}
/// <summary>
/// 获取学员课程列表
...
...
@@ -86,24 +92,76 @@ namespace EduSpider.Services
{
dataList
.
AddRange
(
homeWorkList
);
}
var
examList
=
Exam_ScoreRepository
.
GetExamScoreListRepository
(
query
);
if
(
examList
!=
null
&&
examList
.
Count
>
0
)
{
foreach
(
var
item
in
examList
)
{
decimal
score_p
=
0
;
if
(
item
.
ExamScore
>
0
)
{
score_p
=
Math
.
Round
(
item
.
TScore
/
item
.
ExamScore
,
4
);
}
dataList
.
Add
(
new
ExamWorkResult
()
{
ResultType
=
2
,
Title
=
item
.
ExamName
,
CreateTime
=
item
.
ExamCreateTime
,
Score
=
item
.
TScore
,
Score_p
=
score_p
,
ExamRank
=
item
.
Rank
,
ExamRankRate
=
item
.
RankRate
,
});
}
}
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
dataList
=
dataList
.
OrderBy
(
qitem
=>
qitem
.
CreateTime
).
ToList
();
foreach
(
var
item
in
dataList
)
{
object
obj
=
new
();
//家庭作业
if
(
item
.
ResultType
==
1
)
{
obj
=
new
{
item
.
Score
,
item
.
Score_p
,
item
.
ScoreType
,
item
.
ScoreTypeStr
,
item
.
Score_Value
,
item
.
HomeWorkStatus
,
item
.
HomeWorkStatusStr
,
};
}
//考试
if
(
item
.
ResultType
==
2
)
{
obj
=
new
{
item
.
Score
,
item
.
Score_p
,
item
.
ExamRank
,
item
.
ExamRankRate
,
};
}
//评语
if
(
item
.
ResultType
==
3
)
{
obj
=
new
{
item
.
Comment
};
}
list
.
Add
(
new
{
item
.
ResultType
,
item
.
ResultTypeStr
,
item
.
Title
,
CreateTime
=
VTX
.
FW
.
Helper
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
,
2
),
item
.
Score
,
item
.
Score_p
,
item
.
ScoreType
,
item
.
ScoreTypeStr
,
item
.
Score_Value
,
item
.
HomeWorkStatus
,
item
.
HomeWorkStatusStr
,
item
.
Comment
,
DataObj
=
obj
});
}
}
...
...
EduSpider.Services/ExamService.cs
View file @
ef1fbd79
...
...
@@ -24,27 +24,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>
/// 获取考试分页列表
...
...
@@ -56,7 +56,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,7 +66,7 @@ namespace EduSpider.Services
/// <returns></returns>
public
List
<
RB_Exam_Score_Extend
>
GetExamStuList
(
RB_Exam_Score_Extend
demodel
)
{
return
e
xam_ScoreRepository
.
GetList
(
demodel
);
return
E
xam_ScoreRepository
.
GetList
(
demodel
);
}
/// <summary>
...
...
@@ -79,18 +79,18 @@ namespace EduSpider.Services
public
object
GetExamStuScoreInfo
(
int
examId
,
int
stuId
,
int
stuUId
)
{
if
(
stuUId
>
0
)
{
var
accountModel
=
a
ccountRepository
.
GetAccountList
(
new
RB_Account_Extend
()
{
Id
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
var
accountModel
=
A
ccountRepository
.
GetAccountList
(
new
RB_Account_Extend
()
{
Id
=
stuUId
,
AccountType
=
Utility
.
Enum
.
AccountTypeEnum
.
Student
}).
FirstOrDefault
();
if
(
accountModel
==
null
)
{
return
""
;
}
stuId
=
accountModel
.
AccountId
;
}
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
)
{
...
...
@@ -107,7 +107,7 @@ namespace EduSpider.Services
{
StuId
=
stuModel
.
StudId
,
StuName
=
stuModel
.
StudentName
,
ExamName
=
examModel
.
ExamName
,
examModel
.
ExamName
,
sExamModel
?.
TScore
,
sExamModel
?.
Rank
,
sExamModel
?.
RankRate
,
...
...
@@ -165,7 +165,7 @@ namespace EduSpider.Services
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
e
xamRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
E
xamRepository
.
Update
(
keyValues
,
wheres
);
return
flag
?
""
:
"出错了,请联系管理员"
;
}
...
...
@@ -177,7 +177,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
())
...
...
@@ -186,10 +186,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
,
...
...
@@ -214,7 +214,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
();
...
...
@@ -241,7 +241,7 @@ namespace EduSpider.Services
});
}
//InsertScore = InsertScore.Where(x => x.StuId > 0).ToList();//暂时只插入匹配到学生的
e
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
E
xam_ScoreRepository
.
BatchInsert
(
InsertScore
);
}
return
""
;
...
...
@@ -262,7 +262,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
())
...
...
@@ -271,10 +271,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
,
...
...
@@ -300,7 +300,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
();
//开始插入得分
...
...
@@ -317,7 +317,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 @
ef1fbd79
...
...
@@ -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
{
...
...
@@ -57,7 +57,7 @@ namespace EduSpider.WebApi.Controllers
{
return
ApiResult
.
ParamIsNull
();
}
var
list
=
e
xamService
.
GetExamStuList
(
demodel
);
var
list
=
E
xamService
.
GetExamStuList
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
x
.
Id
,
...
...
@@ -88,7 +88,7 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
ParamIsNull
();
}
var
robj
=
e
xamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
,
StuUId
);
var
robj
=
E
xamService
.
GetExamStuScoreInfo
(
ExamId
,
StuId
,
StuUId
);
return
ApiResult
.
Success
(
""
,
robj
);
}
...
...
@@ -108,7 +108,7 @@ namespace EduSpider.WebApi.Controllers
return
ApiResult
.
ParamIsNull
(
"非老师账户,无法操作"
);
}
string
rmsg
=
e
xamService
.
DelExamInfo
(
ExamId
,
base
.
BaseUserId
);
string
rmsg
=
E
xamService
.
DelExamInfo
(
ExamId
,
base
.
BaseUserId
);
if
(
rmsg
==
""
)
{
return
ApiResult
.
Success
();
...
...
EduSpider.WebApi/Controllers/Upload/UploadController.cs
View file @
ef1fbd79
...
...
@@ -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
==
""
)
{
try
...
...
@@ -129,7 +129,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 @
ef1fbd79
...
...
@@ -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 @
ef1fbd79
...
...
@@ -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