From 784c5b6e10d6a3cfdd8df42570d9c180e8ea296f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 25 Jun 2021 09:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=B8=8A=E6=8A=A5=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=8E=A5=E5=8F=A3=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/stats/BaseReportDao.java | 55 +++++++++++++++++-- .../service/impl/BaseReportServiceImpl.java | 40 ++++++++++++-- .../resources/mapper/stats/BaseReportDao.xml | 24 ++++++++ 3 files changed, 109 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java index d379ba229a..d60d287216 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java @@ -1,7 +1,6 @@ package com.epmet.dao.stats; -import com.epmet.dto.basereport.form.AgencyRegUserFormDTO; -import com.epmet.dto.basereport.form.GridRegUserFormDTO; +import com.epmet.dto.basereport.form.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,30 +14,74 @@ import java.util.List; public interface BaseReportDao { /** - * @Param formDTO * @Description 根据dateId删除客户网格注册用户数据 * @author sun */ int delGridRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId); /** - * @Param formDTO * @Description 批量新增客户网格注册用户数据 * @author sun */ void insertBatchGridRegUser(@Param("list") List dataList); /** - * @Param formDTO * @Description 根据dateId删除客户组织注册用户数据 * @author sun */ int delAgencyRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId); /** - * @Param formDTO * @Description 批量新增客户组织注册用户数据 * @author sun */ void insertBatchAgencyRegUser(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户网格群组总数数据 + * @author sun + */ + int delGridGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户网格群组总数数据 + * @author sun + */ + void insertBatchGridGroupTotal(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户组织群组总数数据 + * @author sun + */ + int delAgencyGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户组织群组总数数据 + * @author sun + */ + void insertBatchAgencyGroupTotal(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户网格热议话题数据 + * @author sun + */ + int delGridHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户网格热议话题数据 + * @author sun + */ + void insertBatchGridHotTopic(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户组织热议话题数据 + * @author sun + */ + int delAgencyHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户组织热议话题数据 + * @author sun + */ + void insertBatchAgencyHotTopic(@Param("list") List dataList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index 5551d2749b..5c4f341e8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -66,7 +66,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridGroupTotal(GridGroupTotalFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchGridGroupTotal(formDTO.getDataList()); + } } /** @@ -77,7 +85,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchAgencyGroupTotal(formDTO.getDataList()); + } } /** @@ -88,7 +104,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridHotTopic(GridHotTopicFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchGridHotTopic(formDTO.getDataList()); + } } /** @@ -99,7 +123,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyHotTopic(AgencyHotTopicFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchAgencyHotTopic(formDTO.getDataList()); + } } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index 8c3e4a4056..45f112c07b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -132,5 +132,29 @@ + + + + + + + + + + + + + + + + + + + + + + + +