帮我将attachmentVOS赋值到materialDetailsList中,并写出代码
时间: 2024-03-10 20:43:47 浏览: 24
好的,我理解您的意思了。如果您想将attachmentVOS赋值到materialDetailsList中,可以在循环中对应的位置添加代码来实现。假设您想将每个附件信息赋值给每个材料详情,可以按照以下方式修改代码:
```
for (MaterialDetailsVO materialDetailsVO : materialDetailsList) {
List<AuditMaterialVO> auditMaterialList = materialDetailsVO.getAuditMaterialList();
for (AuditMaterialVO auditMaterialVO : auditMaterialList) {
List<AttachedFileVO> attachedFileList = auditMaterialVO.getAttachedFileList();
for (AttachedFileVO attachedFileVO : attachedFileList) {
// do something with the attached file
// 将附件信息赋值给材料详情
List<AttachmentVO> attachmentVOS = materialDetailsVO.getAttachmentVOS();
if (attachmentVOS == null) {
attachmentVOS = new ArrayList<>();
materialDetailsVO.setAttachmentVOS(attachmentVOS);
}
AttachmentVO attachment = new AttachmentVO();
attachment.setFileId(attachedFileVO.getFileId());
attachment.setFileName(attachedFileVO.getFileName());
attachmentVOS.add(attachment);
}
}
}
```
这段代码会将每个附件信息赋值给对应的材料详情,并将所有的AttachmentVO对象存储在materialDetailsVO中的attachmentVOS属性中。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)