huanghongfa
2022-03-07 ddb8dee34c54a57b0893a952c8ceb0bbf472d0fc
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -303,10 +303,22 @@
                    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);
                }
            }
        }
@@ -468,6 +480,7 @@
                return R.fail("已经报名过了,请勿重复提交");
            }
            Integer volunteerMax = actActivityDO.getVolunteerMax();
            Integer activityType = actActivityDO.getType();
            Integer residentMax = actActivityDO.getParticipantMax();
            R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(String.valueOf(userId));
            LoginUserInfoVO loginUserInfoVO =
@@ -475,7 +488,7 @@
            // 查询当前活动下参与居民
            Integer residentCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda()
                    .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 0).eq(ComActActSignDO::getStatus, 1));
            if (volunteerMax != 0) {
            if (activityType.equals(2)) {
                //志愿者活动
                boolean userIsVolunteer = loginUserInfoVO.getIsVolunteer() == 1;
                // 查询当前活动下参与志愿者
@@ -585,7 +598,7 @@
     * @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();
@@ -603,6 +616,9 @@
                        .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();