Просмотр исходного кода

教务---校历功能

新疆影视学院高职
ndbs 2 лет назад
Родитель
Сommit
f101a160f0
8 измененных файлов: 369 добавлений и 10 удалений
  1. +78
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SchoolCalendarController.cs
  2. +9
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/Form.cshtml
  3. +17
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/Form.js
  4. +166
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/ScheduleIndex.cshtml
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  6. +42
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarBLL.cs
  7. +13
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarIBLL.cs
  8. +43
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarService.cs

+ 78
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SchoolCalendarController.cs Просмотреть файл

@@ -3,6 +3,7 @@ using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;
using System.Collections;

namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
@@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[HttpGet]
public ActionResult Index()
{
return View();
return View();
}
/// <summary>
/// 表单页
@@ -35,7 +36,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[HttpGet]
public ActionResult Form()
{
return View();
return View();
}

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult ScheduleIndex()
{
return View();
}
#endregion

@@ -62,6 +73,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

/// <summary>
/// 获取日程数据
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult GetListForSchedule()
{
var userInfo = LoginUserInfo.Get();
List<Hashtable> data = new List<Hashtable>();
foreach (SchoolCalendarEntity entity in schoolCalendarIBLL.GetList())
{
Hashtable ht = new Hashtable();
ht["id"] = entity.ID;
ht["academicYearNo"] = "【" + entity.AcademicYearNo + "】";
ht["title"] = entity.Content;
ht["end"] = (entity.EndTime.ToDate().ToString("yyyy-MM-dd") + " " + entity.EndTime.ToString().Substring(0, 2) + ":" + entity.EndTime.ToString().Substring(2, 2)).ToDate().ToString("yyyy-MM-dd HH:mm:ss");
ht["start"] = (entity.StartTime.ToDate().ToString("yyyy-MM-dd") + " " + entity.StartTime.ToString().Substring(0, 2) + ":" + entity.StartTime.ToString().Substring(2, 2)).ToDate().ToString("yyyy-MM-dd HH:mm:ss");
ht["allDay"] = false;
data.Add(ht);
}
return ToJsonResult(data);
}
/// <summary>
/// 获取页面显示列表数据
/// <summary>
@@ -82,8 +116,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var SchoolCalendarData = schoolCalendarIBLL.GetSchoolCalendarEntity( keyValue );
var jsonData = new {
var SchoolCalendarData = schoolCalendarIBLL.GetSchoolCalendarEntity(keyValue);
var jsonData = new
{
SchoolCalendar = SchoolCalendarData,
};
return Success(jsonData);
@@ -114,11 +149,48 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
UserInfo userInfo = LoginUserInfo.Get(); SchoolCalendarEntity entity = strEntity.ToObject<SchoolCalendarEntity>();
schoolCalendarIBLL.SaveEntity(userInfo,keyValue,entity);
UserInfo userInfo = LoginUserInfo.Get();
SchoolCalendarEntity entity = strEntity.ToObject<SchoolCalendarEntity>();
//根据学年和学期查询
var model = schoolCalendarIBLL.GetSchoolCalendarEntityByNo(entity.AcademicYearNo, entity.Semester);
if (string.IsNullOrEmpty(keyValue))
{
if (model != null)
{
return Fail("当前学期已存在!");
}
}
else
{
if (model != null && model.ID != keyValue)
{
return Fail("当前学期已存在!");
}
}
schoolCalendarIBLL.SaveEntity(userInfo, keyValue, entity);
return Success("保存成功!");
}
#endregion

#region 扩展数据
/// <summary>
/// 学年
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult GenerateNearByAcademic()
{
return Success(Learun.Util.WebHelper.GenerateNearByAcademic());
}
/// <summary>
/// 学期
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult GenerateNearBySemeter()
{
return Success(Learun.Util.WebHelper.GenerateNearBySemeter());
}
#endregion
}
}

+ 9
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/Form.cshtml Просмотреть файл

