Commit 6f30b4e9 authored by zhangch's avatar zhangch

优化查询失能人员信息接口

parent dc9b9fb0
package com.hungraim.ltc.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.vo.assessment.ReTaskDistributionVO;
import com.hungraim.ltc.pojo.vo.disable.*;
import com.hungraim.ltc.service.DisableService;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -368,16 +369,19 @@ public class DisableController {
}
/**
* 失能人员信息变更-列表-查看修改
* 通过身份证搜索
* 失能人员信息修改申请详情页搜索失能人员接口
*
* @param pageNum 翻页参数
* @param pageSize 翻页参数
* @param realName 失能人员姓名
* @return 返回一组人员信息
*/
@GetMapping("/searchByCertifNum")
public Result<DisableInfoChangeDetailVo> searchByCertifNum(String certifNum) {
DisableInfoChangeDetailVo disableInfoChangeDetailVo = disableService.searchChangeByCertifNum(certifNum);
if (disableInfoChangeDetailVo != null) {
return Result.success(disableInfoChangeDetailVo);
@GetMapping("/searchByRealName")
public Result<IPage<SearchDisableSimpleVo>> searchByRealName(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, String realName) {
if (StringUtils.isBlank(realName)) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
return Result.failed("数据不一致");
IPage<SearchDisableSimpleVo> searchDisableSimpleVoIPage = disableService.searchByRealName(pageNum, pageSize, realName);
return Result.success(searchDisableSimpleVoIPage);
}
}
package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.disable.*;
import com.hungraim.ltc.pojo.vo.disable.*;
import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
......@@ -120,6 +120,8 @@ public interface DisableService {
/**
* 失能人员信息变更-查看修改
*
* @return
*/
DisableInfoChangeDetailVo searchChangeByCertifNum(String certifNum);
IPage<SearchDisableSimpleVo> searchByRealName(Integer pageNum, Integer pageSize, String realName);
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
......@@ -375,13 +376,12 @@ public class DisableServiceImpl implements DisableService {
}
@Override
public DisableInfoChangeDetailVo searchChangeByCertifNum(String certifNum) {
ChDisableInfo chDisableInfo = disableInfoMapper.selectOne(new LambdaQueryWrapper<ChDisableInfo>().eq(ChDisableInfo::getCertiCode, certifNum));
DisableInfoChangeDetailVo disableInfoChangeDetailVo = null;
if (chDisableInfo != null) {
disableInfoChangeDetailVo = new DisableInfoChangeDetailVo();
BeanUtil.copyProperties(chDisableInfo, disableInfoChangeDetailVo);
}
return disableInfoChangeDetailVo;
public IPage<SearchDisableSimpleVo> searchByRealName(Integer pageNum, Integer pageSize, String realName) {
Page<ChDisableInfo> chDisableInfoPage = disableInfoMapper.selectPage(new Page<>(pageNum, pageSize), new LambdaQueryWrapper<ChDisableInfo>().like(ChDisableInfo::getRealName, realName));
return chDisableInfoPage.convert(disableInfo -> {
SearchDisableSimpleVo searchDisableSimpleVo = new SearchDisableSimpleVo();
BeanUtils.copyProperties(disableInfo, searchDisableSimpleVo);
return searchDisableSimpleVo;
});
}
}
\ No newline at end of file
package com.hungraim.ltc.pojo.vo.disable;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class SearchDisableSimpleVo {
/**
* 失能人员信息id
*/
private Integer disabInfoId;
/**
* 失能人员姓名
*/
private String realName;
/**
* 身份证号
*/
private String certiCode;
/**
* 生日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;
/**
* 性别
*/
private String gender;
/**
* 手机号码
*/
private String tel;
/**
* 诊断疾病
*/
private Integer diseTypeS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment