Browse Source

Merge remote-tracking branch 'origin/dev'

master
yinzuomei 5 years ago
parent
commit
6104246bde
  1. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  3. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  5. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  6. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  9. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -20,7 +20,6 @@ import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
@ -47,7 +46,6 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@ -664,12 +662,21 @@ public class DemoController {
@Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId,@RequestParam("type") String type) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
if ("grid".equals(type)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
} else if ("community".equals(type)) {
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
} else if ("exceptcommunity".equals(type)) {
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
}
}
/*else {
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper);
for (DimCustomerEntity customerEntity : customerEntityList) {
@ -677,8 +684,8 @@ public class DemoController {
pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926");
}
}
return new Result();
}*/
return new Result().ok("调用成功");
}
@PostMapping("extractPublicPartiTotalData")

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java

@ -1,5 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
@ -11,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 原始数据清洗
@ -114,7 +118,15 @@ public class FactOriginExtractController {
**/
@PostMapping("groupdatacleaning")
public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) {
groupExtractService.extractGroupData(param);
if(StringUtils.isNotBlank(param.getStartDate()) && StringUtils.isNotBlank(param.getEndDate())){
List<String> finalDaysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate());
ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class);
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
groupExtractService.extractGroupData(paramNew);
}
}else groupExtractService.extractGroupData(param);
return new Result();
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java

@ -85,19 +85,21 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
@Override
@Transactional(rollbackFor = Exception.class)
public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List<FactOriginGroupMainDailyDTO> originGroupData, List<ExtractGroupMemberActionRecordResultDTO> memberList,List<String> missing) {
if (isFirst) {
//isFirst
baseDao.deleteBatchMemberByCustomerId(customerId,null,null);
} else {
if(StringUtils.isNotBlank(dateId)){
baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date");
if(!CollectionUtils.isEmpty(originGroupData)) {
if (isFirst) {
//isFirst
baseDao.deleteBatchMemberByCustomerId(customerId, null, null);
} else {
if (StringUtils.isNotBlank(dateId)) {
baseDao.deleteBatchMemberByCustomerId(customerId, dateId, "date");
}
}
}
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId, originGroupData.stream().map(FactOriginGroupMainDailyDTO::getId).distinct().collect(Collectors.toList()));
baseDao.insertBatchMain(originGroupData);
baseDao.insertBatchMembers(memberList);
baseDao.insertBatchMain(originGroupData);
baseDao.insertBatchMembers(memberList);
}
if(!CollectionUtils.isEmpty(missing)){
baseDao.deleteBatchByGroupId(customerId,missing);
baseDao.deleteMemberByGroupList(customerId,missing);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java

@ -88,7 +88,7 @@ public class GroupExtractServiceImpl implements GroupExtractService {
log.info("extractGroupData extractGroupData:result:{},param:{}", JSON.toJSONString(originGroupData), JSON.toJSONString(param));
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),null);
if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap =

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

@ -129,7 +129,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel4)));
form.setAgeLevel5(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel5)));
form.setAgeLevel6(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel6)));
form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount)));
// form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount)));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setResiTotal(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getResiTotal)));
form.setRegisterUserCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getRegisterUserCount)));
result.add(form);
@ -175,6 +176,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
@ -183,7 +185,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
// form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
@ -210,7 +212,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel4(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel4)));
form.setAgeLevel5(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel5)));
form.setAgeLevel6(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel6)));
form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount)));
// form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount)));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal)));
form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount)));
result.add(form);
@ -361,6 +364,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setPartyMemberCount(calPartyMemberCount(form));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
@ -370,7 +374,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
// form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
@ -379,4 +383,9 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
}
return new GridPartyDTO(orgIds, result);
}
public Integer calPartyMemberCount(PartyBaseInfoFormDTO form){
Integer result = form.getAgeLevel1() + form.getAgeLevel2() + form.getAgeLevel3() + form.getAgeLevel4() + form.getAgeLevel5() + form.getAgeLevel6();
return result;
}
}

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

