Browse Source

防疫信息查询

dev
zhaoqifeng 3 years ago
parent
commit
ce55a52095
  1. 67
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  2. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java
  3. 21
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionInfoDTO.java
  4. 48
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java
  5. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java
  6. 21
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TripListDTO.java
  7. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccineListDTO.java
  8. 86
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  9. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
  10. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  11. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  12. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  13. 65
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  14. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  15. 104
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  16. 61
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

67
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java

@ -0,0 +1,67 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 14:17
*/
@NoArgsConstructor
@Data
public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 3610567618492110219L;
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 小区ID
*/
private String neighborId;
/**
* 楼栋ID
*/
private String buildingId;
/**
* 单元ID
*/
private String unitId;
/**
* 房屋ID
*/
private String houseId;
/**
* 姓名
*/
private String name;
/**
* 手机
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
/**
* 疫苗接种次数
*/
private Integer vaccineCount;
/**
* 核酸检测次数
*/
private Integer natCount;
}

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcNoticeFormDTO.java

@ -16,6 +16,7 @@ import java.io.Serializable;
public class IcNoticeFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 7392894573654015338L;
private String customerId;
private String noticeId;
@NotBlank(message = "身份证号不能为空", groups = DefaultGroup.class)
private String idCard;
}

21
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionInfoDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 16:19
*/
@NoArgsConstructor
@Data
public class EpidemicPreventionInfoDTO implements Serializable {
private static final long serialVersionUID = -1845197091484928L;
private List<NatListDTO> natList;
private List<VaccineListDTO> vaccineList;
private List<TripListDTO> tripList;
}

