Browse Source

党员大屏数据抽取

dev_shibei_match
zxc 5 years ago
parent
commit
4a6a227393
  1. 85
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java
  2. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  3. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  4. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java
  5. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java
  6. 29
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml

85
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyInfoResultDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/23 1:58 下午
*/
@Data
public class PartyInfoResultDTO implements Serializable {
private static final long serialVersionUID = -5275089831499409888L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 注册用户数
*/
private Integer registerUserCount;
/**
* 群众用户数
*/
private Integer resiTotal;
/**
* 注册党员数
*/
private Integer partyMemberCount;
/**
* 小于20岁的党员总人数
*/
private Integer ageLevel1;
/**
* 20-30岁的党员总人数
*/
private Integer ageLevel2;
/**
* 31-40岁的党员总人数
*/
private Integer ageLevel3;
/**
* 41-50岁的党员总人数
*/
private Integer ageLevel4;
/**
* 51-60岁的党员总人数
*/
private Integer ageLevel5;
/**
* 60+岁的党员总人数
*/
private Integer ageLevel6;
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -74,4 +75,14 @@ public interface ScreenCpcBaseDataDao extends BaseDao<ScreenCpcBaseDataEntity> {
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyBaseInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("orgIds")List<String> orgIds);
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
List<PartyInfoResultDTO> selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId);
}

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

@ -3,6 +3,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
@ -154,10 +155,25 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
List<UserCountResultDTO> userCountRList = userAgencyDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
// 下级机关agencyId
List<String> agencyIds = agencyService.selectSubAgencyId(agencyId, customerId);
// todo
List<PartyInfoResultDTO> partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId);
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName());
form.setOrgId(agencyId);
form.setOrgType(ScreenConstant.AGENCY);
form.setParentId(partyInfoList.get(NumConstant.ZERO).getParentId());
form.setAgeLevel1(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel1)));
form.setAgeLevel2(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel2)));
form.setAgeLevel3(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel3)));
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.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal)));
form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount)));
result.add(form);
});
delAndInsert(result,customerId,dateId);
}
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import java.util.List;
@ -49,4 +50,14 @@ public interface ScreenCpcBaseDataService extends BaseService<ScreenCpcBaseDataE
*/
Integer deleteOldPartyBaseInfo(String customerId, String dateId, List<String> orgIds);
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId,String agencyId);
}

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

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.screen.ScreenCpcBaseDataDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService;
import org.springframework.stereotype.Service;
@ -54,4 +55,17 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl<ScreenCpcBaseD
public Integer deleteOldPartyBaseInfo(String customerId, String dateId, List<String> orgIds) {
return baseDao.deleteOldPartyBaseInfo(customerId, dateId,orgIds);
}
/**
* @Description 查询党员信息根据agencyId来查
* @param customerId
* @param dateId
* @param agencyId
* @author zxc
* @date 2020/9/23 2:01 下午
*/
@Override
public List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId, String agencyId) {
return baseDao.selectPartyInfo(customerId, dateId, agencyId);
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml

@ -9,6 +9,35 @@
limit 1000;
</delete>
<!-- 查询党员信息【根据agencyId来查】 -->
<select id="selectPartyInfo" resultType="com.epmet.dto.extract.result.PartyInfoResultDTO">
SELECT
scbd.CUSTOMER_ID,
scbd.ORG_TYPE,
scbd.PARENT_ID AS orgId,
scbd.REGISTER_USER_COUNT,
scbd.RESI_TOTAL,
scbd.PARTY_MEMBER_COUNT,
scbd.AGE_LEVEL_1,
scbd.AGE_LEVEL_2,
scbd.AGE_LEVEL_3,
scbd.AGE_LEVEL_4,
scbd.AGE_LEVEL_5,
scbd.AGE_LEVEL_6,
sca.PID AS parentId,
sca.AGENCY_NAME AS orgName
FROM
screen_cpc_base_data scbd
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scbd.PARENT_ID
WHERE
scbd.del_flag = '0'
AND sca.DEL_FLAG = 0
AND scbd.ORG_TYPE = 'agency'
AND scbd.DATA_END_TIME = #{dateId}
AND scbd.CUSTOMER_ID = #{customerId}
AND PARENT_ID = #{agencyId}
</select>
<insert id="batchInsertCpcBaseData" parameterType="map">
insert into screen_cpc_base_data
(

Loading…
Cancel
Save