diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java index 15632f7a..71b35cc3 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java @@ -444,6 +444,17 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { if (!ConsultationStatusEnum.SUBMITTED.getCode().equals(entity.getConsultationStatus())) { throw new IllegalArgumentException("只有已提交状态的会诊申请才能取消提交"); } + + // 🎯 新增:检查是否有医生已确认或签名 + // 即使整体状态还是10(部分医生确认/签名),也不允许取消提交 + LambdaQueryWrapper invitedCheckWrapper = new LambdaQueryWrapper<>(); + invitedCheckWrapper.eq(ConsultationInvited::getConsultationRequestId, entity.getId()) + .ge(ConsultationInvited::getInvitedStatus, ConsultationStatusEnum.CONFIRMED.getCode()); + long confirmedOrSignedCount = consultationInvitedMapper.selectCount(invitedCheckWrapper); + if (confirmedOrSignedCount > 0) { + throw new IllegalArgumentException("已有医生确认或签名,无法取消提交"); + } + // 取消提交:将状态从"已提交"改回"新开" entity.setConsultationStatus(ConsultationStatusEnum.NEW.getCode()); entity.setConfirmingPhysician(null); @@ -724,8 +735,8 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { }).collect(Collectors.toList()); dto.setInvitedList(invitedDtoList); - - + + // 🎯 如果会诊已确认、已签名或已完成,填充会诊记录信息(从会诊确认表中获取) // 会诊状态:20=已确认,30=已签名,40=已完成 if (entity.getConsultationStatus() != null && @@ -785,11 +796,6 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { confirmedAndSignedPhysicians.size(), signedPhysicians.size()); } } - - log.info("填充会诊记录信息,已确认和已签名医生数:{},已签名医生数:{}", - confirmedAndSignedPhysicians.size(), signedPhysicians.size()); - } - } } } @@ -1198,7 +1204,7 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { // 10=已提交(待确认)、20=已确认(待签名)、30=已签名,排除40=已完成 LambdaQueryWrapper invitedWrapper = new LambdaQueryWrapper<>(); invitedWrapper.eq(ConsultationInvited::getInvitedPhysicianId, currentPhysicianId) - .in(ConsultationInvited::getInvitedStatus, + .in(ConsultationInvited::getInvitedStatus, ConsultationStatusEnum.SUBMITTED.getCode(), // 10-待确认 ConsultationStatusEnum.CONFIRMED.getCode(), // 20-已确认(待签名) ConsultationStatusEnum.SIGNED.getCode()) // 30-已签名 @@ -1312,9 +1318,9 @@ public class ConsultationAppServiceImpl implements IConsultationAppService { // 4. 更新邀请记录(存储会诊意见) // 格式:科室-医生:意见内容 - String formattedOpinion = String.format("%s-%s:%s", - currentDeptName, - currentPhysicianName, + String formattedOpinion = String.format("%s-%s:%s", + currentDeptName, + currentPhysicianName, dto.getConsultationOpinion()); invited.setInvitedStatus(ConsultationStatusEnum.CONFIRMED.getCode()); // 已确认 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/consultation.vue b/openhis-ui-vue3/src/views/doctorstation/components/consultation.vue index df84d51f..5b18a650 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/consultation.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/consultation.vue @@ -57,11 +57,18 @@ -