springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActAcidDangerMemberApi.java
New file @@ -0,0 +1,51 @@ package com.panzhihua.applets.api; import javax.annotation.Resource; import javax.validation.Valid; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.dtos.community.fms.PageFmsTeamDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; import com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.service.community.CommunityService; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; /** * @title: ComActAcidDangerMemberApi * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: * @author: hans * @date: 2022/04/27 15:54 */ @Slf4j @Api(tags = {"风险人员"}) @RestController @RequestMapping("comActAcidDangerMember") public class ComActAcidDangerMemberApi extends BaseController { /** * 服务对象 */ @Resource private CommunityService communityService; @ApiOperation(value = "分页查询风险人员", response = ComActAcidDangerMemberVO.class) @PostMapping("/page") public R pageDangerMember(@RequestBody @Valid PageDangerMemberDTO pageDangerMemberDTO) { return communityService.pageDangerMember(pageDangerMemberDTO); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/acid/ComActAcidDangerMemberDTO.java
@@ -8,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -32,8 +33,10 @@ @ApiModelProperty(value = "数据来源 1系统") private Integer source; @ApiModelProperty("页数") @NotNull(message = "分页参数不能为空") private Integer page; @ApiModelProperty("条数") @NotNull(message = "分页参数不能为空") private Integer size; @ApiModelProperty("关键字") private String keyword; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/acid/PageDangerMemberDTO.java
New file @@ -0,0 +1,30 @@ package com.panzhihua.common.model.dtos.community.acid; import javax.validation.constraints.NotNull; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @title: PageFmsTeamDTO * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 分页查询团队信息请求参数 * @author: hans * @date: 2022/02/18 10:16 */ @Data @ApiModel("分页查询团队信息请求参数") public class PageDangerMemberDTO { @ApiModelProperty(value = "关键字") private String keyword; @ApiModelProperty(value = "分页-当前页数", example = "1") @NotNull(message = "分页参数不能为空") private Long pageNum; @ApiModelProperty(value = "分页-每页记录数", example = "10") @NotNull(message = "分页参数不能为空") private Long pageSize; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/acid/ComActAcidDangerMemberVO.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.model.vos.community.acid; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -75,4 +76,20 @@ @ApiModelProperty(value = "当前处理情况 1:集中隔离 2:居家隔离 3:健康监测 4:失联或尚需追踪 5:排除风险 6:暂未管控") private Integer status; @ApiModelProperty(value = "健康码颜色") private String colorMark; @ApiModelProperty(value = "核酸检测") private String acidTest; @ApiModelProperty(value = "排查时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date checkTime; /** * 身份证 */ @ApiModelProperty(value = "身份证") private String idCard; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -5,8 +5,10 @@ import com.panzhihua.common.model.dtos.PageBaseDTO; import com.panzhihua.common.model.dtos.civil.*; import com.panzhihua.common.model.dtos.common.*; import com.panzhihua.common.model.dtos.community.acid.ComActAcidDangerMemberDTO; import com.panzhihua.common.model.dtos.community.acid.ComActAcidMemberDTO; import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.dtos.community.reserve.*; import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO; @@ -9714,4 +9716,20 @@ */ @GetMapping("/comActAcidMember/del") R deleteComActAcidMember(@RequestParam("id") Long id); /** * 分页查询风险人员 * @param pageDangerMemberDTO * @return */ @PostMapping("/comActAcidDangerMember/page") R pageDangerMember(@RequestBody PageDangerMemberDTO pageDangerMemberDTO); /** * 后台分页查询风险人员 * @param pageDangerMemberDTO * @return */ @PostMapping("/comActAcidDangerMember/queryAll") R pageDangerMemberAdmin(@RequestBody ComActAcidDangerMemberDTO pageDangerMemberDTO); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidDangerMemberApi.java
New file @@ -0,0 +1,46 @@ package com.panzhihua.community_backstage.api; import javax.annotation.Resource; import javax.validation.Valid; import com.panzhihua.common.model.dtos.community.acid.ComActAcidDangerMemberDTO; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; import com.panzhihua.common.service.community.CommunityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; /** * @title: ComActAcidDangerMemberApi * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: * @author: hans * @date: 2022/04/27 15:54 */ @Slf4j @Api(tags = {"风险人员"}) @RestController @RequestMapping("comActAcidDangerMember") public class ComActAcidDangerMemberApi extends BaseController { /** * 服务对象 */ @Resource private CommunityService communityService; @ApiOperation(value = "后台分页查询风险人员", response = ComActAcidDangerMemberVO.class) @PostMapping("/queryAll") public R pageDangerMember(@RequestBody @Valid ComActAcidDangerMemberDTO pageDangerMemberDTO) { return communityService.pageDangerMemberAdmin(pageDangerMemberDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActAcidDangerMemberApi.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.api.ApiController; import com.panzhihua.common.model.dtos.community.acid.ComActAcidDangerMemberDTO; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.dtos.property.CommonPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -38,7 +39,7 @@ * @param commonPage 查询实体 * @return 所有数据 */ @PostMapping("queryAll") @PostMapping("/queryAll") public R selectAll(@RequestBody ComActAcidDangerMemberDTO commonPage) { return this.comActAcidDangerMemberService.pageList(commonPage); } @@ -86,4 +87,14 @@ public R delete(@RequestParam("id") Long id) { return R.ok(this.comActAcidDangerMemberService.removeById(id)); } /** * 分页查询风险人员 * @param pageDangerMemberDTO * @return */ @PostMapping("/page") public R pageDangerMember(@RequestBody PageDangerMemberDTO pageDangerMemberDTO) { return comActAcidDangerMemberService.pageDangerMember(pageDangerMemberDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActAcidDangerMemberDao.java
@@ -2,10 +2,13 @@ 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.acid.ComActAcidDangerMemberDTO; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; import org.apache.ibatis.annotations.Mapper; import com.panzhihua.service_community.entity.ComActAcidDangerMember; import org.apache.ibatis.annotations.Param; /** * 风险人员表(ComActAcidDangerMember)表数据库访问层 @@ -19,8 +22,18 @@ public interface ComActAcidDangerMemberDao extends BaseMapper<ComActAcidDangerMember> { /** * 分页查询 * * @param page * @param comActAcidDangerMemberDTO * @return */ IPage<ComActAcidDangerMemberVO> pageList(ComActAcidDangerMemberDTO comActAcidDangerMemberDTO); IPage<ComActAcidDangerMemberVO> pageList(@Param("page") Page page, @Param("commonPage") ComActAcidDangerMemberDTO comActAcidDangerMemberDTO); /** * 分页查询风险人员 * @param page * @param pageDangerMemberDTO * @return */ IPage<ComActAcidDangerMemberVO> pageDangerMember(@Param("page") Page page, @Param("pageDangerMemberDTO") PageDangerMemberDTO pageDangerMemberDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComActAcidDangerMember.java
@@ -83,4 +83,10 @@ @ApiModelProperty(value = "当前处理情况 1:集中隔离 2:居家隔离 3:健康监测 4:失联或尚需追踪 5:排除风险 6:暂未管控") private Integer status; /** * 身份证 */ @ApiModelProperty(value = "身份证") private String idCard; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActAcidDangerMemberService.java
@@ -1,6 +1,7 @@ package com.panzhihua.service_community.service; import com.panzhihua.common.model.dtos.community.acid.ComActAcidDangerMemberDTO; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.dtos.property.CommonPage; import com.baomidou.mybatisplus.extension.service.IService; @@ -22,4 +23,11 @@ * @return */ R pageList(ComActAcidDangerMemberDTO commonPage); /** * 分页查询风险人员 * @param pageDangerMemberDTO * @return */ R pageDangerMember(PageDangerMemberDTO pageDangerMemberDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidDangerMemberServiceImpl.java
@@ -1,9 +1,13 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.community.acid.ComActAcidDangerMemberDTO; import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; import com.panzhihua.common.model.dtos.property.CommonPage; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; import com.panzhihua.service_community.entity.ComActAcidDangerMember; import com.panzhihua.service_community.dao.ComActAcidDangerMemberDao; import com.panzhihua.service_community.service.ComActAcidDangerMemberService; @@ -24,6 +28,22 @@ @Override public R pageList(ComActAcidDangerMemberDTO commonPage) { return null; Page page = new Page<>(); page.setSize(commonPage.getSize()); page.setCurrent(commonPage.getPage()); return R.ok(this.baseMapper.pageList(page, commonPage)); } /** * 分页查询风险人员 * @param pageDangerMemberDTO * @return */ @Override public R pageDangerMember(PageDangerMemberDTO pageDangerMemberDTO) { Page page = new Page<>(); page.setSize(pageDangerMemberDTO.getPageSize()); page.setCurrent(pageDangerMemberDTO.getPageNum()); return R.ok(this.baseMapper.pageDangerMember(page, pageDangerMemberDTO)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
@@ -1,5 +1,6 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO; @@ -9,6 +10,8 @@ import com.panzhihua.common.model.vos.community.acid.ComAcidStaticVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComActAcidDangerMemberDao; import com.panzhihua.service_community.entity.ComActAcidDangerMember; import com.panzhihua.service_community.entity.ComActAcidRecord; import com.panzhihua.service_community.dao.ComActAcidRecordDao; import com.panzhihua.service_community.service.ComActAcidRecordService; @@ -16,11 +19,14 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNull; /** * (ComActAcidRecord)表服务实现类 @@ -36,6 +42,9 @@ @Resource private RabbitTemplate rabbitTemplate; @Resource private ComActAcidDangerMemberDao comActAcidDangerMemberDao; @Override public R pageList(ComActAcidRecordDTO comActAcidRecordDTO) { return R.ok(this.baseMapper.pageList(new Page<>(comActAcidRecordDTO.getPage(), comActAcidRecordDTO.getSize()),comActAcidRecordDTO)); @@ -47,6 +56,7 @@ } @Override @Transactional(rollbackFor = Exception.class) public R insertRecord(ComActAcidRecordVO comActAcidRecordVO) { if(StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())){ rabbitTemplate.convertAndSend("huacheng.acid.exchange", "huacheng.acid.key", comActAcidRecordVO, message -> { @@ -57,7 +67,42 @@ ComActAcidRecord comActAcidRecord=new ComActAcidRecord(); BeanUtils.copyProperties(comActAcidRecordVO,comActAcidRecord); comActAcidRecord.setCreateTime(new Date()); return R.ok(this.save(comActAcidRecord)); int result = this.baseMapper.insert(comActAcidRecord); if (result > 0) { String colorMark = comActAcidRecordVO.getColorMark(); String travelCard = comActAcidRecordVO.getTravelCard(); String dangerArea = comActAcidRecordVO.getDangerArea(); String outsideCity = comActAcidRecordVO.getOutsideCity(); String acidTest = comActAcidRecordVO.getAcidTest(); if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是") || outsideCity.equals("是") || acidTest.equals("阳性")) { ComActAcidDangerMember dangerMember = comActAcidDangerMemberDao.selectOne(new LambdaQueryWrapper<ComActAcidDangerMember>() .eq(ComActAcidDangerMember::getIdCard, comActAcidRecordVO.getIdCard())); if (isNull(dangerMember)) { dangerMember = new ComActAcidDangerMember(); dangerMember.setName(comActAcidRecordVO.getName()); dangerMember.setPhone(comActAcidRecordVO.getPhone()); dangerMember.setRecordId(comActAcidRecord.getId()); dangerMember.setSource(1); dangerMember.setStatus(6); dangerMember.setType(1); dangerMember.setCreateTime(new Date()); comActAcidDangerMemberDao.insert(dangerMember); } else { dangerMember.setName(comActAcidRecordVO.getName()); dangerMember.setPhone(comActAcidRecordVO.getPhone()); dangerMember.setRecordId(comActAcidRecord.getId()); dangerMember.setSource(1); dangerMember.setStatus(6); dangerMember.setType(1); dangerMember.setUpdateTime(new Date()); comActAcidDangerMemberDao.updateById(dangerMember); } } return R.ok(); } return R.fail("操作失败,请重新尝试"); } @Override springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidDangerMemberMapper.xml
@@ -9,30 +9,50 @@ <result property="recordId" column="record_id"/> <result property="name" column="name"/> <result property="phone" column="phone"/> <result property="idCard" column="id_card"/> <result property="type" column="type"/> <result property="updateTime" column="update_time"/> </resultMap> <select id="pageList" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO"> select * from com_act_acid_danger_member SELECT t1.id, t1.`name`, t1.`status`, t1.record_id, t1.phone, t1.source, MAX(t3.create_time) AS checkTime FROM com_act_acid_danger_member t1 LEFT JOIN com_act_acid_check_record t3 ON t1.id = t3.member_id <where> <if test="commonPage.keyword!=null and commonPage.keyword !=''"> and (name like concat('%',#{commonPage.keyword},'%') or phone like concat('%',#{commonPage.keyword},'%')) and (t1.`name` like concat('%',#{commonPage.keyword},'%') or t1.phone like concat('%',#{commonPage.keyword},'%') or t1.id_card like concat('%',#{commonPage.keyword},'%')) </if> <if test="commonPage.source!=null"> and source =#{commonPage.source} and t1.source =#{commonPage.source} </if> <if test="commonPage.status!=null"> and status =#{commonPage.status} </if> <if test="commonPage.startTime!=null and commonPage.startTime !=''"> and update_time >=#{commonPage.startTime} </if> <if test="commonPage.stopTime!=null and commonPage.stopTime !=''"> and #{commonPage.stopTime} >= update_time and t1.`status` =#{commonPage.status} </if> </where> order by update_time desc GROUP BY t1.id HAVING 1=1 <if test="commonPage.startTime!=null and commonPage.startTime !=''"> and checkTime >= #{commonPage.startTime} </if> <if test="commonPage.stopTime!=null and commonPage.stopTime !=''"> and #{commonPage.stopTime} >= checkTime </if> order by checkTime desc </select> <select id="pageDangerMember" resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO"> SELECT t1.id, t1.`name`, t1.`status`, t1.record_id, t1.phone, t2.color_mark, t2.acid_test, MAX(t3.create_time) AS checkTime FROM com_act_acid_danger_member t1 LEFT JOIN com_act_acid_record t2 ON t1.record_id = t2.id LEFT JOIN com_act_acid_check_record t3 ON t1.id = t3.member_id <where> <if test="pageDangerMemberDTO.keyword != null and pageDangerMemberDTO.keyword != """> AND t1.`name` LIKE CONCAT('%', #{commonPage.keyword}, '%') </if> </where> GROUP BY t1.id ORDER BY checkTime ASC </select> </mapper>