Browse Source

修复

master
6 years ago
parent
commit
bca2428388
  1. 16
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

16
ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

@ -156,10 +156,18 @@ public class PatientReportService implements IPatientReportService {
//分页查询报告单列表 //分页查询报告单列表
PageHelper.startPage(query.getPageNum(), query.getPageSize()); PageHelper.startPage(query.getPageNum(), query.getPageSize());
HtPatientReportExample reportExample = new HtPatientReportExample(); 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) { if (query.getPatientId() != null) {
reportExample.createCriteria().andPatientIdEqualTo(query.getPatientId()); reportExample.createCriteria().andPatientIdEqualTo(query.getPatientId());
} else if (CollectionUtil.isNotEmpty(doctors)) {
reportExample.createCriteria().andDoctorIdEqualTo(doctors.get(0).getId());
} else { } else {
reportExample.createCriteria().andDoctorIdEqualTo(userId); log.info("既无病人信息,有无医生信息,不允许查询");
throw new BaseException(CodeEnum.PARAM_ERROR);
} }
reportExample.setOrderByClause("create_time desc"); reportExample.setOrderByClause("create_time desc");
@ -169,11 +177,7 @@ public class PatientReportService implements IPatientReportService {
return new PageInfo<>(reportVos); 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)) { if (CollectionUtil.isEmpty(doctors)) {
reports.forEach(report -> { reports.forEach(report -> {
PatientReportVo.ReportName name = new PatientReportVo.ReportName(); PatientReportVo.ReportName name = new PatientReportVo.ReportName();

Loading…
Cancel
Save