Commit e0dbf832 authored by 吴春's avatar 吴春

提交代码

parent 4a220d26
This diff is collapsed.
......@@ -72,6 +72,14 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Student_ViewModel.PublishId), query.PublishId);
}
if (query.PaperId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Student_ViewModel.PaperId), query.PaperId);
}
if (query.GuestId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Student_ViewModel.GuestId), query.GuestId);
}
if (!string.IsNullOrEmpty(query.QPublishIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Examination_Student_ViewModel.PublishId), query.QPublishIds);
......
......@@ -814,6 +814,7 @@ namespace Edu.WebApi.Controllers.Exam
item.CourseId,
item.PublishId,
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "",
item.ExamStatus,
};
result.Add(obj);
}
......
......@@ -216,18 +216,74 @@ namespace Edu.WebApi.Controllers.Public
/// 批量新增节假日
/// </summary>
/// <returns></returns>
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public ApiResult InsertHoliday()
{
string apiResult = Common.Plugin.HttpHelper.HttpGet("http://timor.tech/api/holiday/year/2021/");
JObject parmsJob = JObject.Parse(apiResult);
string resultCode = parmsJob.GetStringValue("code");
string holidayList = parmsJob.GetStringValue("holiday");
// JObject parmsHoliday = JObject.Parse(holidayList);
try
{
return ApiResult.Success("");
}
JObject jsonObject = JObject.Parse(holidayList);
foreach (var item in jsonObject.Children())
{
var test1 = item.Children();// JsonConvert.DeserializeObject<test>();
foreach (var item1 in test1)
{
var test = item1.ToObject<test>();
RB_System_Holiday dmodel = new RB_System_Holiday
{
StartTime = Convert.ToDateTime(test.date),
EndTime = Convert.ToDateTime(test.date)
};
if (test.holiday)//节假日
{
dmodel.DayType = 1;
}
else
{
dmodel.DayType = 2;
}
dmodel.CreateDate = System.DateTime.Now;
dmodel.Status = 0;
dmodel.Group_Id = 100000;
dmodel.School_Id = 0;
bool flag = holidayModule.SetHoliday(dmodel);
}
}
return ApiResult.Success("");
}
catch (Exception ex)
{
return ApiResult.Failed("转换失败");
}
}
#endregion
}
public class holiday
{
// public string info { get; set; }
public test info { get; set; }
}
public class test
{
public bool holiday { get; set; }
public string date { get; set; }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment