From fb4a856d04259f8455cad82010c29dfdf6742e27 Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Wed, 26 Feb 2025 23:53:06 -0800 Subject: [PATCH 1/4] Fixed Enabled Search job Card field --- src/main/resources/static/js/vue-components.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/resources/static/js/vue-components.js b/src/main/resources/static/js/vue-components.js index 8a942ed..49e62aa 100644 --- a/src/main/resources/static/js/vue-components.js +++ b/src/main/resources/static/js/vue-components.js @@ -3445,9 +3445,6 @@ if ( typeof Vue !== 'undefined' ) { }, filter : { default : true - }, - inputMode: { - default : 'none' } } }) From 2409930d9089c35332aef4a2650f9d4147d3adac Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Thu, 27 Feb 2025 00:05:31 -0800 Subject: [PATCH 2/4] add Total Pieces in master bundle barcode --- .../utopiaindustries/service/BarcodeService.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/utopiaindustries/service/BarcodeService.java b/src/main/java/com/utopiaindustries/service/BarcodeService.java index ad699c0..0001d9b 100644 --- a/src/main/java/com/utopiaindustries/service/BarcodeService.java +++ b/src/main/java/com/utopiaindustries/service/BarcodeService.java @@ -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 { From b06178cdb44749e345a3dbd12115e134cbde932d Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Thu, 27 Feb 2025 00:05:48 -0800 Subject: [PATCH 3/4] add Total Pieces in master bundle barcode --- .../com/utopiaindustries/service/BarcodeService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/utopiaindustries/service/BarcodeService.java b/src/main/java/com/utopiaindustries/service/BarcodeService.java index 0001d9b..46bb8d0 100644 --- a/src/main/java/com/utopiaindustries/service/BarcodeService.java +++ b/src/main/java/com/utopiaindustries/service/BarcodeService.java @@ -230,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 { From 05c2559af5d884c3fea2f15f20f6c856110dae5b Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Fri, 28 Feb 2025 00:07:36 -0800 Subject: [PATCH 4/4] fixed sized and Printer Configuration --- .../model/ctp/BarcodeStickerSize.java | 2 +- .../service/BarcodeService.java | 48 ++++--------------- 2 files changed, 10 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/utopiaindustries/model/ctp/BarcodeStickerSize.java b/src/main/java/com/utopiaindustries/model/ctp/BarcodeStickerSize.java index 3bd16bb..f8e3381 100644 --- a/src/main/java/com/utopiaindustries/model/ctp/BarcodeStickerSize.java +++ b/src/main/java/com/utopiaindustries/model/ctp/BarcodeStickerSize.java @@ -7,7 +7,7 @@ public enum BarcodeStickerSize { SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7), SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7), SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7), - SIZE_1_X_2( 67.69f, 125.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7); + SIZE_1_X_2( 67.69f, 128.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7); private final float width; private final float height; diff --git a/src/main/java/com/utopiaindustries/service/BarcodeService.java b/src/main/java/com/utopiaindustries/service/BarcodeService.java index 46bb8d0..b69a4ea 100644 --- a/src/main/java/com/utopiaindustries/service/BarcodeService.java +++ b/src/main/java/com/utopiaindustries/service/BarcodeService.java @@ -287,7 +287,6 @@ public class BarcodeService { g2d.drawString(text, adjustedX, adjustedY); } - public void getBarcodeImagesForStitchItems(List artifacts, BarcodeStickerSize stickerSize) throws Exception { @@ -313,7 +312,7 @@ public class BarcodeService { float qrY =stickerSize.getMarginLeft()+50 ; float qrX = stickerSize.getMarginTop(); - qrCodeImage.setFixedPosition(qrX - 16, qrY-47); + qrCodeImage.setFixedPosition(qrX - 16, qrY-40); document.add(qrCodeImage); float textX = stickerSize.getMarginLeft() + 40; @@ -326,7 +325,7 @@ public class BarcodeService { int maxLength = 14; List lines = new ArrayList<>(); - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 5; i++) { int start = i * maxLength; if (start < combinedText.length()) { String part = combinedText.substring(start, Math.min(start + maxLength, combinedText.length())).replaceAll("\\s+", ""); @@ -336,7 +335,7 @@ public class BarcodeService { float labelWidth = 67.69f; float textBoxWidth = 220; - float textY1 = textY-30; + float textY1 = textY-23; float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50; for (String line : lines) { @@ -354,13 +353,13 @@ public class BarcodeService { String id = String.valueOf(artifact.getId()); document.add(new Paragraph(id) .setFont(font) - .setFontColor(ColorConstants.BLACK) .setBold() + .setFontColor(ColorConstants.BLACK) .setFontSize(stickerSize.getTextSize() + 8) .setTextAlignment(TextAlignment.LEFT) - .setFixedPosition(textX - 25, textY + 8, 140)); + .setFixedPosition(textX - 25, textY + 13, 100)); - float dottedLine = textY - 60; + float dottedLine = textY - 65; for(int i= 0 ;i<16;i++){ document.add(new Paragraph("|") .setFontSize(stickerSize.getTextSize()) @@ -368,12 +367,12 @@ public class BarcodeService { .setBold() .setRotationAngle(-Math.PI / 2) .setTextAlignment(TextAlignment.LEFT) - .setFixedPosition(dottedLine,textX+40, 100)); + .setFixedPosition(dottedLine,textX+45, 100)); dottedLine += 7; } - float dottedLine2 = textY - 60; + float dottedLine2 = textY - 65; for(int i= 0 ;i<16;i++){ document.add(new Paragraph("|") .setFontSize(stickerSize.getTextSize()) @@ -381,7 +380,7 @@ public class BarcodeService { .setBold() .setRotationAngle(-Math.PI / 2) .setTextAlignment(TextAlignment.LEFT) - .setFixedPosition(dottedLine2,textX+75, 100)); + .setFixedPosition(dottedLine2,textX+80, 100)); dottedLine2 += 7; } @@ -434,38 +433,9 @@ public class BarcodeService { public void printLabel(BufferedImage bufferedImage) throws Exception { Connection connection = new TcpConnection(ipAddress, port); connection.open(); - ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection); - - //Reset Printer Settings - String resetSettings = "^XA^JUS^XZ"; - printer.sendCommand(resetSettings); - - //Force Label Length & Disable Auto Feed - String lengthFix = "^XA^LL555^PON^XZ"; // **Reduce Length (880) & Disable Auto Feed - printer.sendCommand(lengthFix); - - //Apply New Settings - String settings = "^XA" + - "^MMT" + // Continuous Mode - "^MTT" + // Thermal Transfer Mode - "^LH0,0" + // Home Position - "^PR6" + // Print Speed (~120mm/sec) - "^MD25" + // Darkness Level - "^PW541" + // Label Width (67.69mm for 203 DPI) - "^LL550" + // Reduced Label Length (fix gap) - "^PN0" + // No Extra Page Feed - "^PON" + // Disable Printer's Auto Feed Mode - "^XZ"; - - printer.sendCommand(settings); - - // Convert BufferedImage to ZebraImage ZebraImage zebraImage = new ZebraImage(bufferedImage); - - // Print image printer.printImage(zebraImage, 0, 0, 0, 0, false); - connection.close(); } } \ No newline at end of file