打印目视单-装配件有相同展示序号的零件需要合并

master
臧学普 6 months ago
parent a3c5a034fe
commit 18fee22d4f

@ -89,12 +89,21 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe
resultMap.put(MesPcnExtConstWords.REPLACE_CSN,MesPcnExtConstWords.REPLACE_CSN_CP+workOrder.getCustPartNo().substring(workOrder.getCustPartNo().length() -4)); resultMap.put(MesPcnExtConstWords.REPLACE_CSN,MesPcnExtConstWords.REPLACE_CSN_CP+workOrder.getCustPartNo().substring(workOrder.getCustPartNo().length() -4));
// 总个数 // 总个数
Integer totalCount = partProdGroup.getTotalCount(); Integer totalCount = partProdGroup.getTotalCount();
Map<Integer, List<MesWorkOrderAssembly>> collect = workOrderAssemblyList.stream().collect(Collectors.groupingBy(MesWorkOrderAssembly::getDisplaySeq));
// 为空时显示内容 // 为空时显示内容
String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent(); String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent();
for (Integer index = 0; index < totalCount; index++) { for (int index = 0; index < collect.size(); index++) {
String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue(); List<MesWorkOrderAssembly> orderAssemblyList = collect.get(index+1);
List<String> disPlayValues = orderAssemblyList.stream().map(MesWorkOrderAssembly::getDisplayValue).distinct().collect(Collectors.toList());
String displayValue =isNullViewContent;
if(!disPlayValues.isEmpty()){
displayValue = String.join("\r\n", disPlayValues);
}
// String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue();
resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue); // resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue);
resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), displayValue);
} }
printDataMapList.add(resultMap); printDataMapList.add(resultMap);

Loading…
Cancel
Save