|
|
@@ -0,0 +1,346 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Web; |
|
|
|
using Learun.Application.Organization; |
|
|
|
using Learun.Application.TwoDevelopment.EducationalAdministration; |
|
|
|
using Nancy; |
|
|
|
|
|
|
|
namespace Learun.Application.WebApi.Modules |
|
|
|
{ |
|
|
|
public class ArrangelessonLogin : BaseNoAuthenticationNoLogin |
|
|
|
{ |
|
|
|
public ArrangelessonLogin() |
|
|
|
: base("/arrangelessonlogin/") |
|
|
|
{ |
|
|
|
Get["/lessontype"] = GetLessonTypes; |
|
|
|
Get["/classtype"] = GetClassType; |
|
|
|
Get["/student"] = GetStudents; |
|
|
|
Get["/lessonsortdetail"] = GetLessonSortDetails; |
|
|
|
Get["/lessonsort"] = GetLessonSorts; |
|
|
|
Get["/classlesson"] = GetClassLessons; |
|
|
|
Get["/bukaolist"] = GetBuKaoList; |
|
|
|
//以下接口需要传值学年学期 |
|
|
|
Get["/school"] = GetSchools; |
|
|
|
Get["/dept"] = GetDepts; |
|
|
|
Get["/major"] = GetMajors; |
|
|
|
Get["/classroom"] = GetClassrooms; |
|
|
|
Get["/lesson"] = GetLessons; |
|
|
|
Get["/teacher"] = GetTeachers; |
|
|
|
Get["/class"] = GetClasses; |
|
|
|
Get["/stu"] = GetStus; |
|
|
|
//以下返回全部 |
|
|
|
Get["/department"] = GetDepartment; |
|
|
|
Get["/allteacher"] = GetAllTeachers; |
|
|
|
Get["/allstudent"] = GetAllStudents; |
|
|
|
Get["/alldept"] = GetAllDept; |
|
|
|
Get["/allmajor"] = GetAllMajor; |
|
|
|
Get["/alllesson"] = GetAllLesson; |
|
|
|
Get["/allclass"] = GetAllClass; |
|
|
|
Get["/alluser"] = GetAllUsers; |
|
|
|
Get["/allschool"] = GetAllSchools; |
|
|
|
Get["/allclasslesson"] = GetAllClassLesson; |
|
|
|
Get["/allelelectivelesson"] = GetAllElectiveLesson; |
|
|
|
|
|
|
|
//以下接口不往ArrangeLessonSync里记录已传数据 |
|
|
|
Get["/schoolNotRecord"] = GetSchoolsNotRecord; |
|
|
|
Get["/deptNotRecord"] = GetDeptsNotRecord; |
|
|
|
Get["/majorNotRecord"] = GetMajorsNotRecord; |
|
|
|
Get["/classroomNotRecord"] = GetClassroomsNotRecord; |
|
|
|
Get["/lessonNotRecord"] = GetLessonsNotRecord; |
|
|
|
Get["/teacherNotRecord"] = GetTeachersNotRecord; |
|
|
|
Get["/classNotRecord"] = GetClassesNotRecord; |
|
|
|
Get["/stuNotRecord"] = GetStusNotRecord; |
|
|
|
Get["trantest"] = TranTest; |
|
|
|
//按条件重置基础数据同步状态 |
|
|
|
Get["/initbasicdata"] = InitBasicData; |
|
|
|
|
|
|
|
} |
|
|
|
private readonly ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); |
|
|
|
private readonly StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); |
|
|
|
private DepartmentIBLL departmentIBLL = new DepartmentBLL(); |
|
|
|
EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); |
|
|
|
private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL(); |
|
|
|
CdDeptIBLL cdDeptIbll = new CdDeptBLL(); |
|
|
|
CdMajorIBLL cdMajorIbll = new CdMajorBLL(); |
|
|
|
private LessonInfoIBLL lessonInfoIbll = new LessonInfoBLL(); |
|
|
|
ClassInfoIBLL classInfoIbll = new ClassInfoBLL(); |
|
|
|
UserIBLL userIbll = new UserBLL(); |
|
|
|
private CompanyIBLL companyIbll = new CompanyBLL(); |
|
|
|
|
|
|
|
private StuSelectLessonListOfElectiveIBLL stuSelectLessonListOfElectiveIbll = |
|
|
|
new StuSelectLessonListOfElectiveBLL(); |
|
|
|
|
|
|
|
private Response TranTest(dynamic _) |
|
|
|
{ |
|
|
|
return Success("ok"); |
|
|
|
} |
|
|
|
|
|
|
|
private Response GetAllLesson(dynamic _) |
|
|
|
{ |
|
|
|
var result = lessonInfoIbll.GetAllLesson(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllClass(dynamic _) |
|
|
|
{ |
|
|
|
var result = classInfoIbll.GetAllClass(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllTeachers(dynamic _) |
|
|
|
{ |
|
|
|
var result = empInfoIbll.GetAllList().Where(m => m.CheckMark == true).ToList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllSchools(dynamic _) |
|
|
|
{ |
|
|
|
var result = companyIbll.GetList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllClassLesson(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetAllClassLesson(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response InitBasicData(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
string BaseTable = Request.Query["BaseTable"]; |
|
|
|
if (string.IsNullOrEmpty(AcademicYearNo) || string.IsNullOrEmpty(Semester)) |
|
|
|
{ |
|
|
|
return Fail("学年学期参数不能为空"); |
|
|
|
} |
|
|
|
if (string.IsNullOrEmpty(BaseTable)) |
|
|
|
{ |
|
|
|
return Fail("基础表参数不能为空"); |
|
|
|
} |
|
|
|
ArrangeLessonTermEntity arrangeLessonTermEntity = new ArrangeLessonTermEntity(); |
|
|
|
arrangeLessonTermEntity.AcademicYearNo = AcademicYearNo; |
|
|
|
arrangeLessonTermEntity.Semester = Semester; |
|
|
|
arrangeLessonTermEntity.SyncBasicTable = BaseTable; |
|
|
|
arrangeLessonTermIBLL.InitAsyncDataByCondition(arrangeLessonTermEntity); |
|
|
|
return Success("操作成功"); |
|
|
|
} |
|
|
|
private Response GetAllElectiveLesson(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = stuSelectLessonListOfElectiveIbll.GetAllElectiveLesson(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllUsers(dynamic _) |
|
|
|
{ |
|
|
|
var result = userIbll.GetAllList().Where(m => !m.F_Account.Contains("System") && m.F_DeleteMark == 0 && m.F_EnabledMark == 1).Select(m => new |
|
|
|
{ |
|
|
|
m.F_UserId, |
|
|
|
m.F_CompanyId, |
|
|
|
m.F_DepartmentId, |
|
|
|
F_Description = m.F_Description == "教师" ? "2" : "3", |
|
|
|
ClassNo = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(m.F_Account)?.ClassNo, |
|
|
|
m.F_RealName, |
|
|
|
m.F_Account, |
|
|
|
Year = "20" + stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(m.F_Account)?.Grade, |
|
|
|
m.F_IdentityCardNo |
|
|
|
}); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllStudents(dynamic _) |
|
|
|
{ |
|
|
|
var result = stuInfoBasicIbll.GetAllList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetDepartment(dynamic _) |
|
|
|
{ |
|
|
|
var result = departmentIBLL.GetAllList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllDept(dynamic _) |
|
|
|
{ |
|
|
|
var result = cdDeptIbll.GetAllList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetAllMajor(dynamic _) |
|
|
|
{ |
|
|
|
var result = cdMajorIbll.GetAllList(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetLessonTypes(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetLessonTypes(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetDepts(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetDepts(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetDeptsNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetDeptsNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
private Response GetSchools(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetSchools(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
private Response GetSchoolsNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetSchoolsNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
private Response GetClassLessons(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetClassLessons().Select(m => new |
|
|
|
{ |
|
|
|
m.AcademicYearNo, |
|
|
|
m.Semester, |
|
|
|
m.DeptNo, |
|
|
|
m.MajorNo, |
|
|
|
m.LessonNo, |
|
|
|
m.TeachClassNo, |
|
|
|
m.EmpNo, |
|
|
|
m.LessonSortNo |
|
|
|
}); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetStudents(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetStudents(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetMajors(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetMajors(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetMajorsNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetMajorsNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetClassrooms(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetClassrooms(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetClassroomsNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetClassroomsNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetClassType(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetClassType(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetLessons(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetLessons(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetLessonsNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetLessonsNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetLessonSortDetails(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetLessonSortDetails(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetLessonSorts(dynamic _) |
|
|
|
{ |
|
|
|
var result = arrangeLessonTermIBLL.GetLessonSorts(); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetTeachers(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetTeachers(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetTeachersNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetTeachersNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetClasses(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetClasses(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
public Response GetClassesNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetClassesNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetStus(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetStus(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
|
|
|
|
public Response GetStusNotRecord(dynamic _) |
|
|
|
{ |
|
|
|
string AcademicYearNo = Request.Query["AcademicYearNo"]; |
|
|
|
string Semester = Request.Query["Semester"]; |
|
|
|
var result = arrangeLessonTermIBLL.GetStusNotRecord(AcademicYearNo, Semester); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 补考名单数据 |
|
|
|
/// </summary> |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <returns></returns> |
|
|
|
private Response GetBuKaoList(dynamic _) |
|
|
|
{ |
|
|
|
var allList = new List<StuScoreEntity>(); |
|
|
|
var notPassList = stuScoreIBLL.GetStuScoreNotPassList(); |
|
|
|
allList.AddRange(notPassList); |
|
|
|
var notPassTwoList = stuScoreIBLL.GetStuScoreNotPassTwoList(); |
|
|
|
allList.AddRange(notPassTwoList); |
|
|
|
|
|
|
|
var result = allList.Select(x => new { x.BuKaoFlag, x.AcademicYearNo, x.Semester, x.StuId, x.StuName, x.LessonId, x.LessonName, x.ClassId, x.ClassName, x.EmpId, x.EmpName }).OrderBy(x => x.BuKaoFlag).ThenByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.StuId); |
|
|
|
return Success(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} |