@ -66,36 +66,44 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//何为参与: 议题的表决行为次数总计
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal());
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal);
BigDecimal issueRatio=new BigDecimal(entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";issueRatio=" + issueRatio);
entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal());
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前网格内所有话题总数
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal);
if(gridTopicTotal == NumConstant.ZERO){
entity.setTopicRatio(BigDecimal.ZERO);
}else{
BigDecimal topicRatio=new BigDecimal(entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题占比topicRatio="+topicRatio);
entity.setTopicRatio(topicRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
}
//当前网格内所有议题总数
int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null);
log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有议题总数=" + gridIssueTotal);
if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占网格内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
@ -106,6 +114,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null));
log.info("extractGridPioneerData 当前网格id=" + gridId +";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占网格内议题总数的比率
if(entity.getShiftProjectTotal() == NumConstant.ZERO){
entity.setShiftProjectRatio(BigDecimal.ZERO);
@ -115,7 +124,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
}
}else{
// log.info("当前网格内所有议题总数="+gridIssueTotal);
log.info("extractGridPioneerData 当前网格id="+gridId+";当前网格内所有议题总数 gridIssueTotal =0 ");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -125,11 +134,13 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED));
log.info("extractGridPioneerData 当前网格id="+gridId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null);
log.info("extractGridPioneerData 当前网格id="+gridId+";总结项目closedProjectTotal="+closedProjectTotal);
if(closedProjectTotal == NumConstant.ZERO){
entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else {
@ -172,30 +183,36 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
String communityId = entity.getOrgId();
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal());
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal());
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal);
entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前社区内所有议题总数
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal);
if (communityIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
@ -204,10 +221,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占社区内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前社区内所有议题总数="+communityIssueTotal);
log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -217,11 +235,13 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED));
log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null);
log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
@ -243,32 +263,39 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} else {
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId()));
}
log.info("extractExceptCommunityPioneerData 当前orgId="+entity.getOrgId()+";agencyPath="+entity.getAgencyPath());
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR));
log.info("extractExceptCommunityPioneerData 党员参与议事issueTotal="+entity.getIssueTotal());
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null);
log.info("extractExceptCommunityPioneerData 平台参与议事issueTotal="+issueTotal);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR));
log.info("extractExceptCommunityPioneerData 党员发布话题topicTotal="+entity.getTopicTotal());
//4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前组织内所有话题总数
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null);
log.info("extractExceptCommunityPioneerData 当前组织内所有话题总数agencyTopicTotal="+agencyTopicTotal);
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前组织内所有议题总数
int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath());
log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal="+agencyIssueTotal);
if (agencyIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath()));
log.info("extractExceptCommunityPioneerData 党员发布议题publishIssueTotal="+entity.getPublishIssueTotal());
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
@ -277,10 +304,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
//7、议题转项目数
entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath()));
log.info("extractExceptCommunityPioneerData 议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal());
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前组织内所有议题总数="+agencyIssueTotal);
log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal=0");
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
@ -290,11 +318,13 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED));
log.info("extractExceptCommunityPioneerData 已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal());
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null);
log.info("extractExceptCommunityPioneerData 总结项目closedProjectTotal="+closedProjectTotal);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -186,7 +186,7 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
**/
@Override
public List<GridAttributesResultDTO> getGridAttributes(String customerId,List<String> gridIds) {
if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST;
return baseDao.selectGridAttributes(customerId,gridIds);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -186,7 +186,7 @@
oper.UPDATED_TIME AS joinDate,
IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag,
groupp.CREATED_BY AS groupOwnerId,
'join' AS actionCode
IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode
FROM
RESI_GROUP groupp

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -104,11 +104,14 @@
dg.DEL_FLAG = '0'
AND da.DEL_FLAG = '0'
AND da.CUSTOMER_ID = #{customerId}
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
<if test="null != gridIds and gridIds.size() > 0">
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
</if>
</select>
</mapper>
Loading…
Cancel
Save