From b4b4067f86a9b7ba91fa92ff6f04b4ed914cb18d Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 19 八月 2021 13:27:04 +0800
Subject: [PATCH] 问卷调查增加浏览量接口

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java
index 41299b8..72226bc 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java
@@ -692,6 +692,7 @@
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public R timedTaskQuestionnaire(){
         Date nowDate = new Date();
         //查询所有开始时间已经超过当前时间的待发布状态调查问卷
@@ -715,4 +716,14 @@
         return R.ok();
     }
 
+    @Override
+    public R addQuestnaireView(Long questId){
+        ComActQuestnaireDO questnaireDO = questnaireDAO.selectById(questId);
+        if(questnaireDO != null){
+            questnaireDO.setViewNum(questnaireDO.getViewNum() + 1);
+            questnaireDAO.updateById(questnaireDO);
+        }
+        return R.ok();
+    }
+
 }

--
Gitblit v1.7.1