Bladeren bron

教师资质证书推送

临城职教中职
zhangli 2 jaren geleden
bovenliggende
commit
bacc52be7b
6 gewijzigde bestanden met toevoegingen van 112 en 5 verwijderingen
  1. +11
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs
  2. +2
    -1
      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. +20
    -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. +67
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs

+ 11
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs Bestand weergeven

@@ -85,6 +85,17 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
dataCollectionIBLL.SyncTeacherTrain();
return Success("操作成功");
}
/// <summary>
/// 教师进修培训数据
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult SyncTeacherQualifications()
{
dataCollectionIBLL.SyncTeacherQualifications();
return Success("操作成功");
}
}
}

+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml Bestand weergeven

@@ -13,7 +13,8 @@
<a id="lr_lesson" class="btn btn-primary">&nbsp;课程信息数据</a>
<a id="lr_textBook" class="btn btn-primary">&nbsp;教材信息数据</a>
<a id="lr_arrangeLessonTerm" class="btn btn-primary">&nbsp;排课数据</a>
<a id="lr_teacherTrain" class="btn btn-primary">&nbsp;教师进修培训</a>
<a id="lr_teacherTrain" class="btn btn-primary">&nbsp;教师进修培训数据</a>
<a id="lr_teacherQualifications" class="btn btn-primary">&nbsp;教师资质证书数据</a>
</div>
</div>
</div>


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

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

//教师资质证书数据
$('#lr_teacherQualifications').on('click', function () {
learun.layerConfirm('是否确认推送教师资质证书数据!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncTeacherQualifications', function () {
refreshGirdData();
});
}
});
});
},
// 初始化列表


+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs Bestand weergeven

@@ -143,5 +143,25 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}


public void SyncTeacherQualifications()
{
try
{
dataCollectionService.SyncTeacherQualifications();
}
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 Bestand weergeven

@@ -11,5 +11,6 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
void SyncTextBook();
void SyncArrangeLessonTerm();
void SyncTeacherTrain();
void SyncTeacherQualifications();
}
}

+ 67
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs Bestand weergeven

@@ -78,8 +78,8 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
var login_res_str = HttpMethods.Get(login_url);
var login_res = JsonConvert.DeserializeObject<InsResult>(login_res_str);
var login_data = login_res.data;
_redis.Write($"access_token", ((dynamic)login_data)?.access_token, TimeSpan.FromSeconds(250));
_redis.Write($"client_secret", ((dynamic)login_data)?.client_secret, TimeSpan.FromSeconds(170000));
_redis.Write($"access_token", ((dynamic)login_data)?.access_token, TimeSpan.FromSeconds(200));
_redis.Write($"client_secret", ((dynamic)login_data)?.client_secret, TimeSpan.FromSeconds(160000));
_redis.Write($"refresh_token", ((dynamic)login_data)?.refresh_token, TimeSpan.FromSeconds(250));
}
/// <summary>
@@ -101,7 +101,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
login();
return;
}
_redis.Write($"access_token", ((dynamic)refresh_res)?.access_token, TimeSpan.FromSeconds(250));
_redis.Write($"access_token", ((dynamic)refresh_res)?.access_token, TimeSpan.FromSeconds(200));
_redis.Write($"refresh_token", ((dynamic)refresh_res)?.refresh_token, TimeSpan.FromSeconds(250));
}
/// <summary>
@@ -494,6 +494,61 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
}
}
}


/// <summary>
/// 教师资质证书
/// </summary>
public void SyncTeacherQualifications()
{
try
{
//校区信息
var company = this.BaseRepository().FindList<CompanyEntity>(x => x.F_DeleteMark == 0 && x.F_EnabledMark == 1).FirstOrDefault();
//教师数据
var teacherTrain = this.BaseRepository("CollegeMIS").FindList<TeacherQualificationsEntity>($@"select min(empid) as gzzyqksjid,count(1) as jszgzrs, sum(case when JobRank in (1,2,3,4) then 1 else 0 end) as gjzcrs,
sum(case when JobRank in (5,6,7,8) then 1 else 0 end) as zjzcrs,
sum(case when JobRank not in (1,2,3,4,5,6,7,8) then 1 else 0 end) as cjzcrs
from empinfo ");

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

var list = new List<object>();
foreach (var data in teacherTrain)
{
var param = new
{
gzzyqksjid = company.F_CompanyId,// data.gzzyqksjid,
xxjgdm = company.F_USCreditCode,
xxjgmc = company.F_FullName,
jszgzrs = data.jszgzrs,
gjzcrs = data.gjzcrs,
zjzcrs = data.zjzcrs,
cjzcrs = data.cjzcrs,
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
@@ -511,6 +566,15 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
public List<object> fileds { get; set; }
}

public class TeacherQualificationsEntity
{
public string gzzyqksjid { get; set; }
public int jszgzrs { get; set; }
public int gjzcrs { get; set; }
public int zjzcrs { get; set; }
public int cjzcrs { get; set; }
}

#endregion
}
}

Laden…
Annuleren
Opslaan