From edbbe803b5c270a1acffbc7946bdda0d5e420dc5 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 07 七月 2021 10:27:29 +0800
Subject: [PATCH] 修改bug

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

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
index 60f648e..4a64407 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
@@ -347,6 +347,10 @@
                         ComActDiscussOptionVO comActDiscussOptionVO=new ComActDiscussOptionVO();
                         BeanUtils.copyProperties(comActDiscussOptionDO,comActDiscussOptionVO);
                         comActDiscussOptionVO.setNum(selectCount);
+
+                        //判断选项是否已投票
+                        int haveVote=comActDiscussOptionUserDAO.selectHaveVotes(comActDiscussOptionDO.getId(),loginUserId);
+                        comActDiscussOptionVO.setHaveVote(haveVote>0?1:0);
                         comActDiscussOptionVOS.add(comActDiscussOptionVO);
                     });
                     comActDiscussOptionVOS.sort(Comparator.comparing(ComActDiscussOptionVO::getNum).reversed());
@@ -482,6 +486,9 @@
                 ComActDiscussOptionVO comActDiscussOptionVO=new ComActDiscussOptionVO();
                 BeanUtils.copyProperties(comActDiscussOptionDO,comActDiscussOptionVO);
                 comActDiscussOptionVO.setNum(selectCount);
+                //判断选项是否已投票
+                int haveVote=comActDiscussOptionUserDAO.selectHaveVotes(comActDiscussOptionDO.getId(),loginUserId);
+                comActDiscussOptionVO.setHaveVote(haveVote>0?1:0);
                 comActDiscussOptionVOS.add(comActDiscussOptionVO);
             });
             comActDiscussOptionVOS.sort(Comparator.comparing(ComActDiscussOptionVO::getNum).reversed());

--
Gitblit v1.7.1