| | |
| | | */ |
| | | @Override |
| | | public R getUserReward(Long userId, Long communityId) { |
| | | // 结果返回参数 |
| | | ComActEasyPhotoRewardVO easyPhotoRewardVO = new ComActEasyPhotoRewardVO(); |
| | | // 查询随手拍活动 |
| | | ComActEasyPhotoActivityVO photoActivityVO = new ComActEasyPhotoActivityVO(); |
| | | Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format); |
| | | List<ComActEasyPhotoActivityDO> photoActivityDOS = |
| | | comActEasyPhotoActivityMapper.selectList(new QueryWrapper<ComActEasyPhotoActivityDO>().lambda() |
| | | .eq(ComActEasyPhotoActivityDO::getCommunityId, communityId) |
| | | .eq(ComActEasyPhotoActivityDO::getStatus, ComActEasyPhotoActivityDO.status.jxz) |
| | | .le(ComActEasyPhotoActivityDO::getActivityStartAt, nowDate) |
| | | .ge(ComActEasyPhotoActivityDO::getActivityEndAt, nowDate)); |
| | | if (!photoActivityDOS.isEmpty()) { |
| | | ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0); |
| | | BeanUtils.copyProperties(photoActivityDO, photoActivityVO); |
| | | easyPhotoRewardVO.setEasyPhotoActivityVO(photoActivityVO); |
| | | } |
| | | |
| | | if (userId != null && userId != 0L) { |
| | | // 查询用户未读奖励金额 |
| | | BigDecimal amount = comActEasyPhotoRewardMapper.getUserReward(userId, communityId); |
| | | if (amount != null) { |
| | | easyPhotoRewardVO.setAmount(amount); |
| | | } |
| | | } |
| | | |
| | | // 查询当前社区正在进行中的弹窗调查问卷 |
| | | ComActQuestnaireDO popupQuestnaireDO = comActQuestnaireDAO.selectOne(new QueryWrapper<ComActQuestnaireDO>() |
| | | .lambda().le(ComActQuestnaireDO::getStartTime, nowDate).ge(ComActQuestnaireDO::getEndTime, nowDate) |
| | | .eq(ComActQuestnaireDO::getCommunityId, communityId).eq(ComActQuestnaireDO::getState, 2) |
| | | .eq(ComActQuestnaireDO::getAdverPositionPopup, ComActQuestnaireDO.isOk.yes)); |
| | | if (popupQuestnaireDO != null) { |
| | | ComActQuestnaireAppVO popupQuestnaireVO = new ComActQuestnaireAppVO(); |
| | | BeanUtils.copyProperties(popupQuestnaireDO, popupQuestnaireVO); |
| | | if (userId != null) { |
| | | if (popupQuestnaireDO.getIsForce().equals(ComActQuestnaireDO.isOk.no)) { |
| | | // 查询用户是否已点击不再提醒 |
| | | Integer count = comActQuestnaireDAO.getNoRemindCount(userId, popupQuestnaireVO.getId()); |
| | | if (count <= 0) { |
| | | popupQuestnaireVO.setIsDisplay(ComActQuestnaireDO.isOk.yes); |
| | | } |
| | | } else { |
| | | popupQuestnaireVO.setIsDisplay(ComActQuestnaireDO.isOk.yes); |
| | | } |
| | | } |
| | | easyPhotoRewardVO.setPopupQuestnaireVO(popupQuestnaireVO); |
| | | } |
| | | |
| | | // 查询社区正在进行中的banner位置调查问卷列表 |
| | | List<ComActQuestnaireAppVO> bannerQuestnaireList = comActQuestnaireDAO.getIndexTopQuestnaireList(communityId); |
| | | if (!bannerQuestnaireList.isEmpty()) { |
| | | easyPhotoRewardVO.setBannerQuestnaireList(bannerQuestnaireList); |
| | | } |
| | | |
| | | //查询社区正在进行中的banner位置的社区活动 |
| | | List<ComActActivityVO> comActActivityVOList = comActActivityDAO.getIndexTopActivityList(communityId); |
| | | if (!comActActivityVOList.isEmpty()) { |
| | | easyPhotoRewardVO.setBannerActivityList(comActActivityVOList); |
| | | } |
| | | |
| | | // 查询社区正在进行中的应用位置调查问卷列表 |
| | | List<ComActQuestnaireAppVO> applicationQuestnaireList = |
| | | comActQuestnaireDAO.getIndexApplicationQuestnaireList(communityId); |
| | | if (!applicationQuestnaireList.isEmpty()) { |
| | | easyPhotoRewardVO.setApplicationQuestnaireList(applicationQuestnaireList); |
| | | } |
| | | //查询社区正在进行中的banner预约/登记列表 |
| | | List<ComActReserveIndexVo> comActReserveIndexVos=comActReserveMapper.indexBanner(communityId); |
| | | if(!comActReserveIndexVos.isEmpty()){ |
| | | easyPhotoRewardVO.setComActReserveIndexBannerVos(comActReserveIndexVos); |
| | | } |
| | | //查询社区正在进行中的应用预约/登记列表 |
| | | List<ComActReserveIndexVo> comActReserveIndexApplicationVos=comActReserveMapper.indexApplication(communityId); |
| | | if(!comActReserveIndexApplicationVos.isEmpty()){ |
| | | easyPhotoRewardVO.setComActReserveIndexApplicationVos(comActReserveIndexApplicationVos); |
| | | } |
| | | return R.ok(easyPhotoRewardVO); |
| | | // // 结果返回参数 |
| | | // ComActEasyPhotoRewardVO easyPhotoRewardVO = new ComActEasyPhotoRewardVO(); |
| | | // // 查询随手拍活动 |
| | | // ComActEasyPhotoActivityVO photoActivityVO = new ComActEasyPhotoActivityVO(); |
| | | // Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format); |
| | | // List<ComActEasyPhotoActivityDO> photoActivityDOS = |
| | | // comActEasyPhotoActivityMapper.selectList(new QueryWrapper<ComActEasyPhotoActivityDO>().lambda() |
| | | // .eq(ComActEasyPhotoActivityDO::getCommunityId, communityId) |
| | | // .eq(ComActEasyPhotoActivityDO::getStatus, ComActEasyPhotoActivityDO.status.jxz) |
| | | // .le(ComActEasyPhotoActivityDO::getActivityStartAt, nowDate) |
| | | // .ge(ComActEasyPhotoActivityDO::getActivityEndAt, nowDate)); |
| | | // if (!photoActivityDOS.isEmpty()) { |
| | | // ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0); |
| | | // BeanUtils.copyProperties(photoActivityDO, photoActivityVO); |
| | | // easyPhotoRewardVO.setEasyPhotoActivityVO(photoActivityVO); |
| | | // } |
| | | // |
| | | // if (userId != null && userId != 0L) { |
| | | // // 查询用户未读奖励金额 |
| | | // BigDecimal amount = comActEasyPhotoRewardMapper.getUserReward(userId, communityId); |
| | | // if (amount != null) { |
| | | // easyPhotoRewardVO.setAmount(amount); |
| | | // } |
| | | // } |
| | | // |
| | | // // 查询当前社区正在进行中的弹窗调查问卷 |
| | | // ComActQuestnaireDO popupQuestnaireDO = comActQuestnaireDAO.selectOne(new QueryWrapper<ComActQuestnaireDO>() |
| | | // .lambda().le(ComActQuestnaireDO::getStartTime, nowDate).ge(ComActQuestnaireDO::getEndTime, nowDate) |
| | | // .eq(ComActQuestnaireDO::getCommunityId, communityId).eq(ComActQuestnaireDO::getState, 2) |
| | | // .eq(ComActQuestnaireDO::getAdverPositionPopup, ComActQuestnaireDO.isOk.yes)); |
| | | // if (popupQuestnaireDO != null) { |
| | | // ComActQuestnaireAppVO popupQuestnaireVO = new ComActQuestnaireAppVO(); |
| | | // BeanUtils.copyProperties(popupQuestnaireDO, popupQuestnaireVO); |
| | | // if (userId != null) { |
| | | // if (popupQuestnaireDO.getIsForce().equals(ComActQuestnaireDO.isOk.no)) { |
| | | // // 查询用户是否已点击不再提醒 |
| | | // Integer count = comActQuestnaireDAO.getNoRemindCount(userId, popupQuestnaireVO.getId()); |
| | | // if (count <= 0) { |
| | | // popupQuestnaireVO.setIsDisplay(ComActQuestnaireDO.isOk.yes); |
| | | // } |
| | | // } else { |
| | | // popupQuestnaireVO.setIsDisplay(ComActQuestnaireDO.isOk.yes); |
| | | // } |
| | | // } |
| | | // easyPhotoRewardVO.setPopupQuestnaireVO(popupQuestnaireVO); |
| | | // } |
| | | // |
| | | // // 查询社区正在进行中的banner位置调查问卷列表 |
| | | // List<ComActQuestnaireAppVO> bannerQuestnaireList = comActQuestnaireDAO.getIndexTopQuestnaireList(communityId); |
| | | // if (!bannerQuestnaireList.isEmpty()) { |
| | | // easyPhotoRewardVO.setBannerQuestnaireList(bannerQuestnaireList); |
| | | // } |
| | | // |
| | | // //查询社区正在进行中的banner位置的社区活动 |
| | | // List<ComActActivityVO> comActActivityVOList = comActActivityDAO.getIndexTopActivityList(communityId); |
| | | // if (!comActActivityVOList.isEmpty()) { |
| | | // easyPhotoRewardVO.setBannerActivityList(comActActivityVOList); |
| | | // } |
| | | // |
| | | // // 查询社区正在进行中的应用位置调查问卷列表 |
| | | // List<ComActQuestnaireAppVO> applicationQuestnaireList = |
| | | // comActQuestnaireDAO.getIndexApplicationQuestnaireList(communityId); |
| | | // if (!applicationQuestnaireList.isEmpty()) { |
| | | // easyPhotoRewardVO.setApplicationQuestnaireList(applicationQuestnaireList); |
| | | // } |
| | | // //查询社区正在进行中的banner预约/登记列表 |
| | | // List<ComActReserveIndexVo> comActReserveIndexVos=comActReserveMapper.indexBanner(communityId); |
| | | // if(!comActReserveIndexVos.isEmpty()){ |
| | | // easyPhotoRewardVO.setComActReserveIndexBannerVos(comActReserveIndexVos); |
| | | // } |
| | | // //查询社区正在进行中的应用预约/登记列表 |
| | | // List<ComActReserveIndexVo> comActReserveIndexApplicationVos=comActReserveMapper.indexApplication(communityId); |
| | | // if(!comActReserveIndexApplicationVos.isEmpty()){ |
| | | // easyPhotoRewardVO.setComActReserveIndexApplicationVos(comActReserveIndexApplicationVos); |
| | | // } |
| | | return R.ok(this.comActEasyPhotoDAO.banner(communityId)); |
| | | } |
| | | |
| | | /** |