Fix Bug #576: AI修复

This commit is contained in:
2026-05-27 03:13:41 +08:00
parent 7630f87121
commit 5d5620bcda
4 changed files with 272 additions and 39 deletions

View File

@@ -0,0 +1,45 @@
package com.openhis.application.service.impl;
import com.openhis.application.domain.entity.LabRequest;
import com.openhis.application.domain.entity.LabRequestItem;
import com.openhis.application.mapper.LabRequestMapper;
import com.openhis.application.service.LabRequestService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 检验申请业务实现
* 修复 Bug #576编辑“待签发”状态申请单时右侧已选择列表回显为空。
* 根因:原 getDetailById 仅查询主表,未加载关联明细项;且前端未正确映射 items 数组。
*/
@Service
public class LabRequestServiceImpl implements LabRequestService {
private final LabRequestMapper labRequestMapper;
public LabRequestServiceImpl(LabRequestMapper labRequestMapper) {
this.labRequestMapper = labRequestMapper;
}
@Override
public LabRequest getDetailById(Long id) {
LabRequest request = labRequestMapper.selectById(id);
if (request == null) {
return null;
}
// 修复 Bug #576显式查询并绑定明细项确保所有状态含待签发均能完整回显
List<LabRequestItem> items = labRequestMapper.selectItemsByRequestId(id);
request.setItems(items);
return request;
}
@Override
public void saveOrUpdate(LabRequest request) {
if (request.getId() == null) {
labRequestMapper.insert(request);
} else {
labRequestMapper.updateById(request);
}
}
}