From 4d1334368c7f09cb19d8b711eb87f0e0144ac73b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 29 Mar 2022 15:18:38 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/model/ImportHouseInfoListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java index 31640c8206..4cd6ae33d6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java @@ -139,10 +139,11 @@ public class ImportHouseInfoListener extends AnalysisEventListener Date: Tue, 29 Mar 2022 17:00:54 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/ExcelUtils.java | 10 ++++++++-- .../commons/tools/utils/excel/ExportMultiView.java | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java index 90b840f4f7..9bc34d0a39 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java @@ -132,14 +132,20 @@ public class ExcelUtils { return response.getOutputStream(); } + /** + * desc:easypoi导出多个sheet + * @param fileName + * @param list + * @param response + * @throws Exception + */ public static void exportMultiSheetExcel(String fileName, List list, HttpServletResponse response) throws Exception { List> excel = new ArrayList<>(); for(ExportMultiView view :list){ Map sheet = new HashMap<>(); sheet.put("title",view.getExportParams()); sheet.put("entity",view.getCls()); - List dataList = view.getDataList(); - sheet.put("data", dataList); + sheet.put("data", view.getDataList()); excel.add(sheet); } Workbook workbook = ExcelExportUtil.exportExcel(excel, ExcelType.XSSF); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java index 815585a1e3..ff69b2c4b0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/excel/ExportMultiView.java @@ -16,8 +16,17 @@ import java.util.List; @Data @AllArgsConstructor public class ExportMultiView { + /** + * 导出的参数 比如设置表头 + */ private ExportParams exportParams; + /** + * 要导出的数据列 + */ private List dataList; + /** + * excel对应的类 + */ private Class cls; } From da247b3beb09d3fd50981cc5e91a1cc56ed5e412 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Mar 2022 17:57:49 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BB=84=E7=BB=87like=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 2 +- .../resources/mapper/evaluationindex/EvaluationIndexDao.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index 66f964c3d9..02d9687ec1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -189,7 +189,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { List gridList = new ArrayList<>(); List finalAgencyGridList = agencyGridList; if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel())){ - gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getPids().concat(StrConstant.COLON).concat(dto.getAgencyId())); + gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getAgencyId()); List allGridList = new ArrayList<>(); gridList.forEach(gr->{ ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index d6bd5022b9..b66738866f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -227,7 +227,7 @@ screen_customer_grid WHERE del_flag = '0' - AND all_parent_ids LIKE concat(#{fullAgencyPath},'%') + AND all_parent_ids LIKE concat('%',#{fullAgencyPath},'%') order by parentAgencyId,gridName From 8f93f6e1a99f0c87efc58adc7c01465c5ec1cf81 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Mar 2022 21:21:09 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=20=E5=AD=94=E6=9D=91=E7=9A=84?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E4=B8=8D=E5=AF=B9=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/evaluationindex/ScreenAgencyOrGridListDTO.java | 3 ++- .../epmet/dataaggre/excel/CustomerDataManageExcel.java | 4 ++-- .../service/datastats/impl/DataStatsServiceImpl.java | 9 +++------ .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 9 ++++----- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 2 ++ 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java index 87e494d0b9..76adaddc40 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.dto.evaluationindex; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -19,7 +20,7 @@ public class ScreenAgencyOrGridListDTO implements Serializable { /** * 所有下级网格列表 */ - private List allGridList; + private List allGridList = new ArrayList<>(); @Data public static class AgencyGrid { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java index 024562fdf4..80cbe66693 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java @@ -11,7 +11,7 @@ import lombok.Data; @Data public class CustomerDataManageExcel { - @Excel(name = "组织",width = 20) + @Excel(name = "组织",width = 25) private String orgName; @Excel(name = "用户数",width = 10) @@ -35,7 +35,7 @@ public class CustomerDataManageExcel { @Excel(name = "项目数",width = 10) private Integer projectCount; - @Excel(name = "结案项目数",width = 10) + @Excel(name = "结案项目数",width = 12) private Integer closedProjectCount; @Excel(name = "巡查人数",width = 10) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index afa93f3853..baa5fa3ba5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1887,20 +1887,16 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve String fileName = excelName(formDTO); ExportParams exportParams = new ExportParams(fileName,fileName); - //exportParams.setAutoSize(true); List exportList = new ArrayList<>(); List excelList = ConvertUtils.sourceToTarget(result, CustomerDataManageExcel.class); exportList.add(new ExportMultiView(exportParams,excelList,CustomerDataManageExcel.class)); - if (formDTO.isExport()){ + if (CollectionUtils.isNotEmpty(operateExport.getAllGridList())){ List gridResult = operateExport.getAllGridList(); setTotal(gridResult); ExportParams exportParams2 = new ExportParams(fileName,"网格数据"); - //exportParams2.setAutoSize(true); List excelList2 = ConvertUtils.sourceToTarget(gridResult, CustomerDataManageExcel.class); exportList.add(new ExportMultiView(exportParams2,excelList2,CustomerDataManageExcel.class)); } - //ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class); - ExcelUtils.exportMultiSheetExcel(fileName, exportList, response); } @@ -2008,7 +2004,8 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve //获取组织级别数据 CustomerDataManageResultDTO resultDTO = getDataManageResultDTO(formDTO, startTimeForm, agencyGrid.getAgencyGridList(),agencyGrid.getLevel()); resultDTO.setTotal(idList.size()); - if (formDTO.isExport()){ + //网格List不为空则 查询网格数据 (仅限查询组织id为街道级别时) + if (CollectionUtils.isNotEmpty(resultDTO.getAllGridList())){ formDTO.setDataType(OrgTypeEnum.GRID.getCode()); idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList()); formDTO.setIdList(idList); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index 02d9687ec1..3ff3400113 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.evaluationindex.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.OrgLevelEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.dataaggre.constant.DataSourceConstant; @@ -187,8 +186,8 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { //2.根据组织级别判断查询直属组织或网格列表 List agencyList = new ArrayList<>(); List gridList = new ArrayList<>(); - List finalAgencyGridList = agencyGridList; - if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel())){ + //孔村和组织级别为街道的查询下级所有网格 + if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel()) || "1234085031077498881".equals(agencyId)){ gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getAgencyId()); List allGridList = new ArrayList<>(); gridList.forEach(gr->{ @@ -213,7 +212,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); org.setOrgId(gr.getAgencyId()); org.setOrgName(gr.getAgencyName()); - finalAgencyGridList.add(org); + agencyGridList.add(org); }); } else { //2-2.直属下级网格列表 @@ -222,7 +221,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); org.setOrgId(gr.getGridId()); org.setOrgName(gr.getGridName()); - finalAgencyGridList.add(org); + agencyGridList.add(org); }); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 0c27cbc878..cf4e4359c4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -561,6 +561,8 @@ public class AgencyServiceImpl implements AgencyService { return nodes.get(0); } + + private void convertOrgTreeNode(List nodeList, ScreenCustomerAgencyDTO currentAgency) { OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class); orgTreeNode.setOrgId(currentAgency.getAgencyId()); From 0319f4a3d81aa0a11ac7fb33070e14d206d5c2a6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Mar 2022 21:32:25 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=20=E5=AD=94=E6=9D=91=E7=9A=84?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E4=B8=8D=E5=AF=B9=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index 3ff3400113..1d5998dcdd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -187,7 +187,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { List agencyList = new ArrayList<>(); List gridList = new ArrayList<>(); //孔村和组织级别为街道的查询下级所有网格 - if (isGetSubAllGrid && OrgLevelEnum.STREET.getCode().equals(dto.getLevel()) || "1234085031077498881".equals(agencyId)){ + if (isGetSubAllGrid && (OrgLevelEnum.STREET.getCode().equals(dto.getLevel()) || "1234085031077498881".equals(agencyId))){ gridList = evaluationIndexDao.getSubAllGridByAgencyPath(dto.getAgencyId()); List allGridList = new ArrayList<>(); gridList.forEach(gr->{ From 792f9b84e923606d7f19ee46671d5e76c63c8f9c Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Mar 2022 21:55:02 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=20=E5=AD=94=E6=9D=91=E7=9A=84?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E4=B8=8D=E5=AF=B9=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug=20heihei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/datastats/impl/DataStatsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index baa5fa3ba5..e55db49a65 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -2005,7 +2005,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve CustomerDataManageResultDTO resultDTO = getDataManageResultDTO(formDTO, startTimeForm, agencyGrid.getAgencyGridList(),agencyGrid.getLevel()); resultDTO.setTotal(idList.size()); //网格List不为空则 查询网格数据 (仅限查询组织id为街道级别时) - if (CollectionUtils.isNotEmpty(resultDTO.getAllGridList())){ + if (CollectionUtils.isNotEmpty(agencyGrid.getAllGridList())){ formDTO.setDataType(OrgTypeEnum.GRID.getCode()); idList = agencyGrid.getAllGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList()); formDTO.setIdList(idList); From d847bbe737cb0471258f310135d07f0a16868148 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 29 Mar 2022 22:27:44 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=20=E5=AD=94=E6=9D=91=E7=9A=84?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E4=B8=8D=E5=AF=B9=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug=E6=8E=92=E9=99=A4=E5=85=9A=E6=80=BB=E6=94=AF?= =?UTF-8?q?=E8=BF=99..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 2 +- .../resources/mapper/evaluationindex/EvaluationIndexDao.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index 1d5998dcdd..7fa4518b2d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -202,7 +202,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { //2-1.直属下级组织列表 //2.判断客户是否存在子客户 List list = customerRelation.haveSubCustomer(dto.getCustomerId()); - if (!CollectionUtils.isNotEmpty(list)) { + if (CollectionUtils.isEmpty(list)) { agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); } else { list.add(dto.getCustomerId()); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index b66738866f..70c5f2d7d6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -165,6 +165,11 @@ AND parent_area_code = #{areaCode} + + + AND PIDS like concat(#{agencyId},'%') + AND LEVEL = 'community' + AND pid = #{agencyId} From c187e55c8a0997ca9892fd4286830b0ac34cf75e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 31 Mar 2022 11:03:27 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatsResiWarnServiceImpl.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 8a1648fdb4..aca5ac654b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -172,7 +172,23 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { //根据buildingID,tableName he columnName获取名字 //限制条数 一栋楼内最多显示1000 即可 - PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{ + for (String s : buildingIdList) { + PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_HUNDRED,false).doSelectPage(()->{ + List dtos = icStatsResiWarnDao.userWarnListDTO(customerId, Arrays.asList(s), icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); + if (!CollectionUtils.isEmpty(dtos)){ + Map> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); + result.forEach(item->{ + item.setConfigId(configId); + groupByBuild.forEach((k,v) -> { + if (item.getBuildingId().equals(k)){ + item.setUserList(v); + } + }); + }); + } + }); + } + /*PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{ List dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); if (!CollectionUtils.isEmpty(dtos)){ Map> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); @@ -185,7 +201,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { }); }); } - }); + });*/ return mapResult; } From 3e304056f0e8c87f73b5c2a3237c32b32501dabe Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 31 Mar 2022 11:16:57 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E8=80=97=E6=97=B6log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DataReportingServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index 0752b72424..e7a0d926c0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -137,11 +137,14 @@ public class DataReportingServiceImpl implements DataReportingService { public List getEventInfo(EventInfoFormDTO formDTO) { List list; //根据入参,获取项目 + long start = System.currentTimeMillis(); List projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); + log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start + "\n项目数:" + formDTO.getProjectId().size()); //项目列表为空,返回空数组 if(CollectionUtils.isEmpty(projectList)) { return Collections.emptyList(); } + start = System.currentTimeMillis(); Map epmetCodeMap = new HashMap<>(); Result parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId()); if (StringUtils.isNotBlank(parentCustomer.getData())) { @@ -194,6 +197,7 @@ public class DataReportingServiceImpl implements DataReportingService { return dto; }).collect(Collectors.toList()); } + log.error("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start); return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new)); } From 7dddebd243c1b56aff073e2ab0c33bd1fed239cb Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 31 Mar 2022 11:49:09 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E8=80=97=E6=97=B6log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DataReportingServiceImpl.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/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index e7a0d926c0..3bc6b5969d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -139,7 +139,7 @@ public class DataReportingServiceImpl implements DataReportingService { //根据入参,获取项目 long start = System.currentTimeMillis(); List projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); - log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start + "\n项目数:" + formDTO.getProjectId().size()); + log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start); //项目列表为空,返回空数组 if(CollectionUtils.isEmpty(projectList)) { return Collections.emptyList(); From aaa632d56c309ce65d1e737e78a87d21110be5e1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 31 Mar 2022 16:15:51 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=88=86=E6=9E=90=E6=B7=BB=E5=8A=A0=20=E8=AF=9D=E9=A2=98Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/CategoryProjectResultDTO.java | 2 ++ .../dataaggre/dao/govissue/IssueDao.java | 18 +++++++++---- .../service/govissue/GovIssueService.java | 7 +++++ .../govissue/impl/GovIssueServiceImpl.java | 9 +++++++ .../impl/GovProjectServiceImpl.java | 27 ++++++++++++++----- .../resources/mapper/govissue/IssueDao.xml | 17 +++++++++++- 6 files changed, 67 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java index 5386febe19..8dc9102b84 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java @@ -54,6 +54,8 @@ public class CategoryProjectResultDTO implements Serializable { //二级分类code @JsonIgnore private String categoryCode; + + private String topicId; } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java index 17d16fd72d..39b9184284 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java @@ -39,15 +39,15 @@ import java.util.List; public interface IssueDao extends BaseDao { /** - * @Description 查询议题【表决中、已关闭】 + * @Description 查询议题【表决中、已关闭】 * @Param gridIds * @author zxc * @date 2020/12/25 下午2:19 */ - List issueStatusClosedOrVoting(@Param("gridIds") List gridIds, @Param("issueStatus")String issueStatus); + List issueStatusClosedOrVoting(@Param("gridIds") List gridIds, @Param("issueStatus") String issueStatus); /** - * @Description 查询已转项目议题 + * @Description 查询已转项目议题 * @Param gridIds * @author zxc * @date 2020/12/25 下午5:27 @@ -72,7 +72,7 @@ public interface IssueDao extends BaseDao { **/ List selectClosedListGov(ClosedIssueListFormDTO fromDTO); - Integer selectIssueCount(@Param("gridIds") List gridIds,@Param("issueType")String issueType); + Integer selectIssueCount(@Param("gridIds") List gridIds, @Param("issueType") String issueType); List selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId); @@ -81,4 +81,12 @@ public interface IssueDao extends BaseDao { * @author sun **/ List getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable); -} \ No newline at end of file + + /** + * desc:根据议题id获取对应的话题id + * + * @param ids + * @return + */ + List selectIssueTopicIdType(@Param("ids") List ids); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java index 3e87ea18d3..93001af72b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java @@ -52,4 +52,11 @@ public interface GovIssueService { * @author sun **/ List categoryList(String customerId, String level, String isDisable); + + /** + * desc:根据id 获取议题的话题的话题Id + * @param collect + * @return + */ + List selectIssueTopicIdType(List collect); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java index 5556d2d3f0..761adb17b2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java @@ -333,4 +333,13 @@ public class GovIssueServiceImpl implements GovIssueService { return issueDao.getCategoryList(customerId, level, isDisable); } + @Override + public List selectIssueTopicIdType(List ids) { + List dtoList = issueDao.selectIssueTopicIdType(ids); + if (CollectionUtils.isEmpty(dtoList)){ + return new ArrayList<>(); + } + return dtoList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index 6cd219c759..3c4ea9f65c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -23,7 +24,6 @@ import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO; import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; -import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO; import com.epmet.dataaggre.dto.govproject.ResiEventDTO; @@ -80,6 +80,8 @@ public class GovProjectServiceImpl implements GovProjectService { private EvaluationIndexService evaluationIndexService; @Autowired private EpmetUserService epmetUserService; + @Autowired + private LoginUserUtil loginUserUtil; /** * @Description 查询项目信息 @@ -415,13 +417,13 @@ public class GovProjectServiceImpl implements GovProjectService { formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); //1.查询客户下分类信息 List categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); - List categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList()); + List categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(IssueProjectCategoryDictDTO::getCategoryCode).collect(Collectors.toList()); formDTO.setCategoreCodeList(categoreCodeList); //2.查询组织及下级截止某一天的某个一级分类下的项目列表 PageInfo result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO)); - if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) { + if (CollectionUtils.isEmpty(result.getList())) { return resultDTO; } resultDTO.setTotal((int) result.getTotal()); @@ -431,7 +433,7 @@ public class GovProjectServiceImpl implements GovProjectService { List list = projectDao.getCategoryList(projectIds); //4.查询来源事件的项目上报的组织信息 - List eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(m -> m.getOriginId()).collect(Collectors.toList()); + List eventIds = result.getList().stream().filter(re -> "resi_event".equals(re.getOrigin())).map(CategoryProjectResultDTO.Project::getOriginId).collect(Collectors.toList()); List eventOrgList = projectDao.getEventOrgList(eventIds); Map eventMap = eventOrgList.stream().collect(Collectors.toMap(ResiEventReportOrgDTO::getResiEventId, Function.identity())); @@ -439,11 +441,19 @@ public class GovProjectServiceImpl implements GovProjectService { List eventUser = projectDao.getEventList(projectIds); List topicUser = projectDao.getTopicUser(projectIds); + //市北客户查询 下议题区分下来源 设置topicId + Map issueTopicSourceMap = new HashMap<>(); + if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(loginUserUtil.getLoginUserCustomerId())){ + issueTopicSourceMap = govIssueService.selectIssueTopicIdType(result.getList().stream() + .filter(re -> "issue".equals(re.getOrigin())) + .map(CategoryProjectResultDTO.Project::getOriginId) + .collect(Collectors.toList())).stream().collect(Collectors.toMap(IssueInfoDTO::getIssueId,IssueInfoDTO::getTopicId)); + } + //5.封装数据 //组织或网格id->组织或网格名称 Map map = new HashMap<>(); - result.getList().forEach(re -> { - //所属组织 + for (CategoryProjectResultDTO.Project re : result.getList()) {//所属组织 if ("issue".equals(re.getOrigin())) { if (map.containsKey(re.getGridId())) { re.setOrgName(map.get(re.getGridId())); @@ -454,6 +464,9 @@ public class GovProjectServiceImpl implements GovProjectService { map.put(re.getGridId(), gridInfo.getGridName()); } } + //市北议题来源的设置话题Id + re.setTopicId(issueTopicSourceMap.get(re.getOriginId())); + } else if ("agency".equals(re.getOrigin())) { if (map.containsKey(re.getAgencyId())) { re.setOrgName(map.get(re.getAgencyId())); @@ -518,7 +531,7 @@ public class GovProjectServiceImpl implements GovProjectService { re.setUserId(to.getUserId()); } }); - }); + } resultDTO.setList(result.getList()); return resultDTO; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml index 90ecda4b20..495473205c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -139,5 +139,20 @@ ORDER BY category_code + - \ No newline at end of file +