|
|
@@ -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 |
|
|
|