@@ -3,13 +3,21 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap">
<div class="col-xs-6 lr-form-item" data-table="SchoolCalendar">
@*<div class="col-xs-6 lr-form-item" data-table="SchoolCalendar">
<div class="lr-form-item-title">学年</div>
<input id="AcademicYearNo" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="SchoolCalendar">
<div class="lr-form-item-title">学期</div>
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div>
</div>*@
<div class="col-xs-12 lr-form-item" data-table="SchoolCalendar">
<div class="lr-form-item-title">学年<font face="宋体">*</font></div>
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="SchoolCalendar">
<div class="lr-form-item-title">学期<font face="宋体">*</font></div>
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="SchoolCalendar">
<div class="lr-form-item-title">开始日期</div>


+ 17
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/Form.js Просмотреть файл

@@ -15,8 +15,22 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
$("#Semester").lrDataItemSelect({ code: 'Semester' });

//学年
$('#AcademicYearNo').lrselect({
placeholder: "请选择学年",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/GenerateNearByAcademic',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "请选择学年",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/GenerateNearBySemeter',
value: 'value',
text: 'text'
});
},
initData: function () {
if (!!keyValue) {
@@ -46,6 +60,7 @@ var bootstrap = function ($, learun) {
if (!!callBack) {
callBack();
}
learun.frameTab.currentIframe().location.reload();
});
};
page.init();


+ 166
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/ScheduleIndex.cshtml Просмотреть файл

@@ -0,0 +1,166 @@
<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>日程管理</title>
<script src="~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js"></script>
<script src="~/Content/jquery/plugin/jquery-ui/jquery-ui.min.js"></script>
<script src="~/Content/jquery/plugin/fullcalendar/js/fullcalendar.min.js"></script>
<link href="~/Content/jquery/plugin/fullcalendar/css/fullcalendar.css" rel="stylesheet" />
@Html.AppendCssFile(
"/Views/LR_Content/style/lr-common.css",
"/Views/LR_Content/style/lr-iframe-index.css"
)

<script type='text/javascript'>
var search = (window.location.search).split('?')[1];
var type = search.split('=')[1];
//type=1 校历查看;type=2 校历管理(日历模式)
$(document).ready(function () {
resize();
$('.calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'agendaDay,agendaWeek,month'
},
monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
dayNamesShort: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
buttonText: {
prev: '上一页',
next: '下一页',
month: '月视图',
week: '周视图',
day: '日视图'
},
titleFormat: "yyyy年MM月",
columnFormat: {
month: 'ddd',
week: 'MM月dd日 ddd',
day: 'MM月dd日 ddd'
},
allDayText: '今天',
axisFormat: "HH:00",
height: $(window).height() - 55,
dayClick: function (date, allDay, jsEvent, view) {
if (type == 2) {
btn_add();
}
},
editable: true,
eventLimit: true,
eventAfterRender: function (event, element, view) {//数据绑定上去后添加相应信息在页面上
//var fstart = $.fullCalendar.formatDate(event.start, "HH:mm");
//var fend = $.fullCalendar.formatDate(event.end, "HH:mm");

if (view.name == "month") {//按月份
var evtcontent = '<div class="fc-event-inner fc-event-skin" data-id="' + event.id + '">';
//evtcontent += '<span class="fc-event-time">' + fstart + " - " + fend + '</span>';
evtcontent += '<span class="fc-event-time">' + event.academicYearNo + '</span>';
evtcontent += '<span class="fc-event-title">: ' + event.title + '</span>';
evtcontent += '</div><div class="ui-resizable-handle ui-resizable-e">&nbsp;&nbsp;&nbsp;</div>';
if (type == 2) {
evtcontent += '<div class="fc-event-delete" style="width:100%;height:100%;background-color:#000;" data-id="' + event.id + '">删除</div>';
}
element.html(evtcontent);
} else {
var evtcontent = '<div class="fc-event-inner fc-event-skin" data-id="' + event.id + '" style="height:98%">';
evtcontent += '<div class="fc-event-head fc-event-skin">';
evtcontent += '<span class="fc-event-time">' + event.academicYearNo + '</span>';
//evtcontent += '<div class="fc-event-time">' + fstart + " - " + fend + event.title + '</div>';
evtcontent += '<div class="fc-event-title">' + event.title + '</div>';
evtcontent += '</div>';
evtcontent += '<div class="fc-event-content"></div>';
evtcontent += '<div class="fc-event-bg"></div>';
evtcontent += '</div>';
if (type == 2) {
evtcontent += '<div class="fc-event-delete" style="width:100%;height:2%;background-color:#000;" data-id="' + event.id + '">删除</div>';
}
element.html(evtcontent);
}
},
events: (function () {
var _data = [];
$.ajax({
url: top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/GetListForSchedule',
type: "get",
dataType: "json",
async: false,
success: function (data) {
_data = data;
}
});
return _data;
})()
});
});
function resize() {
$('#pageayout').height($(window).height() - 20);
$(window).resize(function (e) {
window.setTimeout(function () {
$('#pageayout').height($(window).height() - 20);
}, 200);
e.stopPropagation();
});
}
//添加校历
function btn_add() {
if (type == 2) {
top.learun.layerForm({
id: 'form',
title: '添加校历',
url: '/EducationalAdministration/SchoolCalendar/Form',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
}
};
//编辑校历
$(document).on('click', '.fc-event-inner', function () {
if (type == 2) {
var keyValue = $(this).attr('data-id');
top.learun.layerForm({
id: 'form',
title: '编辑校历',
url: '/EducationalAdministration/SchoolCalendar/Form?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
}
});
//删除日程
$(document).on('click', '.fc-event-delete', function () {
if (type == 2) {
var keyValue = $(this).attr('data-id');
if (!keyValue) {
learun.alert.warning("请选择日程!");
return false;
}
top.learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
top.learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/DeleteForm', { keyValue: keyValue }, function () {
callback();
});
}
});
}
});

