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 @@ + + + + + + + + + + + + + + + + + + + + + + + +