Pārlūkot izejas kodu

排课 修改功能并加入记录表

临城职教中职
zhangli pirms 2 gadiem
vecāks
revīzija
73752e56e6
13 mainītis faili ar 703 papildinājumiem un 128 dzēšanām
  1. +35
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs
  2. +25
    -11
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml
  3. +177
    -108
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js
  4. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ArgLessonTermUpdRecordMap.cs
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  6. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordBLL.cs
  7. +120
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordEntity.cs
  8. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordIBLL.cs
  9. +36
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordService.cs
  10. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs
  11. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs
  12. +193
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs
  13. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 35
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs Parādīt failu

@@ -171,7 +171,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
var listObj = new List<Object>();
for (int i = 1; i <= weekTimes; i++)
{
listObj.Add(new { text = i + "周", value = i });
listObj.Add(new { text = i + "周", value = i });
}
var jsonData = new
{
@@ -189,8 +189,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
string returnStr = "";
var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd"));
int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几
int countDay = endTime.Subtract(startDate).Days; //endTime.DayOfYear;
//int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几
int countDay = endTime.Subtract(startDate).Days;
int countWeek = countDay / 14 + 1;
return countWeek;

@@ -251,7 +251,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
var StartTime = entity.StartTime.Value;
//根据第几周,计算查询的开始和结束日期
startDate = StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd");
endDate= StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd");
endDate = StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd");

var timeTableList = new List<TimeTable>();
//课程表
@@ -280,7 +280,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
where ee == g.Key
select new
{
ALTId=e.ALTId,
ALTId = e.ALTId,
day = e.LessonTime.Split('-')[0],
curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName,
teacher = e?.EmpName,
@@ -335,6 +335,36 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
arrangeLessonTermIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}


/// <summary>
/// 删除课程
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteLessonTerm(string keyValue)
{
arrangeLessonTermIBLL.DeleteLessonTerm(keyValue);
return Success("删除成功!");
}
/// <summary>
///修改课程
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult UpdateLessonTerm(string keyValue,string postdata)
{
UpdateLessonTermEntity model = postdata.ToObject<UpdateLessonTermEntity>();
arrangeLessonTermIBLL.UpdateLessonTerm(keyValue, model);
return Success("操作成功!");
}

#endregion

/// <summary>


+ 25
- 11
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml Parādīt failu

@@ -102,6 +102,9 @@
.lr-select {
width: 150px;
}
.radio {
margin-bottom: 0px;
}
.perWeek1 li {
width: 9%;
float: left;
@@ -114,10 +117,20 @@
}
.rightDiv {
width: 20%;
height: 50%;
float: right;
}


.rightDiv .rdiv {
margin-left: 20%;
margin-top: 10px;
}
.rightDiv .dbtn {
margin-left: 20%;
margin-top: 10px;
}
.rightDiv .ebtn {
margin-top: 10px;
}
.perFestivalsBox td {
padding: 1px;
width: 9%;
@@ -163,18 +176,19 @@
<li>星期十</li>
</ul>
<div class="perFestivalsBox">
<table id="lessonTermTable" cellspacing="0" border="0"></table>
<table id="lessonTermTable" cellspacing="0" border="0" style="width: 100%"></table>
</div>
</div>
<div class="rightDiv">
<div id="LessonInfo"></div>
<div id="EmpInfo"></div>
<div id="ClassroomInfo"></div>
<div id="WeekTimeSelect"></div>
<div id="WeekSelect"></div>
<div id="NodeSelect"></div>
<button class="btn btn-default" id="delete">删除</button>
<button class="btn btn-default " id="edit">修改</button>
<input id="ALTId" hidden="hidden" />
<div class="rdiv" id="LessonInfo"></div>
<div class="rdiv" id="EmpInfo"></div>
<div class="rdiv" id="ClassroomInfo"></div>
<div class="rdiv" id="WeekTimeSelect"></div>
<div class="rdiv" id="WeekSelect"></div>
<div class="rdiv" id="NodeSelect"></div>
<button class="btn btn-default dbtn" id="delete">删除</button>
<button class="btn btn-default ebtn" id="edit">修改</button>
</div>
</div>


+ 177
- 108
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js Parādīt failu

@@ -1,7 +1,5 @@
var refreshGirdData;
var bootstrap = function ($, learun) {
var startTime = '2022-01-17';
var endTime = '2022-01-23';
var classNo;
var curWeek;
var weekList;
@@ -13,7 +11,7 @@ var bootstrap = function ($, learun) {
loadData: function (param) {
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetDataInEducation', param,
function (data) {
console.log('res', data);
//console.log('res', data);
// 数据处理
var html = '';
var weekLists = data.weekList;
@@ -133,6 +131,8 @@ var bootstrap = function ($, learun) {
$('#WeekTimes').lrRadioCheckbox({
type: 'radio',
data: res.data.weekList,
value: 'value',
text: 'text'
//data: [{ text: '分析清晰', value: '1' }, { text: '需要改进', value: '2' }]

});
@@ -146,7 +146,9 @@ var bootstrap = function ($, learun) {
maxHeight: 300,
allowSearch: true,
type: 'multiple',
data: res.data.weekList
data: res.data.weekList,
value: 'value',
text: 'text'
});
}

@@ -158,16 +160,30 @@ var bootstrap = function ($, learun) {
});
//单元格选中事件
$("#lessonTermTable").on('click', '.active', function () {
console.log('选中!');
//undefined
//console.log($(this).attr('id'));
//console.log('当前周', curWeek);
//第几节
//console.log('节次', $(this).closest("tr").find("td:eq(0)").text());
//星期几
//console.log('星期', $(this).attr('num'));
$('#WeekTimeSelect').lrselectSet('1');
$('#WeekSelect').lrselectSet('2');
var id = $(this).attr('id');
$('#ALTId').val(id);
//console.log('id',id);
if (id.length > 0 && id != 'undefined') {
learun.httpAsyncGet(
top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetFormData?keyValue=' + id,
function (res) {
if (res.data) {
$('#LessonInfo').lrselectSet(res.data.LessonNo);
$('#EmpInfo').lrselectSet(res.data.EmpNo);
$('#ClassroomInfo').lrselectSet(res.data.ClassroomNo);
} else {
$('#LessonInfo').lrselectSet('');
$('#EmpInfo').lrselectSet('');
$('#ClassroomInfo').lrselectSet('');
}
});
} else {
$('#LessonInfo').lrselectSet('');
$('#EmpInfo').lrselectSet('');
$('#ClassroomInfo').lrselectSet('');
}
$('#WeekTimeSelect').lrselectSet(curWeek);
$('#WeekSelect').lrselectSet($(this).attr('num'));
$('#NodeSelect').lrselectSet(($(this).closest("tr").find("td:eq(0)").text()).replace('节', ''));

});
@@ -175,107 +191,160 @@ var bootstrap = function ($, learun) {
$('#lr_refresh').on('click', function () {
location.reload();
});
//删除
$('#delete').on('click', function () {
if ($('#ALTId').val()) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/DeleteLessonTerm', { keyValue: $('#ALTId').val() }, function () {
$('#LessonInfo').lrselectSet('');
$('#EmpInfo').lrselectSet('');
$('#ClassroomInfo').lrselectSet('');
$('#WeekTimeSelect').lrselectSet('');
$('#WeekSelect').lrselectSet('');
$('#NodeSelect').lrselectSet('');
refreshGirdData();
});
}
});
}
});
//修改
$('#edit').on('click', function () {
learun.layerConfirm('是否确认修改该项!', function (res) {
if (res) {
var keyValue = $('#ALTId').val();
var postdata = {
//keyValue: $('#ALTId').val(),
TeachClassNo: classNo,
LessonNo: $('#LessonInfo').lrselectGet(),
LessonName: $('#LessonInfo').lrselectGetText(),
EmpNo: $('#EmpInfo').lrselectGet(),
EmpName: $('#EmpInfo').lrselectGetText(),
ClassroomNo: $('#ClassroomInfo').lrselectGet(),
WeekTimeSelect: $('#WeekTimeSelect').lrselectGet(),
WeekSelect: $('#WeekSelect').lrselectGet(),
NodeSelect: $('#NodeSelect').lrselectGet()
};
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/UpdateLessonTerm?keyValue=' + keyValue, { postdata: JSON.stringify(postdata) }, function () {
$('#LessonInfo').lrselectSet('');
$('#EmpInfo').lrselectSet('');
$('#ClassroomInfo').lrselectSet('');
$('#WeekTimeSelect').lrselectSet('');
$('#WeekSelect').lrselectSet('');
$('#NodeSelect').lrselectSet('');
refreshGirdData();
})};
});
});

