From 1593bf6362a47331fbc44c1345075777b267869a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 3 Mar 2022 14:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=8C=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=97=B6=E5=8F=AA=E7=BB=9F=E8=AE=A1=E4=BA=86?= =?UTF-8?q?=E4=BA=94=E4=B8=AA=E8=A1=97=E9=81=93=E7=9A=84=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=E6=98=AF=E4=B8=8A=E6=8A=A5=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E8=BF=99=E4=B8=89=E4=B8=AA=E8=A1=97=E9=81=93?= =?UTF-8?q?=E5=9C=A8=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B9=9F=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E4=BA=86=E6=95=B0=E6=8D=AE=E9=9C=80=E8=A6=81=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=B8=8A=EF=BC=8C=E5=9B=A0=E6=AD=A4=E4=BF=AE=E6=94=B9=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/org/CustomerGridDao.java | 7 ++++ .../service/impl/StatsProjectServiceImpl.java | 35 ++++++++++++++++--- .../service/org/CustomerGridService.java | 8 +++++ .../org/impl/CustomerGridServiceImpl.java | 10 ++++++ .../resources/mapper/org/CustomerGridDao.xml | 13 +++++++ 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index fc651f6c37..c4f683ca2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -25,6 +25,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; @@ -118,4 +119,10 @@ public interface CustomerGridDao extends BaseDao { * @Description 查询工作人员所属网格信息 **/ List getStaffGrid(StaffBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询客户下有效网格列表 + **/ + List gridListByCustomerId(@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/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index eb849391a9..852fb8c47d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -1,17 +1,23 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.PingYinConstant; import com.epmet.constant.ProjectConstant; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.project.form.MonthProjectListFormDTO; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.issue.IssueEntity; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.entity.stats.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.StatsProjectService; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; @@ -63,6 +69,8 @@ public class StatsProjectServiceImpl implements StatsProjectService { private FactGridProjectMonthlyService factGridProjectMonthlyService; @Autowired private CustomerGridService customerGridService; + @Autowired + private CustomerAgencyService customerAgencyService; /** * @Author sun @@ -108,10 +116,18 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询机关维度表数据 - DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); - dimAgencyDTO.setCustomerId(customerId); - List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); - + //2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据, + //但是dim维度表不能有这三个街道的组织,因此改查业务库组织列表数据 start sun + List dimAgencyList = new ArrayList<>(); + if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) { + List agencyList = customerAgencyService.queryAgencyListByCustomerId(customerId); + dimAgencyList = ConvertUtils.sourceToTarget(agencyList, DimAgencyDTO.class); + } else { + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + } + //2022.3.3 end sun /* //2022.1.12 客户数据量大 调整计算逻辑,一千条已查询,封装数据,将这部分业务数据查询拿到子方法分页查询处理 sun //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) @@ -650,7 +666,16 @@ public class StatsProjectServiceImpl implements StatsProjectService { DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询网格维度表数据 - List dimGridList = dimGridService.getGridListByCustomerId(customerId); + //2022.3.3 平阴数据统计时只统计了五个街道的 其他三个街道是上报的,现在这三个街道在小程序也产生了项目(例行工作)数据, + //但是dim维度表不能有这三个街道的组织,因此改查业务库网格列表数据 start sun + List dimGridList = new ArrayList<>(); + if (customerId.equals(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID)) { + List gridList = customerGridService.gridListByCustomerId(customerId); + dimGridList = ConvertUtils.sourceToTarget(gridList, DimGridEntity.class); + } else { + dimGridList = dimGridService.getGridListByCustomerId(customerId); + } + //2022.3.3 end sun //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) ProjectEntity projectEntity = new ProjectEntity(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 5894fafa1b..0dd3fd62a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -8,9 +8,11 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.entity.stats.DimGridEntity; import java.util.Date; import java.util.List; @@ -99,4 +101,10 @@ public interface CustomerGridService extends BaseService { * @Description 查询工作人员所属网格信息 **/ List getStaffGrid(StaffBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询客户下有效网格列表 + **/ + List gridListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index c9ad658627..10bfbc4fd5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.stats.DimGridDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; @@ -147,4 +148,13 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridListByCustomerId(String customerId) { + return customerGridDao.gridListByCustomerId(customerId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 053c6004b0..adcaf8e50d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -185,4 +185,17 @@ + + \ No newline at end of file