瀏覽代碼

20241213

焉耆分支
dao 1 月之前
父節點
當前提交
8fb72cfaba
共有 6 個文件被更改,包括 158 次插入0 次删除
  1. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  2. +62
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Device/LessonShow.cs
  3. +39
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs
  4. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs
  5. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs
  6. +47
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj 查看文件

@@ -191,6 +191,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Bootstraper.cs" />
<Compile Include="Modules\Device\LessonShow.cs" />
<Compile Include="Modules\Echarts\EchartsApi.cs" />
<Compile Include="Modules\Echarts\StudentEchartsApi.cs" />
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermApi.cs" />


+ 62
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Device/LessonShow.cs 查看文件

@@ -0,0 +1,62 @@
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Microsoft.Ajax.Utilities;
using Nancy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learun.Application.WebApi.Modules.Device
{
public class LessonShow: BaseNoAuthentication
{
public LessonShow() : base("/app/lesson")
{
Get["/class/list"] = GetClassList;
Get["/arrangelesson"] = GetLesson;
Post["/class/bind"] = BindClass;
}

DataSourceIBLL dataSourceIBLL = new DataSourceBLL();
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();


/// <summary>
/// 班级列表
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetClassList(dynamic _)
{
//var keyValue = this.GetReqData(); 1=1 AND CheckMark=1 order by classno desc
var data = dataSourceIBLL.GetDataTable("bjsj", "");
return Success(data);
}

public Response BindClass(dynamic _)
{
var k = this.GetReq<BindDevClass>();
classInfoIBLL.BindDevice(k.ClassNo, k.DeviceNo);
return Success("操作成功");
}
public class BindDevClass
{
public string ClassNo { get; set; }

public string DeviceNo { get; set; }
}
public Response GetLesson(dynamic _)
{
var bj = this.GetReq<BindDevClass>();
var classInfo = classInfoIBLL.GetClassNoByDevice(bj.DeviceNo);
if (classInfo == null) return Fail("未找到班级");

return Success(data);
}


}
}

+ 39
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs 查看文件

@@ -278,6 +278,45 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public void BindDevice(string classno, string dev)
{
try
{
classInfoService.BindDevice(classno,dev);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public ClassInfoEntity GetClassNoByDevice(string dev)
{
try
{
var bj= classInfoService.GetClassNoByDevice(dev);
return bj;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoEntity.cs 查看文件

@@ -107,6 +107,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("CLASSSTATUS")]
public string ClassStatus { get; set; }
/// <summary>
/// 设备编码
/// </summary>
[Column("DeviceCode")]
public string DeviceCode { get; set; }
#endregion

#region 扩展操作


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs 查看文件

@@ -69,5 +69,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

IEnumerable<ClassInfoEntity> GetAllClass();
IEnumerable<ClassInfoEntity> GetClassByMajorNo(string majorNo, string nj);

void BindDevice(string classno, string dev);

ClassInfoEntity GetClassNoByDevice(string dev);
}
}

+ 47
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs 查看文件

@@ -391,5 +391,52 @@ 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);
if (cn == null) throw new Exception("未找到班级");
cn.DeviceCode = dev;
db.Update(cn);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public ClassInfoEntity GetClassNoByDevice(string dev)
{
var db = this.BaseRepository("CollegeMIS");
try
{
var cn = db.FindEntity<ClassInfoEntity>(x => x.DeviceCode == dev);
if (cn == null) throw new Exception("未找到班级");
return cn;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

Loading…
取消
儲存