//查询
//$('#lr_search').on('click', function () {
// var p = {};
// p.schoolId = $('#F_SchoolId').lrselectGet();
// p.ClassNo = $('#ClassNo').lrselectGet();
// p.EmpNo = $('#EmpNo').lrselectGet();
// page.search(p);
//});
//查询
//$('#lr_search').on('click', function () {
// var p = {};
// p.schoolId = $('#F_SchoolId').lrselectGet();
// p.ClassNo = $('#ClassNo').lrselectGet();
// p.EmpNo = $('#EmpNo').lrselectGet();
// page.search(p);
//});

//打印课程表
$('#perBtn').on('click',
function () {
AddPrintContent();
});
var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量
//打印课程表
$('#perBtn').on('click',
function () {
AddPrintContent();
});
var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量

function AddPrintContent() {
var myHtml = myHtml = $('.personalBox').html();
var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>";
var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>";
function AddPrintContent() {
var myHtml = myHtml = $('.personalBox').html();
var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>";
var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>";

LODOP = getLodop();
LODOP.PRINT_INIT("个人授课表");
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4");
LODOP = getLodop();
LODOP.PRINT_INIT("个人授课表");
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4");

LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2);
LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7);
LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2);
LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7);

LODOP.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml);
//打印预览
LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示
var TaskID1 = LODOP.PREVIEW();
// 直接打印
// var TaskID1=LODOP.PRINT();
LODOP.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml);
//打印预览
LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示
var TaskID1 = LODOP.PREVIEW();
// 直接打印
// var TaskID1=LODOP.PRINT();

}
}
},
bindSelect: function () {
//课程
$('#LessonInfo').lrDataSourceSelect({
// 展开最大高度
maxHeight: '100px',
placeholder: "请选择课程",
allowSearch: true,
code: 'LessonInfo',
value: 'lessonno',
text: 'lessonname'
});
//教师
$('#EmpInfo').lrDataSourceSelect({
placeholder: "请选择教师",
maxHeight: 300,
allowSearch: true,
code: 'EmpInfo',
value: 'empno',
text: 'empname'
});
//教室
$('#ClassroomInfo').lrDataSourceSelect({
placeholder: "请选择教室",
maxHeight: 300,
allowSearch: true,
code: 'ClassroomInfo',
value: 'classroomno',
text: 'classroomname'
});
////周次
//$('#WeekTimeSelect').lrselect({
// placeholder: "请选择周次",
// maxHeight: 300,
// allowSearch: true,
// type:'multiple',
// data: weekList
//});
//星期
$('#WeekSelect').lrselect({
placeholder: "请选择星期",
maxHeight: 300,
allowSearch: true,
//type: 'multiple',
data: [{ text: '星期一', value: '1' }, { text: '星期二', value: '2' }, { text: '星期三', value: '3' }, { text: '星期四', value: '4' }, { text: '星期五', value: '5' }, { text: '星期六', value: '6' }, { text: '星期日', value: '7' }, { text: '星期八', value: '8' }, { text: '星期九', value: '9' }, { text: '星期十', value: '10' }]
});
//节次
$('#NodeSelect').lrselect({
placeholder: "请选择节次",
maxHeight: 300,
allowSearch: true,
//type: 'multiple',
data: [{ text: '1节', value: '1' }, { text: '2节', value: '2' }, { text: '3节', value: '3' }, { text: '4节', value: '4' }, { text: '5节', value: '5' }, { text: '6节', value: '6' }, { text: '7节', value: '7' }, { text: '8节', value: '8' }, { text: '9节', value: '9' }, { text: '10节', value: '10' }]
});
$('#NodeSelect').lrselectSet(5);
},
search: function (param) {
param = param || {};
//当前第几周
param.curWeek = curWeek;
//班级
param.classNo = '202010';//classNo;
page.loadData(param);
}
bindSelect: function () {
//课程
$('#LessonInfo').lrDataSourceSelect({
// 展开最大高度
maxHeight: '100px',
placeholder: "请选择课程",
allowSearch: true,
code: 'LessonInfo',
value: 'lessonno',
text: 'lessonname'
});
//教师
$('#EmpInfo').lrDataSourceSelect({
placeholder: "请选择教师",
maxHeight: 300,
allowSearch: true,
code: 'EmpInfo',
value: 'empno',
text: 'empname'
});
//教室
$('#ClassroomInfo').lrDataSourceSelect({
placeholder: "请选择教室",
maxHeight: 300,
allowSearch: true,
code: 'ClassroomInfo',
value: 'classroomno',
text: 'classroomname'
});
////周次
//$('#WeekTimeSelect').lrselect({
// placeholder: "请选择周次",
// maxHeight: 300,
// allowSearch: true,
// type:'multiple',
// data: weekList
//});
//星期
$('#WeekSelect').lrselect({
placeholder: "请选择星期",
maxHeight: 300,
allowSearch: true,
//type: 'multiple',
data: [{ text: '星期一', value: '1' }, { text: '星期二', value: '2' }, { text: '星期三', value: '3' }, { text: '星期四', value: '4' }, { text: '星期五', value: '5' }, { text: '星期六', value: '6' }, { text: '星期日', value: '7' }, { text: '星期八', value: '8' }, { text: '星期九', value: '9' }, { text: '星期十', value: '10' }],
value: 'value',
text: 'text'
});
//节次
$('#NodeSelect').lrselect({
placeholder: "请选择节次",
maxHeight: 300,
allowSearch: true,
//type: 'multiple',
data: [{ text: '1节', value: '1' }, { text: '2节', value: '2' }, { text: '3节', value: '3' }, { text: '4节', value: '4' }, { text: '5节', value: '5' }, { text: '6节', value: '6' }, { text: '7节', value: '7' }, { text: '8节', value: '8' }, { text: '9节', value: '9' }, { text: '10节', value: '10' }],
value: 'value',
text: 'text'
});

},
search: function (param) {
param = param || {};
//当前第几周
param.curWeek = curWeek;
//班级
param.classNo = '202010';//classNo;
page.loadData(param);
}
};
page.init();
refreshGirdData = function () {
page.search();
};
page.init();
};

