From 68a3e4c053d15961ede69fe7698f63fe827624c3 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期一, 13 九月 2021 16:08:44 +0800
Subject: [PATCH] Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into auth

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActQuestnaireServiceImpl.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 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 7c75673..82a38eb 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
@@ -151,6 +151,7 @@
                         subSelectionDO.setCreateBy(userId);
                         subSelectionDO.setType(subSelect.getType());
                         subSelectionDO.setKey(subSelect.getKey());
+                        subSelectionDO.setKey(subSelect.getUrl());
                         subSelectionList.add(subSelectionDO);
                     }
                 }
@@ -191,6 +192,9 @@
                 }
                 if (vo.getAdverPositionApplication().equals(ComActQuestnaireDO.isOk.yes)) {
                     sb.append("首页应用,");
+                }
+                if (vo.getIsCover().equals(ComActQuestnaireDO.isOk.yes)) {
+                    sb.append("设置封面,");
                 }
                 String advertPosition = sb.toString();
                 if (advertPosition.length() > 0) {
@@ -485,15 +489,9 @@
         /**
          * 查询用户回答
          */
-        List<ComActQuestnaireAnswerContentDO> questnaireAnswerContentDOList =
+        List<ComActQuestnaireAnswerContentVO> questnaireAnswerContentDOList =
             questnaireAnswerContentDAO.selectListByQuestnaire(questId);
-        List<ComActQuestnaireAnswerContentVO> vos = new ArrayList<>();
-        questnaireAnswerContentDOList.forEach(dos -> {
-            ComActQuestnaireAnswerContentVO vo = new ComActQuestnaireAnswerContentVO();
-            BeanUtils.copyProperties(dos, vo);
-            vos.add(vo);
-        });
-        questnaireAnswersDTO.setAnswers(vos);
+        questnaireAnswersDTO.setAnswers(questnaireAnswerContentDOList);
 
         return R.ok(questnaireAnswersDTO);
     }
@@ -509,10 +507,10 @@
     @Override
     public R pageQuestnaireAnswer(PageQuestnaireAnswerDTO pageQuestnaireAnswerDTO) {
         if (pageQuestnaireAnswerDTO.getPageNum() == null || pageQuestnaireAnswerDTO.getPageNum().longValue() == 0) {
-            pageQuestnaireAnswerDTO.setPageNum(1l);
+            pageQuestnaireAnswerDTO.setPageNum(1L);
         }
         if (pageQuestnaireAnswerDTO.getPageSize() == null || pageQuestnaireAnswerDTO.getPageSize().longValue() == 0) {
-            pageQuestnaireAnswerDTO.setPageSize(10l);
+            pageQuestnaireAnswerDTO.setPageSize(10L);
         }
         Page userPage = new Page(pageQuestnaireAnswerDTO.getPageNum(), pageQuestnaireAnswerDTO.getPageSize());
         IPage<ComActQuestnaireAnswerContentVO> doPager =
@@ -583,8 +581,7 @@
 
                 Long queSubId = questnaireSubDO.getId();
                 // 根据上传的类型查询不同的题目选项
-                if (questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan)) {
-
+                if (questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan) || questnaiteSub.getType().equals(QuestnaiteSubVO.type.imgselect)) {
                     // 单选题处理
                     ComActQuestnaireSubSelectionDO subSelectionDO =
                         questnaireSubSelectionDAO.selectOne(new QueryWrapper<ComActQuestnaireSubSelectionDO>().lambda()
@@ -648,8 +645,6 @@
         }
         // 新增用户填写的答卷
         if (!answerContentList.isEmpty()) {
-            answerContentService.saveBatch(answerContentList);
-
             // 更新回答用户数量
             Integer joinCount = questnaireDO.getJoinCount();
             questnaireDO.setJoinCount(joinCount != null ? joinCount + 1 : 1);
@@ -663,6 +658,11 @@
             userAnswerDO.setJsonObject(answerQuestnaireVO.getJsonObject());
             comActQuestnaireUserAnswerMapper.insert(userAnswerDO);
 
+            answerContentList.forEach(answerContent -> {
+                answerContent.setAnswerId(userAnswerDO.getId());
+            });
+            answerContentService.saveBatch(answerContentList);
+
         }
         return R.ok();
     }

--
Gitblit v1.7.1