springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/EldersAuthApi.java
@@ -114,7 +114,7 @@ return R.ok(result); }else{ log.error("查询老人信息失败,错误信息:" + isOk.getMsg()); return R.fail("查询老人信息失败"); return isOk; } } springcloud_k8s_panzhihuazhihuishequ/common/pom.xml
@@ -14,12 +14,6 @@ <packaging>jar</packaging> <dependencies> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-core</artifactId> <version>4.0.7</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComEldersAuthElderlyExcelListen.java
@@ -81,8 +81,15 @@ throw new ServiceException("身份证号错误"); } eldersAuthElderlyExcelVO.setBirthday(DateUtils.getDateStringYMD(IdcardUtil.getBirthDate(eldersAuthElderlyExcelVO.getIdCard()))); eldersAuthElderlyExcelVO.setLevel(EldersAuthLevelEnum.getCode(IdcardUtil.getAgeByIdCard(eldersAuthElderlyExcelVO.getIdCard()))); String idCard = eldersAuthElderlyExcelVO.getIdCard(); if(idCard!=null && idCard.contains("x")){ idCard = idCard.replaceAll("x", "X"); } eldersAuthElderlyExcelVO.setIdCard(idCard); eldersAuthElderlyExcelVO.setBirthday(DateUtils.getDateStringYMD(IdcardUtil.getBirthDate(idCard))); eldersAuthElderlyExcelVO.setLevel(EldersAuthLevelEnum.getCode(IdcardUtil.getAgeByIdCard(idCard))); list.add(eldersAuthElderlyExcelVO); // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM if(list.size() >= BATCH_COUNT){ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/event/ScreenEventListDTO.java
New file @@ -0,0 +1,59 @@ package com.panzhihua.common.model.dtos.community.bigscreen.event; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; @Data @ApiModel("大屏事件列表请求参数") public class ScreenEventListDTO { @ApiModelProperty(value = "分页每页数量",example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "分页当前记录数",example = "1") private Long pageNum = 1L; @ApiModelProperty(value = "社区id", example = "2", required = true) @NotNull(message = "社区id不能为空") private Long communityId; @ApiModelProperty(value="查询开始时间") private String startTime; @ApiModelProperty(value="查询结束时间") private String endTime; @ApiModelProperty(value="网格id") private Long gridId; @ApiModelProperty(value="事件类型(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报 8宣传教育)") private Integer eventType; @ApiModelProperty(value="事件分类(1、办件事件2、宣传事件3、阅读事件)",hidden = true) private Integer eventCategory = 1; @ApiModelProperty(value="事件处理状态(1待处理、2待验证、3已上报、4已解决、5草稿箱、6已撤销、7已失效 8 已发布)") private Integer eventDealStatus; @ApiModelProperty("是否紧急") private Boolean urgent; @ApiModelProperty("是否重大") private Boolean major; /** * 事件类型(1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报 8宣传教育) */ public interface eventType{ int za = 1; int gg = 2; int md = 3; int bwd = 4; int tf = 5; int ts = 6; int xc = 8; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/work/ScreenDiscussListDTO.java
New file @@ -0,0 +1,39 @@ package com.panzhihua.common.model.dtos.community.bigscreen.work; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; @Data @ApiModel("工作大屏一起议列表请求参数") public class ScreenDiscussListDTO { @ApiModelProperty(value = "分页每页数量",example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "分页当前记录数",example = "1") private Long pageNum = 1L; @ApiModelProperty(value = "社区id", example = "2", required = true) @NotNull(message = "社区id不能为空") private Long communityId; @ApiModelProperty(value="查询开始时间") private String startTime; @ApiModelProperty(value="查询结束时间") private String endTime; @ApiModelProperty(value="发布类型 1 图文 2 投票") private Integer type; /** * 发布类型 1 图文 2 投票 */ public interface type{ int tw = 1; int tp = 2; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/CommonEventAddDTO.java
@@ -7,6 +7,7 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.util.Date; @@ -69,11 +70,13 @@ private Integer dangerLevel; @Max(9999999999L) @Min(value = 0, message = "死亡人数不能为负数") @ApiModelProperty(value = "死亡人数", hidden = false, example = "1", required = true) @NotNull(message = "死亡人数不能为空") private Integer deathsNumber; @Max(9999999999L) @Min(value = 0, message = "受伤人数不能为负数") @ApiModelProperty(value = "受伤人数", hidden = false, example = "1", required = true) @NotNull(message = "受伤人数不能为空") private Integer injuriesNumber; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/CommonEventDealDTO.java
@@ -28,7 +28,7 @@ @NotNull private Long id; @Length(max=255) @Length(max=500, message = "办理意见不能超过500个字") @ApiModelProperty(value = "办理意见", hidden = false, example = "",required = true) @NotNull private String processResult; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PublicityEventAddDTO.java
@@ -8,6 +8,7 @@ import org.hibernate.validator.constraints.URL; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import java.util.Date; @@ -75,6 +76,7 @@ @NotNull(message = "宣传对象不能为空") private String propagandaObject; @Min(1) @Length(max=8) @ApiModelProperty(value = "宣传人数", hidden = false, example = "", required = true) @NotNull(message = "宣传人数不能为空") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventListVO.java
New file @@ -0,0 +1,71 @@ 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; import lombok.Data; import java.util.Date; import java.util.List; @Data @ApiModel("事件列表返回参数") public class EventListVO { @ApiModelProperty("事件id") @JsonSerialize(using = ToStringSerializer.class) private Long id; @ApiModelProperty("发布人昵称") private String userName; @ApiModelProperty("发布人id") private Long gridMemberId; @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 happentAddress; @ApiModelProperty("事件发生经纬度(长在前短在后)") private String happentLatLng; @ApiModelProperty("事件分类1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报") private Integer eventType; @ApiModelProperty("事件分类(1、办件事件2、宣传事件3、阅读事件)") private Integer eventCategory; @ApiModelProperty("事件处理状态(1待处理、2待验证、3已上报、4已解决、5草稿箱、6已撤销、7已失效 8 已发布)") private Integer eventDealStatus; @ApiModelProperty("事件类型") private String eventClazz; @ApiModelProperty("发生区域") private String gridName; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventNewStatisticsVO.java
@@ -25,7 +25,7 @@ @ApiModelProperty("发布人头像") private String imageUrl; @ApiModelProperty("发布时间") @ApiModelProperty("事件上报时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; @@ -50,11 +50,20 @@ @ApiModelProperty("事件分类1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群信息上报") private Integer eventType; @ApiModelProperty("事件处理状态(1待处理、4已解决)") @ApiModelProperty("事件分类(1、办事事件2、宣传事件3、阅读事件)") private Integer eventCategory; @ApiModelProperty("事件处理状态(1待处理、2待验证、3已上报、4已解决、5草稿箱、6已撤销、7已失效 8 已发布)") private Integer eventDealStatus; @ApiModelProperty("随手拍图片集合") private String photoPathList; @ApiModelProperty("事件类型") private String eventClazz; @ApiModelProperty("发生区域") private String gridName; @ApiModelProperty(value = "音频") private List<EventResourceVO> audios; @@ -65,4 +74,7 @@ @ApiModelProperty(value = "图片") private List<EventResourceVO> pics; @ApiModelProperty(value = "事件处理流转记录") private List<EventTransferRecordVO> transferRecordList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventTransferRecordVO.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.common.model.vos.community.screen.event; 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 EventTransferRecordVO { @ApiModelProperty("事件处理时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date processDate; @ApiModelProperty("事件处理结果") private String processResult; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/work/DiscussListVO.java
New file @@ -0,0 +1,53 @@ package com.panzhihua.common.model.vos.community.screen.work; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.community.ComActDiscussOptionVO; 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 DiscussListVO { @ApiModelProperty("主键id") private Long id; @ApiModelProperty("发布人昵称") private String userName; @ApiModelProperty("发布人id") private Long userId; @ApiModelProperty("发布人头像") private String imageUrl; @ApiModelProperty("发布类型 1 图文 2 投票") private Integer type; @ApiModelProperty("发布时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; @ApiModelProperty("发布主题") private String discussSubject; @ApiModelProperty("投票标题") private String voteTitle; @ApiModelProperty("图片地址 多个用逗号隔开") private String photoPah; @ApiModelProperty("评论数量") private Integer commentCount; @ApiModelProperty("点赞数量") private Integer fabulousCount; @ApiModelProperty("投票选项列表") private List<ComActDiscussOptionVO> discussOptionList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/EventDetailsVO.java
@@ -164,9 +164,12 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date submitDate; @ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人id") private Long createBy; @ApiModelProperty(value = "创建人姓名") private String creator; @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java
@@ -34,7 +34,7 @@ private Integer pubPoint; @ApiModelProperty("平均耗时") private Integer dealTime; private String dealTime; @ApiModelProperty("线形图统计时间段") private String listTimes; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -9,6 +9,8 @@ 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; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO; import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; @@ -3025,4 +3027,13 @@ */ @PostMapping("/screen/getScreenEventDetail") R getScreenEventDetail(@RequestBody BigScreenEventDetailDTO eventDetailDTO); /** * 工作大屏-一起议列表 * @param discussListDTO 请求参数 * @return 一起议列表 */ @PostMapping("/screen/work/getScreenDiscussList") R getScreenDiscussList(@RequestBody ScreenDiscussListDTO discussListDTO); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.service.grid; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.dtos.grid.*; import com.panzhihua.common.model.vos.*; import com.panzhihua.common.model.vos.grid.*; @@ -892,4 +893,12 @@ */ @PostMapping("/eventgridmemberwarnlog/judge") R timedTaskGridMember(); /** * 事件大屏查询事件列表 * @param eventListDTO 请求参数 * @return 事件列表 */ @PostMapping("/screen/event/list") R getScreenEventList(@RequestBody ScreenEventListDTO eventListDTO); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -1,12 +1,16 @@ package com.panzhihua.community_backstage.api; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; 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; import com.panzhihua.common.model.vos.community.screen.event.EventListVO; import com.panzhihua.common.model.vos.community.screen.event.EventNewStatisticsVO; 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 com.panzhihua.common.service.grid.GridService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -22,6 +26,8 @@ @Resource private CommunityService communityService; @Resource private GridService gridService; @ApiOperation(value = "大屏测试接口") @GetMapping("/test/noToken") @@ -47,7 +53,7 @@ return communityService.getScreenEvent(communityId); } @ApiOperation(value = "事件大屏详情接口@lyq",response = EventStatisticsVO.class) @ApiOperation(value = "事件大屏详情接口@lyq",response = EventNewStatisticsVO.class) @PostMapping("/event/detail/noToken") public R eventDetail(@RequestBody BigScreenEventDetailDTO eventDetailDTO) { if(eventDetailDTO.getEventId() == null || eventDetailDTO.getType() == null){ @@ -73,4 +79,13 @@ } return communityService.getScreenGirds(communityId); } @ApiOperation(value = "事件大屏事件列表接口@lyq",response = EventListVO.class) @PostMapping("/civil/list/noToken") public R eventList(@RequestBody ScreenEventListDTO eventListDTO) { if(eventListDTO.getCommunityId() == null){ return R.fail("参数错误"); } return gridService.getScreenEventList(eventListDTO); } } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenWorkApi.java
@@ -1,16 +1,15 @@ package com.panzhihua.community_backstage.api; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.screen.work.DiscussListVO; import com.panzhihua.common.model.vos.screen.*; import com.panzhihua.common.service.community.CommunityService; 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; @@ -107,13 +106,17 @@ @ApiOperation(value = "工作情况@xyh",response = ComActWorkScreenVO.class) @GetMapping("/workCount") public R workCount(@RequestParam("communityId") Long communityId){ return communityService.workCount(communityId); } @ApiOperation(value = "工作大屏一起议列表接口@lyq",response = DiscussListVO.class) @PostMapping("/discuss/list") public R discussList(@RequestBody ScreenDiscussListDTO discussListDTO) { if(discussListDTO.getCommunityId() == null){ return R.fail("参数错误"); } return communityService.getScreenDiscussList(discussListDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/EldersAuthApi.java
@@ -1,5 +1,6 @@ package com.panzhihua.service_community.api; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO; @@ -8,6 +9,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.elders.ComElderAuthUserDetailVO; import com.panzhihua.common.model.vos.community.SysConfVO; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.service_community.model.dos.ComEldersAuthUserDO; import com.panzhihua.service_community.model.dos.EldersAuthDO; import com.panzhihua.common.model.vos.community.ComEldersAuthElderlyDetailsVO; @@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; /** * @ClasssName EldersAuthApi @@ -39,11 +42,16 @@ @PostMapping("/getAuth") public R getAuth(@RequestParam("authUserId") Long authUserId){ ComEldersAuthUserDO authUserDO = comEldersAuthUserService.getById(authUserId); if(authUserDO == null){ return R.fail("未查询到老人信息"); } if(authUserDO.getIsAuth().equals(ComEldersAuthUserDO.isAuth.yes)){ return R.fail("该老人已认证"); List<EldersAuthDO> eldersAuthDOList = eldersAuthService.list(new QueryWrapper<EldersAuthDO>() .lambda().eq(EldersAuthDO::getType,2).ge(EldersAuthDO::getCreateAt, DateUtils.getFirstDayOfMonth())); if(!eldersAuthDOList.isEmpty()){ return R.fail("该老人已认证"); } } ComElderAuthUserDetailVO authUserDetailVO = new ComElderAuthUserDetailVO(); BeanUtils.copyProperties(authUserDO,authUserDetailVO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java
@@ -1,11 +1,10 @@ package com.panzhihua.service_community.api; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.ComActDiscussService; import com.panzhihua.service_community.service.ScreenWorkService; 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; @@ -19,6 +18,8 @@ @Resource private ScreenWorkService screenWorkService; @Resource private ComActDiscussService comActDiscussService; /** * @@ -112,4 +113,14 @@ R workCount(@RequestParam("communityId")Long communityId){ return screenWorkService.workCount(communityId); } /** * 工作大屏-一起议列表 * @param discussListDTO 请求参数 * @return 一起议列表 */ @PostMapping("/getScreenDiscussList") public R getScreenDiscussList(@RequestBody ScreenDiscussListDTO discussListDTO) { return R.ok(comActDiscussService.getScreenDiscussList(discussListDTO)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.PageComActDiscussCommentDTO; import com.panzhihua.common.model.dtos.community.PageComActDiscussDTO; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; import com.panzhihua.common.model.vos.community.ComActDiscussOptionVO; import com.panzhihua.common.model.vos.community.ComActDiscussVO; import com.panzhihua.common.model.vos.community.ComActVO; import com.panzhihua.common.model.vos.community.screen.work.DiscussListVO; import com.panzhihua.common.model.vos.screen.CarouselInfoVO; import com.panzhihua.service_community.model.dos.ComActDiscussDO; import org.apache.ibatis.annotations.Mapper; @@ -40,27 +43,27 @@ LoginUserInfoVO selectUserByUserId(Long userId); @Select("<script> " + "select t.* from ("+ "SELECT\n" + "d.id,\n" + "d.`discuss_subject`,\n" + "d.type,\n" + "COUNT( DISTINCT c.id ) commentNum,\n" + "u.name userName,\n" + "u.nick_name userNickName,\n" + "d.create_at \n" + "FROM\n" + "com_act_discuss d\n" + "JOIN sys_user u ON d.user_id = u.user_id\n" + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id \n" + "SELECT " + "d.id, " + "d.`discuss_subject`, " + "d.type, " + "COUNT( DISTINCT c.id ) commentNum, " + "u.name userName, " + "u.nick_name userNickName, " + "d.create_at " + "FROM " + "com_act_discuss d " + "JOIN sys_user u ON d.user_id = u.user_id " + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id " + " where d.community_id=#{pageComActDiscussDTO.communityId}" + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != ""'>" + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' ) \n" + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' ) " + " </if> " + "<if test='pageComActDiscussDTO.begin != null '>" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin} \n" + "AND #{pageComActDiscussDTO.end} \n" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin} " + "AND #{pageComActDiscussDTO.end} " + " </if> " + "GROUP BY\n" + "GROUP BY " + "d.id" + ")t order by t.create_at desc "+ "</script>") @@ -68,108 +71,108 @@ @Select("<script> " + "select * from ("+ "SELECT\n" + "u.`name` userName,\n" + "u.nick_name userNickName,\n" + "u.phone,\n" + "c.`comment`,\n" + "c.`parent_id`,\n" + "COUNT(DISTINCT cu.id ) num,\n" + "c.create_at,\n" + "c.id \n" + "FROM\n" + "com_act_discuss_comment c\n" + "JOIN sys_user u ON c.user_id = u.user_id \n" + "SELECT " + "u.`name` userName, " + "u.nick_name userNickName, " + "u.phone, " + "c.`comment`, " + "c.`parent_id`, " + "COUNT(DISTINCT cu.id ) num, " + "c.create_at, " + "c.id " + "FROM " + "com_act_discuss_comment c " + "JOIN sys_user u ON c.user_id = u.user_id " + "<if test='pageComActDiscussCommentDTO.name != null and pageComActDiscussCommentDTO.name.trim() != ""'>" + "AND u.`name` LIKE concat( #{pageComActDiscussCommentDTO.name}, '%' ) \n" + "AND u.`name` LIKE concat( #{pageComActDiscussCommentDTO.name}, '%' ) " + " </if> " + "<if test='pageComActDiscussCommentDTO.account != null and pageComActDiscussCommentDTO.account.trim() != ""'>" + "AND u.phone LIKE concat( #{pageComActDiscussCommentDTO.account}, '%' )\n" + "AND u.phone LIKE concat( #{pageComActDiscussCommentDTO.account}, '%' ) " + " </if> " + "LEFT JOIN com_act_discuss_comment_user cu ON c.id = cu.disscuss_comment_id \n" + "LEFT JOIN com_act_discuss_comment_user cu ON c.id = cu.disscuss_comment_id " + " where c.discuss_id=#{pageComActDiscussCommentDTO.id}" + "<if test='pageComActDiscussCommentDTO.comment != null and pageComActDiscussCommentDTO.comment.trim() != ""'>" + " and c.`comment` LIKE concat( '%', #{pageComActDiscussCommentDTO.comment" + "}, '%' ) \n" + "}, '%' ) " + " </if> " + "GROUP BY\n" + "c.id\n" + "GROUP BY " + "c.id " + ")t order by t.create_at desc"+ "</script>") IPage<ComActDiscussCommentVO> pageDiscussComment(Page page, @Param("pageComActDiscussCommentDTO")PageComActDiscussCommentDTO pageComActDiscussCommentDTO); @Select("<script> " + "select t.* from ("+ "SELECT\n" + "d.id,\n" + "d.vote_title,\n" + "if(d.address is null or d.address='null',a.name,d.address )address,\n" + "d.photo_pah,\n" + "d.`discuss_subject`,\n" + "d.type,\n" + "COUNT( DISTINCT c.id ) commentNum,\n" + "COUNT( DISTINCT du.id ) signNum,\n" + "if(u.type=1,u.name,a.name) userName,\n" + "if(u.type=1,u.nick_name,a.name) userNickName,\n" + "if(du.id is not null,1,0) haveSign,\n" + "if(ou.id is not null,1,0) haveVote,\n" + "u.image_url,\n" + "d.create_at \n" + "FROM\n" + "com_act_discuss d\n" + "JOIN sys_user u ON d.user_id = u.user_id\n" + "JOIN com_act a ON d.community_id = a.community_id\n" + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id \n" + "LEFT JOIN com_act_discuss_user du ON d.id = du.discuss_id \n" + "LEFT JOIN com_act_discuss_option do ON d.id = do.discuss_id \n" + "LEFT JOIN com_act_discuss_option_user ou on do.id=ou.discuss_option_id and ou.user_id=#{pageComActDiscussDTO.loginUserId}\n" + "SELECT " + "d.id, " + "d.vote_title, " + "if(d.address is null or d.address='null',a.name,d.address )address, " + "d.photo_pah, " + "d.`discuss_subject`, " + "d.type, " + "COUNT( DISTINCT c.id ) commentNum, " + "COUNT( DISTINCT du.id ) signNum, " + "if(u.type=1,u.name,a.name) userName, " + "if(u.type=1,u.nick_name,a.name) userNickName, " + "if(du.id is not null,1,0) haveSign, " + "if(ou.id is not null,1,0) haveVote, " + "u.image_url, " + "d.create_at " + "FROM " + "com_act_discuss d " + "JOIN sys_user u ON d.user_id = u.user_id " + "JOIN com_act a ON d.community_id = a.community_id " + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id " + "LEFT JOIN com_act_discuss_user du ON d.id = du.discuss_id " + "LEFT JOIN com_act_discuss_option do ON d.id = do.discuss_id " + "LEFT JOIN com_act_discuss_option_user ou on do.id=ou.discuss_option_id and ou.user_id=#{pageComActDiscussDTO.loginUserId} " + " where d.community_id=#{pageComActDiscussDTO.communityId}" + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != ""'>" + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' ) \n" + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' ) " + " </if> " + "<if test='pageComActDiscussDTO.userId != null and pageComActDiscussDTO.userId !=0 '>" + " and d.`user_id` = #{pageComActDiscussDTO.userId} \n" + " and d.`user_id` = #{pageComActDiscussDTO.userId} " + " </if> " + "<if test='pageComActDiscussDTO.begin != null '>" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin} \n" + "AND #{pageComActDiscussDTO.end} \n" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin} " + "AND #{pageComActDiscussDTO.end} " + " </if> " + "GROUP BY\n" + "GROUP BY " + "d.id" + ")t order by t.create_at desc "+ "</script>") IPage<ComActDiscussVO> pageDiscussApplets(Page page, @Param("pageComActDiscussDTO")PageComActDiscussDTO pageComActDiscussDTO); @Select("<script> " + "select * from ("+ "SELECT\n" + "u.`name` userName,\n" + "u.nick_name userNickName,\n" + "u.`image_url`,\n" + "u.phone,\n" + "c.`comment`,\n" + "c.`parent_id`,\n" + "c.`is_author`,\n" + "c.`is_topping`,\n" + "COUNT( cu.id ) num,\n" + "c.create_at,\n" + "c.id \n" + "FROM\n" + "com_act_discuss_comment c\n" + "JOIN sys_user u ON c.user_id = u.user_id \n" + "JOIN com_act_discuss d ON c.discuss_id = d.id \n" + "SELECT " + "u.`name` userName, " + "u.nick_name userNickName, " + "u.`image_url`, " + "u.phone, " + "c.`comment`, " + "c.`parent_id`, " + "c.`is_author`, " + "c.`is_topping`, " + "COUNT( cu.id ) num, " + "c.create_at, " + "c.id " + "FROM " + "com_act_discuss_comment c " + "JOIN sys_user u ON c.user_id = u.user_id " + "JOIN com_act_discuss d ON c.discuss_id = d.id " + "<if test='pageComActDiscussCommentDTO.name != null and pageComActDiscussCommentDTO.name.trim() != ""'>" + "AND u.`name` LIKE concat( #{pageComActDiscussCommentDTO.name}, '%' ) \n" + "AND u.`name` LIKE concat( #{pageComActDiscussCommentDTO.name}, '%' ) " + " </if> " + "<if test='pageComActDiscussCommentDTO.account != null and pageComActDiscussCommentDTO.account.trim() != ""'>" + "AND u.phone LIKE concat( #{pageComActDiscussCommentDTO.account}, '%' )\n" + "AND u.phone LIKE concat( #{pageComActDiscussCommentDTO.account}, '%' ) " + " </if> " + "LEFT JOIN com_act_discuss_comment_user cu ON c.id = cu.disscuss_comment_id \n" + "LEFT JOIN com_act_discuss_comment_user cu ON c.id = cu.disscuss_comment_id " + " where c.discuss_id=#{pageComActDiscussCommentDTO.id} and parent_id=0 " + "<if test='pageComActDiscussCommentDTO.comment != null and pageComActDiscussCommentDTO.comment.trim() != ""'>" + " and c.`comment` LIKE concat( '%', #{pageComActDiscussCommentDTO.comment" + "}, '%' ) \n" + "}, '%' ) " + " </if> " + "GROUP BY\n" + "c.id\n" + "GROUP BY " + "c.id " + ")t order by t.is_topping desc , t.create_at desc"+ "</script>") IPage<ComActDiscussCommentVO> pageDiscussCommentApplets(Page page, @Param("pageComActDiscussCommentDTO")PageComActDiscussCommentDTO pageComActDiscussCommentDTO); @@ -177,16 +180,16 @@ @Select("select name,address from com_act where community_id=#{communityId}") ComActVO selectCommunity(Long communityId); @Select("SELECT \n" + "if(du.id is not null,1,0)haveSign,\n" + "if(ou.id is not null,1,0)haveVote\n" + "FROM\n" + "com_act_discuss d \n" + "LEFT JOIN com_act_discuss_user du on d.id=du.discuss_id and du.`user_id`=#{loginUserId}\n" + "LEFT JOIN com_act_discuss_option op on d.id=op.discuss_id\n" + "LEFT JOIN com_act_discuss_option_user ou on op.id=ou.discuss_option_id and ou.user_id=#{loginUserId}\n" + "WHERE\n" + "d.id =#{id}\n" + @Select("SELECT " + "if(du.id is not null,1,0)haveSign, " + "if(ou.id is not null,1,0)haveVote " + "FROM " + "com_act_discuss d " + "LEFT JOIN com_act_discuss_user du on d.id=du.discuss_id and du.`user_id`=#{loginUserId} " + "LEFT JOIN com_act_discuss_option op on d.id=op.discuss_id " + "LEFT JOIN com_act_discuss_option_user ou on op.id=ou.discuss_option_id and ou.user_id=#{loginUserId} " + "WHERE " + "d.id =#{id} " + "GROUP BY d.id") ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId); @@ -220,4 +223,47 @@ @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}") List<CarouselInfoVO> screenDiscuss(@Param("communityId") Long communityId, @Param("pageSize")Integer pageSize); @Select("<script> " + "SELECT " + " cad.id, " + " su.nick_name AS userName, " + " su.image_url, " + " cad.create_at, " + " cad.type, " + " cad.discuss_subject, " + " cad.photo_pah " + "FROM " + " com_act_discuss AS cad " + " LEFT JOIN sys_user AS su ON su.user_id = cad.user_id " + " <where> "+ "<if test='discussListDTO.communityId != null '>" + " and cad.community_id = #{discussListDTO.communityId} " + " </if> " + "<if test='discussListDTO.startTime != null '>" + " and cad.community_id = #{discussListDTO.communityId} " + " </if> " + "<if test='discussListDTO.startTime!=null and discussListDTO.startTime != ""'>" + " AND DATE_FORMAT(cad.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{discussListDTO.startTime} " + " </if> " + "<if test='discussListDTO.endTime!=null and discussListDTO.endTime != ""'>" + " AND DATE_FORMAT(cad.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{discussListDTO.endTime} " + " </if> " + "<if test='discussListDTO.type!=null'>" + " AND cad.type = #{discussListDTO.type} " + " </if> " + " </where> "+ "ORDER BY " + " cad.create_at DESC " + " </script>") IPage<DiscussListVO> getScreenDiscussList(Page page, @Param("discussListDTO") ScreenDiscussListDTO discussListDTO); @Select("SELECT id, discuss_id, create_at, option_content" + ",( SELECT count( id ) FROM com_act_discuss_option_user WHERE discuss_option_id = c.id ) AS num " + " FROM " + " com_act_discuss_option AS c " + " WHERE c.discuss_id = #{discussId}" + " ORDER BY " + " num DESC") List<ComActDiscussOptionVO> getScreenDiscussOptionList(@Param("discussId") Long discussId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -260,7 +260,7 @@ "(" + "(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 status = 4 ) AS dealTime " + "(SELECT AVG(TIMESTAMPDIFF(MINUTE,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); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -152,8 +152,8 @@ List<PieElementVO> countAllNoneCompletedWorkByCommunityId(@Param("communityId")Long communityId); @Select(" SELECT AVG(b.t)AS avgTime " + " FROM (SELECT TIMESTAMPDIFF(HOUR,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + " UNION ALL SELECT TIMESTAMPDIFF(HOUR,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + " )AS b ") Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -809,15 +809,18 @@ @Select("SELECT " + " su.nick_name AS userName, " + " su.image_url AS imageUrl, " + " e.happen_time as createAt, " + " e.create_at as createAt, " + " e.event_des, " + " e.event_clazz, " + " e.danger_level, " + " e.urgent, " + " e.major, " + " e.happen_address, " + " e.happent_lat_lng, " + " e.event_type, " + " e.event_category, " + " e.id, " + " egd.grid_name, " + " e.event_deal_status " + "FROM " + " `event` AS e " + @@ -827,4 +830,10 @@ " e.id = #{eventId}") EventNewStatisticsVO getEventScreenEventDetail(@Param("eventId") Long eventId); @Select("select process_date,process_result from event_transfer_record where event_id = #{eventId}") List<EventTransferRecordVO> getEventScreenEventTransList(@Param("eventId") Long eventId); @Select("select count(id) from com_elders_auth_elderly WHERE community_id = #{communityId}") Integer getStatisticsCount(@Param("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActDiscussService.java
@@ -1,6 +1,7 @@ package com.panzhihua.service_community.service; import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.vos.R; /** @@ -101,4 +102,11 @@ * @return 点赞结果 */ R putDiscussCommentUser(ComActDiscussCommentUserDTO comActDiscussUserDTO); /** * 工作大屏-一起议列表 * @param discussListDTO 请求参数 * @return 一起议列表 */ R getScreenDiscussList(ScreenDiscussListDTO discussListDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; import com.panzhihua.common.model.vos.community.ComActDiscussOptionVO; import com.panzhihua.common.model.vos.community.ComActDiscussVO; import com.panzhihua.common.model.vos.community.ComActVO; import com.panzhihua.common.model.vos.community.screen.work.DiscussListVO; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; import com.panzhihua.service_community.service.ComActDiscussOptionService; @@ -557,4 +559,31 @@ } return R.fail(); } /** * 工作大屏-一起议列表 * @param discussListDTO 请求参数 * @return 一起议列表 */ @Override public R getScreenDiscussList(ScreenDiscussListDTO discussListDTO){ IPage<DiscussListVO> discussListVOIPage = comActDiscussDAO.getScreenDiscussList(new Page(discussListDTO.getPageNum(),discussListDTO.getPageSize()),discussListDTO); if(!discussListVOIPage.getRecords().isEmpty()){ discussListVOIPage.getRecords().forEach(discussListVO -> { //查询评论数量和点赞数量 Integer integer = comActDiscussCommentDAO.selectCount(new QueryWrapper<ComActDiscussCommentDO>().lambda().eq(ComActDiscussCommentDO::getDiscussId, discussListVO.getId())); discussListVO.setCommentCount(integer); Integer integer1 = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, discussListVO.getId())); discussListVO.setFabulousCount(integer1); if(discussListVO.getType().equals(ScreenDiscussListDTO.type.tp)){//投票 List<ComActDiscussOptionVO> discussOptionList = comActDiscussDAO.getScreenDiscussOptionList(discussListVO.getId()); if(!discussOptionList.isEmpty()){ discussListVO.setDiscussOptionList(discussOptionList); } } }); } return R.ok(discussListVOIPage); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEldersAuthElderlyServiceImpl.java
@@ -75,7 +75,7 @@ if(idCardProto!=null && idCardProto.contains("x")){ idCardProto = idCardProto.replaceAll("x", "X"); } String idCardEncrypted = e.getIdCard(); String idCardEncrypted = idCardProto; try { idCardEncrypted = AESUtil.encrypt128(idCardEncrypted, aesKey); } catch (Exception exp) { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -878,6 +878,11 @@ specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(264); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("高龄老人")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId)); specialStatisticsVOList.add(specialStatisticsVO); }else{ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); @@ -993,6 +998,10 @@ newStatisticsVO.setAudios(audioList); newStatisticsVO.setPics(picList); newStatisticsVO.setVideos(videoList); //查询事件流转记录 List<EventTransferRecordVO> transferRecordList = this.baseMapper.getEventScreenEventTransList(newStatisticsVO.getId()); newStatisticsVO.setTransferRecordList(transferRecordList); } statisticsVO.setNewStatisticsVO(newStatisticsVO); @@ -1052,6 +1061,11 @@ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(264); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("高龄老人")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId)); specialStatisticsVOList.add(specialStatisticsVO); }else{ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); @@ -1143,7 +1157,69 @@ comActPopulationScreenVO.setTotalNum(vo.getPopulationTotal() == null ? 0 : vo.getPopulationTotal()); comActPopulationScreenVO.setLocalNum(vo.getLocalTotal() == null ? 0 : vo.getLocalTotal().longValue()); comActPopulationScreenVO.setOutNum(vo.getOutTotal() == null ? 0 : vo.getOutTotal().longValue()); comActPopulationScreenVO.setSpecialNum(vo.getSpecialTotal() == null ? 0 : vo.getSpecialTotal().longValue()); //查询特殊人群统计 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{ if(StringUtils.isNotEmpty(userTag.getTagName())){ if(userTag.getTagName().equals("特扶家庭")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(22); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("低保户")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(94); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("低收入人群")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(2); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("退役军人")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(264); specialStatisticsVOList.add(specialStatisticsVO); }else if(userTag.getTagName().equals("高龄老人")){ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId)); specialStatisticsVOList.add(specialStatisticsVO); }else{ IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } } } } }); } //计算特殊人群总数 specialStatisticsVOList.add(otherSpecialVO); Integer specialNum = 0; if(!specialStatisticsVOList.isEmpty()){ for (IndexSpecialStatisticsVO special:specialStatisticsVOList) { specialNum += special.getSum(); } } comActPopulationScreenVO.setSpecialNum(specialNum.longValue()); //统计已使用社区通人数 Long count = populationDAO.countUsedCommunityPopulation(communityId); comActPopulationScreenVO.setUsedCommunityNum(count == null ? 0 : count); @@ -1318,6 +1394,10 @@ statisticsVO.setAudios(audioList); statisticsVO.setPics(picList); statisticsVO.setVideos(videoList); //查询事件流转记录 List<EventTransferRecordVO> transferRecordList = this.baseMapper.getEventScreenEventTransList(eventDetailDTO.getEventId()); statisticsVO.setTransferRecordList(transferRecordList); } } return R.ok(statisticsVO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -211,7 +211,7 @@ 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 : Double.valueOf(countMap.get("pubPoint").toString()).intValue()); comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue()); comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? "0h" : convertTimeStr(Double.valueOf(countMap.get("dealTime").toString()).intValue())); List<EastPhotoVO> list = new ArrayList<>(); //统计半年数据 int n = 6; @@ -227,7 +227,18 @@ return R.ok(comActEasyPhotoScreenVO); } private String convertTimeStr(int minute) { int hour = minute/60; int min = minute%60; StringBuilder timestr = new StringBuilder(); if(hour > 0){ timestr.append(hour).append("h"); } if(min > 0){ timestr.append(min).append("min"); } return timestr.toString(); } @Override @@ -243,7 +254,8 @@ //统计平均耗时、平均每天完成个数 Map<String,Object> avgMap = comActNeighborCircleDAO.countAvgByCommunityId(communityId); comActWorkScreenVO.setAvgTime(avgMap.get("avgTime")==null?"0":Double.valueOf(avgMap.get("avgTime").toString()).intValue()+""); comActWorkScreenVO.setAvgTime(avgMap.get("avgTime") == null?"0h":convertTimeStr(Double.valueOf(avgMap.get("avgTime").toString()).intValue())); ComActDO comActDO = comActDAO.selectById(communityId); BigDecimal days = new BigDecimal(DateUtil.betweenDay(comActDO.getCreateAt(),new Date(),false)); BigDecimal num = new BigDecimal(comActWorkScreenVO.getTotalCompleted()); springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/BigScreenApi.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.service_grid.api; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_grid.service.EventService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * @ClasssName BigScreenApi * @Description 网格大屏/事件 * @Author lyq * @Date 2021/6/18 * @Version 1.0 **/ @Slf4j @RestController @RequestMapping("/screen/") public class BigScreenApi extends BaseController { @Resource private EventService eventService; /** * 事件大屏查询事件列表 * @param eventListDTO 请求参数 * @return 事件列表 */ @PostMapping("/event/list") public R eventList(@RequestBody ScreenEventListDTO eventListDTO) { return eventService.getScreenEventList(eventListDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/dao/EventMapper.java
@@ -4,13 +4,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.dtos.grid.*; import com.panzhihua.common.model.vos.community.screen.event.EventListVO; import com.panzhihua.common.model.vos.grid.*; import com.panzhihua.service_grid.model.dos.EventDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; /** * DAO @@ -90,4 +93,19 @@ * @return 网格事件统计数据 */ GridEventStatisticsDetailVO getGridEventDetailStatisticsByApp(@Param("statisticsDTO") GridEventStatisticsDTO statisticsDTO); /** * 查询时间发布者基本信息 * @param gridMemberId * @return */ Map<String, Object> getUserBaseInfo(@Param("gridMemberId")Long gridMemberId); /** * 事件大屏查询事件列表 * @param eventListDTO 请求参数 * @return 事件列表 */ IPage<EventListVO> getScreenEventList(Page page, @Param("eventListDTO") ScreenEventListDTO eventListDTO); } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventService.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.dtos.grid.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActVO; @@ -240,4 +241,11 @@ * @return */ R reportDirect(CommonEventDirectReportDTO commonEventDirectReportDTO); /** * 事件大屏查询事件列表 * @param eventListDTO 请求参数 * @return 事件列表 */ R getScreenEventList(ScreenEventListDTO eventListDTO); } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/ComActEasyPhotoServiceImpl.java
@@ -153,6 +153,9 @@ if(easyPhotoDO.getHandleStatus().equals(ComActEasyPhotoDO.handleStatus.yes)){ return R.fail("该随手拍已处理"); } if(easyPhotoDO.getIsReport().equals(ComActEasyPhotoDO.isReport.no)){ return R.fail("该随手拍未上报社区"); } BeanUtils.copyProperties(photoHandleDTO,easyPhotoDO); easyPhotoDO.setHandleStatus(ComActEasyPhotoDO.handleStatus.yes); easyPhotoDO.setFeedbackAt(new Date()); springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -8,9 +8,11 @@ import com.panzhihua.common.enums.EventType; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; import com.panzhihua.common.model.dtos.grid.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActVO; import com.panzhihua.common.model.vos.community.screen.event.EventListVO; import com.panzhihua.common.model.vos.grid.*; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.LngLatUtils; @@ -25,12 +27,11 @@ import org.springframework.stereotype.Service; import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.*; /** * @author cedoo @@ -234,10 +235,17 @@ } eventDetailsVO.setTrans(eventTransferRecordVOS); //查询事件发布人头像 String imageUrl = eventMapper.getGridMemberImageUrl(eventDO.getGridMemberId()); if (StringUtils.isNotEmpty(imageUrl)) { eventDetailsVO.setGridMemberImageUrl(imageUrl); //查询网格员头像,姓名 Map<String,Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId()); if (!CollectionUtils.isEmpty(gridMember)) { eventDetailsVO.setGridMemberName(gridMember.get("name") == null ? "" : gridMember.get("name").toString()); eventDetailsVO.setGridMemberImageUrl(gridMember.get("image_url") == null ? "" : gridMember.get("image_url").toString()); } if(Objects.equals(eventDO.getGridMemberId(),eventDO.getCreateBy())){ eventDetailsVO.setCreator(eventDetailsVO.getGridMemberName()); }else{ Map<String,Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy()); eventDetailsVO.setCreator(createUser.get("name") == null ? "" : createUser.get("name").toString()); } return R.ok(eventDetailsVO); @@ -2050,4 +2058,18 @@ return R.fail(); } /** * 事件大屏查询事件列表 * @param eventListDTO 请求参数 * @return 事件列表 */ @Override public R getScreenEventList(ScreenEventListDTO eventListDTO){ if( eventListDTO.getEventType() != null && eventListDTO.getEventType().equals(ScreenEventListDTO.eventType.xc)){ eventListDTO.setEventCategory(2); } IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(),eventListDTO.getPageSize()),eventListDTO); return R.ok(eventPageList); } } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -876,4 +876,73 @@ </if> </select> <select id="getUserBaseInfo" parameterType="java.lang.Long" resultType="java.util.Map"> select name,image_url from sys_user where user_id = #{gridMemberId} </select> <select id="getScreenEventList" parameterType="com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO" resultType="com.panzhihua.common.model.vos.community.screen.event.EventListVO"> SELECT e.id, e.grid_member_id, su.image_url, su.nick_name AS userName, e.create_at, e.urgent, e.danger_level, e.major, e.event_des, e.event_category, e.event_type, e.event_clazz, e.happen_address, e.happent_lat_lng, e.happent_address, e.event_deal_status, egd.grid_name FROM `event` AS e LEFT JOIN sys_user AS su ON su.user_id = e.grid_member_id LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id <where> and event_status = 2 <if test='eventListDTO.communityId != null'> and egd.grid_community_id = #{eventListDTO.communityId} </if> <if test='eventListDTO.startTime != null and eventListDTO.startTime != ""'> and e.create_at <![CDATA[>=]]> #{eventListDTO.startTime} </if> <if test='eventListDTO.endTime != null and eventListDTO.endTime != ""'> and e.create_at <![CDATA[<=]]> #{eventListDTO.endTime} </if> <if test='eventListDTO.gridId != null'> and e.grid_id = #{eventListDTO.gridId} </if> <if test='eventListDTO.eventCategory != null'> and e.event_category = #{eventListDTO.eventCategory} </if> <if test='eventListDTO.eventType != null'> and e.event_type = #{eventListDTO.eventType} </if> <if test='eventListDTO.eventDealStatus != null'> and e.event_deal_status = #{eventListDTO.eventDealStatus} </if> <if test='eventListDTO.urgent != null and eventListDTO.urgent != ""'> and e.urgent = #{eventListDTO.urgent} </if> <if test='eventListDTO.major != null and eventListDTO.major != ""'> and e.major = #{eventListDTO.major} </if> </where> order by e.create_at desc </select> </mapper>