add Total Pieces in master bundle barcode

add_QRCode
Usama Khan 2025-02-27 00:05:31 -08:00
parent fb4a856d04
commit 2409930d90
1 changed files with 9 additions and 5 deletions

View File

@ -217,6 +217,10 @@ public class BarcodeService {
String concatenatedIds = bundles.stream()
.map(bundle -> String.valueOf(bundle.getId()))
.collect(Collectors.joining("\\"));
int totalWrappedQuantity = bundles.stream()
.mapToInt(e->e.getWrapQuantity().intValue())
.sum();
this.drawCenteredText(g2d, "Total-Pieces: " + totalWrappedQuantity, detailFont, x, y, pageWidth, cols, stickerSize.getMarginTop() + 270, stickerSize.getMarginLeft());
this.drawCenteredText(g2d, "Sub-Bundles: " + concatenatedIds, detailFont, x, y, pageWidth, cols, stickerSize.getMarginTop() + 290, stickerSize.getMarginLeft());
}
@ -226,11 +230,11 @@ public class BarcodeService {
bufferedImages.add(a4Image);
}
saveA4ImageToPDF(bufferedImages,bundlePath);
try {
printPDF(bundleIpAddress, bundlePath);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// printPDF(bundleIpAddress, bundlePath);
// } catch (Exception e) {
// e.printStackTrace();
// }
}
public void printPDF(String printerIP, String pdfFilePath) throws Exception {