Browse Source

调课

黑龙江艺术高中职
hwh2023 5 months ago
parent
commit
aaa27a5110
2 changed files with 61 additions and 14 deletions
  1. +41
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js
  2. +20
    -11
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs

+ 41
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js View File

@@ -70,6 +70,10 @@ var bootstrap = function ($, learun) {
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (keyValue.indexOf(",")>=0) {
learun.alert.warning("只允许编辑一条!");
return false;
}
selectedRow = $('#gridtable').jfGridGet('rowdata');
if (learun.checkrow(keyValue)) {
if (selectedRow.Status == 1) {//提交
@@ -102,9 +106,25 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('Id');
selectedRow = $('#gridtable').jfGridGet('rowdata');
if (learun.checkrow(keyValue)) {
if (selectedRow.Status !== 0) {
learun.alert.warning("当前课程异动记录已提交,无法删除!");
var status = selectedRow.map(item => item.Status);
let newList3 = [];
let map = new Map()
status.forEach((item) => {
// 如果map.has指定的item不存在,那么就设置key和value 这个item就是当前map里面不存在的key,把这个item添加到新数组
// 如果下次出现重复的item,那么map.has(item等于ture 取反 !map.has(item) 不执行
if (!map.has(item)) {
map.set(item, true)
newList3.push(item)
}
})
if (newList3.length > 1) {//.Status !== 0) {
learun.alert.warning("当前课程异动记录已提交!");
return false;
} else {
if (newList3[0] !== 0) {
learun.alert.warning("当前课程异动记录已提交!");
return false;
}
}
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
@@ -121,9 +141,25 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('Id');
selectedRow = $('#gridtable').jfGridGet('rowdata');
if (learun.checkrow(keyValue)) {
if (selectedRow.Status !== 0) {
var status = selectedRow.map(item => item.Status);
let newList3 = [];
let map = new Map()
status.forEach((item) => {
// 如果map.has指定的item不存在,那么就设置key和value 这个item就是当前map里面不存在的key,把这个item添加到新数组
// 如果下次出现重复的item,那么map.has(item等于ture 取反 !map.has(item) 不执行
if (!map.has(item)) {
map.set(item, true)
newList3.push(item)
}
})
if (newList3.length > 1) {//.Status !== 0) {
learun.alert.warning("当前课程异动记录已提交!");
return false;
} else {
if (newList3[0] !== 0) {
learun.alert.warning("当前课程异动记录已提交!");
return false;
}
}
learun.layerConfirm('是否确认提交该项!', function (res) {
if (res) {
@@ -176,6 +212,7 @@ var bootstrap = function ($, learun) {
{ label: "调度备注", name: "AttemperRemark", width: 100, align: "left" },
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
{ label: "学期", name: "Semester", width: 100, align: "left" },
{ label: "学期", name: "Status", width: 100, align: "left" },
{
label: "系部", name: "DeptNo", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
@@ -525,6 +562,7 @@ var bootstrap = function ($, learun) {
//},
],
mainId: 'Id',
isMultiselect: true,
isPage: true,
sord: 'desc',
sidx: 'CreateTime'


+ 20
- 11
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs View File

@@ -193,8 +193,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
this.BaseRepository("CollegeMIS").Delete<ArrangeLessonTermAttemperEntity>(t => t.Id == keyValue);
this.BaseRepository("CollegeMIS").Delete<ArrangeLessonTermAttrmperChildEntity>(t => t.AttemperId == keyValue);
string[] keyvalues = keyValue.Split(',');
foreach (string str in keyvalues)
{
this.BaseRepository("CollegeMIS").Delete<ArrangeLessonTermAttemperEntity>(t => t.Id == str);
this.BaseRepository("CollegeMIS").Delete<ArrangeLessonTermAttrmperChildEntity>(t => t.AttemperId == str);
}
}
catch (Exception ex)
{
@@ -276,16 +280,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
var now = DateTime.Now;

var entity = this.BaseRepository("CollegeMIS").FindEntity<ArrangeLessonTermAttemperEntity>(x => x.Id == keyValue);
if (entity != null)
string[] keyvalues = keyValue.Split(',');
for (int i = 0; i < keyvalues.Length; i++)
{
entity.Status = status;
entity.ProcessId = processId;
entity.SubmitTime = now;
entity.CheckStatus = 1;
this.BaseRepository("CollegeMIS").Update(entity);
var now = DateTime.Now;

var entity = this.BaseRepository("CollegeMIS").FindEntity<ArrangeLessonTermAttemperEntity>(x => x.Id == keyvalues[i]);
if (entity != null)
{
entity.Status = status;
entity.ProcessId = Guid.NewGuid().ToString();
entity.SubmitTime = now;
entity.CheckStatus = 1;
this.BaseRepository("CollegeMIS").Update(entity);
}

}
}
catch (Exception ex)


Loading…
Cancel
Save