Browse Source

screen_pioneer_data党员参与议事提交

master
yinzuomei 5 years ago
parent
commit
02a94de526
  1. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java
  4. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  5. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  6. 86
      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/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  8. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

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

@ -35,10 +35,7 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
@ -655,7 +652,7 @@ public class DemoController {
@PostMapping("zxczxc")
public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId());
// partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId());
return new Result();
}
@ -672,4 +669,28 @@ public class DemoController {
governRankDataExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
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) {
pioneerDataExtractService.extractGridPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926");
}
}
return new Result();
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -72,4 +72,21 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 18:05
**/
int calPartyPartiIssueTotal(@Param("customerId")String customerId,
@Param("gridId")String gridId,
@Param("communityId")String communityId,
@Param("agencyPath")String agencyPath,
@Param("isParty")String isParty);
}

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

@ -1,6 +1,7 @@
package com.epmet.dao.heart;
import com.epmet.dto.extract.result.JoinUserCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -9,6 +10,7 @@ import java.util.List;
* @Author zxc
* @DateTime 2020/9/25 5:21 下午
*/
@Mapper
public interface ActUserRelationDao {
/**

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java

@ -28,4 +28,16 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
*/
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty);
}

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

@ -36,4 +36,19 @@ import org.springframework.stereotype.Service;
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
/**
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
@Override
public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) {
return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
}

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

@ -4,11 +4,13 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -24,6 +26,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/9/22 11:25
*/
@Slf4j
@Service
public class PioneerDataExtractServiceImpl implements PioneerDataExtractService {
@ -35,6 +38,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
/**
* @param customerId
@ -54,11 +60,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
gridList.forEach(entity -> {
entity.setDataEndTime(dateId);
String gridId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
@ -86,6 +96,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前网格内所有议题总数="+gridIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}
@ -102,6 +118,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList);
}
/**
* @return int
* @param customerId
* @param gridId 网格id
* @param communityId 社区的id
* @param agencyPath 组织的pids包含自己
* @param isParty 1党员
* @author yinzuomei
* @description
* @Date 2020/9/26 17:41
**/
private int calPartyPartiIssueTotal(String customerId,
String gridId,
String communityId,
String agencyPath,
String isParty) {
return factOriginIssueLogDailyService.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
@ -112,11 +147,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
communityList.forEach(entity -> {
entity.setDataEndTime(dateId);
String communityId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
@ -144,6 +183,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId));
//8、议题转项目占比 : 占社区内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前社区内所有议题总数="+communityIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}
@ -170,17 +215,20 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
}
agencyList.forEach(entity -> {
entity.setDataEndTime(dateId);
String agencyId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) {
entity.setAgencyPath(entity.getOrgId());
} else {
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId()));
}
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR));
@ -208,6 +256,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath()));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}else{
// log.info("当前组织内所有议题总数="+agencyIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}

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

@ -74,7 +74,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
* @date 2020/9/24 10:16 上午
*/
public void extractDaily(String customerId,String dateId){
partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId,dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId);

26
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -93,4 +93,30 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<!-- 党员参与议事:支持或者反对的次数 -->
<select id="calPartyPartiIssueTotal" parameterType="map" resultType="int">
SELECT
COUNT(1)AS TOTAL
FROM
fact_origin_issue_log_daily M
WHERE
M.DEL_FLAG = '0'
AND M.ACTION_CODE LIKE 'vote_%'
<if test='null != customerId and "" != customerId'>
AND M.CUSTOMER_ID=#{customerId}
</if>
<if test='null != gridId and "" != gridId'>
AND M.GRID_ID=#{gridId}
</if>
<if test='null != communityId and "" != communityId'>
AND M.AGENCY_ID=#{communityId}
</if>
<if test='null != agencyPath and "" != agencyPath'>
AND M.PIDS LIKE CONCAT(#{agencyPath},'%')
</if>
<if test='null != isParty and "" != isParty'>
and M.IS_PARTY=#{isParty}
</if>
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -106,7 +106,7 @@
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND m.CREATE_TOPIC_USER_IS_PARTY='1'
AND t1.CREATE_TOPIC_USER_IS_PARTY='1'
<if test='null != gridId and "" !=gridId'>
AND T1.GRID_ID=#{gridId}
</if>

Loading…
Cancel
Save