+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ArgLessonTermUpdRecordMap.cs Parādīt failu

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-05-24 10:27
/// 描 述:排考数据同步
/// </summary>
public class ArgLessonTermUpdRecordMap : EntityTypeConfiguration<ArgLessonTermUpdRecordEntity>
{
public ArgLessonTermUpdRecordMap()
{
#region 表、主键
//表
this.ToTable("ARGLESSONTERMUPDRECORD");
//主键
this.HasKey(t => t.Id);
#endregion

#region 配置关系
#endregion
}
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj Parādīt failu

@@ -69,6 +69,7 @@
<Compile Include="AssetManagementSystem\Ass_ScrapItemMap.cs" />
<Compile Include="AssetManagementSystem\Ass_ScrapMap.cs" />
<Compile Include="EducationalAdministration\ArrangeExamTermItemNewMap.cs" />
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecordMap.cs" />
<Compile Include="EducationalAdministration\ArrangeExamTermNewMap.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSyncMap.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemperMap.cs" />


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordBLL.cs Parādīt failu

@@ -0,0 +1,23 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;
using System.Threading.Tasks;
using Learun.Application.Organization;
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-02-27 11:05
/// 描 述:排课
/// </summary>
public class ArgLessonTermUpdRecordBLL : ArgLessonTermUpdRecordIBLL
{
private ArgLessonTermUpdRecordService argLessonTermUpdRecordService = new ArgLessonTermUpdRecordService();
}
}

