From 4b919fc06305f5fe62edd42076e2206abbc7965a Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Mon, 15 Mar 2021 12:09:25 +0800 Subject: [PATCH] ht --- .../service/PatientReportService.java | 66 +++++++++---------- question/src/main/resources/application.yml | 4 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/question/src/main/java/com/ccsens/question/service/PatientReportService.java b/question/src/main/java/com/ccsens/question/service/PatientReportService.java index 708b185e..52db1c90 100644 --- a/question/src/main/java/com/ccsens/question/service/PatientReportService.java +++ b/question/src/main/java/com/ccsens/question/service/PatientReportService.java @@ -169,17 +169,17 @@ public class PatientReportService implements IPatientReportService { public PageInfo queryReports(PatientReportDto.QueryReports query, Long userId) { //查询医生信息 - HtDoctorExample doctorExample = new HtDoctorExample(); - doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); - List doctors = htDoctorDao.selectByExample(doctorExample); - log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); +// HtDoctorExample doctorExample = new HtDoctorExample(); +// doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); +// List doctors = htDoctorDao.selectByExample(doctorExample); +// log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); // 获取医生ID和病人ID Long patientId = null; Long doctorId = null; if (query.getPatientId() != null) { patientId = query.getPatientId(); - } else if (CollectionUtil.isNotEmpty(doctors)) { - doctorId = doctors.get(0).getId(); +// } else if (CollectionUtil.isNotEmpty(doctors)) { +// doctorId = doctors.get(0).getId(); } else { log.info("既无病人信息,有无医生信息,不允许查询"); throw new BaseException(CodeEnum.PARAM_ERROR); @@ -187,34 +187,32 @@ public class PatientReportService implements IPatientReportService { //分页查询报告单列表 PageHelper.startPage(query.getPageNum(), query.getPageSize()); List reportVos = htPatientReportDao.queryReportName(doctorId, patientId); - if (CollectionUtils.isEmpty(reportVos)) { - return new PageInfo<>(reportVos); - } - - - if (CollectionUtil.isEmpty(doctors)) { - return new PageInfo<>(reportVos); - } - HtDoctor doctor = doctors.get(0); - //查询下属职务 - List lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId()); - reportVos.forEach(reportVo -> { - - //自己的可见详情 - if (doctor.getId().equals(reportVo.getDoctorId())) { - reportVo.setAuthority((byte)1); - } else if (CollectionUtils.isEmpty(lowerPositionIds)) { - reportVo.setAuthority((byte)0); - } else { - HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId()); - //自己下属的可见详情 - if (lowerPositionIds.contains(reportDoctor.getPositionId())) { - reportVo.setAuthority((byte)1); - } else { - reportVo.setAuthority((byte)0); - } - } - }); +// if (CollectionUtils.isEmpty(reportVos)) { +// return new PageInfo<>(reportVos); +// } +// if (CollectionUtil.isEmpty(doctors)) { +// return new PageInfo<>(reportVos); +// } +// HtDoctor doctor = doctors.get(0); +// //查询下属职务 +// List lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId()); +// reportVos.forEach(reportVo -> { +// +// //自己的可见详情 +// if (doctor.getId().equals(reportVo.getDoctorId())) { +// reportVo.setAuthority((byte)1); +// } else if (CollectionUtils.isEmpty(lowerPositionIds)) { +// reportVo.setAuthority((byte)0); +// } else { +// HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId()); +// //自己下属的可见详情 +// if (lowerPositionIds.contains(reportDoctor.getPositionId())) { +// reportVo.setAuthority((byte)1); +// } else { +// reportVo.setAuthority((byte)0); +// } +// } +// }); return new PageInfo<>(reportVos); } diff --git a/question/src/main/resources/application.yml b/question/src/main/resources/application.yml index 5c2cd5c4..1d437161 100644 --- a/question/src/main/resources/application.yml +++ b/question/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: common, util-dev \ No newline at end of file + active: green + include: common, util-green \ No newline at end of file