Browse Source

新增按条件清空排课数据(清空导入)

黑艺新账号
北京泉江 9 months ago
parent
commit
8e17724e93
9 changed files with 166 additions and 4 deletions
  1. +12
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs
  2. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionFormNew.cshtml
  3. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionFormNew.js
  4. +4
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml
  5. +13
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js
  6. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  7. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs
  8. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs
  9. +43
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs

+ 12
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs View File

@@ -61,6 +61,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
[HttpGet]
public ActionResult EmptyByConditionFormNew()
{
return View();
}
/// <summary>
/// 按条件同步排课数据
/// <summary>
@@ -242,7 +247,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonDataByCondition(entity);
return Success(data);
}

[HttpPost]
[AjaxOnly]
public async Task<ActionResult> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity)
{
var data = await arrangeLessonTermIBLL.AsyncModifyArrangeLessonDataByConditionNew(entity);
return Success(data);
}
/// <summary>
/// 按条件同步排课数据
/// </summary>


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionFormNew.cshtml View File

@@ -0,0 +1,23 @@
@{
ViewBag.Title = "按条件清空排课数据";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">校区<font face="宋体">*</font></div>
<div id="F_SchoolId" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item">
<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">
<div class="lr-form-item-title">学期<font face="宋体">*</font></div>
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">同步内容<font face="宋体">*</font></div>
<div id="SyncType" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionFormNew.js")

+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/EmptyByConditionFormNew.js View File

@@ -0,0 +1,61 @@
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-02-27 11:05
* 描 述:按条件清空排课数据
*/
var acceptClick;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.bind();
//page.initData();
},
bind: function () {
$('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
//学年
$('#AcademicYearNo').lrselect({
placeholder: "请选择学年",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "请选择学期",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
value: 'value',
text: 'text'
});
$('#SyncType').lrselect({
placeholder: "请选择同步内容",
data: [{ text: "课表", value: "1" }, { text: "开课计划", value: "2" }],
value: 'value',
text: 'text'
});
},
initData: function () {
//if (!!selectedRow) {
// $('#form').lrSetFormData(selectedRow);
//}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('#form').lrValidform()) {
return false;
}
var postData = $('#form').lrGetFormData();
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/AsyncModifyArrangeLessonDataByConditionNew', postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});

};
page.init();
}

+ 4
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml View File

@@ -143,13 +143,14 @@
<li id="lr_import"><a><i></i>&nbsp;<span class="lrlt">导入</span></a></li>
<li id="lr_importpk"><a><i></i>&nbsp;<span class="lrlt">排课数据导入</span></a></li>
</ul>
<a id="emptyByConditionNew" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;按条件清空排课数据</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="emptyByCondition" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;按条件清空排课数据</a>
<a id="syncByCondition" class="btn btn-default"><i class="fa fa-handshake-o"></i>&nbsp;按条件同步排课数据</a>
@*<a id="emptyByCondition" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;按条件清空排课数据</a>
<a id="syncByCondition" class="btn btn-default"><i class="fa fa-handshake-o"></i>&nbsp;按条件同步排课数据</a>*@
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="initByCondition" class="btn btn-default"><i class="fa fa-circle-o-notch"></i>&nbsp;按条件重置基础数据同步状态</a>
@*<a id="initByCondition" class="btn btn-default"><i class="fa fa-circle-o-notch"></i>&nbsp;按条件重置基础数据同步状态</a>*@
</div>
</div>
</div>


+ 13
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js View File

@@ -192,6 +192,19 @@ var bootstrap = function ($, learun) {
}
});
});

$('#emptyByConditionNew').on('click', function () {
learun.layerForm({
id: 'EmptyByConditionForm',
title: '按条件清空排课数据',
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/EmptyByConditionFormNew',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 按条件同步排课数据
$('#syncByCondition').on('click', function () {
learun.layerForm({


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -1022,6 +1022,7 @@
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\Acc_DormitoryChange\FormView.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\coursestatictis.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\EmptyByConditionFormNew.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\PrintCourseStatistic.css" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\PrintCourseStatistic.js" />
<Content Include="Areas\EducationalAdministration\Views\CdMajor\FormProvince.js" />
@@ -8355,6 +8356,7 @@
<Content Include="Areas\PersonnelManagement\Views\TimeTable\ImportForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\PrintCourseStatistic.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\TimeTable\PkImportForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\EmptyByConditionFormNew.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs View File

@@ -662,5 +662,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

public async Task<bool> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity)
{
var data = await arrangeLessonTermService.AsyncModifyArrangeLessonDataByConditionNew(entity);
return data;
}
}
}

+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs View File

@@ -58,6 +58,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <returns></returns>
Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity);

Task<bool> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity);
/// <summary>
/// 按条件同步排课数据
/// </summary>


+ 43
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs View File

@@ -1206,7 +1206,48 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
return result;
}

public async Task<bool> AsyncModifyArrangeLessonDataByConditionNew(ArrangeLessonTermEntity entity)
{
bool result = false;
var db = BaseRepository("CollegeMIS");
try
{
if (entity.SyncType == "1")
{

db.BeginTrans();
db.ExecuteBySql(
$"delete from ArrangeLessonTerm where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.Commit();
result = true;
}
else
{
db.BeginTrans();
db.ExecuteBySql(
$"delete from TeachClass where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.ExecuteBySql(
$"delete from OpenLessonPlan where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.ExecuteBySql(
$"delete from StuSelectLessonList where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.Commit();
result = true;
}
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
return result;
}
/// <summary>
/// 课程表
/// </summary>
@@ -3057,7 +3098,9 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les
/// </summary>
public string ARemark { get; set; }

public string LessonWeek { get { return LessonTime.Substring(0, 1); } }

public string LessonNum { get { return LessonTime.Substring(1); } }
}

public class Common


Loading…
Cancel
Save