@@ -0,0 +1,164 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public class DtStayInSchoolController : MvcControllerBase | |||
{ | |||
private DtStayInSchoolIBLL dtStayInSchoolIBLL = new DtStayInSchoolBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = dtStayInSchoolIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var DtStayInSchoolData = dtStayInSchoolIBLL.GetDtStayInSchoolEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
DtStayInSchool = DtStayInSchoolData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
dtStayInSchoolIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
DtStayInSchoolEntity entity = strEntity.ToObject<DtStayInSchoolEntity>(); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.State = "0"; | |||
entity.CreateTime = DateTime.Now; | |||
} | |||
dtStayInSchoolIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
#region 扩展数据 | |||
/// <summary> | |||
/// 提交数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult SubmitList(string keyValue) | |||
{ | |||
var Model = dtStayInSchoolIBLL.GetDtStayInSchoolEntity(keyValue); | |||
if (Model != null) | |||
{ | |||
Model.State = "1"; | |||
Model.CreateTime = DateTime.Now; | |||
dtStayInSchoolIBLL.SaveEntity(keyValue, Model); | |||
} | |||
return Success("提交成功!"); | |||
} | |||
#region 教师审核 | |||
/// <summary> | |||
/// 提交数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult TeacherAudit(string keyValue) | |||
{ | |||
var Model = dtStayInSchoolIBLL.GetDtStayInSchoolEntity(keyValue); | |||
if (Model != null) | |||
{ | |||
Model.State = "2"; | |||
Model.CreateTime = DateTime.Now; | |||
dtStayInSchoolIBLL.SaveEntity(keyValue, Model); | |||
} | |||
return Success("审核成功!"); | |||
} | |||
#endregion | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,47 @@ | |||
@{ | |||
ViewBag.Title = "假期留校"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||
<div id="Grade" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">性别<font face="宋体">*</font></div> | |||
<div id="Sex" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">联系电话<font face="宋体">*</font></div> | |||
<input id="Phone" type="text" class="form-control" isvalid="yes" checkexpession="Mobile" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">班主任<font face="宋体">*</font></div> | |||
<div id="ClassTeacher" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">留校假期<font face="宋体">*</font></div> | |||
<div id="HoildayType" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">开始时间<font face="宋体">*</font></div> | |||
<input id="BeginTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm',onpicked: function () { $('#BeginTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" > | |||
<div class="lr-form-item-title">结束时间<font face="宋体">*</font></div> | |||
<input id="EndTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm',onpicked: function () { $('#EndTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" style="display: none; " > | |||
<div class="lr-form-item-title">创建用户</div> | |||
<input id="CreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="DtStayInSchool" style="display: none; " > | |||
<div class="lr-form-item-title">创建时间</div> | |||
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/DtStayInSchool/Form.js") |
@@ -0,0 +1,59 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-07-20 17:19 | |||
* 描 述:假期留校 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' }); | |||
$('#Grade').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' }); | |||
$('#Sex').lrDataItemSelect({ code: 'usersex' }); | |||
$('#ClassTeacher').lrDataSourceSelect({ code: 'TeacherInfo',value: 'f_userid',text: 'f_realname' }); | |||
$('#HoildayType').lrDataItemSelect({ code: 'StayInSchoolNo' }); | |||
$('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName); | |||
//$('#CreateTime')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
//$('#CreateTime').val(learun.clientdata.get(['userinfo']).realName); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,54 @@ | |||
@{ | |||
ViewBag.Title = "假期留校"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">性别</div> | |||
<div id="Sex"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班主任</div> | |||
<div id="ClassTeacher"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">留校假期</div> | |||
<div id="HoildayType"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">创建时间</div> | |||
<div id="CreateTime"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i> 提交</a>; | |||
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>审核</a>; | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/DtStayInSchool/Index.js") |
@@ -0,0 +1,224 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-07-20 17:19 | |||
* 描 述:假期留校 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); | |||
$('#Sex').lrDataItemSelect({ code: 'usersex' }); | |||
$('#ClassTeacher').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_userid', text: 'f_realname' }); | |||
$('#HoildayType').lrDataItemSelect({ code: 'StayInSchoolNo' }); | |||
//$('#CreateTime').lrUserSelect(0); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State != 0) { | |||
learun.alert.warning("当前项目已提交不能编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//提交 | |||
$('#lr_submit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State != 0) { | |||
learun.alert.warning("当前项目已提交,请勿重复提交!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/SubmitList', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//审核 | |||
$('#lr_lock').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State != 1) { | |||
learun.alert.warning("当前项目未提交,不能审核!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认审核该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/TeacherAudit', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/DtStayInSchool/GetPageList', | |||
headData: [ | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "Grade", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "性别", name: "Sex", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'usersex', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "联系电话", name: "Phone", width: 100, align: "left" }, | |||
{ | |||
label: "班主任", name: "ClassTeacher", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', | |||
key: value, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "留校假期", name: "HoildayType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'StayInSchoolNo', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "开始时间", name: "BeginTime", width: 150, align: "left" }, | |||
{ label: "结束时间", name: "EndTime", width: 150, align: "left" }, | |||
{ | |||
label: "创建用户", name: "CreateUserId", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('user', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "创建时间", name: "CreateTime", width: 200, align: "left"}, | |||
{ | |||
label: "当前状态", name: "State", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == 0) { | |||
return '<span class=\"label label-warning\">草稿</span>'; | |||
} | |||
if (cellvalue == 1) { | |||
return '<span class=\"label label-warning\">已提交</span>'; | |||
} else if (cellvalue == 2) { | |||
return '<span class=\"label label-success\">审核完成</span>'; | |||
} | |||
} | |||
} | |||
], | |||
mainId: 'Id', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -826,6 +826,7 @@ | |||
<Compile Include="Areas\CustomFunction\Controllers\ArchiveInfoController.cs" /> | |||
<Compile Include="Areas\CustomFunction\Controllers\ArchiveRecordInfoController.cs" /> | |||
<Compile Include="Areas\CustomFunction\Controllers\ArchiveUserController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\DtStayInSchoolController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6452,6 +6453,10 @@ | |||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\Index.js" /> | |||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\Form.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\ArchiveUser\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\DtStayInSchool\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\DtStayInSchool\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\DtStayInSchool\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\DtStayInSchool\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public class DtStayInSchoolMap : EntityTypeConfiguration<DtStayInSchoolEntity> | |||
{ | |||
public DtStayInSchoolMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("DTSTAYINSCHOOL"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -575,6 +575,7 @@ | |||
<Compile Include="CustomFunction\ArchiveInfoMap.cs" /> | |||
<Compile Include="CustomFunction\ArchiveRecordInfoMap.cs" /> | |||
<Compile Include="CustomFunction\ArchiveUserMap.cs" /> | |||
<Compile Include="EducationalAdministration\DtStayInSchoolMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,125 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public class DtStayInSchoolBLL : DtStayInSchoolIBLL | |||
{ | |||
private DtStayInSchoolService dtStayInSchoolService = new DtStayInSchoolService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<DtStayInSchoolEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return dtStayInSchoolService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取DtStayInSchool表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public DtStayInSchoolEntity GetDtStayInSchoolEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return dtStayInSchoolService.GetDtStayInSchoolEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
dtStayInSchoolService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, DtStayInSchoolEntity entity) | |||
{ | |||
try | |||
{ | |||
dtStayInSchoolService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,105 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public class DtStayInSchoolEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 专业 | |||
/// </summary> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// 年级 | |||
/// </summary> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
/// <summary> | |||
/// 性别 | |||
/// </summary> | |||
[Column("SEX")] | |||
public string Sex { get; set; } | |||
/// <summary> | |||
/// 联系电话 | |||
/// </summary> | |||
[Column("PHONE")] | |||
public string Phone { get; set; } | |||
/// <summary> | |||
/// 假期类型 | |||
/// </summary> | |||
[Column("HOILDAYTYPE")] | |||
public string HoildayType { get; set; } | |||
/// <summary> | |||
/// 开始时间 | |||
/// </summary> | |||
[Column("BEGINTIME")] | |||
public DateTime? BeginTime { get; set; } | |||
/// <summary> | |||
/// 结束时间 | |||
/// </summary> | |||
[Column("ENDTIME")] | |||
public DateTime? EndTime { get; set; } | |||
/// <summary> | |||
/// 班主任 | |||
/// </summary> | |||
[Column("CLASSTEACHER")] | |||
public string ClassTeacher { get; set; } | |||
/// <summary> | |||
/// 申请人 | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 申请时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
[Column("DEMO")] | |||
public string Demo { get; set; } | |||
/// <summary> | |||
/// 状态 0 草稿 1 老师 | |||
/// </summary> | |||
[Column("STATE")] | |||
public string State { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,48 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public interface DtStayInSchoolIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<DtStayInSchoolEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取DtStayInSchool表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
DtStayInSchoolEntity GetDtStayInSchoolEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, DtStayInSchoolEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,180 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-07-20 17:19 | |||
/// 描 述:假期留校 | |||
/// </summary> | |||
public class DtStayInSchoolService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<DtStayInSchoolEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.MajorNo, | |||
t.Grade, | |||
t.Sex, | |||
t.Phone, | |||
t.ClassTeacher, | |||
t.HoildayType, | |||
t.BeginTime, | |||
t.EndTime, | |||
t.CreateUserId, | |||
t.CreateTime, | |||
t.State | |||
"); | |||
strSql.Append(" FROM DtStayInSchool t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["MajorNo"].IsEmpty()) | |||
{ | |||
dp.Add("MajorNo",queryParam["MajorNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.MajorNo = @MajorNo "); | |||
} | |||
if (!queryParam["Sex"].IsEmpty()) | |||
{ | |||
dp.Add("Sex",queryParam["Sex"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Sex = @Sex "); | |||
} | |||
if (!queryParam["ClassTeacher"].IsEmpty()) | |||
{ | |||
dp.Add("ClassTeacher",queryParam["ClassTeacher"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClassTeacher = @ClassTeacher "); | |||
} | |||
if (!queryParam["HoildayType"].IsEmpty()) | |||
{ | |||
dp.Add("HoildayType",queryParam["HoildayType"].ToString(), DbType.String); | |||
strSql.Append(" AND t.HoildayType = @HoildayType "); | |||
} | |||
if (!queryParam["CreateTime"].IsEmpty()) | |||
{ | |||
dp.Add("CreateTime",queryParam["CreateTime"].ToString(), DbType.String); | |||
strSql.Append(" AND t.CreateTime = @CreateTime "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<DtStayInSchoolEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取DtStayInSchool表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public DtStayInSchoolEntity GetDtStayInSchoolEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<DtStayInSchoolEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<DtStayInSchoolEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, DtStayInSchoolEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -1718,6 +1718,10 @@ | |||
<Compile Include="CustomFunction\ArchiveUser\ArchiveUserService.cs" /> | |||
<Compile Include="CustomFunction\ArchiveUser\ArchiveUserBLL.cs" /> | |||
<Compile Include="CustomFunction\ArchiveUser\ArchiveUserIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\DtStayInSchool\DtStayInSchoolEntity.cs" /> | |||
<Compile Include="EducationalAdministration\DtStayInSchool\DtStayInSchoolService.cs" /> | |||
<Compile Include="EducationalAdministration\DtStayInSchool\DtStayInSchoolBLL.cs" /> | |||
<Compile Include="EducationalAdministration\DtStayInSchool\DtStayInSchoolIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||