| | |
| | | comActActivityVO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | } |
| | | List<ComActActRegistDO> regList = comActActRegistDAO.selectList(new QueryWrapper<ComActActRegistDO>().lambda() |
| | | .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id).eq(ComActActRegistDO::getType, 1)); |
| | | .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id)); |
| | | if (!regList.isEmpty()) { |
| | | List<ComActActRegistDO> collect = regList.stream().sorted(Comparator.comparing(ComActActRegistDO::getId).reversed()).collect(Collectors.toList()); |
| | | comActActivityVO.setTimes(collect.get(0).getTimes()); |
| | | ComActActRegistDO comActActRegistDO=collect.get(0); |
| | | if(comActActRegistDO.getType()==2){ |
| | | if(comActActRegistDO.getEndTime()==null){ |
| | | comActActivityVO.setSignType(2); |
| | | } |
| | | else { |
| | | comActActivityVO.setSignType(1); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | comActActivityVO.setSignType(1); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return 活动列表 |
| | | */ |
| | | @Override |
| | | public R listActivity(Long userId, Integer status) { |
| | | public R listActivity(Long userId, Integer status,Integer type) { |
| | | List<ActivitySignVO> activitySignVOList = comActActSignDAO.selectList(userId); |
| | | if (ObjectUtils.isEmpty(activitySignVOList)) { |
| | | return R.ok(); |
| | |
| | | .filter(activityDO -> activityDO.getStatus().equals(status)).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if(isNull(type)){ |
| | | comActActivityDOS=comActActivityDOS.stream().filter(comActActivityDO -> comActActivityDO.getType().equals(type)).collect(Collectors.toList()); |
| | | } |
| | | if (!comActActivityDOS.isEmpty()) { |
| | | comActActivityDOS.forEach(comActActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |