Commit f1a9271f authored by 黄奎's avatar 黄奎

页面修改

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