diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index e75870980f..a6cc1d5c1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; @@ -11,7 +10,6 @@ import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; -import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; @@ -24,14 +22,12 @@ import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; @@ -213,7 +209,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupCount = approvedResult.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + Integer groupCount = approvedResult.stream().mapToInt(AgencyGroupTotalCountResultDTO::getGridGroupCount).sum(); agencyResult.setGroupTotalCount(groupCount); // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" List peopleTotal = new ArrayList<>(); @@ -225,7 +221,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupPeopleCount = peopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + Integer groupPeopleCount = peopleTotal.stream().mapToInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal).sum(); agencyResult.setGroupMemberTotalCount(groupPeopleCount); // 4. 机关下小组平均人数 agencyResult.setGroupMemberAvgCount(