@@ -0,0 +1,136 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.LogisticsManagement; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public class Acc_DormitoryRuleController : MvcControllerBase | |||
{ | |||
private Acc_DormitoryRuleIBLL acc_DormitoryRuleIBLL = new Acc_DormitoryRuleBLL(); | |||
#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 = acc_DormitoryRuleIBLL.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 Acc_DormitoryRuleData = acc_DormitoryRuleIBLL.GetAcc_DormitoryRuleEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
Acc_DormitoryRule = Acc_DormitoryRuleData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
acc_DormitoryRuleIBLL.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) | |||
{ | |||
Acc_DormitoryRuleEntity entity = strEntity.ToObject<Acc_DormitoryRuleEntity>(); | |||
DateTime time; | |||
bool flag = DateTime.TryParse(entity.LateReturnTime, out time); | |||
if (!flag) | |||
{ | |||
return Fail("晚归时间格式不正确!"); | |||
} | |||
var model = acc_DormitoryRuleIBLL.GetEnableEntity(); | |||
if (entity.IsEnable == 1) | |||
{ | |||
if (string.IsNullOrEmpty(keyValue) && model != null) | |||
{ | |||
return Fail("只能有一个启用的规则!"); | |||
} | |||
else if (!string.IsNullOrEmpty(keyValue) && model != null && model.Id != keyValue) | |||
{ | |||
return Fail("只能有一个启用的规则!"); | |||
} | |||
} | |||
acc_DormitoryRuleIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -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" data-table="Acc_DormitoryRule"> | |||
<div class="lr-form-item-title">晚归时间<font face="宋体">*</font></div> | |||
<input id="LateReturnTime" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请填写时分,例如:22:00" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryRule" > | |||
<div class="lr-form-item-title">推送人<font face="宋体">*</font></div> | |||
<div id="PushUser" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryRule" > | |||
<div class="lr-form-item-title">推送班主任<font face="宋体">*</font></div> | |||
<div id="ClassDiredctor"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Acc_DormitoryRule" > | |||
<div class="lr-form-item-title">启用<font face="宋体">*</font></div> | |||
<div id="IsEnable"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Acc_DormitoryRule/Form.js") |
@@ -0,0 +1,62 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-14 12:05 | |||
* 描 述:宿舍晚归规则 | |||
*/ | |||
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 () { | |||
$('#PushUser').lrDataSourceSelect({ | |||
code: 'teacheruserdata', value: 'f_userid', text: 'f_realname', type: 'multiple' | |||
}); | |||
$('#ClassDiredctor').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'YesOrNoInt', | |||
}); | |||
$('#IsEnable').lrRadioCheckbox({ | |||
type: 'radio', | |||
code: 'YesOrNoInt', | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Acc_DormitoryRule/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 + '/LogisticsManagement/Acc_DormitoryRule/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
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> | |||
<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_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Acc_DormitoryRule/Index.js") |
@@ -0,0 +1,138 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-03-14 12:05 | |||
* 描 述:宿舍晚归规则 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/LogisticsManagement/Acc_DormitoryRule/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)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LogisticsManagement/Acc_DormitoryRule/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 + '/LogisticsManagement/Acc_DormitoryRule/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/Acc_DormitoryRule/GetPageList', | |||
headData: [ | |||
{ label: "晚归时间", name: "LateReturnTime", width: 100, align: "left" }, | |||
{ | |||
label: "推送人", name: "PushUser", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
if (value.indexOf(',') != -1) { | |||
var content = ''; | |||
var timearr = value.split(','); | |||
for (var i = 0; i < timearr.length; i++) { | |||
learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: timearr[i], | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
content += _data['f_realname']; | |||
} | |||
}); | |||
} | |||
content = content.substring(0, content.length - 1); | |||
callback(content); | |||
} else { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: value, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
} | |||
}, | |||
{ | |||
label: "推送班主任", name: "ClassDiredctor", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'YesOrNoInt', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "启用", name: "IsEnable", width: 100, align: "left", | |||
formatter: function (cellvalue, rowObject) { | |||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
], | |||
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(); | |||
} |
@@ -846,6 +846,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookOutController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuCardInfoController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\DormitoryReturnController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\Acc_DormitoryRuleController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6701,6 +6702,10 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Form.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Form.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Acc_DormitoryRule\Index.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Acc_DormitoryRule\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Acc_DormitoryRule\Form.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\Acc_DormitoryRule\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | |||
@@ -460,6 +460,9 @@ | |||
if (!op.code) { | |||
return $(this); | |||
} | |||
if (!!op.type) { | |||
dfop.type = op.type; | |||
} | |||
var $select = $(this).lrselect(dfop); | |||
learun.clientdata.getAllAsync('sourceData', { | |||
@@ -600,6 +600,7 @@ | |||
<Compile Include="EducationalAdministration\TextBookOutMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuCardInfoMap.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryReturnMap.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryRuleMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.LogisticsManagement; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public class Acc_DormitoryRuleMap : EntityTypeConfiguration<Acc_DormitoryRuleEntity> | |||
{ | |||
public Acc_DormitoryRuleMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ACC_DORMITORYRULE"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -1830,6 +1830,10 @@ | |||
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnService.cs" /> | |||
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnBLL.cs" /> | |||
<Compile Include="LogisticsManagement\DormitoryReturn\DormitoryReturnIBLL.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryRule\Acc_DormitoryRuleEntity.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryRule\Acc_DormitoryRuleService.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryRule\Acc_DormitoryRuleBLL.cs" /> | |||
<Compile Include="LogisticsManagement\Acc_DormitoryRule\Acc_DormitoryRuleIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,148 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public class Acc_DormitoryRuleBLL : Acc_DormitoryRuleIBLL | |||
{ | |||
private Acc_DormitoryRuleService acc_DormitoryRuleService = new Acc_DormitoryRuleService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Acc_DormitoryRuleEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return acc_DormitoryRuleService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Acc_DormitoryRule表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Acc_DormitoryRuleEntity GetAcc_DormitoryRuleEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return acc_DormitoryRuleService.GetAcc_DormitoryRuleEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Acc_DormitoryRule表实体数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
public Acc_DormitoryRuleEntity GetEnableEntity() | |||
{ | |||
try | |||
{ | |||
return acc_DormitoryRuleService.GetEnableEntity(); | |||
} | |||
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 | |||
{ | |||
acc_DormitoryRuleService.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, Acc_DormitoryRuleEntity entity) | |||
{ | |||
try | |||
{ | |||
acc_DormitoryRuleService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,85 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public class Acc_DormitoryRuleEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 晚归时间 | |||
/// </summary> | |||
[Column("LATERETURNTIME")] | |||
public string LateReturnTime { get; set; } | |||
/// <summary> | |||
/// 推送人员 | |||
/// </summary> | |||
[Column("PUSHUSER")] | |||
public string PushUser { get; set; } | |||
/// <summary> | |||
/// 是否推送班主任 | |||
/// </summary> | |||
[Column("CLASSDIREDCTOR")] | |||
public int? ClassDiredctor { get; set; } | |||
/// <summary> | |||
/// 是否启用 | |||
/// </summary> | |||
[Column("ISENABLE")] | |||
public int? IsEnable { get; set; } | |||
/// <summary> | |||
/// CreateTime | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// CreateUserId | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// UpdateTime | |||
/// </summary> | |||
[Column("UPDATETIME")] | |||
public DateTime? UpdateTime { get; set; } | |||
/// <summary> | |||
/// UpdateUserId | |||
/// </summary> | |||
[Column("UPDATEUSERID")] | |||
public string UpdateUserId { 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,49 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public interface Acc_DormitoryRuleIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Acc_DormitoryRuleEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Acc_DormitoryRule表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Acc_DormitoryRuleEntity GetAcc_DormitoryRuleEntity(string keyValue); | |||
Acc_DormitoryRuleEntity GetEnableEntity(); | |||
#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, Acc_DormitoryRuleEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,172 @@ | |||
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.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-03-14 12:05 | |||
/// 描 述:宿舍晚归规则 | |||
/// </summary> | |||
public class Acc_DormitoryRuleService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Acc_DormitoryRuleEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.Id, | |||
t.LateReturnTime, | |||
t.PushUser, | |||
t.ClassDiredctor, | |||
t.IsEnable | |||
"); | |||
strSql.Append(" FROM Acc_DormitoryRule t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryRuleEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Acc_DormitoryRule表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Acc_DormitoryRuleEntity GetAcc_DormitoryRuleEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Acc_DormitoryRuleEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Acc_DormitoryRule表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Acc_DormitoryRuleEntity GetEnableEntity() | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Acc_DormitoryRuleEntity>(x => x.IsEnable == 1); | |||
} | |||
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<Acc_DormitoryRuleEntity>(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, Acc_DormitoryRuleEntity 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 | |||
} | |||
} |