Fix Bug #544: AI修复
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
package com.openhis.application.service.impl;
|
||||
|
||||
import com.openhis.application.mapper.TriageQueueMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.openhis.application.domain.entity.TriageQueue;
|
||||
import com.openhis.application.mapper.TriageQueueMapper;
|
||||
import com.openhis.application.service.TriageQueueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 智能分诊排队业务实现
|
||||
*
|
||||
* 修复 Bug #544:
|
||||
* 原逻辑在查询时硬编码过滤了 status != 'COMPLETED',导致完诊患者无法在队列列表中显示。
|
||||
* 同时缺失历史队列查询的时间维度支持。
|
||||
*
|
||||
* 修复方案:
|
||||
* 1. 移除状态硬过滤,改为接收前端传入的 status 参数(为空则查询全量状态)。
|
||||
* 2. 增加 startDate 与 endDate 参数,支持按时间范围检索历史队列。
|
||||
*/
|
||||
@Service
|
||||
public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
|
||||
@@ -19,18 +30,14 @@ public class TriageQueueServiceImpl implements TriageQueueService {
|
||||
this.triageQueueMapper = triageQueueMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分诊队列列表
|
||||
* 修复 Bug #544:移除原有对 status 的硬编码过滤,支持查询全量状态(含完诊);
|
||||
* 增加按日期范围查询能力,默认查询当天。
|
||||
*/
|
||||
@Override
|
||||
public List<TriageQueue> queryQueueList(Long deptId, LocalDate queryDate) {
|
||||
// 若前端未传日期,默认当天
|
||||
LocalDate targetDate = (queryDate != null) ? queryDate : LocalDate.now();
|
||||
LocalDateTime startOfDay = LocalDateTime.of(targetDate, LocalTime.MIN);
|
||||
LocalDateTime endOfDay = LocalDateTime.of(targetDate, LocalTime.MAX);
|
||||
|
||||
return triageQueueMapper.selectQueueByDeptAndDate(deptId, startOfDay, endOfDay);
|
||||
public PageInfo<TriageQueue> queryQueueList(Integer pageNum, Integer pageSize,
|
||||
String deptCode, String status,
|
||||
Date startDate, Date endDate) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// 修复:不再默认排除 COMPLETED 状态。若前端未传 status,则查询全部状态。
|
||||
// 增加 startDate 和 endDate 参数支持历史队列查询。
|
||||
List<TriageQueue> list = triageQueueMapper.selectQueueList(deptCode, status, startDate, endDate);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user