diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 6fefc845b6..e70d9541b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -62,7 +62,6 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Date; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -760,6 +759,7 @@ public class DemoController { orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId()); orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId()); orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId()); + orgRankExtractService.extractDistrictData(formDTO.getCustomerId(), formDTO.getDateId()); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 45f3ba2350..4fb104b4a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -288,6 +288,7 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); + List selectAgencyClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 网格自治率统计--按天 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 2d95509fca..b3b50560f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; -import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import java.math.BigDecimal; @@ -310,7 +309,7 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridClosed(String customerId, String monthId); - + List getAgencyClosed(String customerId, String monthId); /** * 网格自制率统计-按天 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 311da04715..e59b8eab6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -401,6 +401,11 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyClosed(String customerId, String monthId) { + return baseDao.selectAgencyClosed(customerId, monthId); + } + /** * 网格自制率统计-按天 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java index 4e7ecc27aa..fde0f879bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java @@ -6,8 +6,6 @@ import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; -import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; -import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService; @@ -17,9 +15,9 @@ import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService; import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.apache.commons.collections4.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -184,11 +182,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY); @@ -252,11 +254,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); @@ -320,11 +326,15 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService { )); } //结案率 结案数/项目数 - List abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.DISTRICT); - if (CollectionUtils.isNotEmpty(abilityList)) { - list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> - entity.setCloseProjectRatio(dto.getClosedProjectRatio()) - )); + List closed = factOriginProjectLogDailyService.getAgencyClosed(customerId, monthId); + if (CollectionUtils.isNotEmpty(closed)) { + list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); } //满意率 满意和非常满意占比 List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 893b094f3a..121c909d15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -516,6 +516,36 @@ ON a.GRID_ID = b.GRID_ID + +