From 35150537caa0690c25e6198307b535566394a50b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 10 Oct 2020 18:00:50 +0800 Subject: [PATCH 1/7] =?UTF-8?q?screen=5Findex=5Fdata=5Fmonthly=20=E8=B5=8B?= =?UTF-8?q?=E5=80=BCALL=5FPARENT=5FIDS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 45 +++++++++++++++++-- .../screen/ScreenIndexDataMonthlyDao.java | 2 + .../screen/ScreenIndexDataMonthlyEntity.java | 2 + .../screen/ScreenIndexDataMonthlyDao.xml | 6 +++ 4 files changed, 51 insertions(+), 4 deletions(-) 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 c5d269e36f..7ebedfc864 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 @@ -11,21 +11,23 @@ import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; @@ -37,8 +39,6 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; -import com.epmet.service.evaluationindex.extract.todata.GroupExtractService; -import com.epmet.service.evaluationindex.extract.todata.ProjectExtractService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; @@ -718,5 +718,42 @@ public class DemoController { } + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description screen_index_data_monthly 赋值ALL_PARENT_IDS + * @Date 2020/10/10 17:59 + **/ + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("updateDeptIndexMonthly") + public Result updateDeptIndexMonthly(){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("ORG_TYPE", "department"); + List list=screenIndexDataMonthlyDao.selectList(wrapper); + int updateNum=0; + for(ScreenIndexDataMonthlyEntity entity:list){ + if(StringUtils.isNotBlank(entity.getParentId())){ + ScreenCustomerAgencyEntity agencyEntity=screenCustomerAgencyDao.selectByAgencyId(entity.getParentId()); + if(null!=agencyEntity){ + //根组织下的部门 + if("0".equals(agencyEntity.getPid())){ + log.info("根组织下的部门"); + entity.setAllParentIds(agencyEntity.getAgencyId()); + }else{ + entity.setAllParentIds(agencyEntity.getPids().concat(",").concat(agencyEntity.getAgencyId())); + } + updateNum+=screenIndexDataMonthlyDao.updateParentIdsById(entity.getId(),entity.getAllParentIds()); + } + } + } + log.info("影响行数="+updateNum); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 925c5c728f..ecb417b9b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -95,4 +95,6 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao + + + update screen_index_data_monthly m3 + SET m3.ALL_PARENT_IDS =#{allParentIds} + where m3.id=#{id} + From 7c6ac4a364cc3ace025775fa2fb949a3a5b3da9a Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 10 Oct 2020 18:34:06 +0800 Subject: [PATCH 2/7] =?UTF-8?q?data=5Fmonthly=E6=8F=92=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0allPids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IndexDataMonthlyFormDTO.java | 5 ++ .../impl/FactIndexCollectServiceImpl.java | 72 +++++++++++++++---- .../screen/ScreenCustomerAgencyDao.xml | 3 +- .../screen/ScreenCustomerGridDao.xml | 3 +- .../screen/ScreenIndexDataMonthlyDao.xml | 2 + 5 files changed, 68 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java index 4adf142a12..5c730099e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -41,6 +41,11 @@ public class IndexDataMonthlyFormDTO implements Serializable { */ private String parentId; + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + /** * 组织名称 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 0732ac80c5..e21d0055d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; @@ -23,16 +24,20 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -43,6 +48,7 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { + Cache allParentIds = CacheBuilder.newBuilder().expireAfterWrite(2, TimeUnit.HOURS).build(); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -219,6 +225,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly this.insertIndexDataYear(monthId, customerId); + allParentIds.invalidateAll(); } /** @@ -283,6 +290,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); + monthlyDTO.setAllParentIds(gridScoreDTOS.get(i).getAllParentIds()); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -298,21 +306,26 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); - for(Map.Entry> gridScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentGridList)) { + parentGridList.forEach(o -> { + allParentIds.put(o.getGridId(), o.getGridId()); + }); + } + for (Map.Entry> gridScore : collect.entrySet()) { IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < gridScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < gridScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())) { // 是总分 - if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())){ + if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())) { // 总指数 = 网格相关 monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); } @@ -339,6 +352,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), parentAgencyId, gridName, monthlyFormDTO); + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -409,6 +423,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScoreDTOS.get(i).getAgencyId(), communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); + monthlyDTO.setAllParentIds(communityScoreDTOS.get(i).getPids()); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -424,20 +439,25 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS){ + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - for(Map.Entry> communityScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentAgencyList)) { + parentAgencyList.forEach(o -> { + allParentIds.put(o.getAgencyId(), o.getPids()); + }); + } + for (Map.Entry> communityScore : collect.entrySet()) { IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); - for ( int i = 0; i < communityScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ + for (int i = 0; i < communityScore.getValue().size(); i++) { + if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())) { // 是总分 - if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())){ + if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())) { // 总指数 = 社区相关 monthlyFormDTO.setIndexTotal(communityScore.getValue().get(i).getScore()); } @@ -465,6 +485,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); // 补充表中其他字段 monthlyFormDTOList.add(monthlyFormDTO); } @@ -497,7 +518,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); } - if (!CollectionUtils.isEmpty(mismatchDeptList)){ + if (!CollectionUtils.isEmpty(mismatchDeptList)) { + mismatchDeptList.forEach(o -> { + String pids = allParentIds.getIfPresent(o.getParentAgencyId()); + if (!StringUtils.isEmpty(pids)) { + allParentIds.put(o.getDeptId(), pids.concat(StrConstant.COLON).concat(o.getParentAgencyId())); + } + }); // 如果进行不匹配查询,查到了其他部门信息,一律赋默认值 this.insertIndexMonthlyByDeptDefaultScore(monthId, customerId, mismatchDeptList); } @@ -534,6 +561,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScoreDTOS.get(i).getDeptId(), deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); + monthlyDTO.setAllParentIds(allParentIds.getIfPresent(monthlyDTO.getOrgId())); monthlyFormDTOList.add(monthlyDTO); } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); @@ -579,12 +607,17 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deptName = deptEntity.getDeptName(); } } - if ("".equals(parentAgencyId)){ + if ("".equals(parentAgencyId)) { throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(), parentAgencyId, deptName, monthlyFormDTO); + //部门表没有 allParentIds 所以直接获取 然后拼接 + String ppIds = allParentIds.getIfPresent(monthlyFormDTO.getParentId()); + if (!StringUtils.isEmpty(ppIds)) { + monthlyFormDTO.setAllParentIds(ppIds.concat(StrConstant.COLON).concat(monthlyFormDTO.getParentId())); + } monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -634,13 +667,18 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS){ + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); int j = 0; - for(Map.Entry> agencyScore : collect.entrySet()){ + if (!CollectionUtils.isEmpty(parentAgencyList)) { + parentAgencyList.forEach(o -> { + allParentIds.put(o.getAgencyId(), o.getPids()); + }); + } + for (Map.Entry> agencyScore : collect.entrySet()) { if (NumConstant.ZERO_STR.equals(agencyScore.getKey())) { log.warn("insertIndexDataMonthlyByAgencyScore agencyyId is 0"); continue; @@ -669,12 +707,16 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyName = agencyScoreDTO.getAgencyName(); } } - if ("".equals(agencyName)){ + if ("".equals(agencyName)) { throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); + if ("S2-C1".equals(monthlyFormDTO.getOrgId())) { + System.out.println("======" + allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); + } + monthlyFormDTO.setAllParentIds(allParentIds.getIfPresent(monthlyFormDTO.getOrgId())); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 1c1907e4a7..83a948ed38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -81,7 +81,8 @@ + + From a058db69d49840eab8cd0b2cca6214fb0f494f2d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 12 Oct 2020 09:20:44 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8Csql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index ce6e942389..26e433c67f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -209,6 +209,7 @@ dm.del_flag = '0' AND rd.del_flag = '0' AND dm.org_type = 'grid' + AND dm.month_id = #{monthId} AND dm.all_parent_ids LIKE concat('%', #{agencyId}, '%') From 8cee53e3903d180507db4990febe872cc879e3c8 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 12 Oct 2020 09:49:27 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/IndexServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 13ff3a5367..5fee90fb73 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -317,8 +317,10 @@ public class IndexServiceImpl implements IndexService { list.forEach(l->{ BigDecimal num = new BigDecimal(l.getTotalScore()).setScale(1, BigDecimal.ROUND_HALF_UP).stripTrailingZeros(); l.setScroe(num); - l.setSatisfactionRatio(nf.format(Double.parseDouble(l.getSatisfactionRatio()))); - l.setClosedProjectRatio(nf.format(Double.parseDouble(l.getClosedProjectRatio()))); + BigDecimal num1 = new BigDecimal(l.getSatisfactionRatio()).setScale(1, BigDecimal.ROUND_HALF_UP); + l.setSatisfactionRatio(num1 + "%"); + BigDecimal num2 = new BigDecimal(l.getClosedProjectRatio()).setScale(1, BigDecimal.ROUND_HALF_UP); + l.setClosedProjectRatio(num2 + "%"); }); return list; From 0236e69debf7bad4918566fced20a13a7bdbebeb Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 12 Oct 2020 09:56:49 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8C=89=E6=80=BB=E6=8C=87=E6=A0=87=E5=88=86?= =?UTF-8?q?=E9=99=8D=E5=BA=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 26e433c67f..3543c79438 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -211,6 +211,7 @@ AND dm.org_type = 'grid' AND dm.month_id = #{monthId} AND dm.all_parent_ids LIKE concat('%', #{agencyId}, '%') + ORDER BY dm.index_total DESC From b9682cb90dc41b89b2caa5b852c1e59e38227a2d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 12 Oct 2020 10:08:43 +0800 Subject: [PATCH 7/7] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 3543c79438..399d1defa1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -205,6 +205,7 @@ FROM screen_index_data_monthly dm INNER JOIN screen_org_rank_data rd ON dm.org_id = rd.org_id + AND dm.month_id = rd.month_id WHERE dm.del_flag = '0' AND rd.del_flag = '0'