Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # openhis-server-new/openhis-application/src/main/java/com/openhis/web/consultation/appservice/impl/ConsultationAppServiceImpl.java
This commit is contained in:
@@ -149,6 +149,14 @@ public interface IConsultationAppService {
|
|||||||
* @return 会诊意见列表
|
* @return 会诊意见列表
|
||||||
*/
|
*/
|
||||||
List<ConsultationOpinionDto> getConsultationOpinions(String consultationId);
|
List<ConsultationOpinionDto> getConsultationOpinions(String consultationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询会诊申请详情
|
||||||
|
*
|
||||||
|
* @param id 会诊申请ID
|
||||||
|
* @return 会诊申请详情
|
||||||
|
*/
|
||||||
|
ConsultationRequestDto getConsultationById(Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -186,6 +186,11 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
|||||||
wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName());
|
wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 会诊ID查询(支持模糊匹配)
|
||||||
|
if (StringUtils.hasText(dto.getConsultationId())) {
|
||||||
|
wrapper.like(ConsultationRequest::getConsultationId, dto.getConsultationId());
|
||||||
|
}
|
||||||
|
|
||||||
// 按创建时间倒序排列
|
// 按创建时间倒序排列
|
||||||
wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate);
|
wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate);
|
||||||
|
|
||||||
@@ -240,6 +245,11 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
|||||||
wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName());
|
wrapper.like(ConsultationRequest::getPatientName, dto.getPatientName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 会诊ID查询(支持模糊匹配)
|
||||||
|
if (StringUtils.hasText(dto.getConsultationId())) {
|
||||||
|
wrapper.like(ConsultationRequest::getConsultationId, dto.getConsultationId());
|
||||||
|
}
|
||||||
|
|
||||||
// 按创建时间倒序排列
|
// 按创建时间倒序排列
|
||||||
wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate);
|
wrapper.orderByDesc(ConsultationRequest::getConsultationRequestDate);
|
||||||
|
|
||||||
@@ -444,17 +454,6 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
|||||||
if (!ConsultationStatusEnum.SUBMITTED.getCode().equals(entity.getConsultationStatus())) {
|
if (!ConsultationStatusEnum.SUBMITTED.getCode().equals(entity.getConsultationStatus())) {
|
||||||
throw new IllegalArgumentException("只有已提交状态的会诊申请才能取消提交");
|
throw new IllegalArgumentException("只有已提交状态的会诊申请才能取消提交");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🎯 新增:检查是否有医生已确认或签名
|
|
||||||
// 即使整体状态还是10(部分医生确认/签名),也不允许取消提交
|
|
||||||
LambdaQueryWrapper<ConsultationInvited> 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.setConsultationStatus(ConsultationStatusEnum.NEW.getCode());
|
||||||
entity.setConfirmingPhysician(null);
|
entity.setConfirmingPhysician(null);
|
||||||
@@ -1828,5 +1827,26 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConsultationRequestDto getConsultationById(Long id) {
|
||||||
|
try {
|
||||||
|
if (id == null) {
|
||||||
|
throw new IllegalArgumentException("会诊申请ID不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 查询会诊申请
|
||||||
|
ConsultationRequest request = consultationRequestMapper.selectById(id);
|
||||||
|
if (request == null) {
|
||||||
|
throw new IllegalArgumentException("会诊申请不存在,ID: " + id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 转换为DTO并返回
|
||||||
|
return convertToDto(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询会诊申请详情失败", e);
|
||||||
|
throw new RuntimeException("查询会诊申请详情失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -302,5 +302,21 @@ public class ConsultationController {
|
|||||||
return R.fail("获取会诊意见列表失败: " + e.getMessage());
|
return R.fail("获取会诊意见列表失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询会诊申请详情
|
||||||
|
*/
|
||||||
|
@ApiOperation("根据ID查询会诊申请详情")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
public R<ConsultationRequestDto> getConsultationById(
|
||||||
|
@ApiParam("会诊申请ID") @PathVariable Long id) {
|
||||||
|
try {
|
||||||
|
ConsultationRequestDto detail = consultationAppService.getConsultationById(id);
|
||||||
|
return R.ok(detail);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询会诊申请详情失败", e);
|
||||||
|
return R.fail("查询会诊申请详情失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,3 +135,14 @@ export function getConsultationOpinions(consultationId) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询会诊申请详情
|
||||||
|
* @param {Number} id 会诊申请ID
|
||||||
|
*/
|
||||||
|
export function getConsultationById(id) {
|
||||||
|
return request({
|
||||||
|
url: `/consultation/detail/${id}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,15 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="会诊ID">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.consultationId"
|
||||||
|
placeholder="请输入会诊ID"
|
||||||
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleQuery">
|
<el-button type="primary" @click="handleQuery">
|
||||||
<el-icon><Search /></el-icon> 查询
|
<el-icon><Search /></el-icon> 查询
|
||||||
@@ -394,7 +403,8 @@ const queryParams = reactive({
|
|||||||
applyDoctor: '',
|
applyDoctor: '',
|
||||||
urgency: '',
|
urgency: '',
|
||||||
consultationStatus: '',
|
consultationStatus: '',
|
||||||
patientName: ''
|
patientName: '',
|
||||||
|
consultationId: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 会诊状态常量
|
// 会诊状态常量
|
||||||
@@ -702,7 +712,8 @@ const loadData = async () => {
|
|||||||
consultationStatus: queryParams.consultationStatus,
|
consultationStatus: queryParams.consultationStatus,
|
||||||
patientName: queryParams.patientName,
|
patientName: queryParams.patientName,
|
||||||
consultationRequestDate: queryParams.startTime,
|
consultationRequestDate: queryParams.startTime,
|
||||||
consultationUrgency: queryParams.urgency
|
consultationUrgency: queryParams.urgency,
|
||||||
|
consultationId: queryParams.consultationId
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await queryConsultationListPage(queryData, pagination.currentPage, pagination.pageSize)
|
const res = await queryConsultationListPage(queryData, pagination.currentPage, pagination.pageSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user