Browse Source

Merge branch 'dev_screen_data_2.0' into dev_temp

master
sunyuchao 5 years ago
parent
commit
9443c4eb35
  1. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java
  2. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  3. 49
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java
  4. 96
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  6. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  7. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  8. 31
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml
  9. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java
  11. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  12. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java
  14. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml
  15. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

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

@ -0,0 +1,30 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 评价指标字典表数据--接口返参
* @Author sun
*/
@Data
public class IndexDictResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 指标名
*/
private String indexName;
/**
* 指标code
*/
private String indexCode;
/**
* 指标值类型 百分比percent
*/
private String valueType;
}

16
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -45,4 +45,20 @@ public interface FactConstant {
* 网格相关
*/
String WANG_GE_XIANG_GUAN = "wanggexiangguan";
/**
* 评价指标类型-
*/
String NONE = "none";
/**
* 评价指标类型-整数
*/
String INTEGER = "integer";
/**
* 评价指标类型-小数
*/
String DECIMAL = "decimal";
/**
* 评价指标类型-百分比
*/
String PERCENT = "percent";
}

49
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 评价指标字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface IndexDictDao {
/**
* @param
* @Description 查询指标字典表是百分比类型的数据
* @author sun
*/
List<IndexDictResultDTO> selectList();
/**
* @param
* @Description 根据indexCode查询指标字典表具体数据
* @author sun
*/
IndexDictResultDTO selectIndexDict(@Param("indexCode") String indexCode);
}

