诊断记录状态调整

master
gongzhenkun 2 years ago
parent 3bc38afb94
commit f4ac2e7d9c

@ -67,6 +67,7 @@ public class MpController extends BaseController {
recordHistoryService.saveHistory(recordId); recordHistoryService.saveHistory(recordId);
tRecord.setId(recordId); tRecord.setId(recordId);
tRecord.setStatus("0");
tRecord.setUpdateResult(""); tRecord.setUpdateResult("");
tRecord.setUpdateResult2(""); tRecord.setUpdateResult2("");
tRecordService.updateTRecord(tRecord); tRecordService.updateTRecord(tRecord);
@ -90,11 +91,9 @@ public class MpController extends BaseController {
TRecord tRecord = new TRecord(); TRecord tRecord = new TRecord();
tRecord.setPatientId(appPatientHospitalDoctor.getPatientId()); tRecord.setPatientId(appPatientHospitalDoctor.getPatientId());
tRecord.setHospitalId(appPatientHospitalDoctor.getHospitalId()); tRecord.setHospitalId(appPatientHospitalDoctor.getHospitalId());
tRecord.setStatus("0");
tRecord.setDoctorId(appPatientHospitalDoctor.getDoctorId()); tRecord.setDoctorId(appPatientHospitalDoctor.getDoctorId());
tRecord.setAppointmentTime(DateUtils.dateTime(new Date())); tRecord.setAppointmentTime(DateUtils.dateTime(new Date()));
List<TRecord> tRecords = tRecordService.selectTRecordList(tRecord); if (whetherRegistration(tRecord, "0") || whetherRegistration(tRecord, "2") || whetherRegistration(tRecord, "3")) {
if (!CollectionUtils.isEmpty(tRecords)) {
AjaxResult ajaxResult = AjaxResult.error(); AjaxResult ajaxResult = AjaxResult.error();
ajaxResult.put("msg", "当前患者已登记过信息!"); ajaxResult.put("msg", "当前患者已登记过信息!");
return ajaxResult; return ajaxResult;
@ -104,6 +103,7 @@ public class MpController extends BaseController {
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor);
tRecord.setCreateBy(getUsername()); tRecord.setCreateBy(getUsername());
tRecord.setStatus("0");
tRecordService.insertTRecord(tRecord); tRecordService.insertTRecord(tRecord);
List<TPatientHospitalDoctor> tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); List<TPatientHospitalDoctor> tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor);
if (tPHDs.isEmpty()) if (tPHDs.isEmpty())
@ -118,4 +118,10 @@ public class MpController extends BaseController {
ajaxResult.put("msg", "登记成功"); ajaxResult.put("msg", "登记成功");
return ajaxResult; return ajaxResult;
} }
private Boolean whetherRegistration(TRecord tRecord, String status) {
tRecord.setStatus(status);
List<TRecord> tRecords = tRecordService.selectTRecordList(tRecord);
return !CollectionUtils.isEmpty(tRecords);
}
} }

Loading…
Cancel
Save