Browse Source

毕业生归档添加多选功能

应县
ndbs 7 months ago
parent
commit
555e069f2f
5 changed files with 129 additions and 64 deletions
  1. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs
  2. +31
    -22
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Graduate.js
  3. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs
  5. +92
    -36
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs

+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs View File

@@ -491,7 +491,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
@@ -585,9 +585,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[HttpPost]
[AjaxOnly]

public ActionResult StuStore()
public ActionResult StuStore(string keyValue)
{
stuInfoBasicIBLL.StuStore();
stuInfoBasicIBLL.StuStore(keyValue);
return Success("操作成功");
}
/// <summary>


+ 31
- 22
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Graduate.js View File

@@ -58,27 +58,36 @@ var bootstrap = function ($, learun) {

//归档
$('#lr_store').on('click', function () {
learun.layerConfirm('1.毕业生归档必须在6-8月份进行; <br> 2.归档后的学生信息如:操行、奖惩、成绩、毕业证书等只有通过毕业生信息管理才能查询或打印;<br> 3.毕业学生的账户将自动取消;<br> 4.学生所占的床位也将自动退掉;<br> 5.学生所在的班级置为已毕业班级;<br> 6.归档操作后不可撤消,请谨慎操作!', function (res) {
if (res) {
learun.layerForm({
id: 'FinishSchoolDateForm',
title: '设置毕业时间',
url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FinishSchoolDateForm',
width: 400,
height: 400,
callBack: function (id) {
return top[id].acceptClick(function () {
learun.loading(true, "归档中...");
//归档操作
learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/StuStore', {}, function () {
learun.loading(false);
refreshGirdData();
});
});
}
});
var keyValue = $('#gridtable').jfGridValue('StuId');
if (learun.checkrow(keyValue)) {
var CheckMark = $('#gridtable').jfGridValue('FinishSchoolMark');
console.log(CheckMark, "CheckMark")
if (CheckMark.indexOf('') != -1) {
learun.alert.warning("选中记录中包含待准许毕业项目,待准许毕业项目不能归档!");
return;
}
});
learun.layerConfirm('1.毕业生归档必须在6-8月份进行; <br> 2.归档后的学生信息如:操行、奖惩、成绩、毕业证书等只有通过毕业生信息管理才能查询或打印;<br> 3.毕业学生的账户将自动取消;<br> 4.学生所占的床位也将自动退掉;<br> 5.学生所在的班级置为已毕业班级;<br> 6.归档操作后不可撤消,请谨慎操作!', function (res) {
if (res) {
learun.layerForm({
id: 'FinishSchoolDateForm',
title: '设置毕业时间',
url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FinishSchoolDateForm',
width: 400,
height: 400,
callBack: function (id) {
return top[id].acceptClick(function () {
learun.loading(true, "归档中...");
//归档操作
learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/StuStore', { keyValue: keyValue }, function () {
learun.loading(false);
refreshGirdData();
});
});
}
});
}
});
}
})

},
@@ -164,9 +173,9 @@ var bootstrap = function ($, learun) {
],
mainId: 'StuId',
isPage: true,
isMultiselect: false,
isMultiselect: true,
rows: 100,
sidx: 'FinishSchoolMark desc',
sidx: "Grade desc,DeptNo desc,MajorNo desc,ClassNo desc",
sord: 'desc'
});
page.search();


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs View File

@@ -624,11 +624,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void StuStore()
public void StuStore(string keyValue)
{
try
{
stuInfoBasicService.StuStore();
stuInfoBasicService.StuStore(keyValue);
}
catch (Exception ex)
{


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs View File

@@ -100,7 +100,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <param name="keyValue"></param>
void IsFileTransfer(string keyValue, string status, string fort);
void StuStore();
void StuStore(string keyValue);
/// <summary>
/// 学生毕业归档-设置毕业时间
/// </summary>


+ 92
- 36
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs View File

@@ -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();
}


Loading…
Cancel
Save