96
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -15,12 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
/**
* 数据改版api
@ -47,6 +45,8 @@ public class FactIndexServiceImpl implements FactIndexService {
private FactIndexGridScoreDao factIndexGridScoreDao;
@Autowired
private FactIndexGridSubScoreDao factIndexGridSubScoreDao;
@Autowired
private IndexDictDao indexDictDao;
/**
* @param formDTO
@ -125,19 +125,27 @@ public class FactIndexServiceImpl implements FactIndexService {
AblityIndexResultDTO nl = new AblityIndexResultDTO();
nl.setIndexCode(FactConstant.NLZB);
nl.setScoreList(nlList);
if(null != nlList){resultList.add(nl);}
if (null != nlList) {
resultList.add(nl);
}
AblityIndexResultDTO dj = new AblityIndexResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
if (null != djList) {
resultList.add(dj);
}
AblityIndexResultDTO zl = new AblityIndexResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
if (null != zlList) {
resultList.add(zl);
}
AblityIndexResultDTO fw = new AblityIndexResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
if (null != fwList) {
resultList.add(fw);
}
return resultList;
}
@ -203,9 +211,15 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
if(null != dj){resultList.add(dj);}
if(null != zl){resultList.add(zl);}
if(null != fw){resultList.add(fw);}
if (null != dj) {
resultList.add(dj);
}
if (null != zl) {
resultList.add(zl);
}
if (null != fw) {
resultList.add(fw);
}
return resultList;
}
@ -278,15 +292,21 @@ public class FactIndexServiceImpl implements FactIndexService {
MonthScoreListResultDTO dj = new MonthScoreListResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
if (null != djList) {
resultList.add(dj);
}
MonthScoreListResultDTO zl = new MonthScoreListResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
if (null != zlList) {
resultList.add(zl);
}
MonthScoreListResultDTO fw = new MonthScoreListResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
if (null != fwList) {
resultList.add(fw);
}
return resultList;
}
@ -333,7 +353,28 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
//4.查询指标字典表数据
List<IndexDictResultDTO> list = indexDictDao.selectList();
//5.遍历数据,判断数据类型并处理
/*NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMaximumFractionDigits(1);*/
resultList.forEach(result -> {
list.forEach(l -> {
if (result.getKey().equals(l.getIndexCode())) {
//小数类型,四舍五入保留小数点后一位
if (FactConstant.DECIMAL.equals(l.getValueType())) {
BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setValue(num.toString());
}
//百分数类型,四舍五入保留小数点后一位并转成百分比
if (FactConstant.PERCENT.equals(l.getValueType())) {
BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setValue(num+"%");
}
}
});
});
return resultList;
}
@ -373,7 +414,30 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
//6.查询指标字典表具体数据
IndexDictResultDTO dictDTO = indexDictDao.selectIndexDict(formDTO.getKey());
if (null == dictDTO) {
throw new RenException(String.format("根据评价指标indexCode未查询到字典表数据,indexCode值:%s", formDTO.getKey()));
}
//7.遍历数据,判断数据类型并处理
/*NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMaximumFractionDigits(1);*/
//小数类型,四舍五入保留小数点后一位
if (FactConstant.DECIMAL.equals(dictDTO.getValueType())) {
resultList.forEach(result -> {
BigDecimal num = new BigDecimal(result.getAblity()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setAblity(num.toString());
});
}
//百分数类型,四舍五入保留小数点后一位并转成百分比
if (FactConstant.PERCENT.equals(dictDTO.getValueType())) {
resultList.forEach(result -> {
BigDecimal num = new BigDecimal(result.getAblity()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setAblity(num+"%");
});
}
return resultList;
}

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_agency_sub_score fact
@ -23,7 +23,7 @@
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_community_sub_score fact
@ -23,7 +23,7 @@
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectGridAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_grid_sub_score fact
@ -23,7 +23,7 @@
<select id="selectGridMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

31
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.IndexDictDao">
<select id="selectList" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO">
SELECT
index_name AS "indexName",
index_code AS "indexCode",
value_type AS "valueType"
FROM
index_dict
WHERE
del_flag = '0'
AND value_type != 'none'
</select>
<select id="selectIndexDict" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO">
SELECT
index_name AS "indexName",
index_code AS "indexCode",
value_type AS "valueType"
FROM
index_dict
WHERE
del_flag = '0'
AND index_code = #{indexCode}
LIMIT 1
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java

@ -88,6 +88,9 @@ public class ScreenPartyBranchDataFormDTO implements Serializable {
private String updatedBy;
public ScreenPartyBranchDataFormDTO() {
this.organizeCount = NumConstant.ZERO;
this.joinUserCount = NumConstant.ZERO;
this.averageJoinUserCount = NumConstant.ZERO;
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java

@ -20,6 +20,6 @@ public interface ActUserRelationDao {
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgType") String orgType);
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java

@ -76,7 +76,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
String monthId = screenExtractFormDTO.getMonthId();
if (StringUtils.isEmpty(monthId)){
monthId = LocalDate.now().toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
}
if (!CollectionUtils.isEmpty(customerIds)){
String finalMonthId = monthId;
@ -273,8 +273,10 @@ public class PartyGuideServiceImpl implements PartyGuideService {
if (!CollectionUtils.isEmpty(agencyIdList)){
List<ScreenPartyBranchDataFormDTO> result = new ArrayList<>();
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<JoinUserCountResultDTO> joinUserCountByAgencyList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.AGENCY);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds);
if (isGrid == true){
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
@ -286,7 +288,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
joinUserCountList.forEach(join -> {
if (party.getOrgId().equals(join.getOrgId())){
party.setAverageJoinUserCount(join.getJoinUserCount());
party.setAverageJoinUserCount(party.getJoinUserCount() / party.getOrganizeCount());
party.setAverageJoinUserCount(party.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
@ -314,7 +316,17 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setYearId(DateUtils.getYearId(monthId));
form.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
form.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
result.add(form);
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
@ -330,15 +342,17 @@ public class PartyGuideServiceImpl implements PartyGuideService {
});
// 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
orgIds.addAll(disGridIds);
List<ScreenPartyBranchDataFormDTO> gridResult = new ArrayList<>();
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(disGridIds);
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
orgNameList.forEach(org -> {
if (party.getOrgId().equals(org.getGridId())){
party.setOrgName(org.getGridName());
joinUserCountList.forEach(join -> {
if (party.getOrgId().equals(join.getOrgId())){
party.setAverageJoinUserCount(join.getJoinUserCount());
party.setAverageJoinUserCount(party.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class);
@ -360,7 +374,17 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setParentId(screenPartyBranchDataList.get(NumConstant.ZERO).getParentId());
form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
result.add(form);
}
});
@ -369,6 +393,13 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
}
public Integer calAdd(Integer a, Integer b){
if (null != a && null != b){
return a + b;
}
return NumConstant.ZERO;
}
/**
* @Description 社区级别的处理
* @Param customerId

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java

@ -17,6 +17,6 @@ public interface ActUserRelationService {
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(String customerId,String monthId);
List<JoinUserCountResultDTO> selectJoinUserCount(String customerId,String monthId, String orgType);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java

@ -29,7 +29,7 @@ public class ActUserRelationServiceImpl implements ActUserRelationService {
* @date 2020/9/25 5:19 下午
*/
@Override
public List<JoinUserCountResultDTO> selectJoinUserCount(String customerId, String monthId) {
return actUserRelationDao.selectJoinUserCount(customerId, monthId);
public List<JoinUserCountResultDTO> selectJoinUserCount(String customerId, String monthId, String orgType) {
return actUserRelationDao.selectJoinUserCount(customerId, monthId, orgType);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml

@ -128,8 +128,8 @@
<select id="selectScreenPartyBranchDataByOrgId" resultType="com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO">
SELECT
ORG_ID,
ORGANIZE_COUNT,
JOIN_USER_COUNT
ORGANIZE_COUNT AS organizeCount,
JOIN_USER_COUNT AS joinUserCount
FROM
screen_party_branch_data
WHERE
@ -154,8 +154,8 @@
spbd.PARENT_ID AS orgId,
spbd.ORG_TYPE,
sca.AGENCY_NAME AS orgName,
spbd.ORGANIZE_COUNT,
spbd.JOIN_USER_COUNT
IFNULL(spbd.ORGANIZE_COUNT,0) AS organizeCount,
IFNULL(spbd.JOIN_USER_COUNT,0) AS joinUserCount
FROM
screen_party_branch_data spbd
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = spbd.PARENT_ID

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

@ -18,7 +18,7 @@
AND asr.REWARD_FLAG = 'agree'
AND ai.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ai.ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND ai.SPONSOR_TYPE = 'agency'
AND ai.SPONSOR_TYPE = #{orgType}
GROUP BY ai.SPONSOR_ID
</select>
</mapper>

Loading…
Cancel
Save