From 814b7dfb73f8ae763023a4fd2835bbead8c66a93 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期五, 17 九月 2021 17:53:06 +0800
Subject: [PATCH] 一键报警,物业平台相关功能修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java |   67 +++++++++++++++++++++++++++++----
 1 files changed, 58 insertions(+), 9 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 bf9c17c..cd2acfe 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
@@ -1,11 +1,18 @@
 package com.panzhihua.service_community.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.panzhihua.common.model.dtos.community.QuestnaireAnswersDTO;
+import com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO;
 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.service_community.dao.ComActReserveAnswerContentMapper;
 import com.panzhihua.service_community.dao.ComActReserveSubMapper;
 import com.panzhihua.service_community.model.dos.ComActQuestnaireAnswerContentDO;
@@ -19,8 +26,7 @@
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 
 /**
  * @auther lyq
@@ -34,6 +40,11 @@
     @Resource
     private ComActReserveSubMapper comActReserveSubMapper;
 
+    /**
+     * 导出登记明细数据
+     * @param reserveId 登记id
+     * @return  登记明细数据
+     */
     @Override
     public R exportRegisterAdmin(Long reserveId){
         QuestnaireAnswersDTO result = new QuestnaireAnswersDTO();
@@ -49,14 +60,52 @@
         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);
     }
+
+    /**
+     * 分页查询登记明细列表
+     * @param detailedAdminDTO  请求参数
+     * @return  登记明细列表
+     */
+    @Override
+    public R registerDetailedListAdmin(PageReserveRegisterDetailedAdminDTO detailedAdminDTO){
+        IPage<HashMap<String,Object>> resultPage = new Page<>();
+
+        IPage<ComActReserveRegisterDetailedVO> registerDetailedPage = this.baseMapper.pageRegisterDetailedListAdmin(new Page(detailedAdminDTO.getPageNum(),detailedAdminDTO.getPageSize()),detailedAdminDTO);
+        resultPage.setCurrent(registerDetailedPage.getCurrent());
+        resultPage.setTotal(registerDetailedPage.getTotal());
+        resultPage.setSize(registerDetailedPage.getSize());
+        resultPage.setPages(registerDetailedPage.getPages());
+
+        List<HashMap<String,Object>> resultMapList = new ArrayList<>();
+        Integer nub = 1;
+        if(!registerDetailedPage.getRecords().isEmpty()){
+            for (ComActReserveRegisterDetailedVO registerDetailed:registerDetailedPage.getRecords()) {
+                //渲染序号
+                HashMap<String,Object> map = new HashMap<>();
+                map.put("nub",nub);
+                //渲染用户昵称
+                map.put("nickName",registerDetailed.getNickName());
+                //查询记录填写答案并装载到数据集中
+                List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId());
+                if(!registerDetailedAnswerList.isEmpty()){
+                    for (ComActReserveRegisterDetailedAnswerVO detailed:registerDetailedAnswerList) {
+                        map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent());
+                    }
+                }
+                //渲染登记流水号
+                map.put("id",registerDetailed.getId());
+                //渲染登记时间
+                map.put("time", DateUtils.format(registerDetailed.getCreateAt(),DateUtils.ymdhms_format));
+                resultMapList.add(map);
+                nub++;
+            }
+        }
+        resultPage.setRecords(resultMapList);
+        return R.ok(resultPage);
+    }
 }

--
Gitblit v1.7.1