|
@@ -156,6 +156,35 @@ public class SopServiceImpl extends ServiceImpl<SopMapper, SopEntity> implements
|
|
|
return response;
|
|
return response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// @Override
|
|
|
|
|
+ public SopResponseDTO getSopDetailWithActivity(Long id) {
|
|
|
|
|
+ SopResponseDTO response = new SopResponseDTO();
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 查询SOP主表
|
|
|
|
|
+ SopEntity sop = getById(id);
|
|
|
|
|
+ if (sop == null) {
|
|
|
|
|
+ throw new RuntimeException("SOP不存在,ID: " + id);
|
|
|
|
|
+ }
|
|
|
|
|
+ BeanUtils.copyProperties(sop, response);
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 查询SOP明细
|
|
|
|
|
+ LambdaQueryWrapper<SopDetailEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ wrapper.eq(SopDetailEntity::getSopId, id);
|
|
|
|
|
+ wrapper.orderByAsc(SopDetailEntity::getStep);
|
|
|
|
|
+ List<SopDetailEntity> details = sopDetailService.list(wrapper);
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 转换明细
|
|
|
|
|
+ List<SopDetailResponseDTO> detailResponses = details.stream().map(detail -> {
|
|
|
|
|
+ SopDetailResponseDTO dto = new SopDetailResponseDTO();
|
|
|
|
|
+ BeanUtils.copyProperties(detail, dto);
|
|
|
|
|
+ return dto;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ response.setDetails(detailResponses);
|
|
|
|
|
+
|
|
|
|
|
+ return response;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<SopResponseDTO> listSopPage(SopResponseDTO dto) {
|
|
public IPage<SopResponseDTO> listSopPage(SopResponseDTO dto) {
|
|
|
Integer pageIndex = dto.getPageIndex();
|
|
Integer pageIndex = dto.getPageIndex();
|