feat(ebom): 导出到excel时添加选中的节点数据
This commit is contained in:
parent
a6869a8a9a
commit
23b55e23dd
|
|
@ -20,7 +20,8 @@ import java.util.Objects;
|
||||||
@Data
|
@Data
|
||||||
public class EbomExcelVO {
|
public class EbomExcelVO {
|
||||||
|
|
||||||
|
@ExcelColumn("层级")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
@ExcelColumn("物料编码")
|
@ExcelColumn("物料编码")
|
||||||
private String materialNo;
|
private String materialNo;
|
||||||
|
|
|
||||||
|
|
@ -1188,8 +1188,18 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
public void exportBom(List<Long> bomRowIds, HttpServletResponse response) throws IOException {
|
public void exportBom(List<Long> bomRowIds, HttpServletResponse response) throws IOException {
|
||||||
|
|
||||||
List<BomNewEbomParentVO> child = getChildBatch(bomRowIds);
|
List<BomNewEbomParentVO> child = getChildBatch(bomRowIds);
|
||||||
final ListSheet<EbomExcelVO> listSheet = new ListSheet<>(Convert.toList(EbomExcelVO.class, child));
|
List<BomNewEbomParentEntity> parents = baseMapper.selectBatchIds(bomRowIds);
|
||||||
EecExcelUtil.eecExcel("bom列表", listSheet, response);
|
List<EbomExcelVO> datas = parents.stream().map(p -> {
|
||||||
|
EbomExcelVO vo = Convert.convert(EbomExcelVO.class, p);
|
||||||
|
vo.setLevel(1);
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
datas.addAll(child.stream().map(c -> {
|
||||||
|
EbomExcelVO vo = Convert.convert(EbomExcelVO.class, c);
|
||||||
|
vo.setLevel(2);
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
EecExcelUtil.eecExcel("bom列表", new ListSheet<>(datas), response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue