Browse Source

组织次数,参与人数

dev_shibei_match
zxc 5 years ago
parent
commit
33e48cff64
  1. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

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

@ -81,7 +81,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
if (!CollectionUtils.isEmpty(customerIds)){ if (!CollectionUtils.isEmpty(customerIds)){
String finalMonthId = monthId; String finalMonthId = monthId;
customerIds.forEach(oneCustomerId -> { customerIds.forEach(oneCustomerId -> {
// partyGuideExtractParty(oneCustomerId, finalMonthId); partyGuideExtractParty(oneCustomerId, finalMonthId);
partyGuideExtractOrganize(oneCustomerId,finalMonthId); partyGuideExtractOrganize(oneCustomerId,finalMonthId);
}); });
} }
@ -296,9 +296,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 -> {
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, orgIds);
finalResult.forEach(fl -> { finalResult.forEach(fl -> {
screenPartyBranchDataList.forEach(sp -> { screenPartyBranchDataList.forEach(sp -> {
if (fl.getOrgId().equals(sp.getOrgId())){ if (fl.getOrgId().equals(sp.getOrgId())){
@ -353,7 +354,6 @@ public class PartyGuideServiceImpl implements PartyGuideService {
// 存在直属网格 // 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){ if (!CollectionUtils.isEmpty(disGridIds)){
orgIds.addAll(disGridIds); orgIds.addAll(disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
finalResult.forEach(r -> { finalResult.forEach(r -> {
screenPartyBranchDataList.forEach(party ->{ screenPartyBranchDataList.forEach(party ->{
if (r.getOrgId().equals(party.getOrgId())){ if (r.getOrgId().equals(party.getOrgId())){
@ -370,23 +370,25 @@ public class PartyGuideServiceImpl implements PartyGuideService {
} }
delOrganize(customerId,monthId,orgIds); delOrganize(customerId,monthId,orgIds);
List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId);
screenPartyBranchDataList.addAll(disPartyBranchDataList); screenPartyBranchDataByParentList.addAll(disPartyBranchDataList);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){
finalResult.forEach(form -> { finalResult.forEach(form -> {
form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); if (form.getOrgId().equals(agencyId)) {
form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
screenPartyBranchDataByAgencyList.forEach(organize -> { form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
if (organize.getOrgId().equals(agencyId)){ screenPartyBranchDataByParentList.forEach(organize -> {
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)))); if (organize.getOrgId().equals(agencyId)) {
} form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}); }
joinUserCountList.forEach(join -> { });
if (join.getOrgId().equals(agencyId)){ joinUserCountList.forEach(join -> {
form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)))); if (join.getOrgId().equals(agencyId)) {
} form.setJoinUserCount(calAdd(join.getJoinUserCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}); }
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount())); });
form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
}
}); });
} }
}); });

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

@ -51,7 +51,9 @@
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}
AND SPONSOR_TYPE = #{orgType} <if test="orgType != null and orgType != '' ">
AND SPONSOR_TYPE = #{orgType}
</if>
AND AND
( (
<foreach collection="orgIds" item="orgId" separator=" OR "> <foreach collection="orgIds" item="orgId" separator=" OR ">

Loading…
Cancel
Save