尖峰平谷电价的时间区间校验修改

master
xjl 5 months ago
parent bd67ba5a84
commit ca440d8608

@ -306,12 +306,15 @@ namespace WebStarter.Controllers.BasicConfig
for (int i = 0; i < timePeriods.Count; i++) for (int i = 0; i < timePeriods.Count; i++)
{ {
for (int j = i + 1; j < timePeriods.Count; j++) if (timePeriods[i].StartHour != 0 && timePeriods[i].StartMinute != 0 && timePeriods[i].StartSecond != 0 && timePeriods[i].EndHour != 0 && timePeriods[i].EndMinute != 0 && timePeriods[i].EndSecond != 0)//排除开始和结束时间都是0点的不判断
{ {
if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i])) for (int j = i + 1; j < timePeriods.Count; j++)
{ {
notHasOverlap = false; if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i]))
return notHasOverlap; {
notHasOverlap = false;
return notHasOverlap;
}
} }
} }
} }

Loading…
Cancel
Save