From 9e3a4228ca67b51bf44fbb4bd3391b34f7fd49e1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sun, 27 Sep 2020 15:00:24 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8A=9E=E7=BB=93=E6=95=88=E7=8E=87?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=94=BE=E5=85=A5=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataToIndex/impl/IndexCollCommunityServiceImpl.java | 4 +++- .../dataToIndex/impl/IndexCollStreetServiceImpl.java | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 6cd619a2fd..2ed9e35483 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 @@ -26,6 +26,7 @@ import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -143,7 +144,8 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService entity.setClosedProjectRatio(BigDecimal.ZERO); } //办结效率 - entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId())); + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + }); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); 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 896d2d47bd..256ac5b76f 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 @@ -26,6 +26,7 @@ import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -125,14 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); //分母,即机关参与过的项目数(去重) Integer denominator = agencyParticipatedCount.get(entity.getAgencyId()); - if (agencyParticipatedCount.get(entity.getAgencyId()) != NumConstant.ZERO) { + if (null != denominator && denominator != NumConstant.ZERO) { //办结率 entity.setClosedProjectRatio( element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP) ); + }else{ + entity.setClosedProjectRatio(BigDecimal.ZERO); } //办结效率 - entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId())); + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); }); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); From bd8b8ae58e8ee3de534b9f1dce16e6aefd8e9201 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 28 Sep 2020 10:23:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?device=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/PublicPartExtractServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index 7ccb83368f..2f1a6b2c52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -233,7 +233,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0))); } if (votedByIssueCount.intValue() != 0) { - entity.setAvgJoin(bigDecimal.divide(votedByIssueCount).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } } }); From a1e38e07a386f0b93adb4a2ae15710cba046fae5 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 28 Sep 2020 10:35:22 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8A=9E=E7=BB=93=E6=95=88=E7=8E=87?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=94=BE=E5=85=A5=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginProjectMainDailyDao.java | 11 +++ .../FactOriginProjectMainDailyService.java | 11 +++ ...FactOriginProjectMainDailyServiceImpl.java | 14 +++ .../todata/impl/GroupExtractServiceImpl.java | 11 +++ ...srootsGovernDataAbsorptionServiceImpl.java | 7 +- .../extract/FactOriginProjectMainDailyDao.xml | 97 +++++++++++++++++++ 6 files changed, 149 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 01bf423d48..9c47e1184c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -169,4 +170,14 @@ public interface FactOriginProjectMainDailyDao extends BaseDao */ List getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); + + /** + * @Description 查询难点赌点的基本信息,要排除之前已经结案过的项目 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:19 + */ + List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index bc061d6064..23787b2ca3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; import java.util.Map; @@ -216,4 +217,14 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getGridResolveProject(String customerId, String monthId); + + /** + * @Description 查询难点赌点基础信息 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:23 + */ + List getDifficultyBaseInfo(String customerId , List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 6e8c7124e8..a8ff591bae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -213,4 +214,17 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getGridResolveProject(String customerId, String monthId) { return baseDao.getGridResolveProject(customerId, monthId); } + + /** + * @Description 查询难点赌点基础信息 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2020.09.28 10:23 + */ + @Override + public List getDifficultyBaseInfo(String customerId, List list) { + return null; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 00e277e27d..30f19a5c7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; @@ -101,6 +102,11 @@ public class GroupExtractServiceImpl implements GroupExtractService { group.setAgencyId(attr.getAgencyId()); group.setParentId(attr.getParentId()); group.setPids(attr.getPids()); + if(StringUtils.isBlank(group.getPids().trim()) || NumConstant.ZERO_STR.equals(group.getPids().trim())){ + group.setPids(group.getAgencyId()); + }else{ + group.setPids(group.getPids().concat(StrConstant.COLON).concat(group.getAgencyId())); + } } if(null != group.getCreatedTime()){ DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime()); @@ -124,6 +130,11 @@ public class GroupExtractServiceImpl implements GroupExtractService { member.setAgencyId(attr.getAgencyId()); member.setParentId(attr.getParentId()); member.setPids(attr.getPids()); + if(StringUtils.isBlank(member.getPids().trim()) || NumConstant.ZERO_STR.equals(member.getPids().trim())){ + member.setPids(member.getAgencyId()); + }else{ + member.setPids(member.getPids().concat(StrConstant.COLON).concat(member.getAgencyId())); + } } memberList.add(member); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 563a8c65cc..317c953f55 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -1,9 +1,11 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; @@ -88,7 +90,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr user.setGridName(gridInfo.getGridName()); user.setOrgId(gridInfo.getAgencyId()); user.setOrgName(gridInfo.getOrgName()); - user.setAllParentIds(gridInfo.getPids()); + //原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开 + user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA)); } Integer point = pointMap.get(user.getUserId()); BigDecimal score = scoreMap.get(user.getUserId()); @@ -114,6 +117,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr **/ @Override public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { - + ScreenDifficultyDataEntity entity = new ScreenDifficultyDataEntity(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 5b9c58b5ea..72ee315d52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -282,4 +282,101 @@ fm.GRID_ID) b ON a.GRID_ID = b.GRID_ID + + + + \ No newline at end of file From d8c173c1f1aa9de62debbe810932a3e260444b4c Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 28 Sep 2020 10:44:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/project/ProjectDao.java | 9 +++ .../impl/ProjectExtractServiceImpl.java | 69 ++++++++++++------- .../impl/ScreenExtractServiceImpl.java | 17 +++-- .../epmet/service/project/ProjectService.java | 9 +++ .../project/impl/ProjectServiceImpl.java | 5 ++ .../resources/mapper/project/ProjectDao.xml | 9 +++ 6 files changed, 89 insertions(+), 29 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index d676531771..df6da92b0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -94,4 +94,13 @@ public interface ProjectDao extends BaseDao { * @return java.util.List */ List selectProjectInfo(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取用户可滞留天数 + * @author zhaoqifeng + * @date 2020/9/28 10:16 + * @param customerId + * @return java.lang.String + */ + String selectParameterValueByKey(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index a9552ed3b8..3753b69c31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -71,6 +72,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { @Autowired private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + private final static String ONE_DAY = "<1"; + @Override public void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO) { String dateString = extractOriginFormDTO.getDateId(); @@ -80,7 +83,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { List closedList = projectProcessService.getClosedProjectList(customerId, dateString); List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); List finishOrgList = projectProcessService.getFinishOrg(customerId, dateString); - if (null != closedList && !closedList.isEmpty()) { + if (CollectionUtils.isEmpty(closedList)) { List closeProjects = pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); @@ -92,9 +95,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { return entity; })).collect(Collectors.toList()); - if (null != finishOrgList && !finishOrgList.isEmpty()) { + if (CollectionUtils.isEmpty(finishOrgList)) { closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { - String[] orgIds = dto.getPIdPath().split(":"); + String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); if (orgIds.length > NumConstant.ONE) { close.setFinishOrgIds(orgIds[orgIds.length - 1]); } else { @@ -109,7 +112,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } //获取项目信息 List projectList = projectService.getProjectInfo(customerId, dateString); - if (null != projectList && !projectList.isEmpty()) { + if (CollectionUtils.isEmpty(projectList)) { //提取议题ID List issueIds = projectList.stream().map(ProjectDTO::getOriginId).collect(Collectors.toList()); //获取议题信息 @@ -139,7 +142,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setCreatedTime(project.getCreatedTime()); entity.setUpdatedTime(project.getUpdatedTime()); entity.setPids(project.getOrgIdPath()); - String[] pIds = project.getOrgIdPath().split(":"); + String[] pIds = project.getOrgIdPath().split(StrConstant.COLON); if (pIds.length > 1) { entity.setPid(pIds[pIds.length - 2]); } else if(pIds.length == 1){ @@ -163,7 +166,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setIsParty(NumConstant.ONE_STR); })); list.forEach(entity -> finishOrgList.stream().filter(finish -> entity.getId().equals(finish.getProjectId())).forEach(dto -> { - String[] orgIds = dto.getPIdPath().split(":"); + String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); if (orgIds.length > NumConstant.ONE) { entity.setFinishOrgIds(orgIds[orgIds.length - 1]); } else { @@ -179,7 +182,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { final List mainList = list; //节点发起人 List processList = projectProcessService.getProcessListByCustomer(customerId, dateString); - if (null != processList && !processList.isEmpty()) { + if (CollectionUtils.isEmpty(processList)) { List logList = processList.stream().map(process -> { //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); @@ -204,15 +207,15 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setOrgId(process.getGridId()); entity.setPid(process.getAgencyId()); }else{ - if(!process.getPids().contains(":")){ + if(!process.getPids().contains(StrConstant.COLON)){ entity.setPids(""); entity.setPid(NumConstant.ZERO_STR); }else{ - String[] orgArray = process.getPids().split(":"); - if(null != orgArray && orgArray.length > NumConstant.ONE){ + String[] orgArray = process.getPids().split(StrConstant.COLON); + if(orgArray.length > NumConstant.ONE){ entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); String path = process.getPids().replaceAll(process.getAgencyId(),""); - if(path.endsWith(":")){ + if(path.endsWith(StrConstant.COLON)){ path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); } entity.setPids(path); @@ -283,15 +286,15 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setOrgId(process.getGridId()); entity.setPid(process.getAgencyId()); }else{ - if(!process.getPids().contains(":")){ + if(!process.getPids().contains(StrConstant.COLON)){ entity.setPids(""); entity.setPid(NumConstant.ZERO_STR); }else{ - String[] orgArray = process.getPids().split(":"); - if(null != orgArray && orgArray.length > NumConstant.ONE){ + String[] orgArray = process.getPids().split(StrConstant.COLON); + if(orgArray.length > NumConstant.ONE){ entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); String path = process.getPids().replaceAll(process.getAgencyId(),""); - if(path.endsWith(":")){ + if(path.endsWith(StrConstant.COLON)){ path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); } entity.setPids(path); @@ -322,7 +325,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { @Override public void extractProjectPeriodData(ExtractOriginFormDTO param) { int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); - Boolean isFirst = trace <= NumConstant.ZERO ? true : false; + Boolean isFirst = trace <= NumConstant.ZERO; if (StringUtils.isBlank(param.getDateId())) { Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); @@ -345,23 +348,23 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { }else{ dest.setOrgType("agency"); dest.setPids(""); - String[] array = original.getOrgIdPath().split(":"); - if(null == array || array.length <= NumConstant.ZERO){ + String[] array = original.getOrgIdPath().split(StrConstant.COLON); + if(array.length <= NumConstant.ZERO){ dest.setPid(NumConstant.ZERO_STR); } - if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){ + if(array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE){ dest.setPid(NumConstant.ZERO_STR); } - if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){ + if(array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])){ dest.setPid(array[array.length - NumConstant.TWO]); dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); } if(StringUtils.isNotBlank(dest.getPids())){ - while(dest.getPids().endsWith(":")){ + while(dest.getPids().endsWith(StrConstant.COLON)){ dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE)); } - while(dest.getPids().startsWith(":")){ - dest.setPids(dest.getPids().replaceFirst(":","")); + while(dest.getPids().startsWith(StrConstant.COLON)){ + dest.setPids(dest.getPids().replaceFirst(StrConstant.COLON,"")); } } dest.setPids(dest.getPids().replaceAll(" ","")); @@ -400,13 +403,29 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { list.add(workDayFormDTO); Result> detentionDays = epmetCommonServiceOpenFeignClient.detentionDays(list); String days = detentionDays.getData().get(NumConstant.ZERO).getDetentionDays(); - if (("<1").equals(days)) { - result = 1; + if (ONE_DAY.equals(days)) { + result = NumConstant.ONE; } else { result = Integer.parseInt(days); } return result; } + /** + * 客户配置的可滞留时间,没有的话默认5天 + * @author zhaoqifeng + * @date 2020/9/28 10:27 + * @param customerId + * @return java.lang.Integer + */ + private Integer getDays(String customerId) { + String value = projectService.getParameterValueByKey(customerId); + Integer days = NumConstant.FIVE; + if (StringUtils.isNotBlank(value)) { + days = Integer.valueOf(value); + } + return days; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index acbb43dcbf..86e1eef6e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; -import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; -import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; -import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; +import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -35,6 +32,10 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private PioneerDataExtractService pioneerDataExtractService; @Autowired private PublicPartExtractService publicPartExtractService; + @Autowired + private OrgRankExtractService orgRankExtractService; + @Autowired + private GovernRankDataExtractService governRankDataExtractService; /** * @param extractOriginFormDTO @@ -124,5 +125,13 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { formDTO.setMonthId(monthId); publicPartExtractService.extractTotalDataMonthly(formDTO); + //治理能力排行 + governRankDataExtractService.extractGridData(customerId, monthId); + governRankDataExtractService.extractCommunityData(customerId, monthId); + governRankDataExtractService.extractStreetData(customerId, monthId); + //先进排行 + orgRankExtractService.extractGridData(customerId, monthId); + orgRankExtractService.extractCommunityData(customerId, monthId); + orgRankExtractService.extractStreetData(customerId, monthId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index de95867ded..0b0692ba21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -90,4 +90,13 @@ public interface ProjectService extends BaseService { * @return java.util.List */ List getProjectInfo(String customerId, String date); + + /** + * 获取用户可滞留天数 + * @author zhaoqifeng + * @date 2020/9/28 10:15 + * @param customerId + * @return java.lang.String + */ + String getParameterValueByKey(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index d1f5e88b1d..fa22e2090e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -77,4 +77,9 @@ public class ProjectServiceImpl extends BaseServiceImpl + \ No newline at end of file From e53b4a27c77b0f4755c184e423b56bb009560cf6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 28 Sep 2020 11:02:44 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E5=8E=BB=E6=8E=89token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/fact/FactIndexController.java | 28 ++++++++--------- .../controller/screen/IndexController.java | 4 +-- .../screen/ScreenUserController.java | 8 ++--- .../fact/impl/FactIndexServiceImpl.java | 30 +++++++++++++++++++ 4 files changed, 50 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index fbf0e78748..5780a6e4c3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -28,78 +28,78 @@ public class FactIndexController { private FactIndexService factIndexService; /** - * @param tokenDTO + * @param formDTO * @Description 能力指数 * @author sun */ @PostMapping("index/ablityindex") - public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) { + public Result> ablityIndex(@RequestBody AblityIndexFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityIndex(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 按月份查询各项能力分数 * @author sun */ @PostMapping("index/scorelist") - public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) { + public Result> scoreList(@RequestBody ScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.scoreList(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 按月份查询各项能力最近12个月得分 * @author sun */ @PostMapping("index/monthscorelist") - public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) { + public Result> monthScoreList(@RequestBody MonthScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthScoreList(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 按月查询各项指标数据 * @author sun */ @PostMapping("index/ablitylist") - public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) { + public Result> ablityList(@RequestBody AblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityList(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 按月查询各项指标最近12个月数据 * @author sun */ @PostMapping("index/monthablitylist") - public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) { + public Result> monthAblityList(@RequestBody MonthAblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthAblityList(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 同级对比各项数据查询 * @author sun */ @PostMapping("index/peercomparison") - public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) { + public Result> peerComparison(@RequestBody PeerComparisonFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.peerComparison(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 是否根组织 * @author sun */ @PostMapping("index/rootagency") - public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) { + public Result rootAgency(@RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); return new Result().ok(factIndexService.rootAgency(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 98e2207514..79b839ea10 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -103,12 +103,12 @@ public class IndexController { } /** - * @param tokenDTO + * @param formDTO * @Description 组织月度指数得分 * @author sun */ @PostMapping("month/indexscore") - public Result indexScore(@LoginUser TokenDto tokenDTO, @RequestBody IndexScoreFormDTO formDTO) { + public Result indexScore(@RequestBody IndexScoreFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, IndexScoreFormDTO.AddUserInternalGroup.class); return new Result().ok(indexService.indexScore(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index bc6997d45f..84d586306f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -30,23 +30,23 @@ public class ScreenUserController { private ScreenUserService screenUserService; /** - * @param tokenDTO + * @param formDTO * @Description 热心市民积分排行列表 * @author sun */ @PostMapping("userpointrank") - public Result> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) { + public Result> userPointRank(@RequestBody UserPointRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); return new Result>().ok(screenUserService.userPointRank(formDTO)); } /** - * @param tokenDTO + * @param formDTO * @Description 党员(指标得分)排行 * @author sun */ @PostMapping("partindexscroerank") - public Result> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) { + public Result> partIndexScroeRank(@RequestBody PartIndexScroeRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); return new Result>().ok(screenUserService.partIndexScroeRank(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 68b3fd1f60..24efaa35c1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -19,6 +19,7 @@ import java.text.NumberFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.regex.Pattern; /** * 数据改版api @@ -447,6 +448,9 @@ public class FactIndexServiceImpl implements FactIndexService { * @author sun */ public String getDate(String newDate) { + if (!validDateEffecitive(newDate)) { + throw new RenException(String.format("monthId格式错误,monthId:%s", newDate)); + } String date = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); try { @@ -460,6 +464,32 @@ public class FactIndexServiceImpl implements FactIndexService { return date; } + /** + * @param newDate + * @Description 校验日期格式是否正确 + * @author sun + */ + public boolean validDateEffecitive(String newDate) { + //yyyy-MM-dd格式 + //String DATE_REGEX = "^([1-9]\\d{3}-)(([0]{0,1}[1-9]-)|([1][0-2]-))(([0-3]{0,1}[0-9]))$"; + //yyyymm格式 + String DATE_REGEX = "^([1-9]\\d{3})(([0]{0,1}[1-9])|([1][0-2]))$"; + boolean matches = Pattern.matches(DATE_REGEX, newDate); + if (!matches) { + return matches; + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); + //设置日期格式转的严谨性 + sdf.setLenient(false); + try { + sdf.parse(newDate); + } catch (ParseException e) { + e.printStackTrace(); + return false; + } + return matches; + } + /** * @param formDTO * @Description 同级对比各项数据查询 From 88cde1891586b5f5d6a8b91ffd711d6ff0bcb151 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 11:02:56 +0800 Subject: [PATCH 6/6] =?UTF-8?q?monthId=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataToIndex/impl/IndexOriginExtractServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 23a4de5128..60d592a1b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -52,7 +53,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService String monthId = formDTO.getMonthId(); String customerId = formDTO.getCustomerId(); if (StringUtils.isBlank(monthId)) { - monthId = DimIdGenerator.getDateDimId(DateUtils.addDateMonths(new Date(), -1)); + monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); } List customerIds = new ArrayList<>(); if (StringUtils.isNotBlank(customerId)) {