| | |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).collect(toList()); |
| | | collect.forEach(comActActivityVO -> { |
| | | ArrayList<ComActActRegistVO> currentList = new ArrayList<>(); |
| | | Integer[] rewardWayArr = {0}; |
| | | comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | currentList.add(activitySignInVO); |
| | | |
| | | Integer signIdentity = activitySignInVO.getSignIdentity(); |
| | | Integer rewardWay = null; |
| | | Integer rewardIntegral = 0; |
| | | switch (signIdentity) { |
| | | case 1: |
| | | rewardWay = comActActivityVO.getParticipantRewardWay(); |
| | | rewardIntegral = comActActivityVO.getParticipantRewardIntegral(); |
| | | break; |
| | | case 2: |
| | | rewardWay = comActActivityVO.getPbRewardWay(); |
| | | rewardIntegral = comActActivityVO.getPbRewardIntegral(); |
| | | case 3: |
| | | rewardWay = comActActivityVO.getVolunteerRewardWay(); |
| | | rewardIntegral = comActActivityVO.getVolunteerRewardIntegral(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | rewardWayArr[0] = rewardWay; |
| | | if(rewardWay == 1){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | | comActActivityVO.setTimes(1); |
| | | comActActivityVO.setAward(rewardIntegral); |
| | | } |
| | | else { |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | comActActivityVO.setAward(rewardIntegral*comActActivityVO.getTimes()); |
| | | } |
| | | } else { |
| | | if(activitySignInVO.getEndTime()!=null){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | if (currentList.size() > 10) { |
| | | comActActivityVO.setActivitySignInList(currentList.subList(0, 10)); |
| | |
| | | } |
| | | Integer limit = comActActivityVO.getLimit(); |
| | | if(limit != null && limit>0 &¤tList.size()>0){ |
| | | if(rewardWayArr[0] == 2){ |
| | | if(limit==currentList.size()&¤tList.get(currentList.size()-1).getEndTime()!=null){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
| | | } else { |
| | | if(limit==currentList.size()){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
| | | } |
| | | } |
| | | }); |