|
@ -1,16 +1,26 @@ |
|
|
package com.epmet.service.evaluationindex.screen.impl; |
|
|
package com.epmet.service.evaluationindex.screen.impl; |
|
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; |
|
|
import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; |
|
|
|
|
|
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|
|
|
|
|
import com.epmet.dto.screencoll.form.*; |
|
|
import com.epmet.service.evaluationindex.screen.AnScreenCollService; |
|
|
import com.epmet.service.evaluationindex.screen.AnScreenCollService; |
|
|
|
|
|
import com.google.common.collect.Lists; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 安宁数据采集 |
|
|
* @Description 安宁数据采集 |
|
@ -33,4 +43,143 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { |
|
|
private ScreenAnGrassRootsPmRankDao pmRankDao; |
|
|
private ScreenAnGrassRootsPmRankDao pmRankDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ScreenAnGrassRootsPmTotalMonthlyDao pmTotalMonthlyDao; |
|
|
private ScreenAnGrassRootsPmTotalMonthlyDao pmTotalMonthlyDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 安宁大屏数据采集 - 中央区-项目概要 |
|
|
|
|
|
* @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502
|
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author wangc |
|
|
|
|
|
* @date 2020.10.09 16:41 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void communityProjectProfile(ScreenCollFormDTO<AnCommunityProjectProfileFormDTO> formDTO,String customerId) { |
|
|
|
|
|
List<AnCommunityProjectProfileFormDTO> dataList = formDTO.getDataList(); |
|
|
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
|
|
int affectRows = communityProjectProfileDao.deleteBatch(customerId); |
|
|
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
|
|
affectRows = communityProjectProfileDao.deleteBatch(customerId); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_THOUSAND).forEach(list -> { |
|
|
|
|
|
communityProjectProfileDao.insertBatch(list,customerId); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 |
|
|
|
|
|
* @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483
|
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author wangc |
|
|
|
|
|
* @date 2020.10.09 17:19 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void pmRank(ScreenCollFormDTO<AnGrassRootsPmRankFormDTO> formDTO,String customerId) { |
|
|
|
|
|
List<AnGrassRootsPmRankFormDTO> dataList = formDTO.getDataList(); |
|
|
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
|
|
int affectRows = pmRankDao.deleteBatch(customerId); |
|
|
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
|
|
affectRows = pmRankDao.deleteBatch(customerId); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_THOUSAND).forEach(list -> { |
|
|
|
|
|
pmRankDao.insertBatch(list,customerId); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 安宁大屏数据采集 - 基层党员-各类总数 |
|
|
|
|
|
* @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494
|
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author wangc |
|
|
|
|
|
* @date 2020.10.09 17:20 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void pmTotal(ScreenCollFormDTO<AnGrassRootsPmTotalMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
|
|
List<AnGrassRootsPmTotalMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
|
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
|
|
int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
|
|
affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_THOUSAND).forEach(list -> { |
|
|
|
|
|
pmTotalMonthlyDao.insertBatch(list, |
|
|
|
|
|
customerId, |
|
|
|
|
|
formDTO.getMonthId(), |
|
|
|
|
|
quarterId, |
|
|
|
|
|
yearId); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author wangc |
|
|
|
|
|
* @date 2020.10.09 17:22 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void grassrootsOrg(ScreenCollFormDTO<AnGrassRootsOrgMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
|
|
List<AnGrassRootsOrgMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
|
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
|
|
int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
|
|
affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_THOUSAND).forEach(list -> { |
|
|
|
|
|
orgMonthlyDao.insertBatch(list, |
|
|
|
|
|
customerId, |
|
|
|
|
|
formDTO.getMonthId(), |
|
|
|
|
|
quarterId, |
|
|
|
|
|
yearId); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description 安宁大屏数据采集 - 基层治理-各类数 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author wangc |
|
|
|
|
|
* @date 2020.10.09 17:23 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void grassrootsGovern(ScreenCollFormDTO<AnGrassRootsGovernMonthlyFormDTO> formDTO,String customerId) { |
|
|
|
|
|
List<AnGrassRootsGovernMonthlyFormDTO> dataList = formDTO.getDataList(); |
|
|
|
|
|
if(CollectionUtils.isEmpty(dataList)) return ; |
|
|
|
|
|
|
|
|
|
|
|
if(formDTO.getIsFirst()){ |
|
|
|
|
|
int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
while(affectRows >= NumConstant.ONE){ |
|
|
|
|
|
affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); |
|
|
|
|
|
String yearId = DateUtils.getYearId(formDTO.getMonthId()); |
|
|
|
|
|
Lists.partition(formDTO.getDataList(),NumConstant.ONE_THOUSAND).forEach(list -> { |
|
|
|
|
|
governMonthlyDao.insertBatch(list, |
|
|
|
|
|
customerId, |
|
|
|
|
|
formDTO.getMonthId(), |
|
|
|
|
|
quarterId, |
|
|
|
|
|
yearId); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|