From 43f0578e80af82ecae6c61b51bd0539c6b960603 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期二, 16 八月 2022 19:08:32 +0800
Subject: [PATCH] 服务范围优化

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 2 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 6c37a89..1ba4fac 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
@@ -13,7 +13,8 @@
 
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserve;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserveMonth;
-import com.panzhihua.common.model.vos.community.reserve.HomeQuarantineRegisterExportVO;
+import com.panzhihua.common.model.vos.community.reserve.*;
+import com.panzhihua.service_community.dao.ComActReserveMapper;
 import com.panzhihua.service_community.dao.ComActReserveRecordMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
@@ -53,6 +54,8 @@
     private ComActReserveSubMapper comActReserveSubMapper;
     @Resource
     private ComActReserveRecordMapper comActReserveRecordMapper;
+    @Resource
+    private ComActReserveMapper comActReserveMapper;
 
     /**
      * 导出登记明细数据
@@ -66,6 +69,11 @@
 
         //查询用户回答
         List<ComActQuestnaireAnswerContentVO> vos = this.baseMapper.export(pageReserveRegisterDetailedAdminDTO);
+        vos.forEach(vo->{
+            if(vo.getType()==4){
+                vo.setAnswerContent(vo.getAnswerContent().replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*"));
+            }
+        });
         result.setAnswers(vos);
 
         return R.ok(result);
@@ -101,6 +109,9 @@
                 List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId());
                 if(!registerDetailedAnswerList.isEmpty()){
                     for (ComActReserveRegisterDetailedAnswerVO detailed:registerDetailedAnswerList) {
+                        if(detailed.getType()==4){
+                            detailed.setAnswerContent(detailed.getAnswerContent().replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*"));
+                        }
                         if(!detailed.getType().equals(5)){
                             if(detailed.getType().equals(1)){
                                 String key = detailed.getReserveSubId() + "";
@@ -115,6 +126,7 @@
                                 map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent());
                             }
                         }
+
                     }
                 }
                 //渲染登记流水号
@@ -125,6 +137,34 @@
         }
         resultPage.setRecords(resultMapList);
         return R.ok(resultPage);
+    }
+
+    @Override
+    public R registerDetailedListAdminExport(PageReserveRegisterDetailedAdminDTO detailedAdminDTO) {
+        String communityPhone=comActReserveMapper.selectCommunityPhoneByReserveId(detailedAdminDTO.getReserveId());
+        List<ComActReserveRegisterDetailedVO> comActReserveRegisterDetailedVOS = this.baseMapper.pageRegisterDetailedListAdminExport(detailedAdminDTO);
+        if(!comActReserveRegisterDetailedVOS.isEmpty()){
+            List<ReservePdfExportVO> reservePdfExportVOS=new ArrayList<>();
+            comActReserveRegisterDetailedVOS.forEach(comActReserveRegisterDetailedVO -> {
+                List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(comActReserveRegisterDetailedVO.getId());
+                if(!registerDetailedAnswerList.isEmpty()){
+                    ReservePdfExportVO reservePdfExportVO=new ReservePdfExportVO();
+                    reservePdfExportVO.setAddress(registerDetailedAnswerList.get(0).getAnswerContent());
+                    reservePdfExportVO.setSign(registerDetailedAnswerList.get(1).getAnswerContent());
+                    if(detailedAdminDTO.getPdfType()==1){
+                        reservePdfExportVO.setTime(registerDetailedAnswerList.get(2).getAnswerContent());
+                    }
+                    if(detailedAdminDTO.getPdfType()==2){
+                        reservePdfExportVO.setPhone(registerDetailedAnswerList.get(2).getAnswerContent());
+                        reservePdfExportVO.setTime(registerDetailedAnswerList.get(3).getAnswerContent());
+                        reservePdfExportVO.setCommunityPhone(communityPhone);
+                    }
+                    reservePdfExportVOS.add(reservePdfExportVO);
+                }
+            });
+            return R.ok(reservePdfExportVOS);
+        }
+        return R.ok();
     }
 
     /**
@@ -293,7 +333,7 @@
         bigScreenStaticsReserve.setGasPercent(BigDecimal.valueOf(bigScreenStaticsReserve.getGasCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP));
         List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonthList=this.getPoints();
         bigScreenStaticsReserveMonthList.forEach(bigScreenStaticsReserveMonth -> {
-            BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX());
+            BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX(), bigScreenStaticsReserveMonth.getYear());
             bigScreenStaticsReserveMonth.setCount(bigScreenStaticsReserveMonth1.getCount());
             bigScreenStaticsReserveMonth.setReserveCount(bigScreenStaticsReserveMonth1.getReserveCount());
             bigScreenStaticsReserveMonth.setFireCount(bigScreenStaticsReserveMonth1.getFireCount());
@@ -334,6 +374,7 @@
                     aDate=i+"";
                 }
                 BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
+                bigScreenStaticsReserveMonth.setYear("2021");
                 bigScreenStaticsReserveMonth.setX(aDate);
                 bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
             }
@@ -352,6 +393,7 @@
                 }
                 BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
                 bigScreenStaticsReserveMonth.setX(aDate);
+                bigScreenStaticsReserveMonth.setYear(nowYear);
                 bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
             }
         }

--
Gitblit v1.7.1