Commit f1a9271f authored by 黄奎's avatar 黄奎

页面修改

parent c57dc571
......@@ -382,6 +382,25 @@ namespace Edu.Common
return age < 0 ? 0 : age;
}
/// <summary>
/// 获取时间段字符串
/// </summary>
/// <param name="objDate"></param>
/// <returns></returns>
public static string GetTimeStr(object objDate)
{
string str = "";
if (objDate != null)
{
DateTime date = Convert.ToDateTime(objDate);
int times = date.Hour;
if (times >= 0 && times < 12) { str = "早上"; }
if (times >= 12 && times < 17) { str = "下午"; }
if (times >= 17 && times < 24) { str = "晚上"; }
}
return str;
}
/// <summary>
/// 获取最近一个星期一
/// </summary>
......
......@@ -65,5 +65,10 @@ namespace Edu.Model.Entity.Duty
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 值班标准图片
/// </summary>
public string ItemImg { get; set; }
}
}
......@@ -34,5 +34,10 @@ namespace Edu.Model.ViewModel.Duty
/// 是否完成(1-已完成,0-未完成)
/// </summary>
public int IsChecked { get; set; }
/// <summary>
/// 值班项目图片列表
/// </summary>
public List<string> ItemImgList { get; set; }
}
}
......@@ -2040,6 +2040,7 @@ namespace Edu.Module.Course
foreach (var subItem in tempList)
{
var tempTimeList = timeList?.Where(qitem => qitem.ClassPlanId == subItem.ClassPlanId)?.ToList()?.OrderBy(qitem => qitem.StartTime);
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " "+(tempTimeList?.FirstOrDefault()?.StartTime ?? "");
subList.Add(new
{
subItem.ClassId,
......@@ -2047,6 +2048,7 @@ namespace Edu.Module.Course
subItem.CourseName,
subItem.RoomName,
subItem.TeacherName,
TimeStr = Common.ConvertHelper.GetTimeStr(currentDate),
StartTime = tempTimeList?.FirstOrDefault()?.StartTime ?? "",
EndTime = tempTimeList?.LastOrDefault()?.EndTime ?? "",
GuestList = guestList.Where(qitem => qitem.ClassId == subItem.ClassId)?.Select(qitem => new { qitem.GuestName })
......
......@@ -92,6 +92,7 @@ namespace Edu.Module.Duty
{ nameof(RB_Duty_Item_ViewModel.ItemSchools),model.ItemSchools},
{ nameof(RB_Duty_Item_ViewModel.UpdateBy),model.UpdateBy},
{ nameof(RB_Duty_Item_ViewModel.UpdateTime),model.UpdateTime},
{ nameof(RB_Duty_Item_ViewModel.ItemImg),model.ItemImg},
};
return dutyItemRepository.Update(fileds, new WhereHelper(nameof(RB_Duty_Item_ViewModel.Id), model.Id));
}
......@@ -110,8 +111,6 @@ namespace Edu.Module.Duty
#endregion
#region 值班设置
/// <summary>
......@@ -231,7 +230,6 @@ namespace Edu.Module.Duty
}
#endregion
#region 班次设置
/// <summary>
/// 获取班次设置列表
......
......@@ -493,6 +493,10 @@ where sog.Account_Id={query.StuId} and c.ClassStatus in(1,2) and c.`Status`=0 an
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.ClassRoomId), query.ClassRoomId);
}
if (query.ClassId > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.ClassId), query.ClassId);
}
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -511,8 +515,6 @@ WHERE 1=1 AND A.`Status`=0 {0}
) AS A
GROUP BY A.ClassPlanId,A.ClassId ,A.ClassDate,A.ClassRoomId
", where.ToString());
builder.AppendFormat(" ");
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
}
......
......@@ -1879,7 +1879,8 @@ namespace Edu.WebApi.Controllers.Course
EndTime = endDate,
TeacherId = base.ParmJObj.GetInt("TeacherId"),
ClassRoomId = base.ParmJObj.GetInt("ClassRoomId"),
Group_Id=base.UserInfo.Group_Id,
Group_Id = base.UserInfo.Group_Id,
ClassId = base.ParmJObj.GetInt("ClassId"),
};
var obj = classModule.GetClassPlanStatisticalModule(query);
return ApiResult.Success(data:obj);
......@@ -1893,9 +1894,19 @@ namespace Edu.WebApi.Controllers.Course
{
var startDate = base.ParmJObj.GetStringValue("StartTime");
var endDate = base.ParmJObj.GetStringValue("EndTime");
if (!string.IsNullOrEmpty(endDate))
DateTime now = DateTime.Now;
//获取当前月的第一天
DateTime d1 = new DateTime(now.Year, now.Month, 1);
//当月最后一天
DateTime d2 = d1.AddMonths(1).AddDays(-1);
if (string.IsNullOrEmpty(startDate))
{
endDate = Common.ConvertHelper.FormatDate(DateTime.Now);
startDate = Common.ConvertHelper.FormatDate(d1);
}
if (string.IsNullOrEmpty(endDate))
{
endDate = Common.ConvertHelper.FormatDate(d2);
}
else
{
......
......@@ -245,6 +245,15 @@ namespace Edu.WebApi.Controllers.Duty
Group_Id = base.UserInfo.Group_Id,
Id = base.ParmJObj.GetInt("Id"),
};
query.ItemImgList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(base.ParmJObj.GetStringValue("ItemImgList"));
if (query.ItemImgList != null && query.ItemImgList.Count > 0)
{
query.ItemImg = Common.Plugin.JsonHelper.Serialize(query.ItemImgList);
}
else
{
query.ItemImg = "";
}
if (string.IsNullOrWhiteSpace(query.ItemName))
{
return ApiResult.Failed("请输入值班事项名称");
......@@ -287,6 +296,7 @@ namespace Edu.WebApi.Controllers.Duty
{
List<string> SchoolList = new List<string>();
List<string> ShiftList = new List<string>();
List<string> ImgList = new List<string>();
if (!string.IsNullOrEmpty(model?.ItemSchools))
{
SchoolList = Common.ConvertHelper.StringToFileList(model?.ItemSchools);
......@@ -295,6 +305,10 @@ namespace Edu.WebApi.Controllers.Duty
{
ShiftList = Common.ConvertHelper.StringToFileList(model?.Shifts);
}
if (!string.IsNullOrEmpty(model?.ItemImg))
{
ImgList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(model.ItemImg);
}
obj = new
{
model.Id,
......@@ -304,6 +318,7 @@ namespace Edu.WebApi.Controllers.Duty
SchoolList,
model?.Shifts,
ShiftList,
ItemImgList= ImgList
};
}
return ApiResult.Success(data: obj);
......@@ -323,7 +338,6 @@ namespace Edu.WebApi.Controllers.Duty
}
/// <summary>
/// 根据班次获取学校信息
/// </summary>
......@@ -332,7 +346,6 @@ namespace Edu.WebApi.Controllers.Duty
public ApiResult GetSchoolListByFrequencyIds()
{
var Shifts = base.ParmJObj.GetStringValue("Shifts");
var list = schoolModule.GetSchoolListByFrequencyIds(base.UserInfo.Group_Id, Shifts);
var result = list.Select(x => new
{
......
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