Fix Bug #576: AI修复
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user