Commit ef1fbd79 authored by liudong1993's avatar liudong1993

1

parents 3449bf12 dbc12ecd
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Extend; using EduSpider.Model.Extend;
using System; using EduSpider.Model.Query;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.Config; using VTX.FW.Config;
using VTX.FW.DB; using VTX.FW.DB;
...@@ -15,6 +12,15 @@ namespace EduSpider.Repository ...@@ -15,6 +12,15 @@ namespace EduSpider.Repository
/// </summary> /// </summary>
public interface IExam_ScoreRepository : IDBRepository<RB_Exam_Score>, IDependency 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);
} }
} }
...@@ -116,5 +116,15 @@ namespace EduSpider.Model.Extend ...@@ -116,5 +116,15 @@ namespace EduSpider.Model.Extend
return str; return str;
} }
} }
/// <summary>
/// 考试排名
/// </summary>
public int ExamRank { get; set; }
/// <summary>
/// 考试领先度
/// </summary>
public decimal ExamRankRate { get; set; }
} }
} }
...@@ -10,14 +10,25 @@ namespace EduSpider.Model.Extend ...@@ -10,14 +10,25 @@ namespace EduSpider.Model.Extend
/// </summary> /// </summary>
public class RB_Exam_Score_Extend : RB_Exam_Score public class RB_Exam_Score_Extend : RB_Exam_Score
{ {
/// <summary>
/// 考试名称
/// </summary>
public string ExamName { get; set; }
public List<ExamQScoreModel> ScoreList { get; set; } public List<ExamQScoreModel> ScoreList { get; set; }
/// <summary>
/// 考试导入时间
/// </summary>
public DateTime ExamCreateTime { get; set; }
} }
/// <summary> /// <summary>
/// 学生单项分数 /// 学生单项分数
/// </summary> /// </summary>
public class ExamQScoreModel { public class ExamQScoreModel
{
/// <summary> /// <summary>
/// 题号 /// 题号
/// </summary> /// </summary>
......
using EduSpider.Model.Entity; using EduSpider.Model.Entity;
using EduSpider.Model.Extend; using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using EduSpider.Repository.Base; using EduSpider.Repository.Base;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using VTX.FW.DB.Dapper; using VTX.FW.DB.Dapper;
namespace EduSpider.Repository namespace EduSpider.Repository
...@@ -15,6 +14,35 @@ namespace EduSpider.Repository ...@@ -15,6 +14,35 @@ namespace EduSpider.Repository
/// </summary> /// </summary>
public class Exam_ScoreRepository : BaseRepository<RB_Exam_Score>, IExam_ScoreRepository 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) public List<RB_Exam_Score_Extend> GetList(RB_Exam_Score_Extend dmodel)
{ {
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
......
...@@ -49,6 +49,12 @@ namespace EduSpider.Services ...@@ -49,6 +49,12 @@ namespace EduSpider.Services
[Autowired] [Autowired]
public IHomeWorkRepository HomeWorkRepository { get; set; } public IHomeWorkRepository HomeWorkRepository { get; set; }
/// <summary>
/// 学生考试仓储接口
/// </summary>
[Autowired]
public IExam_ScoreRepository Exam_ScoreRepository { get; set; }
/// <summary> /// <summary>
/// 获取学员课程列表 /// 获取学员课程列表
...@@ -86,16 +92,40 @@ namespace EduSpider.Services ...@@ -86,16 +92,40 @@ namespace EduSpider.Services
{ {
dataList.AddRange(homeWorkList); 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) if (dataList != null && dataList.Count > 0)
{ {
dataList = dataList.OrderBy(qitem => qitem.CreateTime).ToList();
foreach (var item in dataList) foreach (var item in dataList)
{ {
list.Add(new object obj = new();
//家庭作业
if (item.ResultType == 1)
{
obj = new
{ {
item.ResultType,
item.ResultTypeStr,
item.Title,
CreateTime = VTX.FW.Helper.ConvertHelper.FormatTime(item.CreateTime, 2),
item.Score, item.Score,
item.Score_p, item.Score_p,
item.ScoreType, item.ScoreType,
...@@ -103,7 +133,35 @@ namespace EduSpider.Services ...@@ -103,7 +133,35 @@ namespace EduSpider.Services
item.Score_Value, item.Score_Value,
item.HomeWorkStatus, item.HomeWorkStatus,
item.HomeWorkStatusStr, item.HomeWorkStatusStr,
item.Comment, };
}
//考试
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),
DataObj = obj
}); });
} }
} }
......
...@@ -24,27 +24,27 @@ namespace EduSpider.Services ...@@ -24,27 +24,27 @@ namespace EduSpider.Services
/// 帐号仓储接口 /// 帐号仓储接口
/// </summary> /// </summary>
[Autowired] [Autowired]
private IAccountRepository accountRepository { get; set; } private IAccountRepository AccountRepository { get; set; }
/// <summary> /// <summary>
/// 考试 /// 考试
/// </summary> /// </summary>
[Autowired] [Autowired]
private IExamRepository examRepository { get; set; } private IExamRepository ExamRepository { get; set; }
/// <summary> /// <summary>
/// 考试题目 /// 考试题目
/// </summary> /// </summary>
[Autowired] [Autowired]
private IExam_QuestionsRepository exam_QuestionsRepository { get; set; } private IExam_QuestionsRepository Exam_QuestionsRepository { get; set; }
/// <summary> /// <summary>
/// 考试得分 /// 考试得分
/// </summary> /// </summary>
[Autowired] [Autowired]
private IExam_ScoreRepository exam_ScoreRepository { get; set; } private IExam_ScoreRepository Exam_ScoreRepository { get; set; }
/// <summary> /// <summary>
/// 学生 /// 学生
/// </summary> /// </summary>
[Autowired] [Autowired]
private IStudentRepository studentRepository { get; set; } private IStudentRepository StudentRepository { get; set; }
/// <summary> /// <summary>
/// 获取考试分页列表 /// 获取考试分页列表
...@@ -56,7 +56,7 @@ namespace EduSpider.Services ...@@ -56,7 +56,7 @@ namespace EduSpider.Services
/// <returns></returns> /// <returns></returns>
public List<RB_Exam_Extend> GetExamPageList(int pageIndex, int pageSize, out long count, RB_Exam_Extend demodel) public List<RB_Exam_Extend> GetExamPageList(int pageIndex, int pageSize, out long count, RB_Exam_Extend demodel)
{ {
return examRepository.GetExamPageList(pageIndex, pageSize, out count, demodel); return ExamRepository.GetExamPageList(pageIndex, pageSize, out count, demodel);
} }
/// <summary> /// <summary>
...@@ -66,7 +66,7 @@ namespace EduSpider.Services ...@@ -66,7 +66,7 @@ namespace EduSpider.Services
/// <returns></returns> /// <returns></returns>
public List<RB_Exam_Score_Extend> GetExamStuList(RB_Exam_Score_Extend demodel) public List<RB_Exam_Score_Extend> GetExamStuList(RB_Exam_Score_Extend demodel)
{ {
return exam_ScoreRepository.GetList(demodel); return Exam_ScoreRepository.GetList(demodel);
} }
/// <summary> /// <summary>
...@@ -79,18 +79,18 @@ namespace EduSpider.Services ...@@ -79,18 +79,18 @@ namespace EduSpider.Services
public object GetExamStuScoreInfo(int examId, int stuId, int stuUId) public object GetExamStuScoreInfo(int examId, int stuId, int stuUId)
{ {
if (stuUId > 0) { if (stuUId > 0) {
var accountModel = accountRepository.GetAccountList(new RB_Account_Extend() { Id = stuUId, AccountType = Utility.Enum.AccountTypeEnum.Student }).FirstOrDefault(); var accountModel = AccountRepository.GetAccountList(new RB_Account_Extend() { Id = stuUId, AccountType = Utility.Enum.AccountTypeEnum.Student }).FirstOrDefault();
if (accountModel == null) { return ""; } if (accountModel == null) { return ""; }
stuId = accountModel.AccountId; stuId = accountModel.AccountId;
} }
var stuModel = studentRepository.GetEntity(stuId); var stuModel = StudentRepository.GetEntity(stuId);
if (stuModel == null) { return ""; } if (stuModel == null) { return ""; }
var examModel = examRepository.GetEntity(examId); var examModel = ExamRepository.GetEntity(examId);
if (examModel == null) { return ""; } if (examModel == null) { return ""; }
//考试题目 //考试题目
var qlist = exam_QuestionsRepository.GetList(new RB_Exam_Questions_Extend() { ExamId = examId }); var qlist = Exam_QuestionsRepository.GetList(new RB_Exam_Questions_Extend() { ExamId = examId });
//考试成绩 //考试成绩
var sExamModel = exam_ScoreRepository.GetList(new RB_Exam_Score_Extend() { ExamId = examId, StuId = stuId }).FirstOrDefault(); var sExamModel = Exam_ScoreRepository.GetList(new RB_Exam_Score_Extend() { ExamId = examId, StuId = stuId }).FirstOrDefault();
if (sExamModel != null) { if (sExamModel != null) {
sExamModel.ScoreList = JsonHelper.Deserialize<List<ExamQScoreModel>>(sExamModel.Content); sExamModel.ScoreList = JsonHelper.Deserialize<List<ExamQScoreModel>>(sExamModel.Content);
foreach (var qitem in sExamModel.ScoreList) { foreach (var qitem in sExamModel.ScoreList) {
...@@ -107,7 +107,7 @@ namespace EduSpider.Services ...@@ -107,7 +107,7 @@ namespace EduSpider.Services
{ {
StuId = stuModel.StudId, StuId = stuModel.StudId,
StuName = stuModel.StudentName, StuName = stuModel.StudentName,
ExamName = examModel.ExamName, examModel.ExamName,
sExamModel?.TScore, sExamModel?.TScore,
sExamModel?.Rank, sExamModel?.Rank,
sExamModel?.RankRate, sExamModel?.RankRate,
...@@ -165,7 +165,7 @@ namespace EduSpider.Services ...@@ -165,7 +165,7 @@ namespace EduSpider.Services
OperatorEnum =OperatorEnum.Equal OperatorEnum =OperatorEnum.Equal
} }
}; };
bool flag = examRepository.Update(keyValues, wheres); bool flag = ExamRepository.Update(keyValues, wheres);
return flag ? "" : "出错了,请联系管理员"; return flag ? "" : "出错了,请联系管理员";
} }
...@@ -177,7 +177,7 @@ namespace EduSpider.Services ...@@ -177,7 +177,7 @@ namespace EduSpider.Services
/// <returns></returns> /// <returns></returns>
public string ImportExcelForStuExamScore(string path_server,int courseId, string examName, int userId) public string ImportExcelForStuExamScore(string path_server,int courseId, string examName, int userId)
{ {
var umodel = accountRepository.GetAccountList(new Model.Extend.RB_Account_Extend() { Id = userId }).FirstOrDefault(); var umodel = AccountRepository.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 "没有权限操作"; } 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); var EQlist = StuExamScoreHelper.GetStuExamScoreData(path_server, out List<StuScoreModel> StuList);
if (EQlist.Any()) if (EQlist.Any())
...@@ -186,10 +186,10 @@ namespace EduSpider.Services ...@@ -186,10 +186,10 @@ namespace EduSpider.Services
StuList = StuList.Where(x => x.Name != "平均分" && !string.IsNullOrWhiteSpace(x.Name)).ToList(); StuList = StuList.Where(x => x.Name != "平均分" && !string.IsNullOrWhiteSpace(x.Name)).ToList();
//根据学生姓名 查询所有的学生账号 //根据学生姓名 查询所有的学生账号
string StuNames = "'" + string.Join("','", StuList.Select(x => x.Name).Distinct()) + "'"; string StuNames = "'" + string.Join("','", StuList.Select(x => x.Name).Distinct()) + "'";
var sList = studentRepository.GetListForStuName(StuNames); var sList = StudentRepository.GetListForStuName(StuNames);
//插入考试 //插入考试
int ExamId = examRepository.Insert(new Model.Entity.RB_Exam() int ExamId = ExamRepository.Insert(new Model.Entity.RB_Exam()
{ {
ExamId = 0, ExamId = 0,
CourseId = courseId, CourseId = courseId,
...@@ -214,7 +214,7 @@ namespace EduSpider.Services ...@@ -214,7 +214,7 @@ namespace EduSpider.Services
Sort = item.Id Sort = item.Id
}); });
} }
exam_QuestionsRepository.BatchInsert(InsertEQ); Exam_QuestionsRepository.BatchInsert(InsertEQ);
decimal ExamScore = InsertEQ.Sum(x => x.Score); decimal ExamScore = InsertEQ.Sum(x => x.Score);
List<Model.Entity.RB_Exam_Score> InsertScore = new(); List<Model.Entity.RB_Exam_Score> InsertScore = new();
...@@ -241,7 +241,7 @@ namespace EduSpider.Services ...@@ -241,7 +241,7 @@ namespace EduSpider.Services
}); });
} }
//InsertScore = InsertScore.Where(x => x.StuId > 0).ToList();//暂时只插入匹配到学生的 //InsertScore = InsertScore.Where(x => x.StuId > 0).ToList();//暂时只插入匹配到学生的
exam_ScoreRepository.BatchInsert(InsertScore); Exam_ScoreRepository.BatchInsert(InsertScore);
} }
return ""; return "";
...@@ -262,7 +262,7 @@ namespace EduSpider.Services ...@@ -262,7 +262,7 @@ namespace EduSpider.Services
/// <returns></returns> /// <returns></returns>
public string ImportExcelForStuExamScore_V2(string path_server, int courseId, string examName, int userId) public string ImportExcelForStuExamScore_V2(string path_server, int courseId, string examName, int userId)
{ {
var umodel = accountRepository.GetAccountList(new Model.Extend.RB_Account_Extend() { Id = userId }).FirstOrDefault(); var umodel = AccountRepository.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 "没有权限操作"; } 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); var EQlist = StuExamScoreHelper.GetStuExamScoreData(path_server, out List<StuScoreModel> StuList);
if (EQlist.Any()) if (EQlist.Any())
...@@ -271,10 +271,10 @@ namespace EduSpider.Services ...@@ -271,10 +271,10 @@ namespace EduSpider.Services
StuList = StuList.Where(x => x.Name != "平均分" && !string.IsNullOrWhiteSpace(x.Name)).ToList(); StuList = StuList.Where(x => x.Name != "平均分" && !string.IsNullOrWhiteSpace(x.Name)).ToList();
//根据学生姓名 查询所有的学生账号 //根据学生姓名 查询所有的学生账号
string StuNames = "'" + string.Join("','", StuList.Select(x => x.Name).Distinct()) + "'"; string StuNames = "'" + string.Join("','", StuList.Select(x => x.Name).Distinct()) + "'";
var sList = studentRepository.GetListForStuName(StuNames); var sList = StudentRepository.GetListForStuName(StuNames);
//插入考试 //插入考试
int ExamId = examRepository.Insert(new Model.Entity.RB_Exam() int ExamId = ExamRepository.Insert(new Model.Entity.RB_Exam()
{ {
ExamId = 0, ExamId = 0,
CourseId = courseId, CourseId = courseId,
...@@ -300,7 +300,7 @@ namespace EduSpider.Services ...@@ -300,7 +300,7 @@ namespace EduSpider.Services
Sort = item.Id Sort = item.Id
}); });
} }
exam_QuestionsRepository.BatchInsert(InsertEQ); Exam_QuestionsRepository.BatchInsert(InsertEQ);
List<Model.Entity.RB_Exam_Score> InsertScore = new(); List<Model.Entity.RB_Exam_Score> InsertScore = new();
//开始插入得分 //开始插入得分
...@@ -317,7 +317,7 @@ namespace EduSpider.Services ...@@ -317,7 +317,7 @@ namespace EduSpider.Services
StuName = item.Name StuName = item.Name
}); });
} }
exam_ScoreRepository.BatchInsert(InsertScore); Exam_ScoreRepository.BatchInsert(InsertScore);
} }
return ""; return "";
......
...@@ -20,7 +20,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -20,7 +20,7 @@ namespace EduSpider.WebApi.Controllers
/// 考试 /// 考试
/// </summary> /// </summary>
[Autowired] [Autowired]
public IExamService examService { get; set; } public IExamService ExamService { get; set; }
/// <summary> /// <summary>
/// 获取考试分页列表 /// 获取考试分页列表
...@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers
ResultPageModel pmodel = JsonHelper.Deserialize<ResultPageModel>(RequestParm.Msg.ToString()); ResultPageModel pmodel = JsonHelper.Deserialize<ResultPageModel>(RequestParm.Msg.ToString());
RB_Exam_Extend demodel = JsonHelper.Deserialize<RB_Exam_Extend>(RequestParm.Msg.ToString()); RB_Exam_Extend demodel = JsonHelper.Deserialize<RB_Exam_Extend>(RequestParm.Msg.ToString());
var list = examService.GetExamPageList(pmodel.PageIndex, pmodel.PageSize, out long count, demodel); var list = ExamService.GetExamPageList(pmodel.PageIndex, pmodel.PageSize, out long count, demodel);
pmodel.RowsCount = count; pmodel.RowsCount = count;
pmodel.PageData = list.Select(x => new pmodel.PageData = list.Select(x => new
{ {
...@@ -57,7 +57,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -57,7 +57,7 @@ namespace EduSpider.WebApi.Controllers
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
var list = examService.GetExamStuList(demodel); var list = ExamService.GetExamStuList(demodel);
return ApiResult.Success("", list.Select(x => new return ApiResult.Success("", list.Select(x => new
{ {
x.Id, x.Id,
...@@ -88,7 +88,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -88,7 +88,7 @@ namespace EduSpider.WebApi.Controllers
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
var robj = examService.GetExamStuScoreInfo(ExamId, StuId, StuUId); var robj = ExamService.GetExamStuScoreInfo(ExamId, StuId, StuUId);
return ApiResult.Success("", robj); return ApiResult.Success("", robj);
} }
...@@ -108,7 +108,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -108,7 +108,7 @@ namespace EduSpider.WebApi.Controllers
return ApiResult.ParamIsNull("非老师账户,无法操作"); return ApiResult.ParamIsNull("非老师账户,无法操作");
} }
string rmsg = examService.DelExamInfo(ExamId, base.BaseUserId); string rmsg = ExamService.DelExamInfo(ExamId, base.BaseUserId);
if (rmsg == "") if (rmsg == "")
{ {
return ApiResult.Success(); return ApiResult.Success();
......
...@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -32,7 +32,7 @@ namespace EduSpider.WebApi.Controllers
/// 考试 /// 考试
/// </summary> /// </summary>
[Autowired] [Autowired]
public IExamService examService { get; set; } public IExamService ExamService { get; set; }
/// <summary> /// <summary>
...@@ -89,7 +89,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -89,7 +89,7 @@ namespace EduSpider.WebApi.Controllers
} }
#region 解析文档数据并保存 #region 解析文档数据并保存
string rmsg = examService.ImportExcelForStuExamScore(path_server, CourseId, ExamName, UserId); string rmsg = ExamService.ImportExcelForStuExamScore(path_server, CourseId, ExamName, UserId);
if (rmsg == "") if (rmsg == "")
{ {
try try
...@@ -129,7 +129,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -129,7 +129,7 @@ namespace EduSpider.WebApi.Controllers
string path_server = "C:/Users/Administrator/Desktop/TempFile/化学成绩查询表.xlsx"; string path_server = "C:/Users/Administrator/Desktop/TempFile/化学成绩查询表.xlsx";
#region 解析文档数据并保存 #region 解析文档数据并保存
string rmsg = examService.ImportExcelForStuExamScore(path_server, 44977497, "测试考试化学2", 11759328); string rmsg = ExamService.ImportExcelForStuExamScore(path_server, 44977497, "测试考试化学2", 11759328);
if (rmsg == "") if (rmsg == "")
{ {
return ApiResult.Success(); return ApiResult.Success();
......
...@@ -28,7 +28,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -28,7 +28,7 @@ namespace EduSpider.WebApi.Controllers
/// 账号仓储接口 /// 账号仓储接口
/// </summary> /// </summary>
[Autowired] [Autowired]
public IAccountService accountService { get; set; } public IAccountService AccountService { get; set; }
#region 账号密码登录 #region 账号密码登录
/// <summary> /// <summary>
...@@ -46,7 +46,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -46,7 +46,7 @@ namespace EduSpider.WebApi.Controllers
string UnionId = jobj.GetString("UnionId"); string UnionId = jobj.GetString("UnionId");
string OpenId = jobj.GetString("OpenId"); string OpenId = jobj.GetString("OpenId");
var model = accountService.GetAccountList(new RB_Account_Extend() var model = AccountService.GetAccountList(new RB_Account_Extend()
{ {
Account = account.Trim() Account = account.Trim()
}).FirstOrDefault(); }).FirstOrDefault();
...@@ -68,7 +68,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -68,7 +68,7 @@ namespace EduSpider.WebApi.Controllers
{ {
model.UnionId = UnionId; model.UnionId = UnionId;
model.OpenId = OpenId; model.OpenId = OpenId;
accountService.UpdateAccountUnionId(model); AccountService.UpdateAccountUnionId(model);
} }
if (model.Status == Utility.Enum.DateStateEnum.Delete) if (model.Status == Utility.Enum.DateStateEnum.Delete)
{ {
...@@ -117,7 +117,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -117,7 +117,7 @@ namespace EduSpider.WebApi.Controllers
{ {
return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 }); return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 });
} }
var model = accountService.GetAccountList(new RB_Account_Extend() var model = AccountService.GetAccountList(new RB_Account_Extend()
{ {
Account = account.Trim() Account = account.Trim()
})?.FirstOrDefault(); })?.FirstOrDefault();
...@@ -138,7 +138,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -138,7 +138,7 @@ namespace EduSpider.WebApi.Controllers
{ {
model.UnionId = UnionId; model.UnionId = UnionId;
model.OpenId = OpenId; model.OpenId = OpenId;
accountService.UpdateAccountUnionId(model); AccountService.UpdateAccountUnionId(model);
} }
if (model.Status == Utility.Enum.DateStateEnum.Delete) if (model.Status == Utility.Enum.DateStateEnum.Delete)
{ {
...@@ -181,7 +181,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -181,7 +181,7 @@ namespace EduSpider.WebApi.Controllers
string code = parms.GetString("code"); string code = parms.GetString("code");
string encryptedData = parms.GetString("encryptedData"); string encryptedData = parms.GetString("encryptedData");
string iv = parms.GetString("iv"); string iv = parms.GetString("iv");
result res = new result() result res = new()
{ {
phoneNumber = "", phoneNumber = "",
openid = "" openid = ""
...@@ -293,7 +293,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -293,7 +293,7 @@ namespace EduSpider.WebApi.Controllers
{ {
return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 }); return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 });
} }
var model = accountService.GetAccountList(new RB_Account_Extend() var model = AccountService.GetAccountList(new RB_Account_Extend()
{ {
Account = account.Trim() Account = account.Trim()
})?.FirstOrDefault(); })?.FirstOrDefault();
...@@ -314,7 +314,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -314,7 +314,7 @@ namespace EduSpider.WebApi.Controllers
{ {
model.UnionId = UnionId; model.UnionId = UnionId;
model.OpenId = OpenId; model.OpenId = OpenId;
accountService.UpdateAccountUnionId(model); AccountService.UpdateAccountUnionId(model);
} }
if (model.Status == Utility.Enum.DateStateEnum.Delete) if (model.Status == Utility.Enum.DateStateEnum.Delete)
{ {
......
...@@ -34,7 +34,7 @@ namespace EduSpider.WebApi ...@@ -34,7 +34,7 @@ namespace EduSpider.WebApi
//ActoFac注入 //ActoFac注入
services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>()); services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
List<string> corsArray = new List<string>() List<string> corsArray = new()
{ {
"http://localhost:7100", "http://localhost:7100",
"http://localhost:7200", "http://localhost:7200",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment