Compare commits
No commits in common. "07dabfa9ad9170c9c7d5e8c72c9e46991636bd1c" and "b10cb9ca42f88f87ab5fdd27fe6e42aac071a48c" have entirely different histories.
07dabfa9ad
...
b10cb9ca42
|
|
@ -91,13 +91,4 @@ public class QmsPdiTaskRecordController extends BaseController {
|
||||||
@NotNull(message = "任务ID不能为空") @RequestParam Long id) {
|
@NotNull(message = "任务ID不能为空") @RequestParam Long id) {
|
||||||
return ApiResult.success(taskRecordControllerService.summary(id));
|
return ApiResult.success(taskRecordControllerService.summary(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货前检测项详情(inspectionItemType=2),图片直接返回URL列表
|
|
||||||
*/
|
|
||||||
@GetMapping("deliveryDetail")
|
|
||||||
public ApiResult<List<QmsPdiTaskRecordDetailVO.DeliveryItemDetailVO>> deliveryDetail(
|
|
||||||
@NotNull(message = "任务ID不能为空") @RequestParam Long id) {
|
|
||||||
return ApiResult.success(taskRecordControllerService.deliveryDetail(id));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -323,63 +323,6 @@ public class QmsPdiTaskRecordControllerService {
|
||||||
return convertImageIdsToVO(result.getInspectionItemImage());
|
return convertImageIdsToVO(result.getInspectionItemImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================= 发货前检测项详情 =========================
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询发货前检测项(inspectionItemType=2),图片直接返回URL列表
|
|
||||||
*/
|
|
||||||
public List<QmsPdiTaskRecordDetailVO.DeliveryItemDetailVO> deliveryDetail(Long taskId) {
|
|
||||||
// 查询该任务下所有 type=2 的记录
|
|
||||||
List<QmsPdiInspectionResults> results = inspectionResultsService.lambdaQuery()
|
|
||||||
.eq(QmsPdiInspectionResults::getTaskId, taskId)
|
|
||||||
.eq(QmsPdiInspectionResults::getInspectionItemType, 2)
|
|
||||||
.list();
|
|
||||||
|
|
||||||
if (results.isEmpty()) {
|
|
||||||
return List.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量查 delivery_item 获取 checklist
|
|
||||||
Set<Long> deliveryItemIds = results.stream()
|
|
||||||
.map(QmsPdiInspectionResults::getInspectionItemId)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
Map<Long, QmsPdiDetectionRulesDeliveryItem> deliveryItemMap = Map.of();
|
|
||||||
if (!deliveryItemIds.isEmpty()) {
|
|
||||||
List<QmsPdiDetectionRulesDeliveryItem> deliveryItems = deliveryItemService.listByIds(deliveryItemIds);
|
|
||||||
deliveryItemMap = deliveryItems.stream()
|
|
||||||
.collect(Collectors.toMap(QmsPdiDetectionRulesDeliveryItem::getId, di -> di, (a, b) -> a));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建返回列表
|
|
||||||
Map<Long, QmsPdiDetectionRulesDeliveryItem> finalMap = deliveryItemMap;
|
|
||||||
List<QmsPdiTaskRecordDetailVO.DeliveryItemDetailVO> detailList = new ArrayList<>();
|
|
||||||
for (QmsPdiInspectionResults r : results) {
|
|
||||||
QmsPdiTaskRecordDetailVO.DeliveryItemDetailVO vo = new QmsPdiTaskRecordDetailVO.DeliveryItemDetailVO();
|
|
||||||
vo.setDeliveryItemId(r.getInspectionItemId());
|
|
||||||
|
|
||||||
// checklist 从 delivery_item 获取
|
|
||||||
QmsPdiDetectionRulesDeliveryItem di = finalMap.get(r.getInspectionItemId());
|
|
||||||
if (di != null) {
|
|
||||||
vo.setChecklist(di.getChecklist());
|
|
||||||
}
|
|
||||||
|
|
||||||
// inspectionItemImage 按逗号拆分,直接返回URL列表
|
|
||||||
String imageStr = r.getInspectionItemImage();
|
|
||||||
if (imageStr != null && !imageStr.isEmpty()) {
|
|
||||||
vo.setInspectionItemImage(Arrays.stream(imageStr.split(","))
|
|
||||||
.map(String::trim)
|
|
||||||
.filter(s -> !s.isEmpty())
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
} else {
|
|
||||||
vo.setInspectionItemImage(List.of());
|
|
||||||
}
|
|
||||||
|
|
||||||
detailList.add(vo);
|
|
||||||
}
|
|
||||||
return detailList;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================= 任务概要 =========================
|
// ========================= 任务概要 =========================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -110,26 +110,4 @@ public class QmsPdiTaskRecordDetailVO {
|
||||||
*/
|
*/
|
||||||
private List<FileDetailVO> inspectionItemImage;
|
private List<FileDetailVO> inspectionItemImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货前检测项明细VO(图片直接返回URL列表)
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public static class DeliveryItemDetailVO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货检查项ID
|
|
||||||
*/
|
|
||||||
private Long deliveryItemId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查项目
|
|
||||||
*/
|
|
||||||
private String checklist;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 现场图片/视频URL列表
|
|
||||||
*/
|
|
||||||
private List<String> inspectionItemImage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue