springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BaseInfo.java
New file @@ -0,0 +1,28 @@ 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 BaseInfo { @ApiModelProperty("人口数") private Integer population; @ApiModelProperty("注册用户量") private Integer user; @ApiModelProperty("入住小区") private Integer village; @ApiModelProperty("实有房屋") private Integer house; @ApiModelProperty("实有单位") private Integer company; @ApiModelProperty("党员数") private Integer partyMember; @ApiModelProperty("志愿者") private Integer volunteer; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexBackReserve.java
New file @@ -0,0 +1,19 @@ 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 IndexBackReserve { @ApiModelProperty("总数") private Integer count; @ApiModelProperty("标题数量") private List<IndexReserveSub> indexReserveSubList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexDynamic.java
New file @@ -0,0 +1,31 @@ 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 IndexDynamic { @ApiModelProperty("微心愿") private Integer microWish; @ApiModelProperty("随手拍") private Integer easyPhoto; @ApiModelProperty("居民活动") private Integer residentActivity=0; @ApiModelProperty("志愿服务") private Integer volunteerActivity=0; @ApiModelProperty("党员活动") private Integer partyActivity; @ApiModelProperty("社区问卷") private Integer questionnaire; @ApiModelProperty("社区动态") private Integer dynamic; @ApiModelProperty("邻里圈") private Integer neighbor; @ApiModelProperty("便民商家") private Integer convenient; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexHomeQuarantine.java
New file @@ -0,0 +1,19 @@ 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 IndexHomeQuarantine { @ApiModelProperty("总数") private Integer count; @ApiModelProperty("标题数量") private List<IndexReserveSub> indexReserveSubList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexInfo.java
New file @@ -0,0 +1,30 @@ package com.panzhihua.common.model.vos.community.bigscreen; import com.panzhihua.common.model.vos.community.screen.index.IndexEventGridStatisticsVO; import com.panzhihua.common.model.vos.community.screen.index.IndexPopulationStatisticsVO; import com.panzhihua.common.model.vos.community.screen.index.IndexSpecialStatisticsVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; /** * @author zzj */ @Data @ApiModel("大屏首页返回数据") public class IndexInfo { @ApiModelProperty("基础数据") private BaseInfo baseInfo; @ApiModelProperty("实有人口数据") private IndexPopulationStatisticsVO indexPopulationStatisticsVO; @ApiModelProperty("特殊人群统计模块数据") private List<IndexSpecialStatisticsVO> specialStatisticsVOList; @ApiModelProperty("网格化治理模块数据") private IndexEventGridStatisticsVO eventGridStatisticsVO; @ApiModelProperty("返攀登记居家隔离数据统计") private IndexReserve indexReserve; @ApiModelProperty("业务统计") private IndexDynamic indexDynamic; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexReserve.java
New file @@ -0,0 +1,17 @@ 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 IndexReserve { @ApiModelProperty("返攀登记数据") private IndexBackReserve indexBackReserve; @ApiModelProperty("居家隔离数据") private IndexHomeQuarantine indexHomeQuarantine; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/IndexReserveSub.java
New file @@ -0,0 +1,17 @@ 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 IndexReserveSub { @ApiModelProperty("标题") private String sub; @ApiModelProperty("数量") private Integer num; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -79,4 +79,12 @@ return R.ok(comMngPopulationService.getScreenEventDetail(eventDetailDTO)); } /** * 新版大屏首页接口 */ @GetMapping("/indexInfo") public R indexInfo(@RequestParam("communityId") Long communityId){ return R.ok(comMngPopulationService.indexInfo(communityId)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -7,6 +7,8 @@ import com.panzhihua.common.model.dtos.community.CascadeHouseDTO; import com.panzhihua.common.model.dtos.property.CommonPage; import com.panzhihua.common.model.vos.community.*; import com.panzhihua.common.model.vos.community.bigscreen.BaseInfo; import com.panzhihua.common.model.vos.community.bigscreen.IndexDynamic; import com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; @@ -615,4 +617,18 @@ * @param newUnitNo 新单元号 */ void updatePopulationUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo); /** * 基础数据统计 * @param communityId * @return */ BaseInfo baseInfo(Long communityId); /** * 业务数据统计 * @param communityId * @return */ IndexDynamic indexDynamic(Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActReserveService.java
@@ -6,6 +6,7 @@ import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; import com.panzhihua.common.model.vos.community.bigscreen.IndexReserve; import com.panzhihua.service_community.model.dos.ComActReserveDO; /** @@ -119,4 +120,11 @@ */ R reserveListApplets(Long communityId); /** * 返攀登记居家隔离大屏数据 * @param communityId * @return */ IndexReserve indexReserve(Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -521,4 +521,11 @@ * @return */ R specialInputUserExport(PageInputUserDTO PageInputUserDTO); /** * 新版大屏首页 * @param communityId * @return */ R indexInfo(Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveServiceImpl.java
@@ -14,6 +14,8 @@ import com.panzhihua.common.model.dtos.community.reserve.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; import com.panzhihua.common.model.vos.community.bigscreen.IndexBackReserve; import com.panzhihua.common.model.vos.community.bigscreen.IndexReserve; import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubSelectionVO; import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubVO; import com.panzhihua.common.model.vos.community.reserve.*; @@ -762,6 +764,18 @@ return R.ok(this.baseMapper.getReserveIndexList(communityId)); } @Override public IndexReserve indexReserve(Long communityId) { List<ComActReserveDO> comActReserveDOS=this.comActReserveMapper.selectList(new QueryWrapper<ComActReserveDO>().lambda().eq(ComActReserveDO::getCommunityId,communityId).orderByDesc(ComActReserveDO::getCreateAt).like(ComActReserveDO::getTitle,"返攀登记").eq(ComActReserveDO::getStatus,ComActReserveDO.status.jxz)); if(!comActReserveDOS.isEmpty()){ IndexBackReserve indexBackReserve=new IndexBackReserve(); indexBackReserve.setCount(this.comActReserveRecordMapper.selectCount(new QueryWrapper<ComActReserveRecordDO>().lambda().eq(ComActReserveRecordDO::getReserveId,comActReserveDOS.get(0).getId()))); } return null; } public static void getFileByBytes(byte[] bytes, String filePath, String fileName) { BufferedOutputStream bos = null; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; import com.panzhihua.common.model.vos.community.bigscreen.*; import com.panzhihua.common.utlis.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; @@ -40,7 +41,6 @@ import com.panzhihua.common.model.helper.AESUtil; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.*; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; @@ -7699,6 +7699,109 @@ return R.ok(this.comMngPopulationDAO.specialInputUserExport(pageInputUserDTO)); } @Override public R indexInfo(Long communityId) { IndexInfo indexInfo=new IndexInfo(); //基础数据 BaseInfo baseInfo=this.comMngPopulationDAO.baseInfo(communityId); indexInfo.setBaseInfo(baseInfo); // 查询实有人口统计模块 IndexPopulationStatisticsVO populationStatisticsVO = new IndexPopulationStatisticsVO(); // 查询实有人口性别统计 List<IndexPopulationSexStatisticsVO> sexPopulationList = comMngPopulationDAO.getScreenIndexByPopulationSex(communityId); populationStatisticsVO.setSexPopulationList(sexPopulationList); // 查询实有人口年龄统计 List<IndexPopulationAgeStatisticsVO> agePopulationList = statisticsAge(communityId); populationStatisticsVO.setAgePopulationList(agePopulationList); indexInfo.setIndexPopulationStatisticsVO(populationStatisticsVO); // 查询特殊人群统计 List<IndexSpecialStatisticsVO> specialStatisticsVOList = new ArrayList<>(); // 查询特殊人群标签列表 List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId); IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO(); otherSpecialVO.setTitle("其他"); otherSpecialVO.setSum(0); if (!userTagList.isEmpty()) { userTagList.forEach(userTag -> { if (userTag != null) { if (userTag.getSysFlag().equals(0)) { Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); } else { if (StringUtils.isNotEmpty(userTag.getTagName())) { if (userTag.getTagName().equals("特扶家庭")) { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(22); specialStatisticsVOList.add(specialStatisticsVO); } else if (userTag.getTagName().equals("低保户")) { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(94); specialStatisticsVOList.add(specialStatisticsVO); } else if (userTag.getTagName().equals("低收入人群")) { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(2); specialStatisticsVOList.add(specialStatisticsVO); } else if (userTag.getTagName().equals("退役军人")) { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(264); specialStatisticsVOList.add(specialStatisticsVO); } else if (userTag.getTagName().equals("高龄老人")) { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId)); specialStatisticsVOList.add(specialStatisticsVO); } else { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } } } } }); } specialStatisticsVOList.add(otherSpecialVO); indexInfo.setSpecialStatisticsVOList(specialStatisticsVOList); // 查询网格化治理 IndexEventGridStatisticsVO eventGridStatisticsVO = new IndexEventGridStatisticsVO(); List<IndexGridStatisticsVO> gridStatisticsList = new ArrayList<>(); // 查询网格化事件数据 IndexGridEventStatisticsVO gridEventStatistics = comMngPopulationDAO.getGridEventStatisticsList(communityId); eventGridStatisticsVO.setGridEventStatisticsList(gridEventStatistics); // 查询网格数据 List<EventGridDataVO> gridDataList = comMngPopulationDAO.getGridDataListByCommunityId(communityId); if (!gridDataList.isEmpty()) { gridDataList.forEach(gridData -> { if (gridData != null) { IndexGridStatisticsVO gridStatisticsVO = new IndexGridStatisticsVO(); gridStatisticsVO.setEventData(gridData.getGridName()); // 根据网格id查询网格事件列表 IndexGridEventStatisticsVO gridEventList = comMngPopulationDAO.getGridEventByGirdId(gridData.getId()); gridStatisticsVO.setGridEventStatisticsList(gridEventList); gridStatisticsList.add(gridStatisticsVO); } }); } eventGridStatisticsVO.setGridStatisticsList(gridStatisticsList); indexInfo.setEventGridStatisticsVO(eventGridStatisticsVO); //首页业务统计 IndexDynamic indexDynamic=this.populationDAO.indexDynamic(communityId); indexInfo.setIndexDynamic(indexDynamic); //返攀登记居家隔离数据统计 IndexReserve indexReserve=new IndexReserve(); return null; } private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo) { mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml
@@ -637,4 +637,28 @@ <update id="updatePopulationUnit"> update com_mng_population set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo} </update> <select id="baseInfo" resultType="com.panzhihua.common.model.vos.community.bigscreen.BaseInfo"> select count(id) as population, IFNULL((select count(id) from com_mng_population_house where community_id = cmpct.community_id),0) as house, IFNULL((select count(id) from com_mng_real_company where community_id = cmpct.community_id),0) as company, IFNULL((select count(DISTINCT `name`) from com_mng_village where community_id = cmpct.community_id),0) as village, IFNULL((select count(user_id) from sys_user where community_id = cmpct.community_id and type=1),0) as user, IFNULL((select count(id) from com_pb_member where community_id = cmpct.community_id ),0) as partyMember, IFNULL((select count(user_id) from sys_user where community_id = cmpct.community_id and is_volunteer=1 and type=1),0) as volunteer from com_mng_population_community_tags AS cmpct where cmpct.community_id = #{communityId} </select> <select id="indexDynamic" resultType="com.panzhihua.common.model.vos.community.bigscreen.IndexDynamic"> SELECT count( id ) AS microWish, IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE status = 4 AND community_id = camw.community_id ),0) AS easyPhoto, IFNULL(( SELECT count( id ) FROM com_pb_activity WHERE STATUS = 5 AND community_id = camw.community_id ),0) AS partyActivity, IFNULL(( SELECT count( id ) FROM com_act_questnaire WHERE community_id = camw.community_id ),0) AS questionnaire, IFNULL(( SELECT count( id ) FROM com_act_dyn WHERE community_id = camw.community_id AND STATUS = 1 ),0) AS dynamic, IFNULL(( SELECT count( id ) FROM com_convenient_merchants WHERE community_id = camw.community_id AND is_del = 0 ),0) AS convenient, IFNULL(( SELECT count( id ) FROM com_act_neighbor_circle WHERE community_id = camw.community_id AND is_del = 2 ),0) AS neighbor, FROM com_act_micro_wish AS camw WHERE camw.STATUS = 6 AND camw.community_id = #{communityId} </select> </mapper>