From 69245df1b296019ba384be1ff6284d96055fcedc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Oct 2020 10:05:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=9C=8D=E5=8A=A1=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E6=B4=BB=E5=8A=A8=E6=AC=A1=E6=95=B0bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcollect/result/CpcIndexCommonDTO.java | 2 +- .../result/GridIndexCommonDTO.java | 18 ++++++++++++++++++ .../java/com/epmet/dao/heart/ActInfoDao.java | 4 ++-- .../service/heart/impl/ActInfoServiceImpl.java | 11 ++++------- .../main/resources/mapper/heart/ActInfoDao.xml | 6 +++--- 5 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java index 10b5603577..f697eae86f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java @@ -5,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * 描述一下 + * 党员相关用 * * @author yinzuomei@elink-cn.com * @date 2020/10/12 21:57 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java new file mode 100644 index 0000000000..3cec199149 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格服务能力用 + * + * @author yinzuomei@elink-cn.com + * @date 2020/10/14 10:02 + */ +@Data +public class GridIndexCommonDTO implements Serializable { + private static final long serialVersionUID = -4316054054019675419L; + private String gridId; + private Integer indexValue; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java index d878fb84a3..f9771495df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java @@ -19,11 +19,11 @@ package com.epmet.dao.heart; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; /** @@ -42,7 +42,7 @@ public interface ActInfoDao{ * @description 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 * @Date 2020/9/21 10:41 **/ - List> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); + List selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * @return java.util.List diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java index dfe7a5f263..b0fffe3f6d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java @@ -5,13 +5,12 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.heart.ActInfoDao; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.service.heart.ActInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -53,12 +52,10 @@ public class ActInfoServiceImpl implements ActInfoService { @Override @DataSource(DataSourceConstant.EPMET_HEART) public Map calActivityCountMap(String customerId, String monthId) { - List> mapList = baseDao.selectActGroupByGridId(customerId, monthId); + List list = baseDao.selectActGroupByGridId(customerId, monthId); Map resultMap = new HashMap<>(); - for (Map map : mapList) { - for (Map.Entry m : map.entrySet()) { - resultMap.put(m.getKey(), m.getValue()); - } + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); } return resultMap; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index 8f04291c27..d29bbb6cce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -3,10 +3,10 @@ - SELECT - ai.SPONSOR_ID, - count( 1 ) AS totalAct + ai.SPONSOR_ID as gridId, + count( 1 ) AS indexValue FROM act_info ai WHERE