|
@@ -22,6 +22,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import javax.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -348,17 +349,26 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
throws ParseException {
|
|
|
List<SpStatementInlandLow> spStatementInlandLowList = new ArrayList<>(
|
|
|
currentMonthData.size());
|
|
|
- for (ShorePowerConnRecordInfoVo currentMonth : currentMonthData) {
|
|
|
+ for (ShorePowerConnRecordInfoEnum areaEnum : ShorePowerConnRecordInfoEnum.values()) {
|
|
|
SpStatementInlandLow spStatementInlandLow = new SpStatementInlandLow();
|
|
|
spStatementInlandLow.setId(String.valueOf(snowflakeMakeConf.snowflakeId()));
|
|
|
+ spStatementInlandLow.setDistrict(areaEnum.getArea());
|
|
|
spStatementInlandLow.setReportDate(
|
|
|
DateUtils.stringToDate(currentDate, DateUtils.DATE_FORMAT_12));
|
|
|
- spStatementInlandLow.setDistrict(
|
|
|
- ShorePowerConnRecordInfoEnum.getByArea(Integer.parseInt(currentMonth.getArea()))
|
|
|
- .getArea());
|
|
|
spStatementInlandLow.setSort(
|
|
|
AreaSortEnum.getByArea(spStatementInlandLow.getDistrict()).getSort());
|
|
|
spStatementInlandLow.setType(2);
|
|
|
+ List<ShorePowerConnRecordInfoVo> areaCollectData = currentMonthData.stream()
|
|
|
+ .filter(
|
|
|
+ i -> ShorePowerConnRecordInfoEnum.getByArea(Integer.parseInt(i.getArea())).getArea()
|
|
|
+ .equals(areaEnum.getArea())).collect(
|
|
|
+ Collectors.toList());
|
|
|
+ ShorePowerConnRecordInfoVo currentMonth;
|
|
|
+ if (!CollectionUtils.isEmpty(areaCollectData)) {
|
|
|
+ currentMonth = areaCollectData.get(0);
|
|
|
+ } else {
|
|
|
+ currentMonth = new ShorePowerConnRecordInfoVo();
|
|
|
+ }
|
|
|
spStatementInlandLow.setBoatUseNumberMonth(currentMonth.getTotal());
|
|
|
|
|
|
spStatementInlandLow.setPowerConnHoursMonth(currentMonth.getDuration());
|
|
@@ -393,11 +403,59 @@ public class SpStatementInlandLowServiceImpl extends
|
|
|
.add(lastReportData.getElectricityUsageYearTotal())
|
|
|
.setScale(2, RoundingMode.HALF_UP));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
spStatementInlandLowList.add(spStatementInlandLow);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return spStatementInlandLowList;
|
|
|
}
|
|
|
}
|