@@ -0,0 +1,133 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public class LessonDevController : MvcControllerBase | |||
{ | |||
private LessonDevIBLL lessonDevIBLL = new LessonDevBLL(); | |||
#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="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList( string queryJson ) | |||
{ | |||
var data = lessonDevIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
/// <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 = lessonDevIBLL.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 data = lessonDevIBLL.GetEntity(keyValue); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
lessonDevIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 解邦 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult UnBind(string keyValue) | |||
{ | |||
lessonDevIBLL.UnBind(keyValue); | |||
return Success("操作成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue,LessonDevEntity entity) | |||
{ | |||
lessonDevIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
@{ | |||
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">Id<font face="宋体">*</font></div> | |||
<input id="Id" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">设备编码<font face="宋体">*</font></div> | |||
<input id="DevCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">设备备注</div> | |||
<input id="DevBz" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LessonDev/Form.js") |
@@ -0,0 +1,38 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2024-12-18 10:37 | |||
* 描 述:课表设备 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var selectedRow = learun.frameTab.currentIframe().selectedRow; | |||
var page = { | |||
init: function () { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
}, | |||
initData: function () { | |||
if (!!selectedRow) { | |||
$('#form').lrSetFormData(selectedRow); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('#form').lrGetFormData(); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/LessonDev/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,34 @@ | |||
@{ | |||
ViewBag.Title = "课表设备"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap"> | |||
<div class="lr-layout-title">标题</div> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" /> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</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_unbind" class="btn btn-default"><i class="fa fa-cog"></i> 解邦</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/LessonDev/Index.js") |
@@ -0,0 +1,106 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2024-12-18 10:37 | |||
* 描 述:课表设备 | |||
*/ | |||
var selectedRow; | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var keyword = $('#txt_Keyword').val(); | |||
page.search({ keyword: keyword }); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/LessonDev/Form', | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/LessonDev/Form?keyValue=' + keyValue, | |||
width: 700, | |||
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/LessonDev/DeleteForm', { keyValue: keyValue}, function () { | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//解绑 | |||
$('#lr_unbind').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('DevCode'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认解邦!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonDev/UnBind', { keyValue: keyValue }, function () { | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/LessonDev/GetPageList', | |||
headData: [ | |||
//{ label: 'Id', name: 'Id', width: 200, align: "left" }, | |||
{ label: '设备编号', name: 'DevCode', width: 200, align: "left" }, | |||
{ label: '备注', name: 'DevBz', width: 200, align: "left" }, | |||
{ label: '邦定班级', name: 'ClassName', width: 200, align: "left" }, | |||
], | |||
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(); | |||
} |
@@ -896,6 +896,7 @@ | |||
<Compile Include="Areas\LR_Desktop\Controllers\VisitManageController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\RepairStudent_rejectlogController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\RepairTeacher_rejectlogController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\LessonDevController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6842,6 +6843,10 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\RepairTeacher_rejectlog\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\RepairTeacher_rejectlog\Form.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\RepairTeacher_rejectlog\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonDev\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonDev\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonDev\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LessonDev\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | |||
@@ -51,10 +51,17 @@ namespace Learun.Application.WebApi.Modules.Device | |||
} | |||
public class BindDevClass | |||
{ | |||
/// <summary> | |||
/// 班级编号 | |||
/// </summary> | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// 设备编号 | |||
/// </summary> | |||
public string DeviceNo { get; set; } | |||
/// <summary> | |||
/// 设备密码 | |||
/// </summary> | |||
public string DevPwd { get; set; } | |||
} | |||
/// <summary> | |||
@@ -65,10 +72,11 @@ namespace Learun.Application.WebApi.Modules.Device | |||
public Response GetLesson(dynamic _) | |||
{ | |||
var bj = this.GetReq<BindDevClass>(); | |||
if (bj.DeviceNo.IsNullOrWhiteSpace()) return Fail($"设备码不正确({bj.DeviceNo});"); | |||
var classInfo = classInfoIBLL.GetClassNoByDevice(bj.DeviceNo); | |||
if (classInfo == null) return Fail("未找到班级"); | |||
var lesson = arrangeLessonTermIBLL.GetLessonDay(DateTime.Today, classInfo.ClassNo, ""); | |||
return Success(lesson); | |||
return Success(new { Lesson=lesson,classInfo.ClassName}); | |||
} | |||
/// <summary> | |||
/// 验证密码 | |||
@@ -83,7 +91,7 @@ namespace Learun.Application.WebApi.Modules.Device | |||
{ | |||
return Fail("密码错误!"); | |||
} | |||
return Success("lesson"); | |||
return Success("验证通过"); | |||
} | |||
} | |||
} |
@@ -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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public class LessonDevMap : EntityTypeConfiguration<LessonDevEntity> | |||
{ | |||
public LessonDevMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("LESSONDEV"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -626,6 +626,7 @@ | |||
<Compile Include="LR_Desktop\VisitManageMap.cs" /> | |||
<Compile Include="LogisticsManagement\RepairStudent_rejectlogMap.cs" /> | |||
<Compile Include="LogisticsManagement\RepairTeacher_rejectlogMap.cs" /> | |||
<Compile Include="EducationalAdministration\LessonDevMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -1790,7 +1790,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||
{ | |||
var startDate = lessonDate; | |||
var endDate = lessonDate.AddDays(1); | |||
string sql = @"select b.AltId,b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName,f.LessonTypeName,f.LessonTypeCode | |||
string sql = @"select b.AltId,b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,d.ClassName,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName,f.LessonTypeName,f.LessonTypeCode | |||
from ArrangeLessonTerm b | |||
left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo | |||
left join LessonInfo e on b.LessonNo=e.LessonNo | |||
@@ -2337,7 +2337,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||
public string LessonTypeName { get; set; } | |||
public string LessonTypeCode { get; set; } | |||
public string LessonOrder { get { return LessonTime.Substring(1); } } | |||
} | |||
public class Common | |||
@@ -357,15 +357,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
public void BindDevice(string classno, string dev) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
var cn = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == classno); | |||
var cn = this.BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.ClassNo == classno); | |||
if (cn == null) throw new Exception("未找到班级"); | |||
if(!cn.DeviceCode.IsEmpty()) throw new Exception("请勿重复邦定!"); | |||
cn.DeviceCode = dev; | |||
db.Update(cn); | |||
this.BaseRepository("CollegeMIS").Update(cn); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -382,10 +381,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
public ClassInfoEntity GetClassNoByDevice(string dev) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
var cn = db.FindEntity<ClassInfoEntity>(x => x.DeviceCode == dev); | |||
var cn = this.BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.DeviceCode == dev); | |||
if (cn == null) throw new Exception("未找到班级"); | |||
return cn; | |||
@@ -0,0 +1,167 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public class LessonDevBLL : LessonDevIBLL | |||
{ | |||
private LessonDevService lessonDevService = new LessonDevService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LessonDevEntity> GetList( string queryJson ) | |||
{ | |||
try | |||
{ | |||
return lessonDevService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LessonDevEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return lessonDevService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public LessonDevEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return lessonDevService.GetEntity(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 | |||
{ | |||
lessonDevService.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> | |||
public void SaveEntity(string keyValue, LessonDevEntity entity) | |||
{ | |||
try | |||
{ | |||
lessonDevService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public void UnBind(string keyValue) | |||
{ | |||
try | |||
{ | |||
lessonDevService.UnBind(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,77 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public class LessonDevEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// DevCode | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("DEVCODE")] | |||
public string DevCode { get; set; } | |||
/// <summary> | |||
/// DevBz | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("DEVBZ")] | |||
public string DevBz { get; set; } | |||
[Column("DevPwd")] | |||
public string DevPwd { get; set; } | |||
#endregion | |||
[NotMapped] | |||
public string ClassNo { get; set; } | |||
[NotMapped] | |||
public string ClassName { get; set; } | |||
#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 | |||
} | |||
} | |||
@@ -0,0 +1,56 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public interface LessonDevIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<LessonDevEntity> GetList( string queryJson ); | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<LessonDevEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
LessonDevEntity GetEntity(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, LessonDevEntity entity); | |||
#endregion | |||
void UnBind(string keyValue); | |||
} | |||
} |
@@ -0,0 +1,206 @@ | |||
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 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-12-18 10:37 | |||
/// 描 述:课表设备 | |||
/// </summary> | |||
public class LessonDevService : RepositoryFactory | |||
{ | |||
#region 构造函数和属性 | |||
private string fieldSql; | |||
/// <summary> | |||
/// 构造方法 | |||
/// </summary> | |||
public LessonDevService() | |||
{ | |||
fieldSql=@" | |||
t.Id, | |||
t.DevCode, | |||
t.DevBz | |||
"; | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LessonDevEntity> GetList( string queryJson ) | |||
{ | |||
try | |||
{ | |||
//参考写法 | |||
//var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
//var dp = new DynamicParameters(new { }); | |||
//dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql); | |||
strSql.Append(" FROM LessonDev t "); | |||
return this.BaseRepository("CollegeMIS").FindList<LessonDevEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LessonDevEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.*,c.ClassNo,c.ClassName "); | |||
strSql.Append(" FROM LessonDev t left join ClassInfo c on t.DevCode=c.DeviceCode"); | |||
return this.BaseRepository("CollegeMIS").FindList<LessonDevEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public LessonDevEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<LessonDevEntity>(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<LessonDevEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// </summary> | |||
public void SaveEntity(string keyValue, LessonDevEntity 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 | |||
public void UnBind(string keyValue) | |||
{ | |||
try | |||
{ | |||
var entity= this.BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.DeviceCode == keyValue); | |||
if (entity == null) throw new Exception("参数错误"); | |||
entity.DeviceCode = string.Empty; | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -1929,6 +1929,10 @@ | |||
<Compile Include="LogisticsManagement\RepairTeacher_rejectlog\RepairTeacher_rejectlogService.cs" /> | |||
<Compile Include="LogisticsManagement\RepairTeacher_rejectlog\RepairTeacher_rejectlogBLL.cs" /> | |||
<Compile Include="LogisticsManagement\RepairTeacher_rejectlog\RepairTeacher_rejectlogIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\LessonDev\LessonDevEntity.cs" /> | |||
<Compile Include="EducationalAdministration\LessonDev\LessonDevService.cs" /> | |||
<Compile Include="EducationalAdministration\LessonDev\LessonDevIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\LessonDev\LessonDevBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||