| | |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.yes); |
| | | cmActEasyPhotoDO.setTransferReason(comActEasyPhotoVO.getTransferReason()); |
| | | cmActEasyPhotoDO.setTransferTime(nowDate); |
| | | |
| | | } else { |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取首页弹窗接口 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 首页弹窗接口 |
| | | */ |
| | | @Override |
| | | public R getUserRewards(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); |
| | | } |
| | | return R.ok(easyPhotoRewardVO); |
| | | } |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * |
| | | * @param userId |