Selaa lähdekoodia

智慧大脑教材信息数据

临城职教中职
zhangli 2 vuotta sitten
vanhempi
commit
79dcd3be7e
6 muutettua tiedostoa jossa 112 lisäystä ja 17 poistoa
  1. +13
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs
  2. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml
  3. +12
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js
  4. +21
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs
  6. +64
    -13
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs

+ 13
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs Näytä tiedosto

@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
[HttpGet]
public ActionResult Index()
{
return View();
return View();
}
#endregion
/// <summary>
@@ -51,6 +51,17 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
dataCollectionIBLL.SyncLesson();
return Success("操作成功");
}

/// <summary>
/// 教材信息
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult SyncTextBook()
{
dataCollectionIBLL.SyncTextBook();
return Success("操作成功");
}
}
}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml Näytä tiedosto

@@ -24,6 +24,7 @@
<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>
<a id="lr_textBook" class="btn btn-primary">&nbsp;教材信息数据</a>
</div>
</div>
</div>


+ 12
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js Näytä tiedosto

@@ -25,7 +25,7 @@ var bootstrap = function ($, learun) {
$('#lr_company').on('click', function () {
learun.layerConfirm('是否确认推送校区基础数据!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncCompany', function () {
learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncCompany', function () {
refreshGirdData();
});
}
@@ -35,13 +35,23 @@ var bootstrap = function ($, learun) {
$('#lr_lesson').on('click', function () {
learun.layerConfirm('是否确认推送课程信息数据!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncLesson', function () {
learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncLesson', function () {
refreshGirdData();
});
}
});
});
//教材数据
$('#lr_textBook').on('click', function () {
learun.layerConfirm('是否确认推送教材信息数据!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncTextBook', function () {
refreshGirdData();
});
}
});
});
},
// 初始化列表
initGird: function () {


+ 21
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs Näytä tiedosto

@@ -82,5 +82,26 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}
}

public void SyncTextBook()
{
try
{
dataCollectionService.SyncTextBook();
}
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 Näytä tiedosto

@@ -8,5 +8,6 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
{
void SaveXqjbsj();
void SyncLesson();
void SyncTextBook();
}
}

+ 64
- 13
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs Näytä tiedosto

@@ -86,7 +86,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
/// </summary>
private void refresh()
{
var client_secret = (_redis.Read<string>("client_secret"))?.Replace("\"","");
var client_secret = (_redis.Read<string>("client_secret"))?.Replace("\"", "");
var refresh_token = (_redis.Read<string>("refresh_token"))?.Replace("\"", "");
var refresh_url =
InsUrl + "/prod-api/api/web/collect/oauth2/refresh?grant_type=refresh_token&client_id=" +
@@ -192,25 +192,76 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
{
var param = new
{
gzzyqksjid= lesson.LessonId,
xxjgdm=company.F_USCreditCode,
gzzyqksjid = lesson.LessonId,
xxjgdm = company.F_USCreditCode,
xxjgmc = company.F_FullName,
ssxqbh = company.F_EnCode,
kcmc= lesson.LessonName,
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,
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);
}
}
}


/// <summary>
/// 教材信息数据
/// </summary>
public void SyncTextBook()
{
try
{
//校区信息
var company = this.BaseRepository().FindList<CompanyEntity>(x => x.F_DeleteMark == 0 && x.F_EnabledMark == 1).FirstOrDefault();
//课程数据
var textBookInfo = this.BaseRepository("CollegeMIS").FindList<TextBookInfoEntity>(x => x.IsValid == true && x.IsDel == 0);

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

var list = new List<object>();
foreach (var book in textBookInfo)
{
var param = new
{
gzzyqksjid = book.ID,
xxjgdm = company.F_USCreditCode,
xxjgmc = company.F_FullName,
jcmc = book.TextBookName,
jcbh=book.TextBookNo,
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");


Ladataan…
Peruuta
Tallenna