张天森
2023-02-06 ec73775202dfe49791b0b6e479c991c701b95ddd
#update 普达大屏
4个文件已修改
32 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenPudaApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComScreenDao.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComScreenMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenPudaApi.java
@@ -44,7 +44,7 @@
        return communityService.partyData();
    }
    @ApiOperation(value = "党建数据",response = CitizenInfoVO.class)
    @ApiOperation(value = "居民信息",response = CitizenInfoVO.class)
    @GetMapping("/peopleInfo")
    public R peopleInfo(){
        return communityService.peopleInfo();
@@ -62,7 +62,7 @@
        return communityService.basicData();
    }
    @ApiOperation(value = "基础数据",response = SpecialPeopleVO.class)
    @ApiOperation(value = "特殊数人群",response = SpecialPeopleVO.class)
    @GetMapping("/specialPeople")
    public R specialPeople(){
        return communityService.specialPeople();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComScreenDao.java
@@ -1,6 +1,7 @@
package com.panzhihua.service_community.dao;
import com.panzhihua.common.model.vos.DateVO;
import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo;
import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo;
import com.panzhihua.common.model.vos.puda.*;
import org.apache.ibatis.annotations.Mapper;
@@ -51,4 +52,7 @@
    PageBuildingListAdminVo peopleInfoAdmin(Long communityId);
    BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdmin(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -16,6 +16,7 @@
import com.panzhihua.common.model.vos.puda.DynamicVO;
import com.panzhihua.common.model.vos.puda.SpecialPeopleVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.service_community.service.ComActBuildingService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -60,7 +61,7 @@
    @Resource
    private ComScreenDao comScreenDao;
    @Resource
    private CommunityService communityService;
    private ComActBuildingService comActBuildingService;
    @Override
    public R statisticNeighborCircle(Long communityId) {
@@ -355,6 +356,7 @@
    @Override
    public R citizenInfo(Long communityId) {
        DateVO vo=new DateVO();
        vo.setCommunityId(communityId);
        //当前日期
        vo.setNow(DateUtil.now());
        //16年前
@@ -368,7 +370,7 @@
        //55年前
        vo.setOffset55(DateUtil.offsetMonth(DateUtil.date(), -660).toDateStr());
        CitizenInfoVO citizenInfoVO = comScreenDao.ageRange(vo);
        citizenInfoVO.setTotal(comScreenDao.peopleInfoAdmin(communityId).getPopulationNum());
        citizenInfoVO.setTotal(comScreenDao.buildingListHeaderStatisticsAdmin(communityId).getPopulationNum());
        citizenInfoVO.setMaleRate(NumberUtil.div(citizenInfoVO.getMaleNum(), citizenInfoVO.getTotal(), 2));
        citizenInfoVO.setFemaleRate(NumberUtil.div(citizenInfoVO.getFemaleNum(), citizenInfoVO.getTotal(), 2));
        //男性占比
@@ -394,9 +396,7 @@
    @Override
    public R basicData(Long communityId) {
        //PageBuildingListAdminVo pageBuildingListAdminVo = comScreenDao.peopleInfoAdmin(communityId);
        R r = communityService.buildingListHeaderStatisticsAdmin(communityId);
        BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdminVo = (BuildingListHeaderStatisticsAdminVo)r.getData();
        BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdminVo=comScreenDao.buildingListHeaderStatisticsAdmin(communityId);
        BasicDataVO vo=new BasicDataVO();
        vo.setPeople(buildingListHeaderStatisticsAdminVo.getPopulationNum());
        vo.setBuildings(buildingListHeaderStatisticsAdminVo.getBuildNum());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComScreenMapper.xml
@@ -34,7 +34,7 @@
        select
        (select count(community_id) from com_mng_village where community_id=#{communityId}) as count,
        (select count(community_id) from com_mng_village where community_id=#{communityId} and type=1) as cityYard,
        (select count(community_id) from com_mng_village where community_id=#{communityId} and type=2) as countryYard,
        (select count(community_id) from com_mng_village where community_id=#{communityId} and type=2) as countryYard
        from com_mng_village limit 1
    </select>
    <select id="basicData" resultType="com.panzhihua.common.model.vos.puda.BasicDataVO">
@@ -55,7 +55,7 @@
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset35} and #{vo.offset27}) AS count3,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset45} and #{vo.offset35}) AS count4,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset55} and #{vo.offset45}) AS count5,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday &lt; #{vo.offset55}) AS count6,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday &lt; #{vo.offset55}) AS count6
        FROM com_mng_population
        WHERE act_id=#{vo.communityId}
    </select>
@@ -67,6 +67,7 @@
    </select>
    <select id="peopleInfoAdmin"
            resultType="com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo">
        SELECT
        cmb.id,
        cmv.village_id,
        cmv.alley,
@@ -87,4 +88,13 @@
        </where>
        order by cmb.id desc
    </select>
    <select id="buildingListHeaderStatisticsAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo">
        SELECT count( id ) AS buildNum,( SELECT count( id ) FROM com_mng_population_house WHERE community_id = cmb.act_id ) AS houseNum,
        ( SELECT count( id ) FROM com_mng_population_community_tags WHERE community_id = cmb.act_id ) AS populationNum
        FROM
            com_mng_building AS cmb
        WHERE
            cmb.act_id = #{communityId}
    </select>
</mapper>