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

页面修改

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