New file |
| | |
| | | package com.panzhihua.common.model.vos.community.bigscreen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("安全防控") |
| | | public class BigScreenStaticsReserve { |
| | | @ApiModelProperty("总数") |
| | | private Integer count; |
| | | @ApiModelProperty("防疫管控") |
| | | private Integer epidemicCount; |
| | | @ApiModelProperty("燃气登记") |
| | | private Integer gasCount; |
| | | @ApiModelProperty("防火登记") |
| | | private Integer fireCount; |
| | | @ApiModelProperty("返攀登记") |
| | | private Integer reserveCount; |
| | | @ApiModelProperty("居家隔离登记") |
| | | private Integer homeCount; |
| | | @ApiModelProperty("返攀登记百分比") |
| | | private Integer reservePercent; |
| | | @ApiModelProperty("居家隔离百分比") |
| | | private Integer homePercent; |
| | | @ApiModelProperty("燃气登记百分比") |
| | | private Integer gasPercent; |
| | | @ApiModelProperty("防火登记百分比") |
| | | private Integer firePercent; |
| | | @ApiModelProperty("折线图数据") |
| | | private List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonthList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.bigscreen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel("每月安全防空数据") |
| | | public class BigScreenStaticsReserveMonth { |
| | | @ApiModelProperty("x轴") |
| | | private String x; |
| | | @ApiModelProperty("燃气登记") |
| | | private Integer gasCount; |
| | | @ApiModelProperty("防火登记") |
| | | private Integer fireCount; |
| | | @ApiModelProperty("返攀登记") |
| | | private Integer reserveCount; |
| | | @ApiModelProperty("居家隔离登记") |
| | | private Integer homeCount; |
| | | @ApiModelProperty("总量") |
| | | private Integer count; |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/screen/getCommunityPassword") |
| | | R getCommunityPassword(@RequestParam("communityId") Long communityId); |
| | | |
| | | @GetMapping("/reserve/bigScreenStaticsReserve") |
| | | R bigScreenStaticsReserve(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserve; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | return communityService.detailDynamic(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "安全防控",response = BigScreenStaticsReserve.class) |
| | | @GetMapping("/reserve") |
| | | public R reserve(){ |
| | | return communityService.bigScreenStaticsReserve(this.getCommunityId()); |
| | | } |
| | | } |
| | |
| | | public R exportHomeQuarantine(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO) { |
| | | return comActReserveAnswerContentService.exportHomeQuarantine(detailedAdminDTO); |
| | | } |
| | | |
| | | @GetMapping("/bigScreenStaticsReserve") |
| | | public R bigScreenStaticsReserve(@RequestParam("communityId") Long communityId){ |
| | | return comActReserveAnswerContentService.bigScreenStaticsReserve(communityId); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.reserve.ComActReserveRegisterStatisticsDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeHandleAdminDTO; |
| | | 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.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | * @return |
| | | */ |
| | | List<ComOperationListVO> queryAll(OperationDetailDTO operationDetailDTO); |
| | | |
| | | /** |
| | | * 大屏数据统计 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | BigScreenStaticsReserve biggestScreen(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 大屏折线图 |
| | | * @param communityId |
| | | * @param date |
| | | * @return |
| | | */ |
| | | BigScreenStaticsReserveMonth biggestScreenMonth(@Param("communityId")Long communityId,@Param("date")String date); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R exportHomeQuarantine(PageReserveRegisterDetailedAdminDTO detailedAdminDTO); |
| | | |
| | | /** |
| | | * 大屏数据统计 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R bigScreenStaticsReserve(Long communityId); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ComActReserveSubMapper comActReserveSubMapper; |
| | | @Resource |
| | | private ComActReserveRecordMapper comActReserveRecordMapper; |
| | | |
| | | /** |
| | | * 导出登记明细数据 |
| | |
| | | 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() |
| | |
| | | }); |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <select id="biggestScreen" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserve"> |
| | | select (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id =#{communityId}) count, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id =#{communityId}) epidemicCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id =#{communityId}) gasCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id =#{communityId}) fireCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id =#{communityId}) homeCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id =#{communityId}) reserveCount |
| | | </select> |
| | | |
| | | <select id="biggestScreenMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserveMonth"> |
| | | select (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id =#{communityId} and t.reserve_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.reserve_time ) count, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id =#{communityId} and t.reserve_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.reserve_time) gasCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id =#{communityId} and t.reserve_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.reserve_time) fireCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id =#{communityId} and t.reserve_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.reserve_time) homeCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id =#{communityId} and t.reserve_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.reserve_time) reserveCount |
| | | </select> |
| | | </mapper> |