Browse Source

党员大屏数据抽取

master
zxc 5 years ago
parent
commit
676c76c9ff
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java
  2. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java
  3. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java
  4. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  6. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  7. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  8. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  11. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml
  12. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  13. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java

@ -33,6 +33,8 @@ public class IssueLogDailyFormDTO implements Serializable {
*/
private String pid;
private String pids;
/**
* 机关ID
*/

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java

@ -79,6 +79,8 @@ public class IssueMainDailyFormDTO implements Serializable {
*/
private String pid;
private String pids;
/**
* 议题组织ID网格所属组织ID
*/

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java

@ -22,4 +22,6 @@ public class AgencyInfoResultDTO implements Serializable {
* 机关的父ID
*/
private String pid;
private String pids;
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -134,4 +134,13 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
ScreenCustomerAgencyEntity getLastUpdatedAgency();
ScreenCustomerAgencyEntity selectByAgencyId(String agencyId);
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
List<String> selectSubAgencyId(@Param("agencyId") String agencyId,@Param("customerId") String customerId);
}

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

@ -126,6 +126,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids());
}
});
});
@ -219,6 +220,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
r.setPids(agency.getPids());
}
});
});

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

@ -14,6 +14,7 @@ import com.epmet.service.stats.user.FactParticipationUserGridDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.epmet.constant.ScreenConstant;
@ -97,6 +98,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
List<PartyMemberInfoResultDTO> partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds);
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 为每个人赋值年龄
partyMemberInfoList.forEach(party -> {
party.setAge(getAge(party.getBirthday()));
});
@ -152,8 +154,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
List<UserCountResultDTO> userCountRList = userAgencyDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> agencyIds = (List<String>) agencyMap.get(agencyId);
// 下级机关agencyId
List<String> agencyIds = agencyService.selectSubAgencyId(agencyId, customerId);
// todo
});
}
@ -227,6 +229,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
* @author zxc
* @date 2020/9/23 10:13 上午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsert(List<PartyBaseInfoFormDTO> result, String customerId, String dateId){
if (!CollectionUtils.isEmpty(result)){
List<String> orgIds = result.stream().map(m -> m.getOrgId()).collect(Collectors.toList());

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java

@ -23,7 +23,6 @@ import java.util.List;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import java.util.List;
import java.util.Map;
/**
@ -58,4 +57,13 @@ public interface ScreenCustomerAgencyService{
ScreenCustomerAgencyEntity getLastUpdatedAgency();
void initAgencies(List<CustomerAgencyEntity> agencies2Add, List<CustomerAgencyEntity> agencies2Update);
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
List<String> selectSubAgencyId(String agencyId, String customerId);
}

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

@ -135,6 +135,18 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
}
}
/**
* @Description 查询下一级机关的ID即以agencyId为pid的agency
* @param agencyId
* @param customerId
* @author zxc
* @date 2020/9/23 11:11 上午
*/
@Override
public List<String> selectSubAgencyId(String agencyId, String customerId) {
return screenCustomerAgencyDao.selectSubAgencyId(agencyId, customerId);
}
private void updateAgency(ScreenCustomerAgencyEntity exists) {
screenCustomerAgencyDao.updateById(exists);
}

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

@ -10,6 +10,7 @@
CUSTOMER_ID,
GRID_ID,
PID,
PIDS,
AGENCY_ID,
DATE_ID,
WEEK_ID,
@ -33,6 +34,7 @@
#{item.customerId},
#{item.gridId},
#{item.pid},
#{item.pids},
#{item.agencyId},
#{item.dateId},
#{item.weekId},

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

@ -19,6 +19,7 @@
TOPIC_ID,
GRID_ID,
PID,
PIDS,
AGENCY_ID,
ISSUE_STATUS,
TOPIC_USER_IS_PARTY,
@ -44,6 +45,7 @@
#{item.topicId},
#{item.gridId},
#{item.pid},
#{item.pids},
#{item.agencyId},
#{item.issueStatus},
#{item.topicUserIsParty},

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml

@ -3,27 +3,4 @@
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.FactIndexAgencySelfSubScoreDao">
<resultMap type="com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity" id="factIndexAgencySelfSubScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentAgencyId" column="PARENT_AGENCY_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="scoreType" column="SCORE_TYPE"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/>
<result property="weight" column="WEIGHT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

@ -258,4 +258,16 @@
AND CUSTOMER_ID = #{customerId}
ORDER BY created_time DESC
</select>
<!-- 查询下一级机关的ID【即以agencyId为pid的agency】 -->
<select id="selectSubAgencyId" resultType="java.lang.String">
SELECT
AGENCY_ID
FROM
screen_customer_agency
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND PID = #{agencyId}
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

@ -303,7 +303,8 @@
<select id="selectAgencyInfo" resultType="com.epmet.dto.extract.result.AgencyInfoResultDTO">
SELECT
id AS agencyId,
pid
pid,
pids
FROM
dim_agency
WHERE

Loading…
Cancel
Save