From b827b2710c1f9ac64fe8879f08e1008a8647966a Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期四, 07 七月 2022 13:42:12 +0800
Subject: [PATCH] 大屏数据调整
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 1 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 15eb630..ffb9ec1 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,15 +1,21 @@
package com.panzhihua.service_community.service.impl;
+import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import javax.xml.bind.DatatypeConverter;
-import com.panzhihua.common.model.vos.community.reserve.HomeQuarantineRegisterExportVO;
+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.*;
+import com.panzhihua.service_community.dao.ComActReserveMapper;
+import com.panzhihua.service_community.dao.ComActReserveRecordMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -46,6 +52,10 @@
@Resource
private ComActReserveSubMapper comActReserveSubMapper;
+ @Resource
+ private ComActReserveRecordMapper comActReserveRecordMapper;
+ @Resource
+ private ComActReserveMapper comActReserveMapper;
/**
* 导出登记明细数据
@@ -118,6 +128,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();
}
/**
@@ -277,6 +315,26 @@
return R.ok(exportVO);
}
+ @Override
+ public R bigScreenStaticsReserve(Long communityId) {
+ BigScreenStaticsReserve bigScreenStaticsReserve=comActReserveRecordMapper.biggestScreen(communityId);
+ bigScreenStaticsReserve.setReservePercent(BigDecimal.valueOf(bigScreenStaticsReserve.getReserveCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP));
+ bigScreenStaticsReserve.setFirePercent(BigDecimal.valueOf(bigScreenStaticsReserve.getFireCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP));
+ bigScreenStaticsReserve.setHomePercent(BigDecimal.valueOf(bigScreenStaticsReserve.getHomeCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP));
+ 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.getYear());
+ bigScreenStaticsReserveMonth.setCount(bigScreenStaticsReserveMonth1.getCount());
+ bigScreenStaticsReserveMonth.setReserveCount(bigScreenStaticsReserveMonth1.getReserveCount());
+ bigScreenStaticsReserveMonth.setFireCount(bigScreenStaticsReserveMonth1.getFireCount());
+ bigScreenStaticsReserveMonth.setGasCount(bigScreenStaticsReserveMonth1.getGasCount());
+ bigScreenStaticsReserveMonth.setHomeCount(bigScreenStaticsReserveMonth1.getHomeCount());
+ });
+ bigScreenStaticsReserve.setBigScreenStaticsReserveMonthList(bigScreenStaticsReserveMonthList);
+ return R.ok(bigScreenStaticsReserve);
+ }
+
private List<ComActQuestnaireSubVO> retrieveQuestnaireSub(PageReserveRegisterDetailedAdminDTO detailedAdminDTO) {
//查询题目
List<ComActReserveSubDO> list = comActReserveSubMapper.selectList(new QueryWrapper<ComActReserveSubDO>().lambda()
@@ -291,4 +349,46 @@
});
return listSubVo;
}
+
+ public List<BigScreenStaticsReserveMonth> getPoints(){
+ List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonths=new ArrayList<>();
+ String nowMonth=DateUtils.getDateFormatString(new Date(),"MM");
+ String nowYear=DateUtils.getDateFormatString(new Date(),"yyyy");
+ String nowYearMonth=DateUtils.getDateFormatString(new Date(),"yyyyMM");
+ if(Integer.parseInt(nowYearMonth)<202212){
+ for(int i=9;i<=12;i++){
+ String aDate="";
+ if(i<10){
+ aDate = "0"+i;
+ }
+ else {
+ aDate=i+"";
+ }
+ BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
+ bigScreenStaticsReserveMonth.setYear("2021");
+ bigScreenStaticsReserveMonth.setX(aDate);
+ bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
+ }
+ }
+ if(Integer.parseInt(nowYear)>2021){
+ for(int i=1;i<=Integer.parseInt(nowMonth);i++){
+ if(bigScreenStaticsReserveMonths.size()>=12){
+ bigScreenStaticsReserveMonths.remove(0);
+ }
+ String aDate="";
+ if(i<10){
+ aDate = "0"+i;
+ }
+ else {
+ aDate=i+"";
+ }
+ BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
+ bigScreenStaticsReserveMonth.setX(aDate);
+ bigScreenStaticsReserveMonth.setYear(nowYear);
+ bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
+ }
+ }
+ return bigScreenStaticsReserveMonths;
+ }
+
}
--
Gitblit v1.7.1