springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/CommonEventAddDTO.java
@@ -11,6 +11,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.util.Date; import java.util.List; /** @@ -26,7 +27,7 @@ public class CommonEventAddDTO { @Max(127) @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1", required = true) @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报", hidden = false, example = "1", required = true) @NotNull(message = "事件分类不能为空") private Integer eventType; @@ -113,4 +114,7 @@ @Length(max = 11) private String phone; @ApiModelProperty(value = "上报人口id列表,当事件类型为特殊人群上报时此字段不为空", hidden = false) private List<Long> populationIds; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/CommonEventEditDTO.java
@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.util.Date; import java.util.List; /** @@ -25,7 +26,7 @@ public class CommonEventEditDTO { @Max(127) @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1", required = true) @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件、6特殊人群上报", hidden = false, example = "1", required = true) @NotNull(message = "事件分类不能为空") private Integer eventType; @@ -114,4 +115,7 @@ @Length(max = 11) private String phone; @ApiModelProperty(value = "上报人口id列表,当事件类型为特殊人群上报时此字段不为空", hidden = false) private List<Long> populationIds; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/PageEventSpecialPopulationDTO.java
New file @@ -0,0 +1,34 @@ package com.panzhihua.common.model.dtos.grid; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotNull; /** * 分页查询表单 * * @author cedoo email:cedoo(a)qq.com * @version 1.0 * @since 1.0 * @date 2021-05-26 * */ @Data @ApiModel("查询事件特殊人群请求参数") public class PageEventSpecialPopulationDTO { @ApiModelProperty(value = "分页-当前页数", example = "1") private Long pageNum = 1L; @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "社区id", hidden = true, example = "2") private Long communityId; @ApiModelProperty(value = "关键词") private String keyWord; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/EventSpecialPopulationVO.java
New file @@ -0,0 +1,36 @@ package com.panzhihua.common.model.vos.grid; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("特殊人群上报-人口数据返回参数") @EncryptDecryptClass public class EventSpecialPopulationVO { @ApiModelProperty("实有人口id") @JsonSerialize(using = ToStringSerializer.class) private Long id; @ApiModelProperty("姓名") private String name; @ApiModelProperty("身份证号") @EncryptDecryptField private String idCard; @ApiModelProperty("人员标签") private String label; @ApiModelProperty("居住地址") private String address; @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") private Integer politicalOutlook; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java
@@ -901,4 +901,12 @@ */ @PostMapping("/screen/event/list") R getScreenEventList(@RequestBody ScreenEventListDTO eventListDTO); /** * 特殊人群上报-社区人口数据列表 * @param specialPopulationDTO 请求参数 * @return 社区人口数据列表 */ @PostMapping("/event/special/population/list") R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO); } springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java
@@ -7,6 +7,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActVO; import com.panzhihua.common.model.vos.grid.EventGridDataAreaVO; import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO; import com.panzhihua.common.utlis.ClazzUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -126,4 +127,13 @@ return gridService.getNearByGrid(pageEventGridNearbyDTO); } @ApiOperation(value = "查询社区特殊人群列表", response = EventSpecialPopulationVO.class) @PostMapping("/special/population/list") public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){ LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); specialPopulationDTO.setCommunityId(loginUserInfoVO.getCommunityId()); return gridService.specialPopulationList(specialPopulationDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -158,9 +158,9 @@ private String healthy; /** * 房屋地址 * 居住地址 */ // private String houseAddress; private String address; /** * 出生年月日 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventApi.java
@@ -302,4 +302,13 @@ R reportDirect(@RequestBody CommonEventDirectReportDTO commonEventDirectReportDTO){ return eventService.reportDirect(commonEventDirectReportDTO); } /** * 特殊人群上报-社区人口数据列表 * @param specialPopulationDTO 请求参数 * @return 社区人口数据列表 */ @PostMapping("/special/population/list") public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){ return eventService.specialPopulationList(specialPopulationDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/dao/EventMapper.java
@@ -108,4 +108,11 @@ */ IPage<EventListVO> getScreenEventList(Page page, @Param("eventListDTO") ScreenEventListDTO eventListDTO); /** * 特殊人群上报-社区人口数据列表 * @param specialPopulationDTO 请求参数 * @return 社区人口数据列表 */ IPage<EventSpecialPopulationVO> specialPopulationList(Page page, @Param("specialPopulationDTO") PageEventSpecialPopulationDTO specialPopulationDTO); } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/dao/EventSpecialCrowdRecordMapper.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.service_grid.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; import org.apache.ibatis.annotations.Mapper; /** * @auther lyq * @create 2021-06-22 15:37:01 * @describe 事件-特殊人群上报人口关联表mapper类 */ @Mapper public interface EventSpecialCrowdRecordMapper extends BaseMapper<EventSpecialCrowdRecordDO> { } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/model/dos/EventSpecialCrowdRecordDO.java
New file @@ -0,0 +1,54 @@ package com.panzhihua.service_grid.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @auther lyq * @create 2021-06-22 15:37:01 * @describe 事件-特殊人群上报人口关联表实体类 */ @Data @TableName("event_special_crowd_record") public class EventSpecialCrowdRecordDO implements Serializable { private static final long serialVersionUID = 1L; /** * 主键id */ @TableId(type = IdType.AUTO) private Long id; /** * 事件id */ private Long eventId; /** * 实有人口id */ private Long populationId; /** * 创建时间 */ private Date createAt; @Override public String toString() { return "EventSpecialCrowdRecordDO{" + "id=" + id + ", eventId=" + eventId + ", populationId=" + populationId + ", createAt=" + createAt + "}"; } } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventService.java
@@ -248,4 +248,11 @@ * @return 事件列表 */ R getScreenEventList(ScreenEventListDTO eventListDTO); /** * 特殊人群上报-社区人口数据列表 * @param specialPopulationDTO 请求参数 * @return 社区人口数据列表 */ R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO); } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventSpecialCrowdRecordService.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.service_grid.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; /** * @auther lyq * @create 2021-06-22 15:37:01 * @describe 事件-特殊人群上报人口关联表服务类 */ public interface EventSpecialCrowdRecordService extends IService<EventSpecialCrowdRecordDO> { } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -10,6 +10,7 @@ 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.helper.AESUtil; 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; @@ -19,10 +20,7 @@ import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_grid.dao.*; import com.panzhihua.service_grid.model.dos.*; import com.panzhihua.service_grid.service.EventGridDataService; import com.panzhihua.service_grid.service.EventResourceService; import com.panzhihua.service_grid.service.EventService; import com.panzhihua.service_grid.service.EventTransferRecordService; import com.panzhihua.service_grid.service.*; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.beans.BeanUtils; @@ -55,7 +53,7 @@ @Resource private EventGridMemberRelationMapper eventGridMemberRelationMapper; @Resource private EventGridDataService eventGridDataService; private EventSpecialCrowdRecordService eventSpecialCrowdRecordService; /** * 分页查找事件 @@ -268,6 +266,14 @@ if (eventGridDataDO == null) { return R.fail("网格不存在"); } //检查特殊人群上报时参数 if(commonEventAddDTO.getEventType().equals(6)){ if(commonEventAddDTO.getPopulationIds().isEmpty()){ return R.fail("上报人员为空"); } } eventDO.setEventCategory(1l);//办件事件 eventDO.setEventStatus(2);//事件状态 2发布 eventDO.setProcessType(1);//网格员处理 @@ -279,6 +285,21 @@ eventDO.setSubmitDate(new Date()); eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); if (eventMapper.insert(eventDO) == 1) { //如果是特殊人群,则新增特殊人群与事件关系 if(commonEventAddDTO.getEventType().equals(6)){ List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); commonEventAddDTO.getPopulationIds().forEach(populationId -> { EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); specialCrowdRecordDO.setEventId(eventDO.getId()); specialCrowdRecordDO.setPopulationId(populationId); specialCrowdRecordDO.setCreateAt(new Date()); crowdRecordList.add(specialCrowdRecordDO); }); //添加特殊人群上报事件与人口关系 eventSpecialCrowdRecordService.saveBatch(crowdRecordList); } //添加音频 if (StringUtils.isNotEmpty(commonEventAddDTO.getAudio())) { EventResourceDO eventResourceDO = new EventResourceDO(); @@ -339,7 +360,15 @@ if (eventGridDataDO == null) { return R.fail("网格不存在"); } if (commonEventEditDTO.getId() == null) { //检查特殊人群上报时参数 if(commonEventEditDTO.getEventType().equals(6)){ if(commonEventEditDTO.getPopulationIds().isEmpty()){ return R.fail("上报人员为空"); } } EventDO eventDO = new EventDO(); BeanUtils.copyProperties(commonEventEditDTO, eventDO); eventDO.setGridMemberId(commonEventEditDTO.getUserId()); @@ -353,6 +382,21 @@ eventDO.setGridMemberTelephone(commonEventEditDTO.getPhone()); eventDO.setEventDealStatus(5); if (eventMapper.insert(eventDO) > 0) { //如果是特殊人群,则新增特殊人群与事件关系 if(commonEventEditDTO.getEventType().equals(6)){ List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); commonEventEditDTO.getPopulationIds().forEach(populationId -> { EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); specialCrowdRecordDO.setEventId(eventDO.getId()); specialCrowdRecordDO.setPopulationId(populationId); specialCrowdRecordDO.setCreateAt(new Date()); crowdRecordList.add(specialCrowdRecordDO); }); //添加特殊人群上报事件与人口关系 eventSpecialCrowdRecordService.saveBatch(crowdRecordList); } //添加音频 if (StringUtils.isNotEmpty(commonEventEditDTO.getAudio())) { EventResourceDO eventResourceDO = new EventResourceDO(); @@ -2072,4 +2116,15 @@ IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(),eventListDTO.getPageSize()),eventListDTO); return R.ok(eventPageList); } /** * 特殊人群上报-社区人口数据列表 * @param specialPopulationDTO 请求参数 * @return 社区人口数据列表 */ @Override public R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO){ IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList(new Page(specialPopulationDTO.getPageNum(),specialPopulationDTO.getPageSize()),specialPopulationDTO); return R.ok(specialPopulationVOIPage); } } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventSpecialCrowdRecordServiceImpl.java
New file @@ -0,0 +1,19 @@ package com.panzhihua.service_grid.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.service_grid.dao.EventSpecialCrowdRecordMapper; import com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO; import com.panzhihua.service_grid.service.EventSpecialCrowdRecordService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; /** * @auther lyq * @create 2021-06-22 15:37:01 * @describe 事件-特殊人群上报人口关联表服务实现类 */ @Slf4j @Service public class EventSpecialCrowdRecordServiceImpl extends ServiceImpl<EventSpecialCrowdRecordMapper, EventSpecialCrowdRecordDO> implements EventSpecialCrowdRecordService { } springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -945,4 +945,28 @@ order by e.create_at desc </select> <select id="specialPopulationList" resultType="com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO" parameterType="com.panzhihua.common.model.dtos.grid.PageEventSpecialPopulationDTO"> SELECT cmp.id, cmp.`name`, cmp.card_no as idCard, cmp.label, cmp.address, cmp.political_outlook FROM com_mng_population AS cmp <where> and cmp.label IS NOT NULL <if test='specialPopulationDTO.communityId != null'> and cmp.act_id = #{specialPopulationDTO.communityId} </if> <if test="specialPopulationDTO.keyWord!=null and specialPopulationDTO.keyWord!= """> AND (cmp.name like concat(#{specialPopulationDTO.keyWord},'%') or cmp.card_no_str like concat(#{specialPopulationDTO.keyWord},'%')) </if> </where> ORDER BY cmp.create_at DESC </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventSpecialCrowdRecordDOMapper.xml
New file @@ -0,0 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_grid.dao.EventSpecialCrowdRecordMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.panzhihua.service_grid.model.dos.EventSpecialCrowdRecordDO"> <id column="id" property="id" /> <result column="event_id" property="eventId" /> <result column="population_id" property="populationId" /> <result column="create_at" property="createAt" /> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id, event_id, population_id, create_at </sql> </mapper>