|
|
@@ -1090,7 +1090,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
/// 毕业生归档 |
|
|
|
/// <summary> |
|
|
|
/// <returns></returns> |
|
|
|
public void StuStore() |
|
|
|
public void StuStore(string keyValue) |
|
|
|
{ |
|
|
|
/* |
|
|
|
1.毕业生归档必须在6-8月份进行; <br> |
|
|
@@ -1105,51 +1105,107 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
var adb = this.BaseRepository().BeginTrans(); |
|
|
|
try |
|
|
|
{ |
|
|
|
//归档前提为毕业标志为1(准许毕业)的学生 |
|
|
|
var stuInfos = db.FindList<StuInfoBasicEntity>(a => a.FinishSchoolMark == "1"); |
|
|
|
foreach (var item in stuInfos) |
|
|
|
if (keyValue.IsEmpty()) |
|
|
|
{ |
|
|
|
var accountInfo = adb.FindEntity<UserEntity>(a => a.F_Account == item.StuNo); |
|
|
|
if (accountInfo != null) |
|
|
|
//归档前提为毕业标志为1(准许毕业)的学生 |
|
|
|
var stuInfos = db.FindList<StuInfoBasicEntity>(a => a.FinishSchoolMark == "1"); |
|
|
|
foreach (var item in stuInfos) |
|
|
|
{ |
|
|
|
//删除账户 |
|
|
|
adb.Delete(accountInfo); |
|
|
|
} |
|
|
|
//清空宿舍信息 |
|
|
|
var dormitory = db.FindEntity<Acc_DormitoryBuildEntity>(a => a.StudentID == item.StuNo); |
|
|
|
if (dormitory != null) |
|
|
|
{ |
|
|
|
dormitory.StudentID = ""; |
|
|
|
dormitory.StuName = ""; |
|
|
|
dormitory.Dept = ""; |
|
|
|
dormitory.Class = ""; |
|
|
|
dormitory.Major = ""; |
|
|
|
dormitory.MainClass = ""; |
|
|
|
db.Update(dormitory); |
|
|
|
//宿舍上一级房间,入住人数-1 |
|
|
|
var room = db.FindEntity<Acc_DormitoryBuildEntity>(x => x.ID == dormitory.ParentID); |
|
|
|
if (room != null) |
|
|
|
var accountInfo = adb.FindEntity<UserEntity>(a => a.F_Account == item.StuNo); |
|
|
|
if (accountInfo != null) |
|
|
|
{ |
|
|
|
//删除账户 |
|
|
|
adb.Delete(accountInfo); |
|
|
|
} |
|
|
|
//清空宿舍信息 |
|
|
|
var dormitory = db.FindEntity<Acc_DormitoryBuildEntity>(a => a.StudentID == item.StuNo); |
|
|
|
if (dormitory != null) |
|
|
|
{ |
|
|
|
if (room.CheckInStu.HasValue && room.CheckInStu.Value > 0) |
|
|
|
dormitory.StudentID = ""; |
|
|
|
dormitory.StuName = ""; |
|
|
|
dormitory.Dept = ""; |
|
|
|
dormitory.Class = ""; |
|
|
|
dormitory.Major = ""; |
|
|
|
dormitory.MainClass = ""; |
|
|
|
db.Update(dormitory); |
|
|
|
//宿舍上一级房间,入住人数-1 |
|
|
|
var room = db.FindEntity<Acc_DormitoryBuildEntity>(x => x.ID == dormitory.ParentID); |
|
|
|
if (room != null) |
|
|
|
{ |
|
|
|
room.CheckInStu--; |
|
|
|
db.Update(room); |
|
|
|
if (room.CheckInStu.HasValue && room.CheckInStu.Value > 0) |
|
|
|
{ |
|
|
|
room.CheckInStu--; |
|
|
|
db.Update(room); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//班级置为已毕业班级 |
|
|
|
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == item.ClassNo); |
|
|
|
if (classInfo != null && classInfo.ClassStatus != "1") |
|
|
|
{ |
|
|
|
classInfo.ClassStatus = "1"; |
|
|
|
db.Update(classInfo); |
|
|
|
} |
|
|
|
//增加学生毕业表信息 |
|
|
|
var addSql = $"insert into StuInfoGraduate select * from StuInfoBasic where StuId='{item.StuId}'"; |
|
|
|
db.ExecuteBySql(addSql); |
|
|
|
//删除学籍表信息 |
|
|
|
db.Delete(item); |
|
|
|
} |
|
|
|
//班级置为已毕业班级 |
|
|
|
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == item.ClassNo); |
|
|
|
if (classInfo != null && classInfo.ClassStatus != "1") |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var keys = keyValue.Split(','); |
|
|
|
foreach (var items in keys) |
|
|
|
{ |
|
|
|
classInfo.ClassStatus = "1"; |
|
|
|
db.Update(classInfo); |
|
|
|
//归档前提为毕业标志为1(准许毕业)的学生 |
|
|
|
var stuInfos = db.FindEntity<StuInfoBasicEntity>(a => a.FinishSchoolMark == "1" && a.StuId == items); |
|
|
|
if (stuInfos != null) |
|
|
|
{ |
|
|
|
var accountInfo = adb.FindEntity<UserEntity>(a => a.F_Account == stuInfos.StuNo); |
|
|
|
if (accountInfo != null) |
|
|
|
{ |
|
|
|
//删除账户 |
|
|
|
adb.Delete(accountInfo); |
|
|
|
} |
|
|
|
//清空宿舍信息 |
|
|
|
var dormitory = db.FindEntity<Acc_DormitoryBuildEntity>(a => a.StudentID == stuInfos.StuNo); |
|
|
|
if (dormitory != null) |
|
|
|
{ |
|
|
|
dormitory.StudentID = ""; |
|
|
|
dormitory.StuName = ""; |
|
|
|
dormitory.Dept = ""; |
|
|
|
dormitory.Class = ""; |
|
|
|
dormitory.Major = ""; |
|
|
|
dormitory.MainClass = ""; |
|
|
|
db.Update(dormitory); |
|
|
|
//宿舍上一级房间,入住人数-1 |
|
|
|
var room = db.FindEntity<Acc_DormitoryBuildEntity>(x => x.ID == dormitory.ParentID); |
|
|
|
if (room != null) |
|
|
|
{ |
|
|
|
if (room.CheckInStu.HasValue && room.CheckInStu.Value > 0) |
|
|
|
{ |
|
|
|
room.CheckInStu--; |
|
|
|
db.Update(room); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//班级置为已毕业班级 |
|
|
|
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == stuInfos.ClassNo); |
|
|
|
if (classInfo != null && classInfo.ClassStatus != "1") |
|
|
|
{ |
|
|
|
classInfo.ClassStatus = "1"; |
|
|
|
db.Update(classInfo); |
|
|
|
} |
|
|
|
//增加学生毕业表信息 |
|
|
|
var addSql = $"insert into StuInfoGraduate select * from StuInfoBasic where StuId='{stuInfos.StuId}'"; |
|
|
|
db.ExecuteBySql(addSql); |
|
|
|
//删除学籍表信息 |
|
|
|
db.Delete(stuInfos); |
|
|
|
} |
|
|
|
} |
|
|
|
//增加学生毕业表信息 |
|
|
|
var addSql = $"insert into StuInfoGraduate select * from StuInfoBasic where StuId='{item.StuId}'"; |
|
|
|
db.ExecuteBySql(addSql); |
|
|
|
//删除学籍表信息 |
|
|
|
db.Delete(item); |
|
|
|
} |
|
|
|
|
|
|
|
db.Commit(); |
|
|
|
adb.Commit(); |
|
|
|
} |
|
|
|