Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_temp

dev_shibei_match
yinzuomei 5 years ago
parent
commit
33fb4d50ee
  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. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  5. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  6. 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>

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java

@ -17,8 +17,11 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant;
@ -36,7 +39,9 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* 大屏数据采集
@ -299,6 +304,11 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
} while (deleteNum != NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
List<CustomerAgencyFormDTO> pidIsZeroList = formDTO.getDataList().stream().filter(d -> d.getPid().equals(NumConstant.ZERO_STR) || "".equals(d.getPid())).collect(Collectors.toList());
if (pidIsZeroList.size()>=NumConstant.ONE){
Object o = JSONObject.toJSON(pidIsZeroList);
throw new RenException("多个pid为【0】的数据:"+o.toString());
}
screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId);
}
}

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