|
@@ -303,10 +303,17 @@ public class Electricityservice {
|
|
|
Date firstDayZeroHour = calendar2.getTime();
|
|
|
|
|
|
|
|
|
- int currentYear = calendar2.get(Calendar.YEAR);
|
|
|
- int currentMonth = calendar2.get(Calendar.MONTH) + 1;
|
|
|
+ // 获取firstDayZeroHour的月份
|
|
|
+ Calendar calFirstDayZeroHour = Calendar.getInstance();
|
|
|
+ calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
|
+ int currentMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
+
|
|
|
+ // 将calendar2的时间设置回当前日期
|
|
|
+ calendar2.setTime(new Date());
|
|
|
+
|
|
|
+ // 获取当前月份的天数
|
|
|
+ int ts = calendar2.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
|
|
-// int daysInMonth = calendar3.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
|
|
for (int i = 1; i <= 12; i++) {
|
|
|
|
|
@@ -377,11 +384,17 @@ public class Electricityservice {
|
|
|
//添加日发电量预测
|
|
|
vo.setRfdlyc(BigDecimal.valueOf(byrzqdhjsum));
|
|
|
|
|
|
- firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, +1);
|
|
|
+// firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, +1);
|
|
|
|
|
|
vos.add(vo);
|
|
|
SortUtils.sort(vos, "hours", SortUtils.ASC);
|
|
|
map.put("value",vos);
|
|
|
+
|
|
|
+
|
|
|
+ // 月份增加一个月
|
|
|
+ firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, 1);
|
|
|
+ calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
|
+ currentMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
}
|
|
|
return map;
|
|
|
}
|