From a469e6f48a0312cb6c5a183a89fb79b9807ef13d Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期一, 06 九月 2021 18:20:17 +0800
Subject: [PATCH] 办事指南分页查询按时间降序排列

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

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java
index 4c85791..d8c7e9d 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java
@@ -9,9 +9,11 @@
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO;
 import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO;
+import com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO;
 import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedAnswerVO;
 import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO;
 import com.panzhihua.common.utlis.DateUtils;
+import com.panzhihua.common.utlis.StringUtils;
 import com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper;
 import com.panzhihua.service_community.dao.ComActReserveSubMapper;
 import com.panzhihua.service_community.model.dos.ComActQuestnaireAnswerContentDO;
@@ -52,21 +54,18 @@
         List<ComActReserveSubDO> list = comActReserveSubMapper.selectList(new QueryWrapper<ComActReserveSubDO>().lambda().eq(ComActReserveSubDO::getReserveId, reserveId));
         List<ComActQuestnaireSubVO> listSubVo = new ArrayList<>();
         list.forEach(subDo -> {
-            ComActQuestnaireSubVO comActQuestnaireSubVO = new ComActQuestnaireSubVO();
-            BeanUtils.copyProperties(subDo, comActQuestnaireSubVO);
-            listSubVo.add(comActQuestnaireSubVO);
+            if(!subDo.getType().equals(5)){
+                ComActQuestnaireSubVO comActQuestnaireSubVO = new ComActQuestnaireSubVO();
+                BeanUtils.copyProperties(subDo, comActQuestnaireSubVO);
+                listSubVo.add(comActQuestnaireSubVO);
+            }
         });
         result.setSubs(listSubVo);
 
         //查询用户回答
-        List<ComActReserveAnswerContentDO> questnaireAnswerContentDOList = this.baseMapper.selectListByReserve(reserveId);
-        List<ComActQuestnaireAnswerContentVO> vos = new ArrayList<>();
-        questnaireAnswerContentDOList.forEach(dos -> {
-            ComActQuestnaireAnswerContentVO vo = new ComActQuestnaireAnswerContentVO();
-            BeanUtils.copyProperties(dos, vo);
-            vos.add(vo);
-        });
+        List<ComActQuestnaireAnswerContentVO> vos = this.baseMapper.selectListByReserve(reserveId);
         result.setAnswers(vos);
+
         return R.ok(result);
     }
 
@@ -98,7 +97,20 @@
                 List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId());
                 if(!registerDetailedAnswerList.isEmpty()){
                     for (ComActReserveRegisterDetailedAnswerVO detailed:registerDetailedAnswerList) {
-                        map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent());
+                        if(!detailed.getType().equals(5)){
+                            if(detailed.getType().equals(1)){
+                                String key = detailed.getReserveSubId() + "";
+                                String value = map.get(key).toString();
+                                if(StringUtils.isNotEmpty(value)){
+                                    value = value + "," + detailed.getAnswerContent();
+                                }else{
+                                    value = detailed.getAnswerContent();
+                                }
+                                map.put(key,value);
+                            }else{
+                                map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent());
+                            }
+                        }
                     }
                 }
                 //渲染登记流水号

--
Gitblit v1.7.1