Browse Source

PioneerDataExtractService添加日志

dev_shibei_match
yinzuomei 5 years ago
parent
commit
0c2bc1bbd4
  1. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

17
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)) {
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")

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));
}
});

Loading…
Cancel
Save