|
@ -152,26 +152,28 @@ public class DfRecordService extends BaseService<DfRecordMapper, DfRecord> { |
|
|
DfRecord record = this.getBaseMapper().selectById(id); |
|
|
DfRecord record = this.getBaseMapper().selectById(id); |
|
|
if (record != null) { |
|
|
if (record != null) { |
|
|
DfRecordDetailDto dto = BeanCopyUtils.copy(record, DfRecordDetailDto.class); |
|
|
DfRecordDetailDto dto = BeanCopyUtils.copy(record, DfRecordDetailDto.class); |
|
|
Wrapper<DfRecordItem> wp = Wrappers.<DfRecordItem>lambdaQuery().eq(DfRecordItem::getRecordId, id); |
|
|
if (dto != null) { |
|
|
List<DfRecordItem> items = recordItemService.list(wp); |
|
|
|
|
|
if (CollectionUtil.isNotEmpty(items) && dto != null) { |
|
|
|
|
|
DfCheckingLine line = checkingLineMapper.selectById(record.getLineId()); |
|
|
DfCheckingLine line = checkingLineMapper.selectById(record.getLineId()); |
|
|
dto.setEntries(Optional.ofNullable(line).map(DfCheckingLine::getPoints).orElse("")); |
|
|
dto.setEntries(Optional.ofNullable(line).map(DfCheckingLine::getPoints).orElse("")); |
|
|
dto.setCreateName(userService.userName(dto.getCreateUid())); |
|
|
dto.setCreateName(userService.userName(dto.getCreateUid())); |
|
|
dto.setItems(StreamUtils.toList(items, r -> { |
|
|
Wrapper<DfRecordItem> wp = Wrappers.<DfRecordItem>lambdaQuery().eq(DfRecordItem::getRecordId, id); |
|
|
DfRecordItemDto itemDto = BeanCopyUtils.copy(r, DfRecordItemDto.class); |
|
|
List<DfRecordItem> items = recordItemService.list(wp); |
|
|
if (itemDto != null) { |
|
|
if (CollectionUtil.isNotEmpty(items)) { |
|
|
itemDto.setParts(Arrays.stream(StringUtils.split(r.getParts(), PART_SEPARATOR)) |
|
|
dto.setItems(StreamUtils.toList(items, r -> { |
|
|
.sorted(Comparator.comparingInt(String::length)).collect(Collectors.toList())); |
|
|
DfRecordItemDto itemDto = BeanCopyUtils.copy(r, DfRecordItemDto.class); |
|
|
DfRecordItem.Doc doc = r.getDocObj(); |
|
|
if (itemDto != null) { |
|
|
if (doc != null) { |
|
|
itemDto.setParts(Arrays.stream(StringUtils.split(r.getParts(), PART_SEPARATOR)) |
|
|
itemDto.setProblemImages(doc.getProblemImages()); |
|
|
.sorted(Comparator.comparingInt(String::length)).collect(Collectors.toList())); |
|
|
itemDto.setHandleImages(doc.getHandleImages()); |
|
|
DfRecordItem.Doc doc = r.getDocObj(); |
|
|
itemDto.setProblemVoices(doc.getProblemVoices()); |
|
|
if (doc != null) { |
|
|
|
|
|
itemDto.setProblemImages(doc.getProblemImages()); |
|
|
|
|
|
itemDto.setHandleImages(doc.getHandleImages()); |
|
|
|
|
|
itemDto.setProblemVoices(doc.getProblemVoices()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return itemDto; |
|
|
return itemDto; |
|
|
})); |
|
|
})); |
|
|
} |
|
|
if (line != null && StringUtils.isNotBlank(line.getXcId())) { |
|
|
if (line != null && StringUtils.isNotBlank(line.getXcId())) { |
|
|
dto.setAllItem((long) dfCheckingItemMapper.selectCount(Wrappers.<DfCheckingItem>lambdaQuery().eq(DfCheckingItem::getXcId, line.getXcId()))); |
|
|
dto.setAllItem((long) dfCheckingItemMapper.selectCount(Wrappers.<DfCheckingItem>lambdaQuery().eq(DfCheckingItem::getXcId, line.getXcId()))); |
|
|
} |
|
|
} |
|
|