zhizhi wu 4 years ago
parent
commit
4b919fc063
  1. 66
      question/src/main/java/com/ccsens/question/service/PatientReportService.java
  2. 4
      question/src/main/resources/application.yml

66
question/src/main/java/com/ccsens/question/service/PatientReportService.java

@ -169,17 +169,17 @@ public class PatientReportService implements IPatientReportService {
public PageInfo<PatientReportVo.ReportName> queryReports(PatientReportDto.QueryReports query, Long userId) { public PageInfo<PatientReportVo.ReportName> queryReports(PatientReportDto.QueryReports query, Long userId) {
//查询医生信息 //查询医生信息
HtDoctorExample doctorExample = new HtDoctorExample(); // HtDoctorExample doctorExample = new HtDoctorExample();
doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); // doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT);
List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample); // List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample);
log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); // log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors));
// 获取医生ID和病人ID // 获取医生ID和病人ID
Long patientId = null; Long patientId = null;
Long doctorId = null; Long doctorId = null;
if (query.getPatientId() != null) { if (query.getPatientId() != null) {
patientId = query.getPatientId(); patientId = query.getPatientId();
} else if (CollectionUtil.isNotEmpty(doctors)) { // } else if (CollectionUtil.isNotEmpty(doctors)) {
doctorId = doctors.get(0).getId(); // doctorId = doctors.get(0).getId();
} else { } else {
log.info("既无病人信息,有无医生信息,不允许查询"); log.info("既无病人信息,有无医生信息,不允许查询");
throw new BaseException(CodeEnum.PARAM_ERROR); throw new BaseException(CodeEnum.PARAM_ERROR);
@ -187,34 +187,32 @@ public class PatientReportService implements IPatientReportService {
//分页查询报告单列表 //分页查询报告单列表
PageHelper.startPage(query.getPageNum(), query.getPageSize()); PageHelper.startPage(query.getPageNum(), query.getPageSize());
List<PatientReportVo.ReportName> reportVos = htPatientReportDao.queryReportName(doctorId, patientId); List<PatientReportVo.ReportName> reportVos = htPatientReportDao.queryReportName(doctorId, patientId);
if (CollectionUtils.isEmpty(reportVos)) { // if (CollectionUtils.isEmpty(reportVos)) {
return new PageInfo<>(reportVos); // return new PageInfo<>(reportVos);
} // }
// if (CollectionUtil.isEmpty(doctors)) {
// return new PageInfo<>(reportVos);
if (CollectionUtil.isEmpty(doctors)) { // }
return new PageInfo<>(reportVos); // HtDoctor doctor = doctors.get(0);
} // //查询下属职务
HtDoctor doctor = doctors.get(0); // List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
//查询下属职务 // reportVos.forEach(reportVo -> {
List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId()); //
reportVos.forEach(reportVo -> { // //自己的可见详情
// if (doctor.getId().equals(reportVo.getDoctorId())) {
//自己的可见详情 // reportVo.setAuthority((byte)1);
if (doctor.getId().equals(reportVo.getDoctorId())) { // } else if (CollectionUtils.isEmpty(lowerPositionIds)) {
reportVo.setAuthority((byte)1); // reportVo.setAuthority((byte)0);
} else if (CollectionUtils.isEmpty(lowerPositionIds)) { // } else {
reportVo.setAuthority((byte)0); // HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId());
} else { // //自己下属的可见详情
HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId()); // if (lowerPositionIds.contains(reportDoctor.getPositionId())) {
//自己下属的可见详情 // reportVo.setAuthority((byte)1);
if (lowerPositionIds.contains(reportDoctor.getPositionId())) { // } else {
reportVo.setAuthority((byte)1); // reportVo.setAuthority((byte)0);
} else { // }
reportVo.setAuthority((byte)0); // }
} // });
}
});
return new PageInfo<>(reportVos); return new PageInfo<>(reportVos);
} }

4
question/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: dev active: green
include: common, util-dev include: common, util-green
Loading…
Cancel
Save