Fix Bug #544: AI修复

This commit is contained in:
2026-05-27 07:06:36 +08:00
parent 70336e8850
commit 0e1e506cf3
3 changed files with 159 additions and 73 deletions

View File

@@ -1,19 +1,25 @@
package com.openhis.application.service.impl;
import com.openhis.application.domain.entity.QueueInfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.openhis.application.domain.dto.QueueQueryDto;
import com.openhis.application.domain.entity.QueueRecord;
import com.openhis.application.mapper.QueueMapper;
import com.openhis.application.service.QueueService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
/**
* 智能分诊排队务实现
*
* 智能分诊排队务实现
*
* 修复 Bug #544
* - 当前排队列表现在会显示 “完诊” 状态的患者;
* - 新增历史排队查询接口供前端使用
* 1. 移除原逻辑中对“完诊”(COMPLETED) 状态的硬编码过滤,确保全流程轨迹可追溯。
* 2. 增加时间范围查询支持,默认查询当天数据,支持历史队列检索
*/
@Service
public class QueueServiceImpl implements QueueService {
@@ -25,12 +31,19 @@ public class QueueServiceImpl implements QueueService {
}
@Override
public List<QueueInfo> getCurrentQueue(Long departmentId) {
return queueMapper.selectCurrentQueue(departmentId);
}
@Transactional(readOnly = true)
public PageInfo<QueueRecord> getQueueList(QueueQueryDto queryDto) {
// 修复 Bug #544默认查询当天若前端未传时间则自动填充当日 00:00:00 ~ 23:59:59
if (queryDto.getStartDate() == null) {
queryDto.setStartDate(LocalDateTime.of(LocalDate.now(), LocalTime.MIN));
}
if (queryDto.getEndDate() == null) {
queryDto.setEndDate(LocalDateTime.of(LocalDate.now(), LocalTime.MAX));
}
@Override
public List<QueueInfo> getHistoryQueue(Long departmentId, Date startTime, Date endTime) {
return queueMapper.selectHistoryQueue(departmentId, startTime, endTime);
// 移除原 WHERE status != 'COMPLETED' 过滤逻辑,交由前端按需筛选或全量展示
PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
List<QueueRecord> list = queueMapper.selectQueueList(queryDto);
return new PageInfo<>(list);
}
}