Selaa lähdekoodia

【增加】全院学生成绩查看接口;全院课程表接口;

临城职教中职
dyy 2 vuotta sitten
committed by ndbs
vanhempi
commit
a583233be5
7 muutettua tiedostoa jossa 317 lisäystä ja 2 poistoa
  1. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  2. +112
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuScoreApi.cs
  3. +88
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs
  4. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs
  5. +19
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs
  6. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs
  7. +67
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj Näytä tiedosto

@@ -209,6 +209,7 @@
<Compile Include="Modules\ListenClassRecordApi.cs" />
<Compile Include="Modules\MpManagementApi.cs" />
<Compile Include="Modules\PersonnelManagement\EpidemicSituationCopyApi.cs" />
<Compile Include="Modules\StuScoreApi.cs" />
<Compile Include="Modules\StuInfoBasicApi.cs" />
<Compile Include="Modules\StatisticsApi.cs" />
<Compile Include="Modules\TaiGang\TUserApi.cs" />


+ 112
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuScoreApi.cs Näytä tiedosto

@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Util;
using Nancy;
using Newtonsoft.Json;

namespace Learun.Application.WebApi.Modules
{
public class StuScoreApi : BaseNoLoginApi
{
public StuScoreApi()
: base("/Learun/adms/EducationalAdministration/StuScore")
{
Get["/scoreListByStuInfo"] = GetScoreListByStuInfo;

}

private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
private StuScoreIBLL stuScoreIBLL = new StuScoreBLL();
private CdMajorIBLL cdMajorIBLL = new CdMajorBLL();
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
/// <summary>
/// 获取成绩列表
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
private Response GetScoreListByStuInfo(dynamic _)
{
var param = this.GetReq<Model>();
ScoreListByStuInfo result = new ScoreListByStuInfo();
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(param.StuNo);
if (stuInfoBasicEntity != null)
{
result.StuNo = stuInfoBasicEntity.StuNo;
result.StuName = stuInfoBasicEntity.StuName;
result.MajorNo = stuInfoBasicEntity.MajorNo;
result.ClassNo = stuInfoBasicEntity.ClassNo;
if (!string.IsNullOrEmpty(stuInfoBasicEntity.MajorNo))
{
result.MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(stuInfoBasicEntity.MajorNo)?.MajorName;
}
if (!string.IsNullOrEmpty(stuInfoBasicEntity.ClassNo))
{
result.ClassName = classInfoIBLL.GetClassInfoEntityByClassNo(stuInfoBasicEntity.ClassNo)?.ClassName;
}
}
var queryJson = JsonConvert.SerializeObject(param);

var data = stuScoreIBLL.GetScoreListByStuInfo(queryJson);
var dataTemp = data.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new ScoreList()
{
AcademicYearNo = x.Key.AcademicYearNo,
Semester = x.Key.Semester,
StuScoreEntityList = x.Select(y => new StuScoreEntity()
{
AcademicYearNo = y.AcademicYearNo,
Semester = y.Semester,
LessonSortNo = y.LessonSortNo,
LessonSortName = y.LessonSortName,
LessonNo = y.LessonNo,
LessonName = y.LessonName,
StudyScore = y.StudyScore,
Score = y.Score,
ScoreOfNotPass = y.ScoreOfNotPass,
ScoreOfNotPassTwo = y.ScoreOfNotPassTwo
}).OrderBy(a=>a.LessonSortNo).ThenBy(a=>a.LessonNo).ToList()
}).ToList().OrderByDescending(x=>x.AcademicYearNo).ThenByDescending(x=>x.Semester);
result.ScoreList = dataTemp.ToList();

return Success(result);
}

public class Model
{
/// <summary>
/// 学年(18-19)
/// </summary>
public string AcademicYearNo { get; set; }
/// <summary>
/// 学期(1)
/// </summary>
public string Semester { get; set; }
/// <summary>
/// 学号
/// </summary>
public string StuNo { get; set; }

}
public class ScoreListByStuInfo {
public string StuNo { get; set; }
public string StuName { get; set; }
public string MajorNo { get; set; }
public string MajorName { get; set; }
public string ClassNo { get; set; }
public string ClassName { get; set; }
public List<ScoreList> ScoreList { get; set; }
}
public class ScoreList {
public string AcademicYearNo { get; set; }
public string Semester { get; set; }
public List<StuScoreEntity> StuScoreEntityList { get; set; }
}

}
}

+ 88
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs Näytä tiedosto

@@ -13,7 +13,7 @@ using Nancy;

namespace Learun.Application.WebApi.Modules
{
public class TimeTable : BaseApi
public class TimeTable : BaseNoLoginApi
{
public TimeTable()
: base("/learun/adms/timetable")
@@ -21,6 +21,7 @@ namespace Learun.Application.WebApi.Modules
Get["/list"] = GetList;
Get["/StuList"] = GetStuInfo;
Get["/StuLessonInfo"] = GetStuLessonInfo;
Get["/timeTableData"] = GetTimeTableData;
}
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL();
private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL();
@@ -112,6 +113,68 @@ namespace Learun.Application.WebApi.Modules

}

