From 62d2377c27bf65a048a7c104b256efcd32ad2319 Mon Sep 17 00:00:00 2001
From: manailin <261030956@qq.com>
Date: 星期四, 19 八月 2021 17:53:40 +0800
Subject: [PATCH] Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into test

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java |   47 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
index d44422d..20210f7 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -54,6 +54,8 @@
     private ComActActSignDAO comActActSignDAO;
     @Resource
     private ComActEasyPhotoFeedbackMapper comActEasyPhotoFeedbackMapper;
+    @Resource
+    private ComActQuestnaireDAO comActQuestnaireDAO;
     /**
      * 分页查询随手拍
      *
@@ -563,11 +565,48 @@
             easyPhotoRewardVO.setEasyPhotoActivityVO(photoActivityVO);
         }
 
-        //查询用户未读奖励金额
-        BigDecimal amount = comActEasyPhotoRewardMapper.getUserReward(userId,communityId);
-        if(amount != null){
-            easyPhotoRewardVO.setAmount(amount);
+        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);
+        }
+
+        //查询社区正在进行中的应用位置调查问卷列表
+        List<ComActQuestnaireAppVO> applicationQuestnaireList = comActQuestnaireDAO.getIndexApplicationQuestnaireList(communityId);
+        if(!applicationQuestnaireList.isEmpty()){
+            easyPhotoRewardVO.setApplicationQuestnaireList(applicationQuestnaireList);
+        }
+
         return R.ok(easyPhotoRewardVO);
     }
 

--
Gitblit v1.7.1