Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
842448a2
Commit
842448a2
authored
May 08, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0c103126
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
192 additions
and
192 deletions
+192
-192
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+192
-192
No files found.
Edu.Module.Duty/DutyPlanModule.cs
View file @
842448a2
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment