Browse Source

智慧大脑推送课程信息数据

临城职教中职
zhangli 2 years ago
parent
commit
48d0eb7065
7 changed files with 119 additions and 10 deletions
  1. +16
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs
  2. +11
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml
  3. +11
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js
  4. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs
  5. +18
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs
  6. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs
  7. +59
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs

+ 16
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs View File

@@ -29,7 +29,10 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
return View();
}
#endregion
/// <summary>
/// 校区基础信息
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult SyncCompany()
@@ -37,5 +40,17 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
dataCollectionIBLL.SaveXqjbsj();
return Success("操作成功");
}
/// <summary>
/// 校区基础信息
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult SyncLesson()
{
dataCollectionIBLL.SyncLesson();
return Success("操作成功");
}
}
}

+ 11
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml View File

@@ -2,26 +2,29 @@
ViewBag.Title = "智慧大脑数据采集";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout " >
<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">
<a id="lr_company" class="btn btn-default">&nbsp;校区基础数据</a>
@*<div class="lr-layout-tool-left">
</div>
@*<div class="lr-layout-tool-right">
<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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>*@
</div>
<div class="lr-layout-body" id="gridtable"></div>
<div class="lr-layout-body" id="gridtable">
<a id="lr_company" class="btn btn-primary">&nbsp;校区基础数据</a>
<a id="lr_lesson" class="btn btn-primary">&nbsp;课程信息数据</a>
</div>
</div>
</div>
</div>


+ 11
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js View File

@@ -31,7 +31,17 @@ var bootstrap = function ($, learun) {
}
});
});

//课程信息数据
$('#lr_lesson').on('click', function () {
learun.layerConfirm('是否确认推送课程信息数据!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncLesson', function () {
refreshGirdData();
});
}
});
});
},
// 初始化列表
initGird: function () {


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs View File

@@ -184,6 +184,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#endregion
#region 扩展字段
[NotMapped]
public string LessonTypeName { get; set; }

#endregion
}
}


+ 18
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs View File

@@ -64,5 +64,23 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}
public void SyncLesson()
{
try
{
dataCollectionService.SyncLesson();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
}
}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs View File

@@ -7,5 +7,6 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
public interface DataCollectionIBLL
{
void SaveXqjbsj();
void SyncLesson();
}
}

+ 59
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs View File

@@ -10,6 +10,7 @@ using System.Text;
using Newtonsoft.Json;
using Learun.Application.Organization;
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Cache.Redis;

namespace Learun.Application.TwoDevelopment.LR_Desktop
@@ -169,7 +170,65 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}

/// <summary>
/// 课程信息数据
/// </summary>
public void SyncLesson()
{
try
{
//校区信息
var company = this.BaseRepository().FindList<CompanyEntity>(x => x.F_DeleteMark == 0 && x.F_EnabledMark == 1).FirstOrDefault();
//课程数据
var lessonInfo = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>($@"SELECT a.*,b.LessonTypeName FROM [dbo].[LessonInfo] a
join [dbo].[CdLessonType] b on a.lessontypeid=b.ltid
where a.checkmark=1");

ParamModel paramModel = new ParamModel();
paramModel.dataObjName = "ods_zzkcxxsj";

var list = new List<object>();
foreach (var lesson in lessonInfo)
{
var param = new
{
gzzyqksjid= lesson.LessonId,
xxjgdm=company.F_USCreditCode,
xxjgmc = company.F_FullName,
ssxqbh = company.F_EnCode,
kcmc= lesson.LessonName,
kcdm = lesson.LessonNo,
kclb =string.IsNullOrEmpty(lesson.LessonSortDetailNo)?"1": lesson.LessonSortDetailNo,
kcxz= lesson.LessonTypeName.Contains("公共")|| lesson.LessonTypeName.Contains("公开")?"1":"2",
kcsx=lesson.LessonSortNo,
kcfl="1",
xklb="14",
sfzyhxkc="0",
lvjxss=lesson.WeekStudyHour>0? lesson.WeekStudyHour :0,
sjjxsy = lesson.WeekPracticeHour > 0? lesson.WeekStudyHour :0,
sjcjsj = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")
};
list.Add(param);
}
paramModel.fileds = list;
var json = JsonConvert.SerializeObject(paramModel);
var connect = _redis.Read<string>("access_token");
connect = (connect).Replace("\"", "");
var res = HttpMethods.HttpPostConnect(saveIncrUrl, json, connect);
}
catch (ExceptionEx ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region MyRegion


Loading…
Cancel
Save