From 59f3164c1135131f511ba78a329b2fae8d6a5f95 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期二, 21 十二月 2021 16:45:28 +0800 Subject: [PATCH] 12/21 大屏临时修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 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..caffa75 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,7 +9,10 @@ import javax.annotation.Resource; import javax.xml.bind.DatatypeConverter; +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.service_community.dao.ComActReserveRecordMapper; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -46,6 +49,8 @@ @Resource private ComActReserveSubMapper comActReserveSubMapper; + @Resource + private ComActReserveRecordMapper comActReserveRecordMapper; /** * 导出登记明细数据 @@ -277,6 +282,26 @@ return R.ok(exportVO); } + @Override + public R bigScreenStaticsReserve(Long communityId) { + BigScreenStaticsReserve bigScreenStaticsReserve=comActReserveRecordMapper.biggestScreen(communityId); + bigScreenStaticsReserve.setReservePercent(bigScreenStaticsReserve.getReserveCount()*100/ bigScreenStaticsReserve.getCount()); + bigScreenStaticsReserve.setFirePercent(bigScreenStaticsReserve.getFireCount()*100/ bigScreenStaticsReserve.getCount()); + bigScreenStaticsReserve.setHomePercent(bigScreenStaticsReserve.getHomeCount()*100/ bigScreenStaticsReserve.getCount()); + bigScreenStaticsReserve.setGasPercent(bigScreenStaticsReserve.getGasCount()*100/ bigScreenStaticsReserve.getCount()); + List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonthList=this.getPoints(); + bigScreenStaticsReserveMonthList.forEach(bigScreenStaticsReserveMonth -> { + BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX()); + 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 +316,22 @@ }); return listSubVo; } + + public List<BigScreenStaticsReserveMonth> getPoints(){ + List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonths=new ArrayList<>(); + for(int i=1;i<=12;i++){ + String aDate=""; + if(i<10){ + aDate = "0"+i; + } + else { + aDate=i+""; + } + BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth(); + bigScreenStaticsReserveMonth.setX(aDate); + bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth); + } + return bigScreenStaticsReserveMonths; + } + } -- Gitblit v1.7.1