Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data_2.0' into dev_temp

dev_shibei_match
jianjun 5 years ago
parent
commit
c1ef787e88
  1. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  3. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java
  5. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  6. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

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

@ -60,5 +60,5 @@ public interface ActInfoDao{
* @author zxc * @author zxc
* @date 2020/9/25 4:00 下午 * @date 2020/9/25 4:00 下午
*/ */
List<ScreenPartyBranchDataFormDTO> selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("orgType") String orgType,@Param("orgIds") List<String> orgIds); List<ScreenPartyBranchDataFormDTO> selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId);
} }

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

@ -301,7 +301,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
// 查询客户下所有机关,网格下的参与人数 // 查询客户下所有机关,网格下的参与人数
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null); List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null);
// 查询机关界别的组织次数 // 查询机关界别的组织次数
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds); List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId);
// 查询客户下所有网格和所有机关 // 查询客户下所有网格和所有机关
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId); List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId);
@ -315,11 +315,10 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}); });
}); });
// 查询所有机关、网格组织次数 // 查询所有机关、网格组织次数
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds);
if (isGrid == true){ if (isGrid == true){
agencyIdList.forEach(agency -> { agencyIdList.forEach(agency -> {
finalResult.forEach(fl -> { finalResult.forEach(fl -> {
screenPartyBranchDataList.forEach(sp -> { screenPartyBranchDataByAgencyList.forEach(sp -> {
if (fl.getOrgId().equals(sp.getOrgId())){ if (fl.getOrgId().equals(sp.getOrgId())){
fl.setOrganizeCount(sp.getOrganizeCount()); fl.setOrganizeCount(sp.getOrganizeCount());
} }
@ -374,7 +373,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
if (!CollectionUtils.isEmpty(disGridIds)){ if (!CollectionUtils.isEmpty(disGridIds)){
orgIds.addAll(disGridIds); orgIds.addAll(disGridIds);
finalResult.forEach(r -> { finalResult.forEach(r -> {
screenPartyBranchDataList.forEach(party ->{ screenPartyBranchDataByAgencyList.forEach(party ->{
if (r.getOrgId().equals(party.getOrgId())){ if (r.getOrgId().equals(party.getOrgId())){
r.setOrganizeCount(party.getOrganizeCount()); r.setOrganizeCount(party.getOrganizeCount());
} }
@ -397,7 +396,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
// 如果存在本级名义的, 下级机关 + 本级 // 如果存在本级名义的, 下级机关 + 本级
screenPartyBranchDataByParentList.forEach(organize -> { screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)) { if (organize.getOrgId().equals(agencyId)) {
form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
} }

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

@ -1,10 +1,13 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl; package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -15,6 +18,8 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* @Author zxc * @Author zxc
@ -40,6 +45,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private GovernRankDataExtractService governRankDataExtractService; private GovernRankDataExtractService governRankDataExtractService;
@Autowired @Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@Autowired
private IndexCalculateService indexCalculateService;
/** /**
* @param extractOriginFormDTO * @param extractOriginFormDTO
@ -146,5 +153,18 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
orgRankExtractService.extractDistrictData(customerId, monthId); orgRankExtractService.extractDistrictData(customerId, monthId);
// 党建引领 screen_party_branch_data,screen_party_link_masses_data // 党建引领 screen_party_branch_data,screen_party_link_masses_data
partyGuideService.partyGuideExtract(formDTO); partyGuideService.partyGuideExtract(formDTO);
//计算分数 todo 优化 手动创建线程池 控制任务数量
ExecutorService pool = Executors.newSingleThreadExecutor();
pool.submit(() -> {
CalculateCommonFormDTO formDTO1 = new CalculateCommonFormDTO();
try {
formDTO1.setMonthId(monthId);
formDTO1.setCustomerId(customerId);
indexCalculateService.indexCalculate(formDTO1);
} catch (Exception e) {
log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1));
}
});
} }
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java

@ -39,5 +39,5 @@ public interface ActInfoService {
* @author zxc * @author zxc
* @date 2020/9/25 4:00 下午 * @date 2020/9/25 4:00 下午
*/ */
List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId, String orgType, List<String> orgIds); List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId);
} }

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java

@ -71,10 +71,7 @@ public class ActInfoServiceImpl implements ActInfoService {
* @date 2020/9/25 4:00 下午 * @date 2020/9/25 4:00 下午
*/ */
@Override @Override
public List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId, String orgType, List<String> orgIds) { public List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId) {
if (!CollectionUtils.isEmpty(orgIds)){ return baseDao.selectActInfo(customerId, monthId);
return baseDao.selectActInfo(customerId, monthId, orgType, orgIds);
}
return new ArrayList<>();
} }
} }

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -51,15 +51,6 @@
AND ACT_STATUS = 'finished' AND ACT_STATUS = 'finished'
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId} AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
<if test="orgType != null and orgType != '' ">
AND SPONSOR_TYPE = #{orgType}
</if>
AND
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
SPONSOR_ID = #{orgId}
</foreach>
)
GROUP BY SPONSOR_ID GROUP BY SPONSOR_ID
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save