|
|
@ -156,10 +156,18 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
//分页查询报告单列表
|
|
|
|
PageHelper.startPage(query.getPageNum(), query.getPageSize()); |
|
|
|
HtPatientReportExample reportExample = new HtPatientReportExample(); |
|
|
|
//查询医生信息
|
|
|
|
HtDoctorExample doctorExample = new HtDoctorExample(); |
|
|
|
doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); |
|
|
|
List<HtDoctor> doctors = htDoctorMapper.selectByExample(doctorExample); |
|
|
|
log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); |
|
|
|
if (query.getPatientId() != null) { |
|
|
|
reportExample.createCriteria().andPatientIdEqualTo(query.getPatientId()); |
|
|
|
} else if (CollectionUtil.isNotEmpty(doctors)) { |
|
|
|
reportExample.createCriteria().andDoctorIdEqualTo(doctors.get(0).getId()); |
|
|
|
} else { |
|
|
|
reportExample.createCriteria().andDoctorIdEqualTo(userId); |
|
|
|
log.info("既无病人信息,有无医生信息,不允许查询"); |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
reportExample.setOrderByClause("create_time desc"); |
|
|
@ -169,11 +177,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
return new PageInfo<>(reportVos); |
|
|
|
} |
|
|
|
|
|
|
|
//查询医生信息
|
|
|
|
HtDoctorExample doctorExample = new HtDoctorExample(); |
|
|
|
doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); |
|
|
|
List<HtDoctor> doctors = htDoctorMapper.selectByExample(doctorExample); |
|
|
|
log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(doctors)) { |
|
|
|
reports.forEach(report -> { |
|
|
|
PatientReportVo.ReportName name = new PatientReportVo.ReportName(); |
|
|
|