From a7b550f95172e29d71aa38dca45cacf7f31949b8 Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期四, 17 六月 2021 14:44:50 +0800 Subject: [PATCH] Merge branch 'test_screen' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java | 28 +- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java | 89 +++++---- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java | 6 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java | 6 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java | 21 ++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java | 66 +++++- springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java | 20 ++ springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java | 15 + springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java | 9 + springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java | 8 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java | 25 ++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java | 11 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java | 10 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java | 5 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 133 +++++++++++++- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java | 6 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java | 12 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java | 13 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDetailDTO.java | 16 + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java | 16 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java | 4 22 files changed, 399 insertions(+), 123 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java index 38d49da..033c458 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java @@ -173,13 +173,13 @@ String relation = dictMap.get(ra); if(StringUtils.isEmpty(relation)){ - vo.setRelationStr(ra); -// ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); -// importErrorVO.setErrorPosition("第" + index + "行,第6列"); -// importErrorVO.setErrorMsg("您填写的与户主关系有误"); -// populationImportErrorVOList.add(importErrorVO); -// index++; -// continue; +// vo.setRelationStr(ra); + ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); + importErrorVO.setErrorPosition("第" + index + "行,第6列"); + importErrorVO.setErrorMsg("您填写的与户主关系有误"); + populationImportErrorVOList.add(importErrorVO); + index++; + continue; }else{ vo.setRelation(Integer.valueOf(relation)); } @@ -286,13 +286,13 @@ String ma = convertMarriage(oneData.get(19)); Integer isOk = PopulMarriageEnum.getCodeByName(ma); if(isOk.equals(-1)){ - vo.setMarriageStr(ma); -// ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); -// importErrorVO.setErrorPosition("第" + index + "行,第20列"); -// importErrorVO.setErrorMsg("您填写的婚姻状况有误"); -// populationImportErrorVOList.add(importErrorVO); -// index++; -// continue; +// vo.setMarriageStr(ma); + ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); + importErrorVO.setErrorPosition("第" + index + "行,第20列"); + importErrorVO.setErrorMsg("您填写的婚姻状况有误"); + populationImportErrorVOList.add(importErrorVO); + index++; + continue; }else{ vo.setMarriage(isOk); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDetailDTO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDetailDTO.java new file mode 100644 index 0000000..c0d16dd --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDetailDTO.java @@ -0,0 +1,16 @@ +package com.panzhihua.common.model.dtos.community.bigscreen; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("大屏事件详情请求参数") +public class BigScreenEventDetailDTO { + + @ApiModelProperty(value = "事件id", required = true) + private Long eventId; + + @ApiModelProperty(value = "事件状态(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报、7随手拍处理)", required = true) + private Integer type; +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java index 7e864eb..efffe14 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java @@ -1,5 +1,7 @@ package com.panzhihua.common.model.vos.community.screen.event; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -8,6 +10,10 @@ @ApiModel("大屏网格下事件统计返回参数") public class EventGridIncidentStatisticsVO { + @ApiModelProperty("事件id") + @JsonSerialize(using = ToStringSerializer.class) + private Long eventId; + @ApiModelProperty("事件状态(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报、7随手拍处理)") private Integer type; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java index 884c209..09adab2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java @@ -1,6 +1,8 @@ package com.panzhihua.common.model.vos.community.screen.event; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.panzhihua.common.model.vos.grid.EventResourceVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -14,6 +16,7 @@ public class EventNewStatisticsVO { @ApiModelProperty("事件id") + @JsonSerialize(using = ToStringSerializer.class) private Long id; @ApiModelProperty("发布人昵称") @@ -50,6 +53,9 @@ @ApiModelProperty("事件处理状态(1待处理、4已解决)") private Integer eventDealStatus; + @ApiModelProperty("随手拍图片集合") + private String photoPathList; + @ApiModelProperty(value = "音频") private List<EventResourceVO> audios; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java index 11079a5..f80c500 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java @@ -18,13 +18,13 @@ @ApiModelProperty("本月新增") private Long currentNum; - @ApiModelProperty("已处理随手拍") + @ApiModelProperty("已处理") private List<EastPhotoTypeVO> deal; - @ApiModelProperty("已公示随手拍") + @ApiModelProperty("已公示") private List<EastPhotoTypeVO> pub; - @ApiModelProperty("已审核随手拍") + @ApiModelProperty("已驳回") private List<EastPhotoTypeVO> approved; @ApiModelProperty("未处理") @@ -36,6 +36,8 @@ @ApiModelProperty("平均耗时") private Integer dealTime; + @ApiModelProperty("线形图统计时间段") + private String listTimes; @ApiModelProperty("随手拍线形列表") private List<EastPhotoVO> list; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java index d503379..81b893d 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/PbWorkVO.java @@ -22,9 +22,4 @@ @ApiModelProperty("党员活动") private Long activity; - - @ApiModelProperty(hidden = true) - private String start; - @ApiModelProperty(hidden = true) - private String end; } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java index 1a9f72a..ded5923 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java @@ -5,6 +5,7 @@ import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; import com.panzhihua.common.model.dtos.community.*; +import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticAgeGenderDTO; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticPartyActivityDTO; import com.panzhihua.common.model.dtos.community.bigscreen.PageBigScreenStatisticPartyOrg; @@ -3016,4 +3017,12 @@ */ @GetMapping("/screen/getScreenGirds") R getScreenGirds(@RequestParam("communityId")Long communityId); + + /** + * 事件大屏查询事件详情 + * @param eventDetailDTO 请求参数 + * @return 事件详情 + */ + @PostMapping("/screen/getScreenEventDetail") + R getScreenEventDetail(@RequestBody BigScreenEventDetailDTO eventDetailDTO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java index fa9b8e5..87c7c57 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java @@ -34,6 +34,8 @@ public static DateTimeFormatter format_ymd_String = DateTimeFormatter.ofPattern("yyMMdd"); + public static SimpleDateFormat yyyyMM_format = new SimpleDateFormat("yyyy-MM"); + /** @@ -718,12 +720,31 @@ return date1.getTime(); } + public static Date parseDateYM(String str) { + try { + return yyyyMM_format.parse(str); + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + public static int getMonth(Date date){ Calendar instance = Calendar.getInstance(); instance.setTime(date); return instance.get(Calendar.MONTH); } + public static boolean before(Date start, Date end){ + Calendar date1 = Calendar.getInstance(); + date1.setTime(start); + Calendar date2 = Calendar.getInstance(); + date2.setTime(end); + return date1.before(date2); + } + + public static void main(String[]args)throws Exception{ diff --git a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java index c24daed..ab8c79d 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java @@ -1,5 +1,6 @@ package com.panzhihua.community_backstage.api; +import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; 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.EventGridStatisticsVO; @@ -9,10 +10,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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 org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -49,6 +47,15 @@ return communityService.getScreenEvent(communityId); } + @ApiOperation(value = "事件大屏详情接口@lyq",response = EventStatisticsVO.class) + @PostMapping("/event/detail/noToken") + public R eventDetail(@RequestBody BigScreenEventDetailDTO eventDetailDTO) { + if(eventDetailDTO.getEventId() == null || eventDetailDTO.getType() == null){ + return R.fail("参数错误"); + } + return communityService.getScreenEventDetail(eventDetailDTO); + } + @ApiOperation(value = "民生大屏统计接口@lyq",response = CivilStatisticsVO.class) @GetMapping("/civil/noToken") public R civil(@RequestParam("communityId") Long communityId) { diff --git a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java index 1106cc8..4ee8c59 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java @@ -97,6 +97,26 @@ return R.ok(); } + + @ApiOperation(value = "excel导入实有人口notoken") + @PostMapping(value = "/serve/import/noToken", consumes = "multipart/*", headers = "content-type=multipart/form-date") + public R downloadPopulationTemplateno(@RequestParam MultipartFile file, HttpServletRequest request) { + //获取文件名 + String fileName = file.getOriginalFilename(); + log.info("传入文件名字【{}】", fileName); + InputStream inputStream = null; + try { + Long communityId = Long.valueOf(request.getParameter("communityId")); + inputStream = file.getInputStream(); + ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, communityId); + EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); + } catch (IOException e) { + log.error("导入模板失败【{}】", e.getMessage()); + e.printStackTrace(); + } + return R.ok(); + } + @ApiOperation(value = "编辑实有人口") @PostMapping(value = "/edit") public R editPopulationInfo(@RequestBody ComMngPopulationEditDTO populationEditDTO){ diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java index 6c2ac15..c3025bd 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java @@ -1,12 +1,10 @@ package com.panzhihua.service_community.api; +import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; 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 org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -53,5 +51,10 @@ return R.ok(comMngPopulationService.getScreenGirds(communityId)); } + @PostMapping("/getScreenEventDetail") + public R eventDetail(@RequestBody BigScreenEventDetailDTO eventDetailDTO) { + return R.ok(comMngPopulationService.getScreenEventDetail(eventDetailDTO)); + } + } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java index f6497ff..658841c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java @@ -21,7 +21,10 @@ private ScreenWorkService screenWorkService; /** + * * 大屏统计邻里圈 + * 状态-显示(2) + * 本月新增-显示(2) * @param communityId * @return */ @@ -31,7 +34,10 @@ } /** - * 大屏统计心愿单 + * 大屏统计心愿单, + * 累计实现-已完成(6) + * 等待实现-非已完成(1、2、3、4、5) + * 本月新增-所有状态(1、2、3、4、5、6) * @param communityId * @return */ @@ -42,6 +48,10 @@ /** * 大屏统计社区活动 + * 状态:报名中(3)、进行中(4)、已结束(5) + * 本月新增:报名中(3)、进行中(4)、已结束(5) + * 志愿者活动-参与者人数上限为0 + * 居民活动-参与者人数上限>0 * @param communityId * @return */ @@ -52,6 +62,7 @@ /** * 大屏统计一起议 + * 参与人数-点赞、评论、评论点赞 * @param communityId * @return */ @@ -62,6 +73,8 @@ /** * 大屏统计党建工作 + * 党员活动:报名中(3)、进行中(4)、已结束(5) + * 党员宣传(党员动态): * @param communityId * @return */ @@ -72,6 +85,16 @@ /** * 大屏统计随手拍 + * 新增的-所有状态 + * 已处理-3已驳回 4已完成 + * 已公示-4已完成 + * 未公示-3已驳回 + * 未处理-1待审核 + * 公示比例-已公示/(已公示+已驳回) + * 平均耗时-创建时间至反馈时间(已完成状态) + * 线形图-随手拍数量-累计 + * 线形图-新增随手拍-时间段新增 + * 线形图-处理随手拍-时间段(已驳回和已完成) * @param communityId * @return */ diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java index b73818a..841d4af 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java @@ -60,8 +60,9 @@ " SELECT id, id_card, ROUND(DATEDIFF(CURDATE(), STR_TO_DATE(SUBSTRING(id_card,7,15), '%Y%m%d'))/365.2422) AS age " + " FROM com_pb_member " + " <where> " + + " audit_result = 1 " + "<if test='queryDTO.communityId != null'> " + - " community_id = #{queryDTO.communityId} " + + " AND community_id = #{queryDTO.communityId} " + "</if> " + " </where>" + " ) t " + @@ -82,8 +83,9 @@ " SELECT CONVERT(SUBSTRING(id_card,'17',1), UNSIGNED INTEGER)%2 AS sxi, COUNT(id_card) AS total " + " FROM com_pb_member " + " <where> " + + " audit_result = 1 " + "<if test='queryDTO.communityId != null'>" + - " community_id = #{queryDTO.communityId} " + + " AND community_id = #{queryDTO.communityId} " + "</if> " + " </where>" + " GROUP BY sxi " + diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java index be9453f..e9fa6ce 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java @@ -259,19 +259,18 @@ "\t\tAND a.community_id =#{communityId}") CommunityActivitiesVO selectCommunityActivitiesVO(@Param("communityId") Long communityId, @Param("date")Date date); - @Select("SELECT COUNT(id) AS totalNum," + - "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%'))AS currentNum," + - "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND volunteer_max = 0)AS commonNum," + - "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.volunteer_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + + @Select("SELECT COUNT(id) AS currentNum," + + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max > 0)AS commonNum," + + "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.participant_max > 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max = 0)AS volunteerNum," + "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.community_id=#{communityId} AND a.participant_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5))AS volunteerPeopleNum" + - " FROM com_act_activity where community_id=#{communityId} AND (status = 3 OR status = 4 OR status = 5)") + " FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%') ") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); - @Select("SELECT id,activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + + @Select("SELECT id,activity_name as content,IF(participant_max = 0,'志愿者活动','居民活动') AS typeName FROM com_act_activity " + "WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) ORDER BY create_at DESC LIMIT #{pageSize}") List<CarouselInfoVO> screenActivity(@Param("communityId")Long communityId, @Param("pageSize")Integer pageSize); - @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId}") + @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5)") List<String> listImg(@Param("communityId")Long communityId); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java index e71264a..a8fc4fd 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java @@ -190,9 +190,8 @@ "GROUP BY d.id") ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId); - @Select(" SELECT COUNT(id) AS totalNum," + - "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%'))AS currentNum," + - "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND TYPE = 1)AS imgNum," + + @Select(" SELECT COUNT(id) AS currentNum," + + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 1)AS imgNum," + "(" + "SELECT COUNT(DISTINCT(user_id)) FROM (" + " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + @@ -203,7 +202,8 @@ " UNION ALL " + " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + ")d " + - ")AS commonPeopleNum," + + ")AS imgPeopleNum," + + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 2)AS voteNum," + "(" + "SELECT COUNT(DISTINCT(user_id)) FROM (" + " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + @@ -214,8 +214,8 @@ " UNION ALL " + " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + ")d " + - ")AS volunteerPeopleNum " + - " FROM com_act_discuss") + ")AS votePeopleNum " + + " FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%')") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId, @Param("date")String date); @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java index eec7ae4..0aced19 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java @@ -242,17 +242,17 @@ IPage<ComActEasyPhotoVO> pageEasyPhotoApplets(Page page, @Param("comActEasyPhotoVO")ComActEasyPhotoVO comActEasyPhotoVO); @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + - "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.handle_status = 1 AND p.community_id = #{communityId} " + + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 1 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countDeal(@Param("communityId")Long communityId); @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + - "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.is_publicity = 1 AND p.community_id = #{communityId} " + + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 4 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countPub(@Param("communityId")Long communityId); @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + - "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.status = 4 and p.community_id = #{communityId} " + + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id and p.community_id = #{communityId} AND p.status = 3 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countApproved(@Param("communityId")Long communityId); @@ -261,15 +261,15 @@ "SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = 2 AND create_at LIKE concat(#{nowDate},'%') " + ") AS currentNum," + "(" + - "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 AND handle_status = 2)*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND handle_status = 2) " + + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND status = 4 )*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} and (status = 3 or status = 4)) " + ") AS pubPoint," + - "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and handle_status = 2 ) AS dealTime " + - "FROM com_act_easy_photo where community_id = #{communityId}") + "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and status = 4 ) AS dealTime " + + "FROM com_act_easy_photo where community_id = #{communityId} and status = 1 ") Map<String, Object> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate") String nowDate); @Select("SELECT COUNT(id) AS total, " + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ) AS adds, " + - "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND handle_status = 2 AND #{start} < create_at and create_at < #{end}) AS deal " + - "FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ") + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND (status = 3 or status = 4) AND #{start} < create_at and create_at < #{end}) AS deal " + + "FROM com_act_easy_photo WHERE community_id = #{communityId} AND create_at < #{end} ") EastPhotoVO countByTime(@Param("start")String start, @Param("end")String end, @Param("nowDate")String nowDate, @Param("communityId")Long communityId); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java index e18aee3..ce38416 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java @@ -163,8 +163,8 @@ int updateStatusAutoConfirm(); @Select("SELECT COUNT(id) AS completedNum," + - "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + - "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 4 OR status = 5)) AS willNum ," + + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + "FROM com_act_micro_wish WHERE community_id = #{communityId} AND status = 6 ") Map<String, Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate); diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java index f20a336..017eeb8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java @@ -110,18 +110,18 @@ " where reply.comment_id = #{commentId} and reply.status = 1") IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); - @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and(status = 2 or status = 3) ORDER BY create_at DESC limit #{pageSize}") + @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and status = 2 ORDER BY create_at DESC limit #{pageSize}") List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); @Select(" SELECT COUNT(id) AS totalNum," + - " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND (status = 2 OR status = 3) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + - " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") + " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2 AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + + " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); - @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) ") + @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 ") Map<String, Object> sumScreenNum(@Param("communityId")Long communityId); - @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") + @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 order by create_at desc limit #{pageSize}") List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); } \ No newline at end of file diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java index a9faba8..87cc381 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java @@ -305,18 +305,17 @@ @Select("SELECT " + " count( e.id ) AS eventTFTotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_status = 2 AND event_deal_status in (1,2,3) AND grid_id = egd.id ),0) AS eventZATotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 3 AND event_status = 2 AND event_deal_status in (1,2,3) AND grid_id = egd.id ),0) AS eventMDTotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_status = 2 AND event_deal_status in (1,2,3) AND grid_id = egd.id ),0) AS eventTSTotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 4 AND event_status = 2 AND event_deal_status in (1,2,3) AND grid_id = egd.id ),0) AS eventBWDTotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 2 AND event_status = 2 AND event_deal_status in (1,2,3) AND grid_id = egd.id ),0) AS eventGGTotal " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_status = 2 AND grid_id = egd.id ),0) AS eventZATotal, " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 3 AND event_status = 2 AND grid_id = egd.id ),0) AS eventMDTotal, " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_status = 2 AND grid_id = egd.id ),0) AS eventTSTotal, " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 4 AND event_status = 2 AND grid_id = egd.id ),0) AS eventBWDTotal, " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 2 AND event_status = 2 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 in (1,2,3) " + " AND e.event_status = 2 " + " AND egd.grid_community_id = #{communityId}") IndexGridEventStatisticsVO getGridEventStatisticsList(@Param("communityId") Long communityId); @@ -326,17 +325,16 @@ @Select("SELECT " + " count( e.id ) AS eventTFTotal, " + - " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_status = 2 AND event_deal_status in (1,2,3) 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_status = 2 AND event_deal_status in (1,2,3) 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_status = 2 AND event_deal_status in (1,2,3) 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_status = 2 AND event_deal_status in (1,2,3) 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_status = 2 AND event_deal_status in (1,2,3) AND grid_id = e.grid_id ),0) AS eventGGTotal " + + " IFNULL(( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_status = 2 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_status = 2 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_status = 2 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_status = 2 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_status = 2 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 in (1,2,3) " + " AND e.event_status = 2 " + " AND e.grid_id = #{gridId}") IndexGridEventStatisticsVO getGridEventByGirdId(@Param("gridId") Long gridId); @@ -625,6 +623,7 @@ @Select("SELECT " + " event_type AS type, " + + " e.id AS eventId, " + " happent_lat_lng AS latLng " + "FROM " + " `event` AS e " + @@ -633,18 +632,17 @@ " 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} " + " AND e.happen_time BETWEEN date_add( curdate(), INTERVAL - DAY ( curdate())+ 1 DAY ) " + " AND date_add( curdate()- DAY ( curdate())+ 1, INTERVAL 1 MONTH ) UNION ALL " + "SELECT " + " IFNULL( NULL, 7 ) AS type, " + + " id AS eventId, " + " 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 " + " AND create_at BETWEEN date_add( curdate(), INTERVAL - DAY ( curdate())+ 1 DAY ) " + @@ -724,4 +722,44 @@ "(SELECT (SELECT TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") Map<String, Long> indexCountByAge(@Param("communityId")Long communityId); + + @Select("SELECT " + + " id, " + + " su.nick_name AS userName, " + + " su.image_url, " + + " caep.create_at, " + + " caep.detail AS eventDes, " + + " caep.happen_addr AS happenAddress, " + + " caep.lng_lat AS happentLatLng, " + + " caep.photo_path_list, " + + " IFNULL( NULL, 7 ) AS eventType, " + + " caep.handle_status AS eventDealStatus " + + "FROM " + + " com_act_easy_photo AS caep " + + " LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id " + + "WHERE " + + " id = #{eventId}") + EventNewStatisticsVO getEventScreenSSPDateil(@Param("eventId")Long eventId); + + @Select("SELECT " + + " su.nick_name AS userName, " + + " su.image_url AS imageUrl, " + + " e.happen_time as createAt, " + + " 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 " + + " e.id = #{eventId}") + EventNewStatisticsVO getEventScreenEventDetail(@Param("eventId") Long eventId); + } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java index e25f4be..b8d1155 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java @@ -4,6 +4,7 @@ import com.panzhihua.common.model.dtos.community.ComMngPopulationEditDTO; import com.panzhihua.common.model.dtos.community.ComMngPopulationTagCardNoDTO; import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; +import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; @@ -205,4 +206,6 @@ R screenStatistic(Long communityId); R getScreenGirds(Long communityId); + + R getScreenEventDetail(BigScreenEventDetailDTO eventDetailDTO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java index 4630487..f95a52b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java @@ -14,6 +14,7 @@ import com.panzhihua.common.enums.PopulIsOksEnum; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.dtos.community.*; +import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.helper.AESUtil; import com.panzhihua.common.model.vos.R; @@ -856,11 +857,35 @@ 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); + 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{ + IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); + specialStatisticsVO.setTitle(userTag.getTagName()); + Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); + specialStatisticsVO.setSum(count); + specialStatisticsVOList.add(specialStatisticsVO); + } + } } } }); @@ -1007,11 +1032,35 @@ 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); + 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{ + IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); + specialStatisticsVO.setTitle(userTag.getTagName()); + Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); + specialStatisticsVO.setSum(count); + specialStatisticsVOList.add(specialStatisticsVO); + } + } } } }); @@ -1206,10 +1255,74 @@ comActPopulationScreenVO.setAgeGroup(ageList); } + @Override public R getScreenGirds(Long communityId){ return R.ok(this.baseMapper.getEventScreenGridData(communityId)); } + @Override + public R getScreenEventDetail(BigScreenEventDetailDTO eventDetailDTO){ + EventNewStatisticsVO statisticsVO = new EventNewStatisticsVO(); + if(eventDetailDTO.getType().equals(7)){//随手拍详情 + statisticsVO = this.baseMapper.getEventScreenSSPDateil(eventDetailDTO.getEventId()); + if(statisticsVO != null && StringUtils.isNotEmpty(statisticsVO.getPhotoPathList())){ + statisticsVO.setDangerLevel("0"); + statisticsVO.setMajor(false); + statisticsVO.setUrgent(false); + if(statisticsVO.getEventDealStatus().equals(2)){ + statisticsVO.setEventDealStatus(4); + } + List<EventResourceVO> picList = new ArrayList<>(); + String [] pics = statisticsVO.getPhotoPathList().split(","); + if(pics.length > 0){ + for (int i = 0; i < pics.length; i++) { + EventResourceVO resourceVO = new EventResourceVO(); + resourceVO.setType(1); + resourceVO.setUrl(pics[i]); + picList.add(resourceVO); + } + } + statisticsVO.setPics(picList); + } + }else{//事件详情 + statisticsVO = this.baseMapper.getEventScreenEventDetail(eventDetailDTO.getEventId()); + if(statisticsVO != null){ + //查询事件资源文件 + List<EventResourceDO> eventResourceDOList = + eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() + .eq(EventResourceDO::getClassification, 1) + .eq(EventResourceDO::getRefId, statisticsVO.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; + } + }); + statisticsVO.setAudios(audioList); + statisticsVO.setPics(picList); + statisticsVO.setVideos(videoList); + } + } + return R.ok(statisticsVO); + } + 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)); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java index 6ef4a1e..f01e54a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java @@ -1,5 +1,6 @@ package com.panzhihua.service_community.service.impl; +import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -43,7 +45,14 @@ @Resource private ComActEasyPhotoDAO comActEasyPhotoDAO; + /** + * 项目开始时间,超过的不统计 + */ + private final String initMonth = "2020-12"; + private final String moth_format_str = "yyyy-MM"; + + private final String moth_format_ch = "yyyy年MM月"; private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; @@ -108,12 +117,12 @@ //统计本月新增、居民活动,志愿者活动 String date = DateUtils.getDateFormatString(new Date(),moth_format_str); Map<String,Long> countMap = actActivityDAO.countByCommunityId(communityId,date); - comActActivityScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); comActActivityScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); comActActivityScreenVO.setCommonNum(countMap.get("commonNum") == null ? 0L : countMap.get("commonNum")); comActActivityScreenVO.setCommonPeopleNum(countMap.get("commonPeopleNum") == null ? 0L : countMap.get("commonPeopleNum")); comActActivityScreenVO.setVolunteerNum(countMap.get("volunteerNum") == null ? 0L : countMap.get("volunteerNum")); comActActivityScreenVO.setVolunteerPeopleNum(countMap.get("volunteerPeopleNum") == null ? 0L : countMap.get("volunteerPeopleNum")); + comActActivityScreenVO.setTotalNum(comActActivityScreenVO.getCommonNum()+comActActivityScreenVO.getVolunteerNum()); //最近活动 comActActivityScreenVO.setList(actActivityDAO.screenActivity(communityId,pageSize)); return R.ok(comActActivityScreenVO); @@ -126,11 +135,11 @@ String date = DateUtils.getDateFormatString(new Date(),moth_format_str); Map<String,Long> countMap = comActDiscussDAO.countByCommunityId(communityId,date); discussScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); - discussScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); discussScreenVO.setImgNum(countMap.get("imgNum") == null ? 0L : countMap.get("imgNum")); discussScreenVO.setImgPeopleNum(countMap.get("imgPeopleNum") == null ? 0L : countMap.get("imgPeopleNum")); - discussScreenVO.setVoteNum(discussScreenVO.getTotalNum() - discussScreenVO.getImgNum()); + discussScreenVO.setVoteNum(countMap.get("voteNum") == null ? 0L : countMap.get("voteNum")); discussScreenVO.setVotePeopleNum(countMap.get("votePeopleNum") == null ? 0L : countMap.get("votePeopleNum")); + discussScreenVO.setTotalNum(discussScreenVO.getImgNum()+discussScreenVO.getVoteNum()); discussScreenVO.setList(comActDiscussDAO.screenDiscuss(communityId,pageSize)); return R.ok(discussScreenVO); } @@ -145,10 +154,11 @@ pbWorkScreenVO.setTotalNum(pbWorkScreenVO.getActivityNum() + pbWorkScreenVO.getDynNum()); pbWorkScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); //统计近半年数据 + int n = 6; List<PbWorkVO> list = new ArrayList<>(); - for(PbWorkVO workVO: listHalfYear()){ - PbWorkVO result = comPbDynDAO.countByTime(workVO.getStart(),workVO.getEnd(),communityId); - result.setMonth(workVO.getMonth()); + for(Map<String,String> map : listHalfYear(n)){ + PbWorkVO result = comPbDynDAO.countByTime(map.get("start"),map.get("end"),communityId); + result.setMonth(map.get("name")); list.add(result); } pbWorkScreenVO.setList(list); @@ -156,10 +166,10 @@ } - private List<PbWorkVO> listHalfYear() { - List<PbWorkVO> dateList = new ArrayList<>(); + private List<Map<String,String>> listHalfYear(int num) { + List<Map<String,String>> dateList = new ArrayList<>(); Date now = new Date(); - for(int i= 6;i>=1;i--){ + for(int i= num;i>=1;i--){ Date date = DateUtils.getDateM(now,-i); DateTime endDay = DateUtil.endOfMonth(date); @@ -167,16 +177,19 @@ int day = DateUtil.dayOfMonth(endDay); int half = day/2; String month = DateUtil.format(date,moth_format_str); - PbWorkVO pbWorkVO = new PbWorkVO(); - pbWorkVO.setMonth(monthStr[m]+"月上旬"); - pbWorkVO.setStart(month+ "-01 00:00:00"); - pbWorkVO.setEnd(month+ "-"+half+" 23:59:58"); - dateList.add(pbWorkVO); - PbWorkVO pbWorkVO2 = new PbWorkVO(); - pbWorkVO2.setMonth(monthStr[m]+"月下旬"); - pbWorkVO2.setStart(month+ "-"+half+" 23:59:58"); - pbWorkVO2.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); - dateList.add(pbWorkVO2); + if(Objects.equals(month,initMonth)){ + continue; + } + Map<String,String> startMap = new HashMap<>(); + startMap.put("name",monthStr[m]+"月上旬"); + startMap.put("start",month+ "-01 00:00:00"); + startMap.put("end",month+ "-"+half+" 23:59:58"); + dateList.add(startMap); + Map<String,String> endMap = new HashMap<>(); + endMap.put("name",monthStr[m]+"月下旬"); + endMap.put("start",month+ "-"+half+" 23:59:59"); + endMap.put("end",DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); + dateList.add(endMap); } return dateList; @@ -192,39 +205,39 @@ Map<String,Object> countMap = comActEasyPhotoDAO.countByCommunityId(communityId,date); comActEasyPhotoScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : Long.valueOf(countMap.get("currentNum").toString())); comActEasyPhotoScreenVO.setNoneDeal(countMap.get("noneDeal") == null ? 0L : Long.valueOf(countMap.get("noneDeal").toString())); - comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0 : Integer.valueOf(countMap.get("pubPoint").toString())); + comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0 : Double.valueOf(countMap.get("pubPoint").toString()).intValue()); comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue()); List<EastPhotoVO> list = new ArrayList<>(); - for(PbWorkVO workVO: listHalfYear()){ - String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(workVO.getStart()),moth_format_str); - EastPhotoVO result = comActEasyPhotoDAO.countByTime(workVO.getStart(),workVO.getEnd(),nowDate,communityId); - result.setMonth(workVO.getMonth()); + //统计半年数据 + int n = 6; + for(Map<String,String> map : listHalfYear(n)){ + String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(map.get("start")),moth_format_str); + EastPhotoVO result = comActEasyPhotoDAO.countByTime(map.get("start"),map.get("end"),nowDate,communityId); + result.setMonth(map.get("name")); list.add(result); } comActEasyPhotoScreenVO.setList(list); + String fmt = "yyyy-MM-01 00:00:00"; + Date start = DateUtil.parse(DateUtil.format(DateUtils.getDateM(new Date(),-n),new SimpleDateFormat(fmt))); + Date initTime = DateUtil.parse(initMonth +"-01 00:00:00", DatePattern.NORM_DATETIME_FORMAT); + if(!DateUtils.before(initTime,start)){ + start = initTime; + } + comActEasyPhotoScreenVO.setListTimes(DateUtil.format(start,moth_format_ch)+"-"+DateUtil.format(DateUtils.getDateM(new Date(),-1),moth_format_ch)); return R.ok(comActEasyPhotoScreenVO); } - private List<EasyPhotoPointVO> getList(Map<String, Long> dealMap) { - Set<Map.Entry<String,Long>> entrySet = dealMap.entrySet(); - - List<EasyPhotoPointVO> list = new ArrayList<>(); - for(Map.Entry<String,Long> en:entrySet){ - EasyPhotoPointVO easyPhotoPointVO = new EasyPhotoPointVO(); - easyPhotoPointVO.setTypeName(en.getKey()); - easyPhotoPointVO.setPoint(en.getValue().intValue()); - list.add(easyPhotoPointVO); - } - return list; - - } - @Override public R workCount(Long communityId) { ComActWorkScreenVO comActWorkScreenVO = new ComActWorkScreenVO(); + //已完成 +// Map<String,Long> countMap = comActNeighborCircleDAO.countAllWorkBy(communityId); + + + comActWorkScreenVO.setAvgTime("1小时"); comActWorkScreenVO.setTotalCompletedPoint(70); comActWorkScreenVO.setEveryDayNum("0.3"); -- Gitblit v1.7.1