Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data' into dev_temp

dev_shibei_match
jianjun 5 years ago
parent
commit
4f49c4d5b1
  1. 32
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java
  2. 32
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java
  3. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java
  4. 33
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java
  5. 33
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java
  6. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  7. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java
  8. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  9. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  10. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml
  11. 57
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml
  12. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java
  13. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

32
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupTopicShiftIssueRatioRankFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
/**
* 邻里党群-社群人数排名-接口入参
* @Author sun
*/
@Data
public class GroupTopicShiftIssueRatioRankFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class })
private Integer pageNo;
/**
* 页容量默认10页
*/
@Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class })
private Integer pageSize;
/**
* 客户Id
*/
private String customerId;
public interface AddUserInternalGroup {}
}

32
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/GroupUserCountRankFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
/**
* 邻里党群-社群人数排名-接口入参
* @Author sun
*/
@Data
public class GroupUserCountRankFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class })
private Integer pageNo;
/**
* 页容量默认10页
*/
@Min(value = 1, message = "每页条数必须大于0", groups = { AddUserInternalGroup.class })
private Integer pageSize;
/**
* 客户Id
*/
private String customerId;
public interface AddUserInternalGroup {}
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/HeartVolunteerrankFormDTO.java

@ -1,11 +1,9 @@
package com.epmet.evaluationindex.screen.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -15,6 +13,7 @@ import java.io.Serializable;
@Data
public class HeartVolunteerrankFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
public interface AddUserInternalGroup {}
/**
* 页码从1开始
*/
@ -29,5 +28,5 @@ public class HeartVolunteerrankFormDTO implements Serializable {
* 客户Id
*/
private String customerId;
public interface AddUserInternalGroup {}
}

33
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupTopicShiftIssueRatioRankResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 公益互助-个人志愿者公益时长排名
* @Author sun
*/
@Data
public class GroupTopicShiftIssueRatioRankResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 小组id
*/
private String groupId = "";
/**
* 小组名称
*/
private String groupName = "";
/**
* 话题数量
*/
private Integer topicCount = 0;
/**
* 群主名称
*/
private String groupLeader = "";
}

33
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupUserCountRankResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 公益互助-个人志愿者公益时长排名
* @Author sun
*/
@Data
public class GroupUserCountRankResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 小组id
*/
private String groupId = "";
/**
* 小组名称
*/
private String groupName = "";
/**
* 群成员数
*/
private Integer memberCount = 0;
/**
* 群主名称
*/
private String groupLeader = "";
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java

@ -6,6 +6,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.dto.result.issue.IssueGridTotalRankDTO;
import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.dto.result.issue.KcIssueSummary;
@ -191,5 +193,31 @@ public class KcScreenController {
return new Result<GroupGridgroupcountrankResultDTO>().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("group/usercountrank")
public Result<List<GroupUserCountRankResultDTO>> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
return new Result<List<GroupUserCountRankResultDTO>>().ok(kcScreenService.groupUserCountRank(formDTO));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题数量排名
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("group/topicshiftissueratiorank")
public Result<List<GroupTopicShiftIssueRatioRankResultDTO>> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
return new Result<List<GroupTopicShiftIssueRatioRankResultDTO>>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO));
}
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupDetailGridDailyDao.java

@ -17,8 +17,14 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.GroupTopicShiftIssueRatioRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.GroupUserCountRankResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* KC-小组详情(先根据customerId+dateId删除)
*
@ -28,4 +34,17 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcGroupDetailGridDailyDao {
/**
* @param formDTO
* @Description 按客户查询最近一天所有网格数据 再按社群总数降序排列
* @author sun
*/
List<GroupUserCountRankResultDTO> selectGroupUserCountRankList(GroupUserCountRankFormDTO formDTO);
/**
* @param formDTO
* @Description 按客户查询最近一天所有网格数据 再按话题总数降序排列
* @author sun
*/
List<GroupTopicShiftIssueRatioRankResultDTO> selectGroupTopicShiftIssueRatioRankList(GroupTopicShiftIssueRatioRankFormDTO formDTO);
}

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java

@ -2,6 +2,8 @@ package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.dto.result.issue.*;
import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
@ -83,4 +85,17 @@ public interface KcScreenService {
*/
GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam);
/**
* @param formDTO
* @Description 邻里党群-社群数量排名
* @author sun
*/
List<GroupUserCountRankResultDTO> groupUserCountRank(GroupUserCountRankFormDTO formDTO);
/**
* @param formDTO
* @Description 邻里党群-话题数量排名
* @author sun
*/
List<GroupTopicShiftIssueRatioRankResultDTO> groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO);
}

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java

