新增统计界面按照时间返回查询患者详情方法
This commit is contained in:
parent
5bfd85a59f
commit
dbdee7840d
@ -1472,6 +1472,14 @@ public class InspectPatientController {
|
||||
public CommonResult<InspectPatientDO> getPatientInfo(@RequestParam("medicalSn") String medicalSn) {
|
||||
return success(patientService.getPatientInfo(medicalSn));
|
||||
}
|
||||
@GetMapping("/getPatientDetails")
|
||||
@Operation(summary = "根据时间范围获得患者统计信息")
|
||||
public CommonResult<List<InspectPatientDO>> getPatientDetails(@RequestParam("stadate") String stadate, @RequestParam("enddate")String enddate,@RequestParam("addname") String addname) {
|
||||
|
||||
List<InspectPatientDO> doList= patientService.getPatientdetails(stadate,enddate,addname);
|
||||
|
||||
return success(doList);
|
||||
}
|
||||
|
||||
@GetMapping("/PatientBySearchKey")
|
||||
@Operation(summary = "根据姓名、身份证号、体检编号获得患者信息")
|
||||
|
@ -91,6 +91,10 @@ public interface InspectPatientService {
|
||||
* 根据体检编号更新PDF报告URL
|
||||
* */
|
||||
void updatePatientPdfUrl(@Valid InspectPatientSaveReqVO updateReqVO);
|
||||
/*
|
||||
* 根据条件获取患者的详细信息
|
||||
* */
|
||||
List<InspectPatientDO> getPatientdetails(String stadate, String enddate, String addname);
|
||||
|
||||
/*
|
||||
* 根据体检编号更新数据
|
||||
|
@ -171,6 +171,50 @@ public class InspectPatientServiceImpl implements InspectPatientService {
|
||||
|
||||
return patientDO;
|
||||
}
|
||||
@Override
|
||||
public List<InspectPatientDO> getPatientdetails(String stadate, String enddate, String addname) {
|
||||
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.select(
|
||||
InspectPatientDO::getMedicalSn,
|
||||
InspectPatientDO::getGender,
|
||||
InspectPatientDO::getPName,
|
||||
InspectPatientDO::getCardId,
|
||||
InspectPatientDO::getOrgname,
|
||||
InspectPatientDO::getDistrictname,
|
||||
InspectPatientDO::getOldmanflag,
|
||||
InspectPatientDO::getHtnflag,
|
||||
InspectPatientDO::getDiaflag,
|
||||
InspectPatientDO::getSmiflag,
|
||||
InspectPatientDO::getPulflag
|
||||
);
|
||||
// 将字符串时间转换为 LocalDate
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // 根据实际格式调整
|
||||
LocalDate startDate = null;
|
||||
LocalDate endDate = null;
|
||||
|
||||
try {
|
||||
if (stadate != null && !stadate.isEmpty()) {
|
||||
startDate = LocalDate.parse(stadate, formatter);
|
||||
}
|
||||
if (enddate != null && !enddate.isEmpty()) {
|
||||
endDate = LocalDate.parse(enddate, formatter);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("时间格式不正确,请使用 yyyy-MM-dd 格式");
|
||||
}
|
||||
|
||||
// 构建查询条件
|
||||
if (startDate != null && endDate != null) {
|
||||
queryWrapper.between(InspectPatientDO::getMedicalDateTime, startDate, endDate);
|
||||
}
|
||||
|
||||
if (addname != null && !addname.isEmpty()) {
|
||||
queryWrapper.eq(InspectPatientDO::getDistrictname, addname);
|
||||
}
|
||||
|
||||
return patientMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updatePatientInfo(InspectPatientSaveReqVO updateReqVO) {
|
||||
|
Loading…
Reference in New Issue
Block a user