Browse Source

去掉修改报告单时的身份判断 question

sd
zhizhi wu 4 years ago
parent
commit
c3c0bce2c8
  1. 68
      question/src/main/java/com/ccsens/question/service/PatientReportService.java

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

@ -112,39 +112,39 @@ public class PatientReportService implements IPatientReportService {
return CodeEnum.PARAM_ERROR; return CodeEnum.PARAM_ERROR;
} }
//查询修改医生信息 //查询修改医生信息
HtDoctorExample example = new HtDoctorExample(); // HtDoctorExample example = new HtDoctorExample();
example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS); // example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
List<HtDoctor> doctors = htDoctorDao.selectByExample(example); // List<HtDoctor> doctors = htDoctorDao.selectByExample(example);
if (CollectionUtils.isEmpty(doctors)) { // if (CollectionUtils.isEmpty(doctors)) {
log.info("{}医生信息尚未审核通过"); // log.info("{}医生信息尚未审核通过");
return CodeEnum.AUDIT_NOT_PASS; // return CodeEnum.AUDIT_NOT_PASS;
} // }
HtDoctor doctor = doctors.get(0); // HtDoctor doctor = doctors.get(0);
//判断该报告单是否为该医生的 // //判断该报告单是否为该医生的
HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(htPatientReport.getDoctorId()); // HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(htPatientReport.getDoctorId());
// 上级医生和报告单医生允许修改 // // 上级医生和报告单医生允许修改
List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId()); // List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
if (!doctor.getId().equals(reportDoctor.getId()) && !lowerPositionIds.contains(reportDoctor.getPositionId())) { // if (!doctor.getId().equals(reportDoctor.getId()) && !lowerPositionIds.contains(reportDoctor.getPositionId())) {
log.info("不具备修改权限"); // log.info("不具备修改权限");
return CodeEnum.REPORT_DOCTOR_ERROR; // return CodeEnum.REPORT_DOCTOR_ERROR;
} // }
//记录病人的随访记录 // //记录病人的随访记录
if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) { // if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) {
//1.统计病人的报告单的总数 // //1.统计病人的报告单的总数
HtPatientReportExample patientReportExample = new HtPatientReportExample(); // HtPatientReportExample patientReportExample = new HtPatientReportExample();
patientReportExample.createCriteria().andPatientIdEqualTo(htPatientReport.getPatientId()).andInitialImpressionIsNotNull(); // patientReportExample.createCriteria().andPatientIdEqualTo(htPatientReport.getPatientId()).andInitialImpressionIsNotNull();
long count = htPatientReportDao.countByExample(patientReportExample); // long count = htPatientReportDao.countByExample(patientReportExample);
HtPatientFollowUp followUp = new HtPatientFollowUp(); // HtPatientFollowUp followUp = new HtPatientFollowUp();
followUp.setId(snowflake.nextId()); // followUp.setId(snowflake.nextId());
followUp.setPatientId(htPatientReport.getPatientId()); // followUp.setPatientId(htPatientReport.getPatientId());
followUp.setFollowUpDatetime(new Date()); // followUp.setFollowUpDatetime(new Date());
followUp.setFollowUpTimes((int)count+1); // followUp.setFollowUpTimes((int)count+1);
followUp.setRecorder(htPatientReport.getDoctorId()); // followUp.setRecorder(htPatientReport.getDoctorId());
followUp.setDiagnose(doctor.getId()); // followUp.setDiagnose(doctor.getId());
htPatientFollowUpMapper.insertSelective(followUp); // htPatientFollowUpMapper.insertSelective(followUp);
} // }
//修改报告单 //修改报告单
HtPatientReport copy = patientReport.copy(); HtPatientReport copy = patientReport.copy();
copy.setUrl(Constant.Ht.STRING_DEFAULT); copy.setUrl(Constant.Ht.STRING_DEFAULT);
@ -156,7 +156,7 @@ public class PatientReportService implements IPatientReportService {
HtPatientReportRecord record = new HtPatientReportRecord(); HtPatientReportRecord record = new HtPatientReportRecord();
record.setId(snowflake.nextId()); record.setId(snowflake.nextId());
record.setReportId(htPatientReport.getId()); record.setReportId(htPatientReport.getId());
record.setDoctorId(doctor.getId()); record.setDoctorId(userId);
record.setContent(patientReport.toString()); record.setContent(patientReport.toString());
htPatientReportRecordMapper.insertSelective(record); htPatientReportRecordMapper.insertSelective(record);
log.info("记录编辑日志"); log.info("记录编辑日志");

Loading…
Cancel
Save