Browse Source

网格服务能力活动次数bug修改

master
yinzuomei 5 years ago
parent
commit
69245df1b2
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/CpcIndexCommonDTO.java
  2. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/GridIndexCommonDTO.java
  3. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  4. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  5. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

2
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

18
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;
}

4
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<Map<String, Integer>> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId);
List<GridIndexCommonDTO> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.util.List<java.lang.String>

11
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<String, Integer> calActivityCountMap(String customerId, String monthId) {
List<Map<String, Integer>> mapList = baseDao.selectActGroupByGridId(customerId, monthId);
List<GridIndexCommonDTO> list = baseDao.selectActGroupByGridId(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
for (GridIndexCommonDTO gridIndexCommonDTO : list) {
resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue());
}
return resultMap;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -3,10 +3,10 @@
<mapper namespace="com.epmet.dao.heart.ActInfoDao">
<!-- 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 -->
<select id="selectActGroupByGridId" parameterType="map" resultType="java.util.Map">
<select id="selectActGroupByGridId" parameterType="map" resultType="com.epmet.dto.indexcollect.result.GridIndexCommonDTO">
SELECT
ai.SPONSOR_ID,
count( 1 ) AS totalAct
ai.SPONSOR_ID as gridId,
count( 1 ) AS indexValue
FROM
act_info ai
WHERE

Loading…
Cancel
Save