function callback() {
location.reload();
}
</script>
</head>
<body>
<div id="pageayout" class="border" style="overflow: auto; padding: 0px;">
<div id='calendar' class="calendar" style="margin: 10px;background: #fff; "></div>
</div>
</body>
</html>

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Просмотреть файл

@@ -7910,6 +7910,7 @@
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\FormView.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\FormView.cshtml" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\FormView.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\SchoolCalendar\ScheduleIndex.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 42
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarBLL.cs Просмотреть файл

@@ -90,6 +90,48 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <returns>返回列表</returns>
public IEnumerable<SchoolCalendarEntity> GetList()
{
try
{
return schoolCalendarService.GetList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}


public SchoolCalendarEntity GetSchoolCalendarEntityByNo(string academicYearNo, string semester)
{
try
{
return schoolCalendarService.GetSchoolCalendarEntityByNo(academicYearNo, semester);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion



+ 13
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarIBLL.cs Просмотреть файл

@@ -34,6 +34,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
SchoolCalendarEntity GetSchoolCalendarEntity(string keyValue);

/// <summary>
/// 获取列表
/// </summary>
/// <returns>返回列表</returns>
IEnumerable<SchoolCalendarEntity> GetList();

/// <summary>
/// 根据学年获取SchoolCalendar表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
SchoolCalendarEntity GetSchoolCalendarEntityByNo(string academicYearNo, string semester);
#endregion

#region 提交数据


+ 43
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SchoolCalendar/SchoolCalendarService.cs Просмотреть файл

@@ -142,6 +142,48 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取列表
/// </summary>
/// <returns>返回列表</returns>
public IEnumerable<SchoolCalendarEntity> GetList()
{
try
{
return this.BaseRepository().FindList<SchoolCalendarEntity>();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
throw;
else
throw ExceptionEx.ThrowServiceException(ex);
}
}
/// <summary>
/// 获取SchoolCalendar表实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public SchoolCalendarEntity GetSchoolCalendarEntityByNo(string academicYearNo, string semester)
{
try
{
return this.BaseRepository().FindEntity<SchoolCalendarEntity>(x => x.AcademicYearNo == academicYearNo && x.Semester == semester);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

#region 提交数据
@@ -204,6 +246,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}

#endregion
}
}

Загрузка…
Отмена
Сохранить