如果装配件有展示顺序,在ptr替换是需要替换目视项

tags/yfai-mes-ext-v2.4
臧学普 6 months ago
parent bcabf20313
commit 5432c0400c

@ -79,13 +79,28 @@ public class AssemblyVisualListPrintStrategy implements IPrintTemplateStrategySe
// 总个数
Integer totalCount = partProdGroup.getTotalCount();
Map<Integer, List<MesWorkOrderAssembly>> collect = workOrderAssemblyList.stream().collect(Collectors.groupingBy(MesWorkOrderAssembly::getDisplaySeq));
// 为空时显示内容
String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent();
for (Integer index = 0; index < totalCount; index++) {
String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue();
for (int index = 0; index < collect.size(); index++) {
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(MesExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : null : displayValue);
// resultMap.put(MesPcnExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : isNullViewContent : displayValue);
resultMap.put(MesExtConstWords.ASSEMBLY_PARAM + (index+1), displayValue);
}
// 为空时显示内容
// String isNullViewContent = StringUtils.isEmpty(partProdGroup.getIsNullViewContent()) ? "" : partProdGroup.getIsNullViewContent();
// for (Integer index = 0; index < totalCount; index++) {
// String displayValue = workOrderAssemblyList.size() -1 < index ? isNullViewContent : workOrderAssemblyList.get(index).getDisplayValue();
//
// resultMap.put(MesExtConstWords.ASSEMBLY_PARAM + (index+1), StringUtils.isEmpty(displayValue) ? StringUtils.isEmpty(isNullViewContent) ? "" : null : displayValue);
// }
printDataMapList.add(resultMap);

Loading…
Cancel
Save