@ -8,6 +8,8 @@ import com.epmet.datareport.dao.evaluationindex.screenkc.*;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.dto.result.issue.*;
import com.epmet.evaluationindex.screen.dto.form.GroupTopicShiftIssueRatioRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.GroupUserCountRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
@ -58,6 +60,9 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired
private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao;
@Autowired
private ScreenKcGroupDetailGridDailyDao screenKcGroupDetailGridDailyDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
@ -251,4 +256,32 @@ public class KcScreenServiceImpl implements KcScreenService {
return resultDTO;
}
/**
* @param formDTO
* @Description 邻里党群-社群数量排名
* @author sun
*/
@Override
public List<GroupUserCountRankResultDTO> groupUserCountRank(GroupUserCountRankFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
//按客户查询最近一天所有网格数据 再按社群总数降序排列
List<GroupUserCountRankResultDTO> list = screenKcGroupDetailGridDailyDao.selectGroupUserCountRankList(formDTO);
return list;
}
/**
* @param formDTO
* @Description 邻里党群-话题数量排名
* @author sun
*/
@Override
public List<GroupTopicShiftIssueRatioRankResultDTO> groupTopicShiftIssueRatioRank(GroupTopicShiftIssueRatioRankFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
//按客户查询最近一天所有网格数据 再按话题总数降序排列
List<GroupTopicShiftIssueRatioRankResultDTO> list = screenKcGroupDetailGridDailyDao.selectGroupTopicShiftIssueRatioRankList(formDTO);
return list;
}
}

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml

@ -4,8 +4,7 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcActTrendMonthlyDao">
<select id="selectActTrendMonthly"
resultType="com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO">
<select id="selectActTrendMonthly" resultType="com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO">
SELECT
month_id AS "monthId",
act_count AS "actCount"

57
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupDetailGridDailyDao.xml

@ -3,5 +3,62 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcGroupDetailGridDailyDao">
<select id="selectGroupUserCountRankList" resultType="com.epmet.evaluationindex.screen.dto.result.GroupUserCountRankResultDTO">
SELECT
grid_id AS "groupId",
grid_name AS "groupName",
member_count AS "memberCount",
group_leader AS "groupLeader"
FROM
screen_kc_group_detail_grid_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND date_id = (
select
date_id
from
screen_kc_group_detail_grid_daily
where
del_flag = '0'
and customer_id = #{customerId}
order by
date_id desc,
created_time desc
limit 1
)
ORDER BY
member_count DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectGroupTopicShiftIssueRatioRankList" resultType="com.epmet.evaluationindex.screen.dto.result.GroupTopicShiftIssueRatioRankResultDTO">
SELECT
grid_id AS "groupId",
grid_name AS "groupName",
topic_count AS "topicCount",
group_leader AS "groupLeader"
FROM
screen_kc_group_detail_grid_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND date_id = (
select
date_id
from
screen_kc_group_detail_grid_daily
where
del_flag = '0'
and customer_id = #{customerId}
order by
date_id desc,
created_time desc
limit 1
)
ORDER BY
member_count DESC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java

@ -15,11 +15,11 @@ public interface IndexCalConstant {
/**
* 批量删除 一次删除50
*/
Integer DELETE_SIZE=1000;
Integer DELETE_SIZE = 1000;
/**
* 分批计算一次计算 10条
*/
Integer PAGE_SIZE = 1000;
Integer PAGE_SIZE = 800;
String GRID_ID="GRID_ID";

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -84,7 +84,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
List<CpcScoreEntity> list = null;
Map<String, CpcScoreEntity> preLastCpcScoreTotalMap = new HashMap<>();
CpcScoreEntity currentLastCpcScore = null;
//当前最后一条记录
//CpcScoreEntity currentLastCpcScore = null;
//当前第一条记录
//CpcScoreEntity currentFirstCpcScore = null;
do {
//获取数据
list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize);
@ -93,11 +96,14 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
log.warn("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId());
} else {
//获取最后一条
currentLastCpcScore = list.get(list.size() - 1);
if (preLastCpcScoreTotalMap.containsKey(currentLastCpcScore.getUserId())) {
//currentLastCpcScore = list.get(list.size() - 1);
//获取第一条
//currentFirstCpcScore = list.get(0);
/*if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) {
cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap);
preLastCpcScoreTotalMap.clear();
preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null);
}
}*/
Map<String, List<CpcScoreEntity>> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId));
userGroupMap.forEach((userId, partScoreList) -> {
CpcScoreEntity totalEntity = null;
@ -114,12 +120,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
totalEntity.setScore(new BigDecimal(NumConstant.ZERO));
totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
cpcScoreTotalMap.put(userId, totalEntity);
if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) {
/* if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) {
preLastCpcScoreTotalMap.put(part.getUserId(), part);
} else {
cpcScoreTotalMap.put(userId, totalEntity);
}
}*/
}
//自建群活跃度——议题转项目率 有阈值 >60%按60%算
BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight());

Loading…
Cancel
Save