From cbac5e8ca89de2f937049f7fb997b767fb19c182 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Oct 2020 14:24:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E4=BF=A1=E6=81=AFv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java | 2 +- .../screen/impl/IndexGroupDetailServiceImpl.java | 2 +- .../mapper/evaluationindex/screen/IndexGroupDetailDao.xml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index 2c6d867a08..9429d1a8a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -49,5 +49,5 @@ public interface IndexGroupDetailDao extends BaseDao { */ List selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath); - int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight); + int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight,@Param("allParentIndexCode")String allParentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index 0b807c0f7c..c607004310 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -93,7 +93,7 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl values, String customerId) { int updatedNum=0; for(IndexGroupDetailTemplateEntity entity:values){ - updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight()); + updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight(),entity.getAllParentIndexCode()); } log.info("修改客户权重信息,影响行数="+updatedNum); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 6624f1b58a..914d4798a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -34,10 +34,11 @@ UPDATE index_group_detail - SET WEIGHT =#{weight} + SET WEIGHT =#{weight},UPDATED_TIME=NOW() WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND INDEX_CODE = #{indexCode} + and ALL_INDEX_CODE_PATH=#{allParentIndexCode} \ No newline at end of file From 9545538623baa4e02040aa46f8bde4552147d053 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Oct 2020 14:24:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E4=BF=A1=E6=81=AFv3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/screen/IndexGroupDetailDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 914d4798a2..0fa884b2c7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -39,6 +39,6 @@ DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND INDEX_CODE = #{indexCode} - and ALL_INDEX_CODE_PATH=#{allParentIndexCode} + and ALL_PARENT_INDEX_CODE=#{allParentIndexCode} \ No newline at end of file From bcee97c3cad58a538b436668137daf719ce64c5b Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 14 Oct 2020 17:42:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=BB=93=E6=A1=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectParticipatedAgencyResultDTO.java | 6 +- .../extract/FactOriginProjectLogDailyDao.java | 15 +++- .../impl/IndexCollCommunityServiceImpl.java | 7 +- .../impl/IndexCollDistrictServiceImpl.java | 7 +- .../impl/IndexCollStreetServiceImpl.java | 7 +- .../FactOriginProjectLogDailyService.java | 14 ++-- .../FactOriginProjectLogDailyServiceImpl.java | 48 ++++-------- .../extract/FactOriginProjectLogDailyDao.xml | 78 +++++++++---------- 8 files changed, 80 insertions(+), 102 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java index 1cd9de713b..0065a286ec 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java @@ -14,11 +14,7 @@ import java.io.Serializable; public class ProjectParticipatedAgencyResultDTO implements Serializable { private static final long serialVersionUID = 1071619125612033138L; - private String projectId; - private String agencyId; - private String level; - - private int score; + private int count; } 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 63e54d4354..74354a41d1 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 @@ -107,14 +107,21 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId, - @Param("dateType")String dateType); + List selectProjectParticipatedAgency(@Param("agencies") List agencies, @Param("dimId") String dimId); + /*** + * @Description 查询机关办结次数 + * @param agencies + * @return java.util.List + * @author wangc + * @date 2020.10.14 10:27 + */ + List selectAgencyHandledProjectCount(@Param("agencies") List agencies,@Param("customerId") String customerId,@Param("dimId") String dimId); /** * 网格项目响应度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java index e362661ab0..dbf40fc0a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -135,9 +135,10 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService } //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); - Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month"); - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month"); list.forEach(entity ->{ entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java index 90814b7dfb..4337f9699b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java @@ -128,9 +128,10 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { })); } //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); - Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month"); - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month"); list.forEach(entity ->{ entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java index 2e5e5e4698..dcf3a43dcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -126,9 +126,10 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { })); } //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); - Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month"); - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); + List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month"); list.forEach(entity ->{ entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); 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 b3c8c8958e..f8f430eb0a 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 @@ -170,32 +170,32 @@ public interface FactOriginProjectLogDailyService extends BaseService getProjectHandledAgency(String customerId, String dimId,String dateType); + Map getProjectHandledAgency(List agencies, String customerId, String dimId,String dateType); /** - * @Description 查询机关单位经手的项目数 - * @param customerId + * @Description 查询机关单位经手的项目数,去重 + * @param agencies * @param dimId * @param dateType - 日期维度类型 month date week quarter year * @return * @author wangc * @date 2020.09.23 10:06 **/ - Map getCountOfProjectsHandledByAgency(String customerId, String dimId,String dateType); + Map getCountOfDealingAgency(List agencies, String customerId,String dimId,String dateType); /** * @Description 计算机关办结项目效率 - * @param customerId + * @param agencies * @return * @author wangc * @date 2020.09.21 02:16 **/ - Map getAgencyWorkPieceRatio(String customerId, String dimId,String dateType); + Map getAgencyWorkPieceRatio(List agencies, String customerId,String dimId,String dateType); /** * 网格项目响应度 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 070770a414..ff6d5d6150 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 @@ -165,42 +165,26 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getProjectHandledAgency(String customerId, String dimId, String dateType) { + public Map getProjectHandledAgency(List agencies, String customerId,String dimId, String dateType) { Map result = new HashMap<>(); - List projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType); - if(!CollectionUtils.isEmpty(projectAgency)){ - Map> map - = projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId)); - - map.forEach((key ,agencies) ->{ - if(!CollectionUtils.isEmpty(agencies)) { - String highest = agencies.get(NumConstant.ZERO).getLevel(); - for (int i = NumConstant.ZERO; i < agencies.size(); i++) { - if(StringUtils.equals(agencies.get(i).getLevel(),highest)){ - if(null != result.get(agencies.get(i).getAgencyId())){ - result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE); - }else{ - result.put(key,NumConstant.ONE); - } - }else break; - } - } - }); + List countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId); + if(!CollectionUtils.isEmpty(countList)){ + result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); } return result; } /** - * @Description 查询机关单位经手的项目数 - * @param customerId + * @Description 查询机关单位经手的项目数,去重 + * @param agencies * @param dimId * @param dateType - 日期维度类型 month date week quarter year * @return @@ -208,30 +192,24 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getCountOfProjectsHandledByAgency(String customerId, String dimId, String dateType) { + public Map getCountOfDealingAgency(List agencies, String customerId,String dimId, String dateType) { Map result = new HashMap<>(); - List projectAgencyCount = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType); + List projectAgencyCount = baseDao.selectProjectParticipatedAgency(agencies,dimId); if(!CollectionUtils.isEmpty(projectAgencyCount)){ - Map> map = - projectAgencyCount.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId)); - - map.forEach((agency,handledProjectList) -> { - result.put(agency,handledProjectList.size()); - }); - return result; + result = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); } return result; } /** * @Description 计算机关办结项目效率 - * @param customerId + * @param agencies * @return * @author wangc * @date 2020.09.21 02:16 **/ @Override - public Map getAgencyWorkPieceRatio(String customerId, String dimId, String dateType) { + public Map getAgencyWorkPieceRatio(List agencies, String customerId,String dimId, String dateType) { //网格、部门的办结系数 List gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType); //机关的办结系数 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 7ddb366da3..1ce108986a 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 @@ -138,56 +138,50 @@ fopld.ORG_ID - + + + +