/// <summary>
/// 全院课程表【按班级分组】
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
private Response GetTimeTableData(dynamic _)
{
var param = this.GetReq<TimeParameter>();

TimeTableData result = new TimeTableData();

//开始时间
var startdate = string.IsNullOrEmpty(param.StartDate) ? DateTime.Today : Convert.ToDateTime(param.StartDate);
var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd");
var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd");
result.StartDate = startDate;
result.EndDate = endDate;

var semesterAndYear = Common.GetSemesterAndYear(startDate);
result.AcademicYearNo = semesterAndYear.AcademicYearLong;
result.Semester = semesterAndYear.Semester;

//课程表数据
var timeTableList = new List<Learun.Application.TwoDevelopment.EducationalAdministration.TimeTable>();
//必修课课程表
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, param.ClassNo, param.EmpNo, "");
timeTableList.AddRange(data);
//选修课课程表
var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, param.ClassNo, param.EmpNo, "");
timeTableList.AddRange(dataOfElective);
var dataTemp = timeTableList.GroupBy(x => new { x.TeachClassNo, x.ClassName, x.LessonSortNo }).Select(x => new ClassDataList()
{
ClassNo = x.Key.TeachClassNo,
ClassName = x.Key.ClassName,
LessonSortNo = x.Key.LessonSortNo,
TimeTableList = x.Select(y => new TwoDevelopment.EducationalAdministration.TimeTable()
{
AcademicYear = y.AcademicYear,
Semester = y.Semester,
DeptNo = y.DeptNo,
MajorNo = y.MajorNo,
F_SchoolId = y.F_SchoolId,
LessonNo = y.LessonNo,
LessonName = y.LessonName,
LessonDate = y.LessonDate,
LessonTime = y.LessonTime,
EmpNo = y.EmpNo,
EmpName = y.EmpName,
TeachClassNo = y.TeachClassNo,
ClassName = y.ClassName,
ClassRoomNo = y.ClassRoomNo,
ClassroomName = y.ClassroomName,
LessonSortNo = y.LessonSortNo
}).OrderBy(a => a.LessonTime.Substring(0, 1)).ThenBy(a => a.LessonTime.Substring(1)).ToList()
}).OrderBy(x => x.LessonSortNo).ThenBy(x => x.ClassNo).ToList();

result.ClassDataList = dataTemp;
return Success(result);

}

/// <summary>
/// 数字转中文
@@ -167,6 +230,30 @@ namespace Learun.Application.WebApi.Modules
{
public string StartDate { get; set; }
public string EndDate { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public string ClassNo { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public string EmpNo { get; set; }
}
public class TimeTableData
{
public string AcademicYearNo { get; set; }
public string Semester { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public List<ClassDataList> ClassDataList { get; set; }
}
public class ClassDataList
{
public string ClassNo { get; set; }
public string ClassName { get; set; }
public string LessonSortNo { get; set; }
public List<TwoDevelopment.EducationalAdministration.TimeTable> TimeTableList { get; set; }
}


}

+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs Näytä tiedosto

@@ -677,6 +677,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 根据学号/姓名获取学生成绩列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson)
{
try
{
return stuScoreService.GetScoreListByStuInfo(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public List<object> GetStuGraduateInfo(string queryJson)
{
try


+ 19
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs Näytä tiedosto

@@ -388,11 +388,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration


/// <summary>
/// 成绩格式化(补)(重)
/// 成绩格式化(补)(重)(选修)
/// </summary>
[NotMapped]
public string ScoreFormat { get; set; }

/// <summary>
/// 补考成绩
/// </summary>
[NotMapped]
public string ScoreOfNotPass { get; set; }
/// <summary>
/// 二次补考成绩
/// </summary>
[NotMapped]
public string ScoreOfNotPassTwo { get; set; }
/// <summary>
/// 课程类别名称
/// </summary>
/// <returns></returns>
[NotMapped]
public string LessonSortName { get; set; }


}
}


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs Näytä tiedosto

@@ -182,6 +182,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="queryJson"></param>
/// <returns></returns>
IEnumerable<StuScoreEntity> GetScoreListByStuNo(string queryJson);
/// <summary>
/// 根据学号/姓名获取学生成绩列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson);

/// <summary>
/// 获取个人成绩列表


+ 67
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs Näytä tiedosto

@@ -1876,5 +1876,72 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
}
}
}

/// <summary>
/// 根据学号/姓名获取学生成绩列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson)
{
try
{
//参考写法
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
var tableName = "StuScore";
if (!queryParam["TableName"].IsEmpty())
{
tableName = queryParam["TableName"].ToString();
}
var strSql = new StringBuilder();
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,li.StudyScore,ls.LessonSortName,bb.Score,sp.Score as ScoreOfNotPass,spt.Score as ScoreOfNotPassTwo ");
strSql.Append(" from ( ");
strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" where 1=1 and s.CheckMark='1' ");
if (!queryParam["AcademicYearNo"].IsEmpty())
{
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String);
strSql.Append(" and s.AcademicYearNo=@AcademicYearNo ");
}
if (!queryParam["Semester"].IsEmpty())
{
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String);
strSql.Append(" and s.Semester=@Semester ");
}
if (!queryParam["StuNo"].IsEmpty())
{
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String);
strSql.Append(" and s.StuNo=@StuNo ");
}
if (!queryParam["StuName"].IsEmpty())
{
dp.Add("StuName", queryParam["StuName"].ToString(), DbType.String);
strSql.Append(" and s.StuName=@StuName ");
}
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb ");
strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.LessonSortNo=sp.LessonSortNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo and sp.CheckMark = '1' ");
strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.LessonSortNo=spt.LessonSortNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo and spt.CheckMark = '1' ");
strSql.Append(" left join CdLessonSort ls on bb.LessonSortNo= ls.LessonSortNo ");
strSql.Append(" left join LessonInfo li on bb.LessonNo= li.LessonNo ");

return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}



}
}

Ladataan…
Peruuta
Tallenna