Commit 57d4bd8c authored by 黄奎's avatar 黄奎

页面修改

parent 982b291a
......@@ -93,7 +93,7 @@ namespace Edu.WebApi.Controllers.Duty
[HttpPost]
public ApiResult GetMyDutyPlanPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
7var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Duty_Plan_ViewModel()
{
School_Id = base.ParmJObj.GetInt("School_Id"),
......@@ -108,6 +108,7 @@ namespace Edu.WebApi.Controllers.Duty
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
//当前班次
var currentModel = new RB_Duty_PlanDetails_ViewModel();
//上一个班次
......@@ -117,7 +118,17 @@ namespace Edu.WebApi.Controllers.Duty
if (item.PlanDetails != null && item.PlanDetails.Count > 0)
{
//当前值班人员索引
int currentIndex = item.PlanDetails.FindIndex(qitem => qitem.DutyMan == base.UserInfo.Id);
int currentIndex = 0;
var currentDayNow = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.Date) + " " + DateTime.Now.ToString("HH:mm:ss"));
for (var i=0;i<item.PlanDetails.Count;i++)
{
var sStartTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.Date) + " " + item.PlanDetails[i].StartTime);
var sEndTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.Date) + " " + item.PlanDetails[i].EndTime);
if (currentDayNow >= sStartTime && currentDayNow <= sEndTime && item.PlanDetails[i].DutyMan==base.UserInfo.Id)
{
currentIndex = i;
}
}
//上一个班次索引
int previousIndex = currentIndex - 1;
//下一个班次索引
......
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