|
|
@@ -4263,8 +4263,16 @@ namespace Business.ResourceExamineManagement
|
|
|
if (srtPoint == null)
|
|
|
{
|
|
|
//获取开始时间最近的时间段
|
|
|
- srtPoint = workPoints.Where(p => p.EndPoint <= startTime).OrderBy(p => p.Level).Last();
|
|
|
- startTime = srtPoint.EndPoint;
|
|
|
+ //开始时间小于工作开始时间
|
|
|
+ if (startTime <= workPoints[0].StartPoint)
|
|
|
+ {
|
|
|
+ srtPoint = workPoints[0];
|
|
|
+ startTime = srtPoint.StartPoint;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ srtPoint = workPoints.Where(p => p.EndPoint <= startTime).OrderBy(p => p.Level).Last();
|
|
|
+ startTime = srtPoint.EndPoint;
|
|
|
+ }
|
|
|
}
|
|
|
//开始时间、结束时间处于同一天
|
|
|
if (startTime.Date == endTime.Date)
|
|
|
@@ -4275,8 +4283,20 @@ namespace Business.ResourceExamineManagement
|
|
|
if (lstPoint == null)
|
|
|
{
|
|
|
//获取结束时间最近的时间段
|
|
|
- lstPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
- endTime = lstPoint.EndPoint;
|
|
|
+ //lstPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
+ //endTime = lstPoint.EndPoint;
|
|
|
+ //获取开始时间最近的时间段
|
|
|
+ //结束时间小于工作开始时间
|
|
|
+ if (endTime <= workPoints[0].StartPoint)
|
|
|
+ {
|
|
|
+ lstPoint = workPoints[0];
|
|
|
+ endTime = lstPoint.StartPoint;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lstPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
+ endTime = lstPoint.EndPoint;
|
|
|
+ }
|
|
|
}
|
|
|
//开始时间和结束时间位于同一时间段
|
|
|
if (srtPoint.Level == lstPoint.Level)
|
|
|
@@ -4314,8 +4334,19 @@ namespace Business.ResourceExamineManagement
|
|
|
if (curPoint == null)
|
|
|
{
|
|
|
//获取结束时间最近的时间段
|
|
|
- curPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
- endTime = curPoint.EndPoint;
|
|
|
+ //curPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
+ //endTime = curPoint.EndPoint;
|
|
|
+ //结束时间小于工作开始时间
|
|
|
+ if (endTime <= workPoints[0].StartPoint)
|
|
|
+ {
|
|
|
+ curPoint = workPoints[0];
|
|
|
+ endTime = curPoint.StartPoint;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ curPoint = workPoints.Where(p => p.EndPoint <= endTime).OrderBy(p => p.Level).Last();
|
|
|
+ endTime = curPoint.EndPoint;
|
|
|
+ }
|
|
|
}
|
|
|
span = endTime - curPoint.StartPoint;
|
|
|
sumTimes += (decimal)span.TotalMinutes;
|