+ 120
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordEntity.cs Parādīt failu

@@ -0,0 +1,120 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace Learun.Application.TwoDevelopment.EducationalAdministration

{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2022-01-20 11:05
/// 描 述:排课修改记录
/// </summary>
public class ArgLessonTermUpdRecordEntity
{
#region 实体成员
/// <summary>
/// 标识列
/// </summary>
/// <returns></returns>
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// 排课表Id
/// </summary>
/// <returns></returns>
[Column("ALTID")]
public string ALTId { get; set; }
/// <summary>
/// 原课程
/// </summary>
/// <returns></returns>
[Column("LESSONNOOLD")]
public string LessonNoOld { get; set; }
/// <summary>
/// 新课程
/// </summary>
/// <returns></returns>
[Column("LESSONNONEW")]
public string LessonNoNew { get; set; }
/// <summary>
/// 原教师
/// </summary>
/// <returns></returns>
[Column("EMPNOOLD")]
public string EmpNoOld { get; set; }
/// <summary>
/// 新教师
/// </summary>
/// <returns></returns>
[Column("EMPNONEW")]
public string EmpNoNew { get; set; }
/// <summary>
/// 原教室
/// </summary>
/// <returns></returns>
[Column("CLASSROOMNOOLD")]
public string ClassroomNoOld { get; set; }
/// <summary>
/// 新教室
/// </summary>
/// <returns></returns>
[Column("CLASSROOMNONEW")]
public string ClassroomNoNew { get; set; }
/// <summary>
/// 原星期-节次
/// </summary>
/// <returns></returns>
[Column("LESSONTIMEOLD")]
public string LessonTimeOld { get; set; }
/// <summary>
/// 新星期-节次
/// </summary>
/// <returns></returns>
[Column("LESSONTIMENEW")]
public string LessonTimeNew { get; set; }
/// <summary>
/// 修改时间
/// </summary>
/// <returns></returns>
[Column("UPDATETIME")]
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 操作人
/// </summary>
/// <returns></returns>
[Column("UPDATEUSERID")]
public string UpdateUserId { get; set; }
/// <summary>
/// 备注
/// </summary>
/// <returns></returns>
[Column("REMARK")]
public string Remark { get; set; }


#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.Id = Guid.NewGuid().ToString();
this.UpdateTime = DateTime.Now;
this.UpdateUserId = LoginUserInfo.Get().userId;
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.Id = keyValue;
}
#endregion
}
}


+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordIBLL.cs Parādīt failu

@@ -0,0 +1,20 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;
using System.Threading.Tasks;
using Learun.Application.Organization;
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-02-27 11:05
/// 描 述:排课
/// </summary>
public interface ArgLessonTermUpdRecordIBLL
{
}
}

+ 36
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordService.cs Parādīt failu

@@ -0,0 +1,36 @@
using Dapper;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Learun.Application.Base.SystemModule;
using Learun.Application.Organization;
using Newtonsoft.Json;
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-02-27 11:05
/// 描 述:排课
/// </summary>
public class ArgLessonTermUpdRecordService : RepositoryFactory
{

}
}



+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs Parādīt failu

@@ -213,6 +213,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public void DeleteLessonTerm(string keyValue)
{
try
{
arrangeLessonTermService.DeleteLessonTerm(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
@@ -237,6 +256,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model)
{
try
{
arrangeLessonTermService.UpdateLessonTerm(keyValue, model);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public IEnumerable<StuInfoBasicEntity> GetStudents()
{
try


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs Parādīt failu

@@ -86,6 +86,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
void DeleteEntity(string keyValue);
void DeleteLessonTerm(string keyValue);
void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model);
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>


+ 193
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs Parādīt failu

@@ -197,6 +197,172 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 删除课程
/// </summary>
/// <param name="keyValue"></param>
public void DeleteLessonTerm(string keyValue)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
var entity = db.FindEntity<ArrangeLessonTermEntity>(keyValue);
//更改课程表标记
entity.CheckMark = "0";
entity.Modify(keyValue);
db.Update(entity);

//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity.ALTId;
record.LessonNoOld = entity.LessonNo;
record.LessonNoNew = "";
record.EmpNoOld = entity.EmpNo;
record.EmpNoNew = "";
record.ClassroomNoOld = entity.ClassroomNo;
record.ClassroomNoNew = "";
record.Remark = "删除";
db.Insert(record);
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 修改课程
/// </summary>
/// <param name="keyValue"></param>
public void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
//开始时间
var startdate = DateTime.Today;
var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd");

var semesterAndYear = Common.GetSemesterAndYear(startDate);
//学校日历
var schoolCalendar = this.BaseRepository().FindEntity<SchoolCalendarEntity>(x =>
x.AcademicYearNo == semesterAndYear.AcademicYearShort && x.Semester == semesterAndYear.Semester);
//周次
var weekTimeAry = model.WeekTimeSelect.Split(',');
foreach (var weekTime in weekTimeAry)
{
var weektime = Convert.ToInt32(weekTime);
//开课时间
DateTime lessonDate = DateTime.Now;
if (weektime == 1)
{
//第一周
lessonDate = Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value)
.AddDays(model.WeekSelect - 1);
}
else
{
var start= Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value).AddDays((Convert.ToInt32(weekTime) - 1) * 14);
lessonDate = start.AddDays(model.WeekSelect - 1);
}
var lessiontime = model.WeekSelect + "-" + model.NodeSelect;
var entity =
db.FindEntity<ArrangeLessonTermEntity>(x =>
x.LessonDate == lessonDate && x.LessonTime == lessiontime);
if (entity == null)
{
//不存在 新增
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == model.TeachClassNo);

entity = new ArrangeLessonTermEntity();
entity.Create();
entity.LessonDate = lessonDate;
entity.AcademicYearNo = semesterAndYear.AcademicYearShort;
entity.Semester = semesterAndYear.Semester;
entity.LessonDate = lessonDate;

entity.DeptNo = classInfo?.DeptNo;
entity.MajorNo = classInfo?.MajorNo;

entity.LessonNo = model.LessonNo;
entity.LessonName = model.LessonName;
entity.EmpNo = model.EmpNo;
entity.EmpName = model.EmpName;
entity.TeachClassNo = model.TeachClassNo;
entity.ClassroomNo = model.ClassroomNo;
entity.LessonTime = lessiontime;
entity.CheckMark = "1";
entity.F_SchoolId = LoginUserInfo.Get().companyId;
db.Insert(entity);

//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity.ALTId;
record.LessonNoOld = "";
record.LessonNoNew = model.LessonNo;
record.EmpNoOld = "";
record.EmpNoNew = model.EmpNo;
record.ClassroomNoOld = "";
record.ClassroomNoNew = model.ClassroomNo;
record.Remark = "新增";
db.Insert(record);
}
else
{
//新增修改记录表
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity();
record.Create();
record.ALTId = entity.ALTId;
record.LessonNoOld = entity.LessonNo;
record.LessonNoNew = model.LessonNo;
record.EmpNoOld = entity.EmpNo;
record.EmpNoNew = model.EmpNo;
record.ClassroomNoOld = entity.ClassroomNo;
record.ClassroomNoNew = model.ClassroomNo;
record.Remark = "修改";
db.Insert(record);

//存在 修改
entity.TeachClassNo = model.TeachClassNo;
entity.LessonNo = model.LessonNo;
entity.LessonName = model.LessonName;
entity.EmpNo = model.EmpNo;
entity.EmpName = model.EmpName;
entity.ClassroomNo = model.ClassroomNo;
db.Update(entity);
}
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
@@ -230,6 +396,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}



internal bool GetAny()
{
try
@@ -705,14 +873,14 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
MajorNo = classinfo?.MajorNo,
LessonNo = item.curriculunNumber,
LessonName = item.curriculunName,
TeachClassNo =classinfo?.ClassNo,
TeachClassNo = classinfo?.ClassNo,
EmpNo = item.teacherNumber,
EmpName = item.teachername,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber)?.LessonSortNo,
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo)?.ClassroomNo,
LessonTime = item.week+"-"+item.section,
LessonTime = item.week + "-" + item.section,
CheckMark = "1",
F_SchoolId =entity.F_SchoolId
F_SchoolId = entity.F_SchoolId
};
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
@@ -845,7 +1013,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
LEFT JOIN tb_major m ON m.id=p.major
LEFT JOIN tb_course cour ON cour.id= p.`course`
LEFT JOIN tb_curriculum curr ON curr.id=cour.`course`
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester
+ "' AND sc.sid = '" + entity.F_SchoolId + "' ORDER BY p.`major` ");
var majorData = (await BaseRepository("CollegeMIS").FindListAsync<CdMajorEntity>()).ToList();
var lessonData = (await BaseRepository("CollegeMIS").FindListAsync<LessonInfoEntity>()).ToList();
@@ -2006,6 +2174,27 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les

#region MyRegion

#region 编辑课程表

public class UpdateLessonTermEntity
{
public string TeachClassNo { get; set; }
public string LessonNo { get; set; }
public string LessonName { get; set; }
public string EmpNo { get; set; }
public string EmpName { get; set; }
public string ClassroomNo { get; set; }
//周次
public string WeekTimeSelect { get; set; }
//星期
public int WeekSelect { get; set; }
//节次
public int NodeSelect { get; set; }
}


#endregion

public class TimeTable
{
public string ALTId { get; set; }


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj Parādīt failu

@@ -107,6 +107,10 @@
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncEntity.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncIBLL.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncService.cs" />
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordBLL.cs" />
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordEntity.cs" />
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordIBLL.cs" />
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordService.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperBLL.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperEntity.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperIBLL.cs" />


Notiek ielāde…
Atcelt
Saglabāt