Commit 842448a2 authored by 黄奎's avatar 黄奎

页面修改

parent 0c103126
......@@ -74,22 +74,22 @@ namespace Edu.Module.Duty
foreach (var item in list)
{
item.PlanDetails = planDetails?.Where(qitem => qitem.PlanId == item.Id)?.ToList() ?? new List<RB_Duty_PlanDetails_ViewModel>();
item.DutyStatus = 0;
if (item.PlanDetails != null && item.PlanDetails.Count > 0)
{
foreach (var subItem in item.PlanDetails)
{
if (subItem.Status == 2)
{
subItem.DutyStatus = DutyStatusEnum.DutyFinished;
}
else
{
subItem.DutyStatus = CalcDutyPlanStatusModule(item.Date, subItem?.StartTime, subItem?.EndTime);
}
}
item.DutyStatus = CalcDutyStatusModule(item.PlanDetails);
}
//item.DutyStatus = 0;
//if (item.PlanDetails != null && item.PlanDetails.Count > 0)
//{
// foreach (var subItem in item.PlanDetails)
// {
// if (subItem.Status == 2)
// {
// subItem.DutyStatus = DutyStatusEnum.DutyFinished;
// }
// else
// {
// subItem.DutyStatus = CalcDutyPlanStatusModule(item.Date, subItem?.StartTime, subItem?.EndTime);
// }
// }
// item.DutyStatus = CalcDutyStatusModule(item.PlanDetails);
//}
}
}
return list;
......@@ -142,78 +142,78 @@ namespace Edu.Module.Duty
foreach (var subItem in item.PlanDetails)
{
subItem.WorkContentList = new List<RB_Duty_PlanWork_ViewModel>();
if (subItem.Status == 2)
{
subItem.DutyStatus = DutyStatusEnum.DutyFinished;
}
else
{
subItem.DutyStatus = CalcDutyPlanStatusModule(item.Date, subItem.StartTime, subItem.EndTime);
}
//if (subItem.Status == 2)
//{
// subItem.DutyStatus = DutyStatusEnum.DutyFinished;
//}
//else
//{
// subItem.DutyStatus = CalcDutyPlanStatusModule(item.Date, subItem.StartTime, subItem.EndTime);
//}
if (subItem.DutyStatus == DutyStatusEnum.DutyFinished)
{
foreach (var dItem in dutyContentList.Where(qitem => qitem.PlanType==1 && qitem.PlanId == item.Id && qitem.PlanShift == subItem.Shift))
{
var dutyItem = dutyItemList?.Where(qitem => qitem.Shifts.Contains(subItem.Shift.ToString()) && qitem.Id == dItem.ItemId && qitem.ItemSchools.Contains(item.School_Id.ToString()))?.FirstOrDefault();
int isFinish = 0;
if (dutyItem.ItemType == ItemTypeEnum.Choice)
{
isFinish = dItem.WorkIsFinish;
}
else if (dutyItem.ItemType == ItemTypeEnum.FillIn)
{
if (!string.IsNullOrEmpty(dItem.WorkContent))
{
isFinish = 1;
}
}
subItem.WorkContentList.Add(new RB_Duty_PlanWork_ViewModel()
{
Id = dItem.Id,
ItemId = dutyItem?.Id ?? 0,
ItemType = dutyItem?.ItemType ?? ItemTypeEnum.Choice,
ItemName = dutyItem?.ItemName ?? "",
WorkContent = dItem?.WorkContent ?? "",
IsChecked=isFinish
});
}
}
else
{
foreach (var dutyItem in dutyItemList.Where(qitem => qitem.ItemSchools.Contains(item.School_Id.ToString()) && qitem.Shifts.Contains(subItem.Shift.ToString())))
{
int isFinish = 0;
var dItem = dutyContentList.Where(qitem => qitem.PlanType == 1 && qitem.PlanId == item.Id && qitem.PlanShift == subItem.Shift && qitem.ItemId == dutyItem.Id)?.FirstOrDefault();
if (dutyItem.ItemType == ItemTypeEnum.Choice)
{
isFinish = dItem?.WorkIsFinish??0;
}
else if (dutyItem.ItemType == ItemTypeEnum.FillIn)
{
if (!string.IsNullOrEmpty(dItem?.WorkContent))
{
isFinish = 1;
}
}
//if (subItem.DutyStatus == DutyStatusEnum.DutyFinished)
//{
// foreach (var dItem in dutyContentList.Where(qitem => qitem.PlanType==1 && qitem.PlanId == item.Id && qitem.PlanShift == subItem.Shift))
// {
// var dutyItem = dutyItemList?.Where(qitem => qitem.Shifts.Contains(subItem.Shift.ToString()) && qitem.Id == dItem.ItemId && qitem.ItemSchools.Contains(item.School_Id.ToString()))?.FirstOrDefault();
// int isFinish = 0;
// if (dutyItem.ItemType == ItemTypeEnum.Choice)
// {
// isFinish = dItem.WorkIsFinish;
// }
// else if (dutyItem.ItemType == ItemTypeEnum.FillIn)
// {
// if (!string.IsNullOrEmpty(dItem.WorkContent))
// {
// isFinish = 1;
// }
// }
// subItem.WorkContentList.Add(new RB_Duty_PlanWork_ViewModel()
// {
// Id = dItem.Id,
// ItemId = dutyItem?.Id ?? 0,
// ItemType = dutyItem?.ItemType ?? ItemTypeEnum.Choice,
// ItemName = dutyItem?.ItemName ?? "",
// WorkContent = dItem?.WorkContent ?? "",
// IsChecked=isFinish
// });
// }
//}
//else
//{
// foreach (var dutyItem in dutyItemList.Where(qitem => qitem.ItemSchools.Contains(item.School_Id.ToString()) && qitem.Shifts.Contains(subItem.Shift.ToString())))
// {
// int isFinish = 0;
// var dItem = dutyContentList.Where(qitem => qitem.PlanType == 1 && qitem.PlanId == item.Id && qitem.PlanShift == subItem.Shift && qitem.ItemId == dutyItem.Id)?.FirstOrDefault();
// if (dutyItem.ItemType == ItemTypeEnum.Choice)
// {
// isFinish = dItem?.WorkIsFinish??0;
// }
// else if (dutyItem.ItemType == ItemTypeEnum.FillIn)
// {
// if (!string.IsNullOrEmpty(dItem?.WorkContent))
// {
// isFinish = 1;
// }
// }
subItem.WorkContentList.Add(new RB_Duty_PlanWork_ViewModel()
{
Id = dItem?.Id??0,
ItemId = dutyItem?.Id ?? 0,
ItemType = dutyItem?.ItemType ?? ItemTypeEnum.Choice,
ItemName = dutyItem?.ItemName ?? "",
WorkContent = dItem?.WorkContent ?? "",
IsChecked = isFinish
});
}
}
// subItem.WorkContentList.Add(new RB_Duty_PlanWork_ViewModel()
// {
// Id = dItem?.Id??0,
// ItemId = dutyItem?.Id ?? 0,
// ItemType = dutyItem?.ItemType ?? ItemTypeEnum.Choice,
// ItemName = dutyItem?.ItemName ?? "",
// WorkContent = dItem?.WorkContent ?? "",
// IsChecked = isFinish
// });
// }
//}
subItem.BurstCount = dutyContentList?.Where(qitem => qitem.PlanType == 3 && qitem.PlanId == item.Id && qitem.CreateBy == subItem.DutyMan)?.Count() ?? 0;
if (subItem.Status == 2)
{
subItem.HandoverCount = dutyContentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.Id && qitem.CreateBy == subItem.DutyMan)?.Count() ?? 0;
}
//subItem.BurstCount = dutyContentList?.Where(qitem => qitem.PlanType == 3 && qitem.PlanId == item.Id && qitem.CreateBy == subItem.DutyMan)?.Count() ?? 0;
//if (subItem.Status == 2)
//{
// subItem.HandoverCount = dutyContentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.Id && qitem.CreateBy == subItem.DutyMan)?.Count() ?? 0;
//}
}
}
item.TotalBurstCount = item.PlanDetails.Sum(qitem => qitem.BurstCount);
......@@ -257,18 +257,18 @@ namespace Edu.Module.Duty
public DutyStatusEnum CalcDutyStatusModule(List<RB_Duty_PlanDetails_ViewModel> PlanDetails)
{
DutyStatusEnum dutyStatus = DutyStatusEnum.NoStart;
if (PlanDetails.Where(qitem => qitem.DutyStatus == DutyStatusEnum.NoStart).Count() == PlanDetails.Count)
{
dutyStatus = DutyStatusEnum.NoStart;
}
else if (PlanDetails.Where(qitem => qitem.DutyStatus == DutyStatusEnum.DutyFinished).Count() == PlanDetails.Count)
{
dutyStatus = DutyStatusEnum.DutyFinished;
}
else
{
dutyStatus = DutyStatusEnum.DutyIng;
}
//if (PlanDetails.Where(qitem => qitem.DutyStatus == DutyStatusEnum.NoStart).Count() == PlanDetails.Count)
//{
// dutyStatus = DutyStatusEnum.NoStart;
//}
//else if (PlanDetails.Where(qitem => qitem.DutyStatus == DutyStatusEnum.DutyFinished).Count() == PlanDetails.Count)
//{
// dutyStatus = DutyStatusEnum.DutyFinished;
//}
//else
//{
// dutyStatus = DutyStatusEnum.DutyIng;
//}
return dutyStatus;
}
......@@ -476,7 +476,7 @@ namespace Edu.Module.Duty
{
dutyStatusEnum = DutyStatusEnum.DutyFinished;
}
item.DutyStatus = dutyStatusEnum;
// item.DutyStatus = dutyStatusEnum;
}
}
}
......@@ -623,70 +623,70 @@ namespace Edu.Module.Duty
}
List<object> pList = new List<object>();
var currentPlanContetList = contentList.Where(qitem => qitem.PlanShift == Shift && qitem.PlanType == 1)?.ToList();
if (currentModel.DutyStatus == DutyStatusEnum.DutyFinished)
{
foreach (var item in currentPlanContetList)
{
var c_itemModel = dutyItemList?.Where(qitem => qitem.Id == item.ItemId)?.FirstOrDefault();
if (c_itemModel != null)
{
var itemType = c_itemModel.ItemType;
int workIsFinish = 0;
if (itemType == ItemTypeEnum.FillIn )
{
if (!string.IsNullOrEmpty(item?.WorkContent))
{
workIsFinish = 1;
}
}
else
{
workIsFinish = item?.WorkIsFinish ?? 0;
}
var pObj = new
{
Id = item?.Id ?? 0,
ItemId = item.ItemId,
ItemName = c_itemModel?.ItemName ?? "",
ItemType = c_itemModel?.ItemType ?? ItemTypeEnum.FillIn,
IsChecked = workIsFinish,
WorkContent = item?.WorkContent ?? "",
};
//if (currentModel.DutyStatus == DutyStatusEnum.DutyFinished)
//{
// foreach (var item in currentPlanContetList)
// {
// var c_itemModel = dutyItemList?.Where(qitem => qitem.Id == item.ItemId)?.FirstOrDefault();
// if (c_itemModel != null)
// {
// var itemType = c_itemModel.ItemType;
// int workIsFinish = 0;
// if (itemType == ItemTypeEnum.FillIn )
// {
// if (!string.IsNullOrEmpty(item?.WorkContent))
// {
// workIsFinish = 1;
// }
// }
// else
// {
// workIsFinish = item?.WorkIsFinish ?? 0;
// }
// var pObj = new
// {
// Id = item?.Id ?? 0,
// ItemId = item.ItemId,
// ItemName = c_itemModel?.ItemName ?? "",
// ItemType = c_itemModel?.ItemType ?? ItemTypeEnum.FillIn,
// IsChecked = workIsFinish,
// WorkContent = item?.WorkContent ?? "",
// };
pList.Add(pObj);
}
}
}
else
{
foreach (var item in PlanList)
{
var c_workModel = currentPlanContetList?.Where(qitem => qitem.ItemId == item.Id)?.FirstOrDefault();
var itemType = item.ItemType;
int workIsFinish = 0;
if (itemType == ItemTypeEnum.FillIn)
{
if (!string.IsNullOrEmpty(c_workModel?.WorkContent))
{
workIsFinish = 1;
}
}
else
{
workIsFinish = c_workModel?.WorkIsFinish ?? 0;
}
var pObj = new
{
Id = c_workModel?.Id ?? 0,
ItemId = item.Id,
item.ItemName,
item.ItemType,
IsChecked = workIsFinish,
WorkContent = c_workModel?.WorkContent ?? "",
};
pList.Add(pObj);
}
}
// pList.Add(pObj);
// }
// }
//}
//else
//{
// foreach (var item in PlanList)
// {
// var c_workModel = currentPlanContetList?.Where(qitem => qitem.ItemId == item.Id)?.FirstOrDefault();
// var itemType = item.ItemType;
// int workIsFinish = 0;
// if (itemType == ItemTypeEnum.FillIn)
// {
// if (!string.IsNullOrEmpty(c_workModel?.WorkContent))
// {
// workIsFinish = 1;
// }
// }
// else
// {
// workIsFinish = c_workModel?.WorkIsFinish ?? 0;
// }
// var pObj = new
// {
// Id = c_workModel?.Id ?? 0,
// ItemId = item.Id,
// item.ItemName,
// item.ItemType,
// IsChecked = workIsFinish,
// WorkContent = c_workModel?.WorkContent ?? "",
// };
// pList.Add(pObj);
// }
//}
result.Add("WorkList", pList);
//突发事项列表
......@@ -727,35 +727,35 @@ namespace Edu.Module.Duty
List<object> HandoverList = new List<object>();
foreach (var item in model.PlanDetails)
{
if ( item.Id != currentModel.Id)
{
if (item.Status == 2)
{
var tempHandOverList = contentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.PlanId && qitem.PlanShift == item.Shift)?.ToList() ?? new List<RB_Duty_Content_ViewModel>();
if (tempHandOverList != null && tempHandOverList.Count > 0)
{
foreach (var subItem in tempHandOverList)
{
subItem.IsOperate = 0;
subItem.CreateByName = empList?.Where(qitem => qitem.Id == subItem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "";
}
HandoverList.AddRange(tempHandOverList);
}
}
}
else
{
var tempHandOverList = contentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.PlanId && qitem.PlanShift == item.Shift)?.ToList() ?? new List<RB_Duty_Content_ViewModel>();
if (tempHandOverList != null && tempHandOverList.Count > 0)
{
foreach (var subItem in tempHandOverList)
{
subItem.IsOperate = 1;
subItem.CreateByName = empList?.Where(qitem => qitem.Id == subItem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "";
}
HandoverList.AddRange(tempHandOverList);
}
}
//if ( item.Id != currentModel.Id)
//{
// if (item.Status == 2)
// {
// var tempHandOverList = contentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.PlanId && qitem.PlanShift == item.Shift)?.ToList() ?? new List<RB_Duty_Content_ViewModel>();
// if (tempHandOverList != null && tempHandOverList.Count > 0)
// {
// foreach (var subItem in tempHandOverList)
// {
// subItem.IsOperate = 0;
// subItem.CreateByName = empList?.Where(qitem => qitem.Id == subItem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "";
// }
// HandoverList.AddRange(tempHandOverList);
// }
// }
//}
//else
//{
// var tempHandOverList = contentList?.Where(qitem => qitem.PlanType == 2 && qitem.PlanId == item.PlanId && qitem.PlanShift == item.Shift)?.ToList() ?? new List<RB_Duty_Content_ViewModel>();
// if (tempHandOverList != null && tempHandOverList.Count > 0)
// {
// foreach (var subItem in tempHandOverList)
// {
// subItem.IsOperate = 1;
// subItem.CreateByName = empList?.Where(qitem => qitem.Id == subItem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "";
// }
// HandoverList.AddRange(tempHandOverList);
// }
//}
}
result.Add("HandoverList", HandoverList);
......@@ -763,8 +763,8 @@ namespace Edu.Module.Duty
result.Add("GiveMan", previousModel?.DutyManName ?? "");
}
result.Add("DutyStatus", currentModel?.DutyStatus);
result.Add("DutyStatusStr", (currentModel?.Status==2?Common.Plugin.EnumHelper.ToName(DutyStatusEnum.DutyFinished):currentModel?.DutyStatusStr));
//result.Add("DutyStatus", currentModel?.DutyStatus);
//result.Add("DutyStatusStr", (currentModel?.Status==2?Common.Plugin.EnumHelper.ToName(DutyStatusEnum.DutyFinished):currentModel?.DutyStatusStr));
return result;
}
......
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