48
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpidemicPreventionResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 14:22
*/
@NoArgsConstructor
@Data
public class EpidemicPreventionResultDTO implements Serializable {
private static final long serialVersionUID = -1901847880985531089L;
private String id;
/**
* 姓名
*/
private String name;
/**
* 所属网格
*/
private String gridId;
private String gridName;
/**
* 所属家庭
*/
private String homeId;
private String houseName;
/**
* 手机号
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
/**
* 疫苗接种次数
*/
private Double vaccineCount;
/**
* 核酸检测次数
*/
private Double natCount;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 16:19
*/
@NoArgsConstructor
@Data
public class NatListDTO implements Serializable {
private static final long serialVersionUID = 6294272007213038642L;
private String testTime;
private String address;
private String result;
}

21
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TripListDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 16:22
*/
@NoArgsConstructor
@Data
public class TripListDTO implements Serializable {
private String fromRegion;
private String arrivalTime;
private String leaveTime;
private String noticeTime;
private String remark;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccineListDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/3/29 16:20
*/
@NoArgsConstructor
@Data
public class VaccineListDTO implements Serializable {
private static final long serialVersionUID = 182173953023413061L;
private String vaccinateTime;
private String manufactor;
private String address;
}

86
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.EpidemicPreventionFormDTO;
import com.epmet.dto.result.EpidemicPreventionInfoDTO;
import com.epmet.dto.result.EpidemicPreventionResultDTO;
import com.epmet.service.IcResiUserService;
import lombok.extern.slf4j.Slf4j;
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 javax.annotation.Resource;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Slf4j
@RestController
@RequestMapping("epidemicPrevention")
public class IcEpidemicPreventionController{
@Resource
private IcResiUserService icResiUserService;
/**
* 居民防疫信息查询
* @Param tokenDto
* @Param formDTO
* @Return {@link Result< PageData<EpidemicPreventionResultDTO>>}
* @Author zhaoqifeng
* @Date 2022/3/29 14:25
*/
@PostMapping("page")
public Result<PageData<EpidemicPreventionResultDTO>> search(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.epidemicPreventionList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
/**
* 居民防疫信息详情
* @Param formDTO
* @Return {@link Result< EpidemicPreventionResultDTO>}
* @Author zhaoqifeng
* @Date 2022/3/29 16:13
*/
@PostMapping("detail")
public Result<EpidemicPreventionResultDTO> detail(@RequestBody EpidemicPreventionFormDTO formDTO) {
EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO);
return new Result<EpidemicPreventionResultDTO>().ok(result);
}
@PostMapping("info")
public Result<EpidemicPreventionInfoDTO> info(@RequestBody EpidemicPreventionFormDTO formDTO) {
EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO);
return new Result<EpidemicPreventionInfoDTO>().ok(result);
}
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java

@ -38,9 +38,9 @@ public class IcNoticeController {
return new Result<PageData<IcNoticeDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcNoticeDTO> get(@PathVariable("id") String id){
IcNoticeDTO data = icNoticeService.get(id);
@RequestMapping(method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcNoticeDTO> get(@RequestBody IcNoticeFormDTO formDTO){
IcNoticeDTO data = icNoticeService.get(formDTO.getNoticeId());
return new Result<IcNoticeDTO>().ok(data);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.EpidemicPreventionFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
@ -270,4 +271,13 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<String> getExistUserByHouseIds(@Param("ids") List<String> ids);
/**
* 居民防疫信息查询
* @Param formDTO
* @Return {@link List< EpidemicPreventionResultDTO>}
* @Author zhaoqifeng
* @Date 2022/3/29 14:52
*/
List<EpidemicPreventionResultDTO> getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java

@ -6,6 +6,7 @@ import com.epmet.dto.IcNatDTO;
import com.epmet.dto.form.AddIcNatFormDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.entity.IcNatEntity;
@ -68,4 +69,13 @@ public interface IcNatService extends BaseService<IcNatEntity> {
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId);
/**
* 核酸检测信息
* @Param idCard
* @Return {@link List<NatListDTO>}
* @Author zhaoqifeng
* @Date 2022/3/29 16:29
*/
List<NatListDTO> getNatList(String idCard);
}

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -216,4 +216,32 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @date 2022/3/2 10:32 上午
*/
List<String> getExistUserByHouseIds(List<String> ids);
/**
* 居民防疫信息查询
*
* @Param formDTO
* @Return {@link PageData< EpidemicPreventionResultDTO>}
* @Author zhaoqifeng
* @Date 2022/3/29 14:27
*/
PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO);
/**
* 居民防疫信息详情
* @Param formDTO
* @Return {@link EpidemicPreventionResultDTO}
* @Author zhaoqifeng
* @Date 2022/3/29 15:16
*/
EpidemicPreventionResultDTO getEpidemicPreventionDetail(EpidemicPreventionFormDTO formDTO);
/**
* 居民防疫信息详情:核酸疫苗行程
* @Param formDTO
* @Return {@link EpidemicPreventionInfoDTO}
* @Author zhaoqifeng
* @Date 2022/3/29 16:25
*/
EpidemicPreventionInfoDTO getEpidemicPreventionInfo(EpidemicPreventionFormDTO formDTO);
}

65
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -1,11 +1,9 @@
package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -18,23 +16,13 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.AddIcNatFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.MyNatListFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
import com.epmet.dto.result.MyNatListResultDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcNatEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.excel.handler.IcNatExcelImportListener;
@ -47,11 +35,9 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
@ -59,15 +45,15 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.ArrayList;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* 核酸上报记录
@ -344,6 +330,43 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
}
/**
* 核酸检测信息
*
* @param idCard
* @Param idCard
* @Return {@link List< NatListDTO >}
* @Author zhaoqifeng
* @Date 2022/3/29 16:29
*/
@Override
public List<NatListDTO> getNatList(String idCard) {
LambdaQueryWrapper<IcNatEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNatEntity::getIdCard, idCard);
wrapper.orderByDesc(IcNatEntity::getNatTime);
List<IcNatEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
NatListDTO dto = new NatListDTO();
dto.setAddress(item.getNatAddress());
dto.setTestTime(DateUtils.format(item.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE));
switch (item.getNatResult())
{
case NumConstant.ZERO_STR:
dto.setResult("阴性");
break;
case NumConstant.ONE_STR:
dto.setResult("阳性");
break;
default:
dto.setResult("未知");
}
return dto;
}).collect(Collectors.toList());
}
/**
* 批量持久化
* @param entities

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -158,7 +158,7 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
messageFormDTO.setTargetId(item.getId());
msgList.add(messageFormDTO);
}
//TODO
//TODO 短信消息
if (StringUtils.isNotBlank(item.getMobile())) {
ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO();
sms.setCustomerId(item.getCustomerId());
@ -168,11 +168,12 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
smsList.add(sms);
}
});
//发送小程序消息
Result result = messageFeignClient.saveUserMessageList(msgList);
if (!result.success()) {
log.error("发送小程序消息失败" + JSON.toJSONString(result));
}
//TODO 发送短信
}
/**

104
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -71,6 +71,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Date;
@ -117,6 +118,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private IcUserTransferRecordService icUserTransferRecordService;
@Autowired
private RedisTemplate redisTemplate;
@Resource
private IcNatService icNatService;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
@ -1230,6 +1233,107 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return baseDao.getExistUserByHouseIds(ids);
}
/**
* 居民防疫信息查询
*
* @param formDTO
* @Param formDTO
* @Return {@link PageData< EpidemicPreventionResultDTO>}
* @Author zhaoqifeng
* @Date 2022/3/29 14:27
*/
@Override
public PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<EpidemicPreventionResultDTO> list = baseDao.getEpidemicPreventionList(formDTO);
PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list);
if (CollectionUtils.isNotEmpty(list)) {
//查询网格名称
List<String> gridIds = list.stream().map(EpidemicPreventionResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//查询房子名称
Set<String> houseIds = new HashSet<>();
List<String> houseIdList = list.stream().map(EpidemicPreventionResultDTO::getHomeId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
houseIds.addAll(houseIdList);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
list.forEach(item -> {
if (gridInfoMap.containsKey(item.getGridId()) && null != gridInfoMap.get(item.getGridId())) {
item.setGridName(gridInfoMap.get(item.getGridId()).getGridName());
}
if (houseInfoMap.containsKey(item.getHomeId()) && null != houseInfoMap.get(item.getHomeId())) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(item.getHomeId());
item.setHomeId(houseInfoDTO.getAllName());
}
});
}
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 居民防疫信息详情
*
* @param formDTO
* @Param formDTO
* @Return {@link EpidemicPreventionResultDTO}
* @Author zhaoqifeng
* @Date 2022/3/29 15:16
*/
@Override
public EpidemicPreventionResultDTO getEpidemicPreventionDetail(EpidemicPreventionFormDTO formDTO) {
EpidemicPreventionResultDTO result = new EpidemicPreventionResultDTO();
if (StringUtils.isBlank(formDTO.getId())) {
return result;
}
List<EpidemicPreventionResultDTO> list = baseDao.getEpidemicPreventionList(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
result = list.get(NumConstant.ZERO);
//查询网格名称
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(result.getGridId());
if (null != gridInfo) {
result.setGridName(gridInfo.getGridName());
}
//查询房子名称
Set<String> houseIds = new HashSet<>();
houseIds.add(result.getHomeId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(new HashSet<>(houseIds),formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
if (houseInfoMap.containsKey(result.getHomeId()) && null != houseInfoMap.get(result.getHomeId())) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(result.getHomeId());
result.setHomeId(houseInfoDTO.getAllName());
}
}
return result;
}
/**
* 居民防疫信息详情:核酸疫苗行程
*
* @param formDTO
* @Param formDTO
* @Return {@link EpidemicPreventionInfoDTO}
* @Author zhaoqifeng
* @Date 2022/3/29 16:25
*/
@Override
public EpidemicPreventionInfoDTO getEpidemicPreventionInfo(EpidemicPreventionFormDTO formDTO) {
EpidemicPreventionInfoDTO result = new EpidemicPreventionInfoDTO();
IcResiUserEntity icResiUser = baseDao.selectById(formDTO.getId());
if (null != icResiUser) {
//核酸检测
List<NatListDTO> natList = icNatService.getNatList(icResiUser.getIdCard());
result.setNatList(natList);
//TODO 疫苗接种
//TODO 行程信息
}
return result;
}
/**
* @Description 居民分类 网格名 处理
* @param list

61
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -642,4 +642,65 @@
</foreach>
)
</select>
<select id="getEpidemicPreventionList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">
SELECT * FROM
(SELECT
ID,
`NAME`,
GRID_ID,
HOME_ID,
MOBILE,
a.ID_CARD,
IFNULL( b.count, 0 ) AS vaccineCount,
IFNULL( c.count, 0 ) AS natCount
FROM
ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
WHERE
a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="id != null and id != ''">
AND ID = #{id}
</if>
<if test="gridId != null and gridId != ''">
AND GRID_ID = #{gridId}
</if>
<if test="neighborId != null and neighborId != ''">
AND NEIGHBOR_HOOD_ID = #{neighborId}
</if>
<if test="buildingId != null and buildingId != ''">
AND BUILD_ID = #{buildingId}
</if>
<if test="unitId != null and unitId != ''">
AND UNIT_ID = #{unitId}
</if>
<if test="houseId != null and houseId != ''">
AND HOME_ID = #{houseId}
</if>
<if test="name != null and name != ''">
AND `NAME` LIKE concat( '%', #{name}, '%' )
</if>
<if test="mobile != null and mobile != ''">
AND MOBILE LIKE concat( '%', #{mobile}, '%' )
</if>
<if test="idCard != null and idCard != ''">
AND ID_CARD LIKE concat( '%', #{idCard}, '%' )
</if>
) t
WHERE
1=1
<if test="vaccineCount != null">
AND vaccineCount = #{vaccineCount}
</if>
<if test="natCount != null">
AND natCount = #{natCount}
</if>
ORDER BY `NAME`
</select>
</mapper>

Loading…
Cancel
Save