springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/civil/CivilPopulationStatisticsVO.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.common.model.vos.community.screen.civil; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("民生统计返回参数") public class CivilPopulationStatisticsVO { @ApiModelProperty("本月特殊人群数量") private Integer specialTotal; @ApiModelProperty("上月特殊人群数量") private Integer toMonthSpecialTotal; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/civil/CivilStatisticsVO.java
New file @@ -0,0 +1,31 @@ package com.panzhihua.common.model.vos.community.screen.civil; import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO; 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.math.BigDecimal; import java.util.List; @Data @ApiModel("民生统计返回参数") public class CivilStatisticsVO { @ApiModelProperty("大屏网格数据") private List<EventGridStatisticsVO> gridStatisticsList; @ApiModelProperty("特殊人群统计模块数据") private List<IndexSpecialStatisticsVO> specialStatisticsList; @ApiModelProperty("小区列表数据") private List<CivilVillageStatisticsVO> villageStatisticsList; @ApiModelProperty("特殊人群总数") private Integer specialNum; @ApiModelProperty("环比上月增长率") private BigDecimal rate; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/civil/CivilVillageStatisticsVO.java
New file @@ -0,0 +1,29 @@ package com.panzhihua.common.model.vos.community.screen.civil; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("民生统计小区列表返回参数") public class CivilVillageStatisticsVO { @ApiModelProperty("小区名字") private String name; @ApiModelProperty("小区居住人数") private Integer userSum; @ApiModelProperty("经度") private String lng; @ApiModelProperty("纬度") private String lat; @ApiModelProperty("小区图片") private String villageImages; @ApiModelProperty("小区id") private String villageId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏网格下事件统计返回参数") public class EventGridIncidentStatisticsVO { @ApiModelProperty("事件状态(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报、7随手拍处理)") private Integer type; @ApiModelProperty("事件发生经纬度") private String latLng; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridStatisticsVO.java
New file @@ -0,0 +1,31 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏事件网格统计返回参数") public class EventGridStatisticsVO { @ApiModelProperty("网格id") private Long id; @ApiModelProperty("网格名称") private String gridName; @ApiModelProperty("网格围栏数据") private String data; @ApiModelProperty("网格线条颜色") private String lineColor; @ApiModelProperty("网格线条宽度") private String lineBroadband; @ApiModelProperty("网格填充颜色") private String fillColor; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventLeftDownStatisticsVO.java
New file @@ -0,0 +1,56 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏事件左下统计返回参数") public class EventLeftDownStatisticsVO { @ApiModelProperty("治安隐患事件总数") private Integer eventZATotal; @ApiModelProperty("治安隐患已完成事件总数") private Integer yesEventZATotal; @ApiModelProperty("突发事件总数") private Integer eventTFTotal; @ApiModelProperty("突发事件已完成总数") private Integer yesEventTFTotal; @ApiModelProperty("特殊人群信息上报总数") private Integer eventTSTotal; @ApiModelProperty("特殊人群信息上报已完成事件总数") private Integer yesEventTSTotal; @ApiModelProperty("矛盾纠纷事件总数") private Integer eventMDTotal; @ApiModelProperty("矛盾纠纷已完成事件总数") private Integer yesEventMDTotal; @ApiModelProperty("不稳定因素事件总数") private Integer eventBWDTotal; @ApiModelProperty("不稳定因素已完成事件总数") private Integer yesEventBWDTotal; @ApiModelProperty("公共服务事件总数") private Integer eventGGTotal; @ApiModelProperty("公共服务已完成事件总数") private Integer yesEventGGTotal; @ApiModelProperty("随手拍总数") private Integer eventSSPTotal; @ApiModelProperty("随手拍已完成总数") private Integer yesEventSSPTotal; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventLeftStatisticsVO.java
New file @@ -0,0 +1,19 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏事件左边统计返回参数") public class EventLeftStatisticsVO { @ApiModelProperty("大屏事件左上统计返回参数") private EventLeftTopStatisticsVO leftTopStatisticsVO; @ApiModelProperty("大屏事件左下统计返回参数") private EventLeftDownStatisticsVO leftDownStatisticsVO; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventLeftTopStatisticsVO.java
New file @@ -0,0 +1,32 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏事件左上统计返回参数") public class EventLeftTopStatisticsVO { @ApiModelProperty("网格数") private Integer gridTotal; @ApiModelProperty("网格员数") private Integer gridMemberTotal; @ApiModelProperty("事件数") private Integer eventTotal; @ApiModelProperty("未解决事件数") private Integer noSolveEventTotal; @ApiModelProperty("累计解决事件数") private Integer solveEventTotal; @ApiModelProperty("频发月份") private List<Integer> oftenMonth; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java
New file @@ -0,0 +1,62 @@ package com.panzhihua.common.model.vos.community.screen.event; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.grid.EventResourceVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; import java.util.List; @Data @ApiModel("大屏事件播报统计返回参数") public class EventNewStatisticsVO { @ApiModelProperty("事件id") private Long id; @ApiModelProperty("发布人昵称") private String userName; @ApiModelProperty("发布人头像") private String imageUrl; @ApiModelProperty("发布时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; @ApiModelProperty("事件描述") private String eventDes; @ApiModelProperty("危险级别:0 (无) 1(特别重大)、2(重大)、3(较大)、4(一般)") private String dangerLevel; @ApiModelProperty("是否紧急") private Boolean urgent; @ApiModelProperty("是否重大") private Boolean major; @ApiModelProperty("事件发生地点") private String happenAddress; @ApiModelProperty("事件发生经纬度(长在前短在后)") private String happentLatLng; @ApiModelProperty("事件分类1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报") private Integer eventType; @ApiModelProperty("事件处理状态(1待处理、4已解决)") private Integer eventDealStatus; @ApiModelProperty(value = "音频") private List<EventResourceVO> audios; @ApiModelProperty(value = "视频") private List<EventResourceVO> videos; @ApiModelProperty(value = "图片") private List<EventResourceVO> pics; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventStatisticsVO.java
New file @@ -0,0 +1,25 @@ package com.panzhihua.common.model.vos.community.screen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏事件统计返回参数") public class EventStatisticsVO { @ApiModelProperty("大屏网格数据") private List<EventGridStatisticsVO> gridStatisticsList; @ApiModelProperty("大屏左边数据") private EventLeftStatisticsVO leftStatisticsVO; @ApiModelProperty("事件播报数据") private EventNewStatisticsVO newStatisticsVO; @ApiModelProperty("社区事件数据") private List<EventGridIncidentStatisticsVO> gridIncidentList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexBasicsStatisticsVO.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页基础数据统计返回参数") public class IndexBasicsStatisticsVO { @ApiModelProperty("人口数量") private Integer populationTotal; @ApiModelProperty("房屋数量") private Integer houseTotal; @ApiModelProperty("单位数量") private Integer companyTotal; @ApiModelProperty("小区数量") private Integer villageTotal; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexDynamicStatisticsVO.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页社区治理动态数据统计返回参数") public class IndexDynamicStatisticsVO { @ApiModelProperty("微心愿") private Integer microWishTotal; @ApiModelProperty("随手拍") private Integer easyPhotoTotal; @ApiModelProperty("回复留言数量") private Integer replyTotal; @ApiModelProperty("开展文化活动") private Integer cultureActivityTotal; @ApiModelProperty(value = "党员活动数量",hidden = true) private Integer pbTotal; @ApiModelProperty(value = "社区活动数量",hidden = true) private Integer actTotal; @ApiModelProperty("发起民意调查") private Integer investigationTotal; @ApiModelProperty("社区宣传") private Integer propagandaTotal; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexEventGridStatisticsVO.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏首页网格化治理数据统计返回参数") public class IndexEventGridStatisticsVO { @ApiModelProperty("网格化治理事件数据") private IndexGridEventStatisticsVO gridEventStatisticsList; @ApiModelProperty("网格化治理事件总和") private Integer gridEventTotal = 0; @ApiModelProperty("网格化治理网格数据") private List<IndexGridStatisticsVO> gridStatisticsList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexEventListStatisticsVO.java
New file @@ -0,0 +1,24 @@ package com.panzhihua.common.model.vos.community.screen.index; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @Data @ApiModel("大屏首页实时治理信息数据统计返回参数") public class IndexEventListStatisticsVO { @ApiModelProperty("事件上报时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; @ApiModelProperty("事件状态(1.待处理 4.已处理)") private Integer eventDealStatus; @ApiModelProperty("事件描述") private String eventDes; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexGridEventStatisticsVO.java
New file @@ -0,0 +1,29 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页网格化治理事件数据统计返回参数") public class IndexGridEventStatisticsVO { @ApiModelProperty("突发事件数量") private Integer eventTFTotal; @ApiModelProperty("治安隐患事件数量") private Integer eventZATotal; @ApiModelProperty("矛盾纠纷事件数量") private Integer eventMDTotal; @ApiModelProperty("特殊人员上报数量") private Integer eventTSTotal; @ApiModelProperty("不稳定因素事件数量") private Integer eventBWDTotal; @ApiModelProperty("公共服务数量") private Integer eventGGTotal; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexGridStatisticsVO.java
New file @@ -0,0 +1,19 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏首页网格化治理事件数据统计返回参数") public class IndexGridStatisticsVO { @ApiModelProperty("网格名称") private String eventData; @ApiModelProperty("网格事件数据") private IndexGridEventStatisticsVO gridEventStatisticsList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexPopulationAgeStatisticsVO.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页实有人口年龄段数据统计返回参数") public class IndexPopulationAgeStatisticsVO { @ApiModelProperty("年龄段(1、0-16 2、16-27 3、27-35 4、35-45 5、45-55 6、55以上)") private Integer type; @ApiModelProperty("数量") private Integer sum = 0; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexPopulationSexStatisticsVO.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页实有人口性别数据统计返回参数") public class IndexPopulationSexStatisticsVO { @ApiModelProperty("性别(1.男 2.女)") private Integer type; @ApiModelProperty("数量") private Integer sum; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexPopulationStatisticsVO.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏首页实有人口数据统计返回参数") public class IndexPopulationStatisticsVO { @ApiModelProperty("人口总数量") private Integer populationTotal = 0; @ApiModelProperty("大屏首页实有人口性别数据统计返回参数") private List<IndexPopulationSexStatisticsVO> sexPopulationList; @ApiModelProperty("大屏首页实有人口年龄段数据统计返回参数") private List<IndexPopulationAgeStatisticsVO> agePopulationList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexSpecialStatisticsVO.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("大屏首页特殊人群统计数据返回参数") public class IndexSpecialStatisticsVO { @ApiModelProperty("特殊人群标签") private String title; @ApiModelProperty("人口数量") private Integer sum; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexStatisticsVO.java
New file @@ -0,0 +1,30 @@ package com.panzhihua.common.model.vos.community.screen.index; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel("大屏首页统计返回参数") public class IndexStatisticsVO { @ApiModelProperty("基础模块数据") private IndexBasicsStatisticsVO basicsStatistics; @ApiModelProperty("实有人口统计模块数据") private IndexPopulationStatisticsVO populationStatisticsVO; @ApiModelProperty("实时治理信息统计模块数据") private List<IndexEventListStatisticsVO> eventListStatisticsList; @ApiModelProperty("社区治理动态模块数据") private IndexDynamicStatisticsVO dynamicStatisticsVO; @ApiModelProperty("网格化治理模块数据") private IndexEventGridStatisticsVO eventGridStatisticsVO; @ApiModelProperty("特殊人群统计模块数据") private List<IndexSpecialStatisticsVO> specialStatisticsVOList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/ComMngUserTagVO.java
@@ -22,4 +22,7 @@ @ApiModelProperty(value = "社区id",hidden = true) private Long communityId; @ApiModelProperty("系统预置:1-是 0-否") private Integer sysFlag; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -2859,4 +2859,13 @@ @PostMapping("/elders/getAuthHistoryExport") R getAuthHistoryExport(@RequestBody PageEldersAuthHistoryDTO pageEldersAuthElderlyDTO); @GetMapping("/screen/getScreenIndex") R getScreenIndex(@RequestParam("communityId")Long communityId); @GetMapping("/screen/getScreenEvent") R getScreenEvent(@RequestParam("communityId")Long communityId); @GetMapping("/screen/getScreenCivil") R getScreenCivil(@RequestParam("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -1,6 +1,10 @@ package com.panzhihua.community_backstage.api; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.EventStatisticsVO; import com.panzhihua.common.model.vos.community.screen.index.IndexStatisticsVO; import com.panzhihua.common.service.community.CommunityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -9,15 +13,47 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @Slf4j @Api(tags = {"大屏统计数据模块"}) @RestController @RequestMapping("/screen/") public class BigScreenStatisticsApi { @Resource private CommunityService communityService; @ApiOperation(value = "大屏测试接口") @GetMapping("/test/noToken") public R detailDiscuss(@RequestParam("communityId") Long communityId) { public R test(@RequestParam("communityId") Long communityId) { return R.ok("测试,测试社区id" + communityId); } @ApiOperation(value = "首页大屏统计接口@lyq",response = IndexStatisticsVO.class) @GetMapping("/index/noToken") public R index(@RequestParam("communityId") Long communityId) { if(communityId == null){ return R.fail("参数错误"); } return communityService.getScreenIndex(communityId); } @ApiOperation(value = "事件大屏统计接口@lyq",response = EventStatisticsVO.class) @GetMapping("/event/noToken") public R event(@RequestParam("communityId") Long communityId) { if(communityId == null){ return R.fail("参数错误"); } return communityService.getScreenEvent(communityId); } @ApiOperation(value = "民生大屏统计接口@lyq",response = CivilStatisticsVO.class) @GetMapping("/civil/noToken") public R civil(@RequestParam("communityId") Long communityId) { if(communityId == null){ return R.fail("参数错误"); } return communityService.getScreenCivil(communityId); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.service_community.api; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.ComMngPopulationService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @Slf4j @RestController @RequestMapping("/screen/") public class BigScreenStatisticsApi { @Resource private ComMngPopulationService comMngPopulationService; @GetMapping("/getScreenIndex") public R index(@RequestParam("communityId") Long communityId) { return R.ok(comMngPopulationService.getScreenIndex(communityId)); } @GetMapping("/getScreenEvent") public R event(@RequestParam("communityId") Long communityId) { return R.ok(comMngPopulationService.getScreenEvent(communityId)); } @GetMapping("/getScreenCivil") public R civil(@RequestParam("communityId") Long communityId) { return R.ok(comMngPopulationService.getScreenCivil(communityId)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -6,19 +6,20 @@ import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.vos.area.AreaAddressVO; import com.panzhihua.common.model.vos.community.ComActMessageVO; import com.panzhihua.common.model.vos.community.ComMngPopulationTotalVO; import com.panzhihua.common.model.vos.community.ComMngPopulationVO; import com.panzhihua.common.model.vos.community.PageComActMessageVO; import com.panzhihua.common.model.vos.user.ComHouseMemberVo; import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; import com.panzhihua.common.model.vos.user.InputUserInfoVO; import com.panzhihua.common.model.vos.user.UserElectronicFileVO; import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.*; import com.panzhihua.common.model.vos.community.screen.index.*; import com.panzhihua.common.model.vos.grid.EventGridDataVO; import com.panzhihua.common.model.vos.user.*; import com.panzhihua.service_community.model.dos.ComMngPopulationDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.Date; import java.util.List; /** @@ -28,29 +29,29 @@ public interface ComMngPopulationDAO extends BaseMapper<ComMngPopulationDO> { @Select("<script> " + "SELECT\n" + "cmp.`name`,\n" + "cmp.id,\n" + "cmp.street_id,\n" + "cmp.act_id,\n" + "cmp.village_id,\n" + "cmp.sex,\n" + "cmp.age,\n" + "cmp.card_no,\n" + "cmp.road,\n" + "cmp.door_no,\n" + "cmp.floor,\n" + "cmp.unit_no,\n" + "cmp.house_no,\n" + "cmp.political_outlook,\n" + "cmp.work_company,\n" + "cmp.special_situation,\n" + "cmp.phone,\n" + "cmp.remark,\n" + "cmv.alley,\n" + "cmp.native_place,\n" + "cmp.nation \n" + "FROM \n" + "SELECT " + "cmp.`name`, " + "cmp.id, " + "cmp.street_id, " + "cmp.act_id, " + "cmp.village_id, " + "cmp.sex, " + "cmp.age, " + "cmp.card_no, " + "cmp.road, " + "cmp.door_no, " + "cmp.floor, " + "cmp.unit_no, " + "cmp.house_no, " + "cmp.political_outlook, " + "cmp.work_company, " + "cmp.special_situation, " + "cmp.phone, " + "cmp.remark, " + "cmv.alley, " + "cmp.native_place, " + "cmp.nation " + "FROM " + "com_mng_population AS cmp " + "LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + "<where>" + @@ -105,39 +106,39 @@ List<ComHouseMemberVo> listHouseMermberByUserId(@Param("houseId") Long houseId, @Param("populId") Long populId); @Select("<script> " + "SELECT\n" + "cmp.`name`,\n" + "cmp.id,\n" + "cmp.street_id,\n" + "cmp.act_id,\n" + "cmp.village_id,\n" + "cmp.sex,\n" + "cmp.age,\n" + "cmp.card_no,\n" + "cmp.road,\n" + "cmp.door_no,\n" + "cmp.floor,\n" + "cmp.unit_no,\n" + "cmp.house_no,\n" + "cmp.political_outlook,\n" + "cmp.work_company,\n" + "cmp.special_situation,\n" + "cmp.phone,\n" + "cmp.remark,\n" + "cmv.alley,\n" + "cmp.native_place,\n" + "cmp.nation, \n" + "cmp.label, \n" + "cmp.relation, \n" + "cmp.marriage, \n" + "cmp.culture_level, \n" + "cmp.out_or_local, \n" + "cmp.census_register, \n" + "cmp.healthy, \n" + "cmp.birthday, \n" + "cmp.update_at, \n" + "cmp.is_rent \n" + "FROM \n" + "SELECT " + "cmp.`name`, " + "cmp.id, " + "cmp.street_id, " + "cmp.act_id, " + "cmp.village_id, " + "cmp.sex, " + "cmp.age, " + "cmp.card_no, " + "cmp.road, " + "cmp.door_no, " + "cmp.floor, " + "cmp.unit_no, " + "cmp.house_no, " + "cmp.political_outlook, " + "cmp.work_company, " + "cmp.special_situation, " + "cmp.phone, " + "cmp.remark, " + "cmv.alley, " + "cmp.native_place, " + "cmp.nation, " + "cmp.label, " + "cmp.relation, " + "cmp.marriage, " + "cmp.culture_level, " + "cmp.out_or_local, " + "cmp.census_register, " + "cmp.healthy, " + "cmp.birthday, " + "cmp.update_at, " + "cmp.is_rent " + "FROM " + "com_mng_population AS cmp " + "LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " + "<where>" + @@ -238,4 +239,426 @@ ",(select count(id) from com_mng_population where act_id = #{communityId} and label is not null) as specialTotal " + " from com_mng_population as cmp where act_id = #{communityId}") ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); @Select("select count(id) as populationTotal," + "IFNULL((select count(id) from com_mng_population_house where community_id = cmp.act_id),0) as houseTotal, " + "IFNULL((select count(id) from com_mng_real_company where community_id = cmp.act_id),0) as companyTotal, " + "IFNULL((select count(village_id) from com_mng_village where community_id = cmp.act_id),0) as villageTotal " + " from com_mng_population as cmp " + " where act_id = #{communityId}") IndexBasicsStatisticsVO getScreenIndexByBasics(@Param("communityId") Long communityId); @Select("SELECT " + " IFNULL( NULL, 1 ) AS type, " + " count( id ) AS sum " + "FROM " + " com_mng_population " + "WHERE " + " sex = 1 " + " AND act_id = #{communityId} UNION ALL " + "SELECT " + " IFNULL( NULL, 2 ) AS type, " + " count( id ) AS sum " + "FROM " + " com_mng_population " + "WHERE " + " sex = 2 " + " AND act_id = #{communityId}") List<IndexPopulationSexStatisticsVO> getScreenIndexByPopulationSex(@Param("communityId") Long communityId); @Select("SELECT " + " e.create_at, " + " e.event_des, " + " e.event_deal_status " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + "WHERE " + " egd.grid_community_id = #{communityId} " + " AND e.event_deal_status IN ( 1, 4 ) " + "ORDER BY " + " e.create_at DESC " + " LIMIT 8") List<IndexEventListStatisticsVO> getScreenIndexByEventList(@Param("communityId") Long communityId); @Select("SELECT " + " count( id ) AS microWishTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2 AND community_id = camw.community_id ),0) AS easyPhotoTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_message WHERE STATUS = 2 AND community_id = camw.community_id ),0) AS replyTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_activity WHERE STATUS = 5 AND community_id = camw.community_id ),0) AS actTotal, " + " IFNULL(( SELECT count( id ) FROM com_pb_activity WHERE STATUS = 5 AND community_id = camw.community_id ),0) AS pbTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_questnaire WHERE community_id = camw.community_id ),0) AS investigationTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_dyn WHERE community_id = camw.community_id AND STATUS = 1 ),0) AS propagandaTotal " + "FROM " + " com_act_micro_wish AS camw " + "WHERE " + " camw.STATUS = 6 " + " AND camw.community_id = #{communityId}") IndexDynamicStatisticsVO getScreenIndexByDynamic(@Param("communityId") Long communityId); @Select("SELECT " + " count( e.id ) AS eventTFTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_deal_status = 4 AND grid_id = egd.id ),0) AS eventZATotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 3 AND event_deal_status = 4 AND grid_id = egd.id ),0) AS eventMDTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_deal_status = 4 AND grid_id = egd.id ),0) AS eventTSTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 4 AND event_deal_status = 4 AND grid_id = egd.id ),0) AS eventBWDTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 2 AND event_deal_status = 4 AND grid_id = egd.id ),0) AS eventGGTotal " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + "WHERE " + " e.event_category = 1 " + " AND e.event_type = 5 " + " AND e.event_deal_status = 4 " + " AND egd.grid_community_id = #{communityId}") IndexGridEventStatisticsVO getGridEventStatisticsList(@Param("communityId") Long communityId); @Select("select id,grid_name from event_grid_data where grid_community_id = #{communityId}") List<EventGridDataVO> getGridDataListByCommunityId(@Param("communityId") Long communityId); @Select("SELECT " + " count( e.id ) AS eventTFTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_deal_status = 4 AND grid_id = e.grid_id ),0) AS eventZATotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 3 AND event_deal_status = 4 AND grid_id = e.grid_id) ,0) AS eventMDTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_deal_status = 4 AND grid_id = e.grid_id ),0) AS eventTSTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 4 AND event_deal_status = 4 AND grid_id = e.grid_id ),0) AS eventBWDTotal, " + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 2 AND event_deal_status = 4 AND grid_id = e.grid_id ),0) AS eventGGTotal " + "FROM " + " `event` AS e " + "WHERE " + " e.event_category = 1 " + " AND e.event_type = 5 " + " AND e.event_deal_status = 4 " + " AND e.grid_id = #{gridId}") IndexGridEventStatisticsVO getGridEventByGirdId(@Param("gridId") Long gridId); @Select("SELECT " + " tag_name, " + " sys_flag " + "FROM " + " com_mng_user_tag " + "WHERE " + " sys_flag = 1 " + " OR community_id = #{communityId}") List<ComMngUserTagVO> getUserTagListByCommunityId(@Param("communityId") Long communityId); @Select("SELECT " + " count( id ) " + "FROM " + " com_mng_population " + "WHERE " + " label like concat('%',#{label},'%')") Integer getSpecialStatisticsByLabel(@Param("label") String label); @Select("SELECT " + " count( egd.id ) AS gridTotal, " + " ( SELECT count( user_id ) FROM sys_user WHERE community_id = egd.grid_community_id AND type = 6 ) AS gridMemberTotal, " + " ( " + " SELECT " + " count( e.id ) " + " FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd1 ON e.grid_id = egd1.id " + " WHERE " + " egd1.grid_community_id = egd.grid_community_id " + " AND event_status = 2 " + " ) AS eventTotal, " + " ( " + " SELECT " + " count( e1.id ) " + " FROM " + " `event` AS e1 " + " LEFT JOIN event_grid_data AS egd2 ON e1.grid_id = egd2.id " + " WHERE " + " egd2.grid_community_id = egd.grid_community_id " + " AND event_status = 2 " + " AND event_deal_status IN ( 1, 2, 3 )) AS noSolveEventTotal, " + " ( " + " SELECT " + " count( e1.id ) " + " FROM " + " `event` AS e1 " + " LEFT JOIN event_grid_data AS egd2 ON e1.grid_id = egd2.id " + " WHERE " + " egd2.grid_community_id = egd.grid_community_id " + " AND event_status = 2 " + " AND event_deal_status = 4 " + " ) AS solveEventTotal " + "FROM " + " event_grid_data AS egd " + "WHERE " + " egd.grid_community_id = #{communityId}") EventLeftTopStatisticsVO getEventScreenLeftTop(@Param("communityId") Long communityId); @Select("SELECT " + " DATE_FORMAT( e.create_at, '%m' ) months " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + "WHERE " + " e.create_at BETWEEN concat( YEAR ( now()), '-01-01 00:00:00' ) " + " AND concat( YEAR ( now()), '-12-31 23:59:59' ) " + " AND egd.grid_community_id = #{communityId} " + "GROUP BY " + " months " + "ORDER BY " + " count( e.id ) DESC " + " LIMIT 3") List<Integer> getFrequentlyEventMonth(@Param("communityId") Long communityId); @Select("SELECT " + " count( e.id ) AS eventZATotal, " + " IFNULL(( " + " SELECT " + " count( e1.id ) " + " FROM " + " `event` AS e1 " + " LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id " + " WHERE " + " egd1.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 1 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventZATotal, " + " IFNULL(( " + " SELECT " + " count( e2.id ) " + " FROM " + " `event` AS e2 " + " LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id " + " WHERE " + " egd2.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 5 " + " AND event_status = 2 " + " ), " + " 0 " + " ) AS eventTFTotal, " + " IFNULL(( " + " SELECT " + " count( e3.id ) " + " FROM " + " `event` AS e3 " + " LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id " + " WHERE " + " egd3.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 5 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventTFTotal, " + " IFNULL(( " + " SELECT " + " count( e4.id ) " + " FROM " + " `event` AS e4 " + " LEFT JOIN event_grid_data AS egd4 ON egd4.id = e4.grid_id " + " WHERE " + " egd4.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 6 " + " AND event_status = 2 " + " ), " + " 0 " + " ) AS eventTSTotal, " + " IFNULL(( " + " SELECT " + " count( e5.id ) " + " FROM " + " `event` AS e5 " + " LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id " + " WHERE " + " egd5.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 6 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventTSTotal, " + " IFNULL(( " + " SELECT " + " count( e6.id ) " + " FROM " + " `event` AS e6 " + " LEFT JOIN event_grid_data AS egd6 ON egd6.id = e6.grid_id " + " WHERE " + " egd6.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 3 " + " AND event_status = 2 " + " ), " + " 0 " + " ) AS eventMDTotal, " + " IFNULL(( " + " SELECT " + " count( e7.id ) " + " FROM " + " `event` AS e7 " + " LEFT JOIN event_grid_data AS egd7 ON egd7.id = e7.grid_id " + " WHERE " + " egd7.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 3 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventMDTotal, " + " IFNULL(( " + " SELECT " + " count( e8.id ) " + " FROM " + " `event` AS e8 " + " LEFT JOIN event_grid_data AS egd8 ON egd8.id = e8.grid_id " + " WHERE " + " egd8.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 4 " + " AND event_status = 2 " + " ), " + " 0 " + " ) AS eventBWDTotal, " + " IFNULL(( " + " SELECT " + " count( e9.id ) " + " FROM " + " `event` AS e9 " + " LEFT JOIN event_grid_data AS egd9 ON egd9.id = e9.grid_id " + " WHERE " + " egd9.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 4 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventBWDTotal, " + " IFNULL(( " + " SELECT " + " count( e10.id ) " + " FROM " + " `event` AS e10 " + " LEFT JOIN event_grid_data AS egd10 ON egd10.id = e10.grid_id " + " WHERE " + " egd10.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 2 " + " AND event_status = 2 " + " ), " + " 0 " + " ) AS eventGGTotal, " + " IFNULL(( " + " SELECT " + " count( e11.id ) " + " FROM " + " `event` AS e11 " + " LEFT JOIN event_grid_data AS egd11 ON egd11.id = e11.grid_id " + " WHERE " + " egd11.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 2 " + " AND event_deal_status = 4 " + " ), " + " 0 " + " ) AS yesEventGGTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status IS NOT NULL AND community_id = #{communityId} ), 0 ) AS eventSSPTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status = 2 AND community_id = #{communityId} ), 0 ) AS yesEventSSPTotal " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + "WHERE " + " egd.grid_community_id = #{communityId} " + " AND event_category = 1 " + " AND event_type = 1 " + " AND event_status = 2") EventLeftDownStatisticsVO getEventScreenLeftDown(@Param("communityId") Long communityId); @Select("SELECT " + " su.nick_name AS userName, " + " su.image_url AS imageUrl, " + " e.create_at, " + " e.event_des, " + " e.danger_level, " + " e.urgent, " + " e.major, " + " e.happen_address, " + " e.happent_lat_lng, " + " e.event_type, " + " e.id, " + " e.event_deal_status " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + " LEFT JOIN sys_user AS su ON su.user_id = e.grid_member_id " + "WHERE " + " egd.grid_community_id = #{communityId} " + " AND e.event_status = 2 " + " AND e.event_deal_status = 1 " + " AND e.event_category = 1 " + "ORDER BY " + " e.create_at DESC " + " LIMIT 1") EventNewStatisticsVO getEventScreenRightTop(@Param("communityId") Long communityId); @Select("SELECT " + " grid_name, " + " `data`, " + " line_color, " + " line_broadband, " + " id, " + " fill_color " + "FROM " + " event_grid_data AS egd " + "WHERE " + " egd.grid_community_id = #{communityId}") List<EventGridStatisticsVO> getEventScreenGridData(@Param("communityId") Long communityId); @Select("SELECT " + " event_type as type, " + " happent_lat_lng as latLng " + "FROM " + " `event` AS e " + " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id " + "WHERE " + " e.event_category = 1 " + " AND e.event_type IN ( 1, 2, 3, 4, 5, 6 ) " + " AND e.event_status = 2 " + " AND e.event_deal_status = 1 " + " AND egd.grid_community_id = #{communityId} UNION ALL " + "SELECT " + " IFNULL( NULL, 7 ) AS type, " + " lng_lat AS latLng " + "FROM " + " com_act_easy_photo " + "WHERE " + " community_id = #{communityId} " + " AND handle_status = 1 " + " AND del_tag = 0 " + " AND lng_lat IS NOT NULL") List<EventGridIncidentStatisticsVO> getEventScreenEventList(@Param("communityId") Long communityId); @Select("SELECT " + " count( id ) AS specialTotal, " + " ( SELECT count( id ) FROM com_mng_population WHERE label IS NOT NULL AND act_id = #{communityId} AND create_at < #{lastMonth} ) AS toMonthSpecialTotal " + "FROM " + " com_mng_population AS cmp " + "WHERE " + " label IS NOT NULL " + " AND act_id = #{communityId}") CivilPopulationStatisticsVO getCivilScreenPopulation(@Param("communityId") Long communityId,@Param("lastMonth") Date lastMonth); @Select("SELECT `NAME`, " + " user_sum, " + " lng, " + " lat, " + " village_images, " + " village_id " + "FROM " + " com_mng_village AS cmv " + "WHERE " + " community_id = #{communityId}") List<CivilVillageStatisticsVO> getCivilScreenVillageList(@Param("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/EventResourceMapper.java
New file @@ -0,0 +1,19 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_community.model.dos.EventResourceDO; import org.apache.ibatis.annotations.Mapper; /** * DAO * * @author cedoo email:cedoo(a)qq.com * @version 1.0 * @since 1.0 * @date 2021-05-26 * */ @Mapper public interface EventResourceMapper extends BaseMapper<EventResourceDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -17,7 +17,7 @@ /** * 自增 id */ @TableId(type = IdType.AUTO) @TableId(type = IdType.INPUT) private Long id; /** * 街道id @@ -42,12 +42,18 @@ /** * 年龄 */ @TableField(exist = false) private Integer age; /** * 身份证号码 */ @EncryptDecryptField private String cardNo; /** * 临时用 */ private String cardNoStr; /** * 街路巷 */ @@ -132,7 +138,10 @@ /** * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他) */ @TableField(exist = false) private Integer relation; // // private String relationStr; /** * 文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他) @@ -144,6 +153,7 @@ */ private Integer marriage; /** * 健康状况 */ @@ -152,6 +162,7 @@ /** * 房屋地址 */ @TableField(exist = false) private String houseAddress; /** @@ -162,6 +173,7 @@ /** * 居住地房屋id */ @TableField(exist = false) private Long houseId; /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/EventResourceDO.java
New file @@ -0,0 +1,66 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * 事件或者走访中关联的图片音频和视频文件实体类 * * @author cedoo email:cedoo(a)qq.com * @version 1.0 * @since 1.0 * @date 2021-05-26 * */ @Data @TableName("event_resource") public class EventResourceDO implements Serializable { private static final long serialVersionUID = 1L; /** * 分类(1、事件 2、走访 3、事件流转) 列: classification */ private Integer classification; /** * ID 列: id */ @TableId(type = IdType.ASSIGN_ID) private Long id; /** * 事件或者走访任务关联ID 列: id */ private Long refId; /** * 事件上传的资源类型(1是图片2是音频3是是视频) 列: type */ private Integer type; /** * 资源名称 列: resource_name */ private String resourceName; /** * 资源大小 列: resource_size */ private String resourceSize; /** * 视频或音频时长 列: resource_time */ private Integer resourceTime; /** * 事件上传的资源URL地址 列: url */ private String url; /** * 创建人 列: create_by */ private Long createBy; /** * 创建时间 列: create_at */ @TableField(fill = FieldFill.INSERT) private Date createAt; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -144,4 +144,10 @@ * @return 统计结果 */ R getPopulationTotalByAdmin(Long communityId); R getScreenIndex(Long communityId); R getScreenEvent(Long communityId); R getScreenCivil(Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/EventResourceService.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_community.model.dos.EventResourceDO; /** * 事件或者走访中关联的图片音频和视频文件 service * * @author cedoo email:cedoo(a)qq.com * @version 1.0 * @since 1.0 * @date 2021-05-26 * */ public interface EventResourceService extends IService<EventResourceDO> { } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -1,6 +1,8 @@ package com.panzhihua.service_community.service.impl; import cn.hutool.core.util.IdcardUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -12,31 +14,31 @@ import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.helper.AESUtil; import com.panzhihua.common.model.helper.AESUtil; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.area.AreaAddressVO; import com.panzhihua.common.model.vos.community.*; 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; import com.panzhihua.common.model.vos.community.screen.event.*; import com.panzhihua.common.model.vos.community.screen.index.*; import com.panzhihua.common.model.vos.grid.EventGridDataVO; import com.panzhihua.common.model.vos.grid.EventResourceVO; import com.panzhihua.common.model.vos.user.*; import com.panzhihua.common.utlis.*; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; import com.panzhihua.service_community.service.ComMngPopulationService; import com.panzhihua.service_community.service.EventResourceService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -60,7 +62,11 @@ @Resource private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO; @Resource private ComMngPopulationDAO comMngPopulationDAO; @Resource private ComMngPopulationHouseUserService comMngPopulationHouseUserService; @Resource private EventResourceService eventResourceService; @Value("${domain.aesKey:}") private String aesKey; @@ -786,6 +792,264 @@ return R.ok(this.baseMapper.getPopulationTotalByAdmin(communityId)); } @Override public R getScreenIndex(Long communityId){ //创建统计返回参数 IndexStatisticsVO statisticsVO = new IndexStatisticsVO(); //查询基础数据模块 IndexBasicsStatisticsVO basicsStatisticsVO = comMngPopulationDAO.getScreenIndexByBasics(communityId); statisticsVO.setBasicsStatistics(basicsStatisticsVO); //查询实有人口统计模块 IndexPopulationStatisticsVO populationStatisticsVO = new IndexPopulationStatisticsVO(); //查询实有人口性别统计 List<IndexPopulationSexStatisticsVO> sexPopulationList = comMngPopulationDAO.getScreenIndexByPopulationSex(communityId); populationStatisticsVO.setSexPopulationList(sexPopulationList); //查询实有人口年龄统计 List<ComMngPopulationDO> populationDOList = comMngPopulationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() .eq(ComMngPopulationDO::getActId,communityId)); List<IndexPopulationAgeStatisticsVO> agePopulationList = statisticsAge(populationDOList); populationStatisticsVO.setAgePopulationList(agePopulationList); statisticsVO.setPopulationStatisticsVO(populationStatisticsVO); //查询实有人口实时治理信息 List<IndexEventListStatisticsVO> eventListStatisticsList = comMngPopulationDAO.getScreenIndexByEventList(communityId); statisticsVO.setEventListStatisticsList(eventListStatisticsList); //查询社区治理动态信息 IndexDynamicStatisticsVO dynamicStatisticsVO = comMngPopulationDAO.getScreenIndexByDynamic(communityId); dynamicStatisticsVO.setCultureActivityTotal(dynamicStatisticsVO.getPbTotal() + dynamicStatisticsVO.getActTotal()); statisticsVO.setDynamicStatisticsVO(dynamicStatisticsVO); //查询网格化治理 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); statisticsVO.setEventGridStatisticsVO(eventGridStatisticsVO); //查询特殊人群统计 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()); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); }else{ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } } }); } specialStatisticsVOList.add(otherSpecialVO); statisticsVO.setSpecialStatisticsVOList(specialStatisticsVOList); return R.ok(statisticsVO); } private List<IndexPopulationAgeStatisticsVO> statisticsAge(List<ComMngPopulationDO> populationDOList){ List<IndexPopulationAgeStatisticsVO> agePopulationList = new ArrayList<>(); IndexPopulationAgeStatisticsVO ageStatisticsVO1 = new IndexPopulationAgeStatisticsVO(); IndexPopulationAgeStatisticsVO ageStatisticsVO2 = new IndexPopulationAgeStatisticsVO(); IndexPopulationAgeStatisticsVO ageStatisticsVO3 = new IndexPopulationAgeStatisticsVO(); IndexPopulationAgeStatisticsVO ageStatisticsVO4 = new IndexPopulationAgeStatisticsVO(); IndexPopulationAgeStatisticsVO ageStatisticsVO5 = new IndexPopulationAgeStatisticsVO(); IndexPopulationAgeStatisticsVO ageStatisticsVO6 = new IndexPopulationAgeStatisticsVO(); ageStatisticsVO1.setType(1); ageStatisticsVO2.setType(2); ageStatisticsVO3.setType(3); ageStatisticsVO4.setType(4); ageStatisticsVO5.setType(5); ageStatisticsVO6.setType(6); if(populationDOList.isEmpty()){ ageStatisticsVO1.setSum(0); ageStatisticsVO2.setSum(0); ageStatisticsVO3.setSum(0); ageStatisticsVO4.setSum(0); ageStatisticsVO5.setSum(0); ageStatisticsVO6.setSum(0); }else{ populationDOList.forEach(population -> { Integer age = IdcardUtil.getAgeByIdCard(population.getCardNoStr()); if(age >= 0 && age < 16){ ageStatisticsVO1.setSum(ageStatisticsVO1.getSum() + 1); }else if(age >= 16 && age < 27){ ageStatisticsVO2.setSum(ageStatisticsVO2.getSum() + 1); }else if(age >= 27 && age < 35){ ageStatisticsVO3.setSum(ageStatisticsVO3.getSum() + 1); }else if(age >= 35 && age < 45){ ageStatisticsVO4.setSum(ageStatisticsVO4.getSum() + 1); }else if(age >= 45 && age < 55){ ageStatisticsVO5.setSum(ageStatisticsVO5.getSum() + 1); }else if(age >= 55){ ageStatisticsVO6.setSum(ageStatisticsVO6.getSum() + 1); } }); } agePopulationList.add(ageStatisticsVO1); agePopulationList.add(ageStatisticsVO2); agePopulationList.add(ageStatisticsVO3); agePopulationList.add(ageStatisticsVO4); agePopulationList.add(ageStatisticsVO5); agePopulationList.add(ageStatisticsVO6); return agePopulationList; } @Override public R getScreenEvent(Long communityId){ //创建统计返回参数 EventStatisticsVO statisticsVO = new EventStatisticsVO(); //查询页面左边数据 EventLeftStatisticsVO leftStatisticsVO = new EventLeftStatisticsVO(); //查询左上数据 EventLeftTopStatisticsVO leftTopStatisticsVO = this.baseMapper.getEventScreenLeftTop(communityId); //查询时间频发月份 List<Integer> monthList = this.baseMapper.getFrequentlyEventMonth(communityId); leftTopStatisticsVO.setOftenMonth(monthList); leftStatisticsVO.setLeftTopStatisticsVO(leftTopStatisticsVO); //查询左下数据 EventLeftDownStatisticsVO leftDownStatisticsVO = this.baseMapper.getEventScreenLeftDown(communityId); leftStatisticsVO.setLeftDownStatisticsVO(leftDownStatisticsVO); statisticsVO.setLeftStatisticsVO(leftStatisticsVO); //查询事件播报模块数据 EventNewStatisticsVO newStatisticsVO = this.baseMapper.getEventScreenRightTop(communityId); //查询事件资源文件 List<EventResourceDO> eventResourceDOList = eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() .eq(EventResourceDO::getClassification, 1) .eq(EventResourceDO::getRefId, newStatisticsVO.getId()) ); List<EventResourceVO> picList = new ArrayList<>(); List<EventResourceVO> audioList = new ArrayList<>(); List<EventResourceVO> videoList = new ArrayList<>(); eventResourceDOList.forEach(eventResourceDO -> { switch (eventResourceDO.getType()) { case 1: EventResourceVO picEventResourceVO = new EventResourceVO(); BeanUtils.copyProperties(eventResourceDO, picEventResourceVO); picList.add(picEventResourceVO); break; case 2: EventResourceVO audioResourceVO = new EventResourceVO(); BeanUtils.copyProperties(eventResourceDO, audioResourceVO); audioList.add(audioResourceVO); break; case 3: EventResourceVO videoResourceVO = new EventResourceVO(); BeanUtils.copyProperties(eventResourceDO, videoResourceVO); videoList.add(videoResourceVO); break; } }); newStatisticsVO.setAudios(audioList); newStatisticsVO.setPics(picList); newStatisticsVO.setVideos(videoList); statisticsVO.setNewStatisticsVO(newStatisticsVO); //查询网格数据 List<EventGridStatisticsVO> gridStatisticsList = this.baseMapper.getEventScreenGridData(communityId); statisticsVO.setGridStatisticsList(gridStatisticsList); //查询社区事件列表 List<EventGridIncidentStatisticsVO> gridIncidentList = this.baseMapper.getEventScreenEventList(communityId); statisticsVO.setGridIncidentList(gridIncidentList); return R.ok(statisticsVO); } public R getScreenCivil(Long communityId){ //创建统计返回参数 CivilStatisticsVO civilStatisticsVO = new CivilStatisticsVO(); //查询特殊人群统计 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()); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); }else{ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } } }); } //计算特殊人群总数 specialStatisticsVOList.add(otherSpecialVO); Integer specialNum = 0; if(!specialStatisticsVOList.isEmpty()){ for (IndexSpecialStatisticsVO special:specialStatisticsVOList) { specialNum += special.getSum(); } } civilStatisticsVO.setSpecialNum(specialNum); civilStatisticsVO.setSpecialStatisticsList(specialStatisticsVOList); //计算环比上月增长率 BigDecimal rate = BigDecimal.ZERO; CivilPopulationStatisticsVO populationStatisticsVO = this.baseMapper.getCivilScreenPopulation(communityId,DateUtils.getFirstDayOfMonth()); if(populationStatisticsVO != null){ if(populationStatisticsVO.getToMonthSpecialTotal().equals(0)){ rate = BigDecimal.valueOf(100); }else{ rate = BigDecimal.valueOf(populationStatisticsVO.getSpecialTotal() - populationStatisticsVO.getToMonthSpecialTotal()).divide(BigDecimal.valueOf(populationStatisticsVO.getToMonthSpecialTotal()),3,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); } } civilStatisticsVO.setRate(rate); //查询网格数据 List<EventGridStatisticsVO> gridStatisticsList = this.baseMapper.getEventScreenGridData(communityId); civilStatisticsVO.setGridStatisticsList(gridStatisticsList); //查询小区列表 List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId); civilStatisticsVO.setVillageStatisticsList(villageStatisticsList); return R.ok(civilStatisticsVO); } public static void main(String[] args) { // List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new)); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EventResourceServiceImpl.java
New file @@ -0,0 +1,21 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_community.dao.EventResourceMapper; import com.panzhihua.service_community.model.dos.EventResourceDO; import com.panzhihua.service_community.service.EventResourceService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; /** * @auther lyq * @create 2021-04-14 15:03:01 * @describe 订单表服务实现类 */ @Slf4j @Service public class EventResourceServiceImpl extends ServiceImpl<EventResourceMapper, EventResourceDO> implements EventResourceService { }