Browse Source

组织次数,参与人数

dev_shibei_match
zxc 5 years ago
parent
commit
a2893f62ad
  1. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  2. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

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

@ -283,7 +283,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
if (isGrid == false){
orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
}
List<JoinUserCountResultDTO> joinUserCountByAgencyList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.AGENCY);
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId);
@ -297,7 +297,6 @@ public class PartyGuideServiceImpl implements PartyGuideService {
});
});
if (isGrid == true){
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
agencyIdList.forEach(agency -> {
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, orgIds);
finalResult.forEach(fl -> {
@ -329,7 +328,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
fl.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
@ -340,7 +339,6 @@ public class PartyGuideServiceImpl implements PartyGuideService {
});
}
});
log.error("结果"+JSON.toJSONString(finalResult));
delOrganize(customerId,monthId,orgIds);
insertOrganize(finalResult);
}else {
@ -355,7 +353,6 @@ public class PartyGuideServiceImpl implements PartyGuideService {
// 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
orgIds.addAll(disGridIds);
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
finalResult.forEach(r -> {
screenPartyBranchDataList.forEach(party ->{
@ -384,13 +381,12 @@ public class PartyGuideServiceImpl implements PartyGuideService {
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
});
}
});

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

@ -10,7 +10,7 @@
COUNT(asr.USER_ID) AS joinUserCount
FROM
act_user_relation asr
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
WHERE
ai.DEL_FLAG = 0
AND asr.DEL_FLAG = '0'
@ -18,7 +18,9 @@
AND asr.REWARD_FLAG = 'agree'
AND ai.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ai.ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND ai.SPONSOR_TYPE = #{orgType}
<if test="orgType != null and orgType != '' ">
AND ai.SPONSOR_TYPE = #{orgType}
</if>
GROUP BY ai.SPONSOR_ID
</select>
</mapper>

Loading…
Cancel
Save