Browse Source

screen_pioneer_data党员参与议事提交 V0.3

master
yinzuomei 5 years ago
parent
commit
81065c3b77
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java
  2. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  3. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  4. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java
  5. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java

@ -7,4 +7,12 @@ package com.epmet.constant;
* @date 2020/9/16 10:14
*/
public interface DimObjectStatusConstant {
/**
* 已解决
*/
String RESOLVED="resolved";
/**
* 无需解决
*/
String UNRESOLVED="unresolved";
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java

@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.todata.*;
@ -57,7 +56,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、构造初始值
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records");
log.info("dim_customer_partymember do not any records customerId="+customerId);
return;
}
String quarterId= DateUtils.getQuarterId(monthId);
@ -75,11 +74,11 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
//6、党员自建群群众人数 (todo 和monthId无关??)
//6、党员自建群群众人数 :和评价周期无关
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//7、党员自建群活跃群众人数
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
//8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId);
//9、自建群活跃度——议题转项目率
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);

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

@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
@ -107,7 +108,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -194,7 +195,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -203,7 +204,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList);
}
@ -267,7 +268,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved"));
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -276,7 +277,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList);
}

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

@ -1,5 +1,6 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
@ -41,21 +42,13 @@ public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalD
public void extractPublicPartiTotalData(String customerId, String dateId) {
List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId);
if (CollectionUtils.isEmpty(userTotalDataEntityList)) {
log.warn("screen_user_total_data dosen't have any record ");
log.warn("screen_user_total_data dosen't have any record customerId="+customerId);
return;
}
List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>();
for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) {
ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity();
entity.setCustomerId(customerId);
entity.setOrgType(totalData.getOrgType());
entity.setOrgId(totalData.getOrgId());
entity.setParentId(totalData.getParentId());
entity.setOrgName(totalData.getOrgName());
ScreenPublicPartiTotalDataEntity entity = ConvertUtils.sourceToTarget(totalData,ScreenPublicPartiTotalDataEntity.class);
entity.setDataEndTime(dateId);
entity.setTopicTotal(totalData.getTopicTotal());
entity.setIssueTotal(totalData.getIssueTotal());
entity.setProjectTotal(totalData.getProjectTotal());
entity.setRegUserTotal(totalData.getUserTotal());
//参与人数参与人数: 议题的表决行为的用户数去重的累计值
int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId());

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

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
@ -58,13 +59,13 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
@Override
public List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType) {
List<ScreenPioneerDataEntity> list = new ArrayList<>();
if ("grid".equals(orgType)) {
if (OrgTypeConstant.GRID.equals(orgType)) {
//按网格构造
list = baseDao.initGridPioneerDataList(customerId);
} else if ("community".equals(orgType)) {
} else if (OrgTypeConstant.COMMUNITY.equals(orgType)) {
//按社构造
list = baseDao.initCommunityPioneerDataList(customerId);
}else if("agency".equals(orgType)){
}else if(OrgTypeConstant.AGENCY.equals(orgType)){
list = baseDao.initExceptCommunityPioneerDataList(customerId);
}
return list;

Loading…
Cancel
Save