From a6088b8c5b281316272303988ad9db982af6cfed Mon Sep 17 00:00:00 2001
From: dyy <807692433@qq.com>
Date: Wed, 28 Sep 2022 11:09:02 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E6=AF=95=E4=B8=9A=E8=AF=81=E5=8F=B7=E7=94=9F=E6=88=90?=
=?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=AD=A6?=
=?UTF-8?q?=E5=8F=B7=E5=BC=80=E5=A7=8B=E6=8E=92=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/StuInfoBasicController.cs | 11 ++++
.../StuInfoBasic/CreateGraduateNo.cshtml | 2 +-
.../Views/StuInfoBasic/CreateGraduateNo.js | 37 +++++++++-----
.../StuInfoBasic/StuInfoBasicBLL.cs | 24 +++++++++
.../StuInfoBasic/StuInfoBasicIBLL.cs | 7 +++
.../StuInfoBasic/StuInfoBasicService.cs | 50 +++++++++++++++++++
6 files changed, 117 insertions(+), 14 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs
index d4c522968..49057d604 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs
@@ -593,6 +593,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
stuInfoBasicIBLL.CreateGraduateNoByMajor(CityCode, SchoolCode, MajorList);
return Success("生成成功");
}
+ ///
+ /// 按学号生成毕业证号
+ ///
+ ///
+ [HttpPost]
+ [AjaxOnly]
+ public ActionResult DoCreateGraduateNo()
+ {
+ stuInfoBasicIBLL.DoCreateGraduateNo();
+ return Success("生成成功");
+ }
///
/// 审核
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml
index edfd4c6db..e4034cd02 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.cshtml
@@ -47,7 +47,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.js
index c261905c8..092c8f045 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/CreateGraduateNo.js
@@ -39,7 +39,7 @@ var bootstrap = function ($, learun) {
});
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
$('#FinishSchoolMark').lrselect({
- data: [{ text: "准许毕业", value: "1" }, { text: "待准许", value: "0" }],
+ data: [{ text: "已毕业", value: "2" }, { text: "准许毕业", value: "1" }, { text: "待准许", value: "0" }],
text: "text",
value: "value"
})
@@ -47,26 +47,37 @@ var bootstrap = function ($, learun) {
$('#lr_refresh').on('click', function () {
location.reload();
});
+ //生成毕业证【按专业进行排序】
+ //$('#lr_create').on('click', function () {
+ // learun.layerForm({
+ // id: 'form',
+ // title: '生成毕业证',
+ // url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/CreateGraduateNoForm',
+ // width: 800,
+ // height: 600,
+ // callBack: function (id) {
+ // return top[id].acceptClick(refreshGirdData);
+ // }
+ // });
+ //})
+ //生成毕业证【按学号排序】
$('#lr_create').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '生成毕业证',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/CreateGraduateNoForm',
- width: 800,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
+ learun.layerConfirm('1.毕业证号的生成规则:年份两位(22)+学校编码十位(3642000004)+顺序号四位(0001)组成;
2.此次操作仅对毕业状态为“准许毕业”和“已毕业”的学生进行操作;
3.生成毕业证号后不可撤消,请谨慎操作!
', function (res) {
+ if (res) {
+ learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/DoCreateGraduateNo', {}, function () {
+ refreshGirdData();
+ });
}
});
})
-
+
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
headData: [
- { label: "学号", name: "StuNo", width: 100, align: "left" },
+ { label: "学号", name: "StuNo", width: 150, align: "left" },
{ label: "姓名", name: "StuName", width: 100, align: "left" },
{
label: "性别", name: "GenderNo", width: 80, align: "left",
@@ -139,12 +150,12 @@ var bootstrap = function ($, learun) {
}
}
},
- { label: "毕业证", name: "DiplomaNo", width: 100, align: "left" },
{ label: "毕业时间", name: "FinishSchoolDate", width: 100, align: "left" },
+ { label: "毕业证号", name: "DiplomaNo", width: 100, align: "left" },
],
mainId: 'StuId',
isPage: true,
- isMultiselect: true,
+ isMultiselect: false,
});
page.search();
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs
index 51aab5fc0..ce2fc8776 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs
@@ -109,6 +109,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ ///
+ /// 获取StuInfoBasic表实体数据
+ /// 主键
+ ///
+ ///
+ public void DoCreateGraduateNo()
+ {
+ try
+ {
+ stuInfoBasicService.DoCreateGraduateNo();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
///
/// 获取StuInfoBasic表实体数据
/// 主键
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs
index 8db86d681..e07debd2d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs
@@ -29,6 +29,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
StuInfoBasicEntity GetStuInfoBasicEntity(string keyValue);
List GetMajorInfoWithGraduation();
void CreateGraduateNoByMajor(string CityCode,string SchoolCode,string MajorList);
+
+ ///
+ /// 获取StuInfoBasic表实体数据
+ /// 主键
+ ///
+ ///
+ void DoCreateGraduateNo();
StuInfoBasicEntity GetStuNoByAccount(string keyValue);
List GetSaveClassStudents(string account);
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs
index 11d51a52b..93c12e031 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs
@@ -389,6 +389,56 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ ///
+ /// 获取StuInfoBasic表实体数据
+ /// 主键
+ ///
+ ///
+ public void DoCreateGraduateNo()
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ //年份
+ var year = DateTime.Now.Year.ToString().Substring(2, 2);
+ //学校编码十位
+ var schoolCode = "3642000004";
+ //顺序号四位
+ var numberCode = 1;
+
+ //获取最大的序号
+ var DiplomaNoList = this.BaseRepository("CollegeMIS").FindList(x => x.DiplomaNo.Contains(year + schoolCode)).Select(x => x.DiplomaNo).ToList();
+ if (DiplomaNoList.Any())
+ {
+ numberCode = DiplomaNoList.Max(x => x).Substring(12,4).ToInt()+1;
+ }
+
+ //获取所有要毕业的学生按年级查询出来,再按学号进行由小到大排序,
+ var stuList = this.BaseRepository("CollegeMIS").FindList(x => (x.FinishSchoolMark == "1" || x.FinishSchoolMark == "2") && (x.DiplomaNo == null || x.DiplomaNo == "")).OrderBy(x=>x.Grade).ThenBy(x=>x.StuNo);
+ foreach (var item in stuList)
+ {
+ item.DiplomaNo = year + schoolCode + numberCode.ToString().PadLeft(4, '0');
+ db.Update(item);
+
+ numberCode++;
+ }
+
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
///
/// 获取StuInfoBasic表实体数据
/// 主键