Commit 04fbbe1f authored by 黄奎's avatar 黄奎

页面修改

parent 98d30c10
......@@ -771,46 +771,15 @@ namespace Edu.Module.Duty
//当前班次
var currentModel = new RB_Duty_PlanDetails_ViewModel();
List<RB_Duty_Content_ViewModel> otherContentList = new List<RB_Duty_Content_ViewModel>();
otherContentList = duty_ContentRepository.GetDutyContentListRepository(new RB_Duty_Content_ViewModel()
{
HandoverDlandetails=model.DetailId.ToString()
});
if (model.PlanDetails != null && model.PlanDetails.Count > 0)
{
//查找当前人员索引
int currentIndex = CalcCurrentDutyManIndexModule_V2(model);
//currentIndex == 0 &&
if ( Common.ConvertHelper.FormatDate(model.Date)==Common.ConvertHelper.FormatDate(DateTime.Now))
{
var yestoday = model.Date.AddDays(-1);
List<RB_Duty_PlanDetails_ViewModel> y_PlanDetails = new List<RB_Duty_PlanDetails_ViewModel>();
var yestodayList= GetMyDutyPlanPageModule(1, 1000, out _, new RB_Duty_Plan_ViewModel()
{
QStartDate = Common.ConvertHelper.FormatDate(yestoday),
QEndDate = Common.ConvertHelper.FormatDate(yestoday),
Group_Id = model.Group_Id
});
foreach (var yItem in yestodayList)
{
if (yItem.PlanDetails != null && yItem.PlanDetails.Count > 0)
{
y_PlanDetails.AddRange(yItem.PlanDetails);
}
}
if (y_PlanDetails != null && y_PlanDetails.Count > 0)
{
string maxTime = y_PlanDetails.Max(qitem => qitem.StartTime);
if (!string.IsNullOrEmpty(maxTime))
{
var tempContent = y_PlanDetails.Where(qitem => qitem.StartTime == maxTime)?.FirstOrDefault();
if (tempContent != null)
{
otherContentList = duty_ContentRepository.GetDutyContentListRepository(new RB_Duty_Content_ViewModel()
{
PlanId = Convert.ToInt32(tempContent.PlanId),
PlanShift = Convert.ToInt32(tempContent.Shift),
PlanType = 2
});
}
}
}
}
//当前班次
currentModel = model.PlanDetails[currentIndex];
}
......@@ -1271,6 +1240,7 @@ namespace Edu.Module.Duty
item.PlanId,
item.Shift,
item.DutyMan,
item.DutyManName,
item.ConfigStartTime,
item.ConfigEndTime,
item.ShiftName,
......@@ -1292,7 +1262,7 @@ namespace Edu.Module.Duty
/// <param name="message"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool DutyCheckModule(int Id, int Shift, int DutyMan, int Status, List<RB_Duty_Content_ViewModel> worklist,string HandoverShift,out string message)
public virtual bool DutyCheckModule(int Id, int Shift, int DutyMan, int Status, List<RB_Duty_Content_ViewModel> worklist,string HandoverDlandetails, out string message)
{
message = "";
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -1373,9 +1343,9 @@ namespace Edu.Module.Duty
{
flag = duty_ContentRepository.InsertBatch(worklist);
}
if (!string.IsNullOrEmpty(HandoverShift))
if (!string.IsNullOrEmpty(HandoverDlandetails))
{
flag = duty_ContentRepository.UpdateHandoverShiftRepository(HandoverShift, new RB_Duty_Content_ViewModel()
flag = duty_ContentRepository.UpdateHandoverShiftRepository(HandoverDlandetails, new RB_Duty_Content_ViewModel()
{
PlanId = Id,
PlanShift = Shift,
......
......@@ -51,6 +51,10 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Duty_Content_ViewModel.PlanType), query.PlanType);
}
if (!string.IsNullOrEmpty(query.HandoverDlandetails))
{
builder.AppendFormat(@" AND FIND_IN_SET('{0}', A.HandoverDlandetails)>0 ", query.HandoverDlandetails);
}
}
return Get<RB_Duty_Content_ViewModel>(builder.ToString()).ToList();
}
......
......@@ -411,7 +411,7 @@ namespace Edu.WebApi.Controllers.Duty
});
}
}
var flag = dutyPlanModule.DutyCheckModule(Id, Shift, base.UserInfo.Id, Status, list,HandoverShift,out string message);
var flag = dutyPlanModule.DutyCheckModule(Id, Shift, base.UserInfo.Id, Status, list, HandoverDlandetails, out string message);
return flag ? ApiResult.Success() : ApiResult.Failed(message: message);
}
......
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