101captain
2021-12-21 59f3164c1135131f511ba78a329b2fae8d6a5f95
12/21  大屏临时修改
7个文件已修改
2个文件已添加
160 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserve.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserveMonth.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenWorkApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActReserveApi.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveRecordMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActReserveAnswerContentService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserve.java
New file
@@ -0,0 +1,37 @@
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;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserveMonth.java
New file
@@ -0,0 +1,25 @@
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;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7446,4 +7446,7 @@
     */
    @GetMapping("/screen/getCommunityPassword")
    R getCommunityPassword(@RequestParam("communityId") Long communityId);
    @GetMapping("/reserve/bigScreenStaticsReserve")
    R bigScreenStaticsReserve(@RequestParam("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenWorkApi.java
@@ -2,6 +2,7 @@
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;
@@ -284,4 +285,9 @@
        return communityService.detailDynamic(id);
    }
    @ApiOperation(value = "安全防控",response = BigScreenStaticsReserve.class)
    @GetMapping("/reserve")
    public R reserve(){
        return communityService.bigScreenStaticsReserve(this.getCommunityId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActReserveApi.java
@@ -348,4 +348,9 @@
    public R exportHomeQuarantine(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO) {
        return comActReserveAnswerContentService.exportHomeQuarantine(detailedAdminDTO);
    }
    @GetMapping("/bigScreenStaticsReserve")
    public R bigScreenStaticsReserve(@RequestParam("communityId") Long communityId){
        return comActReserveAnswerContentService.bigScreenStaticsReserve(communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveRecordMapper.java
@@ -7,6 +7,8 @@
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;
@@ -105,4 +107,19 @@
     * @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);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActReserveAnswerContentService.java
@@ -39,4 +39,11 @@
     * @return
     */
    R exportHomeQuarantine(PageReserveRegisterDetailedAdminDTO detailedAdminDTO);
    /**
     * 大屏数据统计
     * @param communityId
     * @return
     */
    R bigScreenStaticsReserve(Long communityId);
}
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;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml
@@ -318,4 +318,21 @@
        </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>