From be08c7205662e2ac3d3341b8fd252ac2e8fedb84 Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Wed, 12 Mar 2025 23:42:39 -0700 Subject: [PATCH 1/5] fixed job card print and add bundle id in stitching offline item and make table dsc order --- .../controller/StitchingController.java | 4 ++-- .../ctp/StichedOfflineItemQueryBuilder.java | 4 ++-- .../com/utopiaindustries/service/BundleService.java | 6 +++--- src/main/resources/templates/cutting/bundles.html | 2 +- .../resources/templates/cutting/master-bundles.html | 2 +- .../templates/finishing/finished-item-list.html | 2 +- src/main/resources/templates/job-card-view-pdf.html | 11 ----------- .../templates/quality-control/inventory-accounts.html | 2 +- .../templates/quality-control/qc-items-list.html | 2 +- .../templates/stitching/_finished-item-sidebar.html | 4 ++-- .../templates/stitching/stitched-offline-items.html | 4 +++- 11 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/utopiaindustries/controller/StitchingController.java b/src/main/java/com/utopiaindustries/controller/StitchingController.java index 486d91e..b54bc11 100644 --- a/src/main/java/com/utopiaindustries/controller/StitchingController.java +++ b/src/main/java/com/utopiaindustries/controller/StitchingController.java @@ -93,13 +93,13 @@ public class StitchingController { @RequestParam( value = "sku", required = false ) String sku, @RequestParam( value = "start-date", required = false) String startDate, @RequestParam( value = "end-date", required = false ) String endDate, - @RequestParam( value = "job-card-id", required = false ) String jobCardId, + @RequestParam(value = "bundle-id", required = false) Long bundleID, @RequestParam( value = "count", required = false, defaultValue = "100") Long count, Model model ,RedirectAttributes redirect){ LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); - List itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, jobCardId ,count ); + List itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleID ,count ); model.addAttribute("items", itemList ) ; model.addAttribute("startDate", startDate1); model.addAttribute("endDate", endDate1); diff --git a/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java b/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java index fb90c68..453498d 100644 --- a/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java +++ b/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java @@ -8,7 +8,7 @@ import java.time.LocalDate; public class StichedOfflineItemQueryBuilder { - public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count) { + public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleID, Long count) { // format date String formattedDate; String formattedEndDate; @@ -35,7 +35,7 @@ public class StichedOfflineItemQueryBuilder { .and() .columnEquals("item_id", itemId ) .and() - .columnEquals("job_card_id", jobCardId ) + .columnEquals("bundle_id", bundleID ) .and() .columnEqualToOrGreaterThan("created_at", startDate1) .and() diff --git a/src/main/java/com/utopiaindustries/service/BundleService.java b/src/main/java/com/utopiaindustries/service/BundleService.java index 2fc7b36..8cc618b 100644 --- a/src/main/java/com/utopiaindustries/service/BundleService.java +++ b/src/main/java/com/utopiaindustries/service/BundleService.java @@ -125,13 +125,13 @@ public class BundleService { /* * find finished Items by params * */ - public List getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count ){ + public List getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleID, Long count ){ List stitchingOfflineItems = new ArrayList<>(); if( count == null ){ count = 100L; } - if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId ) ){ - String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId , count ); + if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleID) ) ){ + String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleID , count ); System.out.println( query ); stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query ); } else { diff --git a/src/main/resources/templates/cutting/bundles.html b/src/main/resources/templates/cutting/bundles.html index de8118c..f61f5c5 100644 --- a/src/main/resources/templates/cutting/bundles.html +++ b/src/main/resources/templates/cutting/bundles.html @@ -18,7 +18,7 @@
- +
diff --git a/src/main/resources/templates/cutting/master-bundles.html b/src/main/resources/templates/cutting/master-bundles.html index 2c2ae02..0e32bf5 100644 --- a/src/main/resources/templates/cutting/master-bundles.html +++ b/src/main/resources/templates/cutting/master-bundles.html @@ -19,7 +19,7 @@
ID
+ data-order="[[ 0, "dsc" ]]"> diff --git a/src/main/resources/templates/finishing/finished-item-list.html b/src/main/resources/templates/finishing/finished-item-list.html index 92d6726..76bead2 100644 --- a/src/main/resources/templates/finishing/finished-item-list.html +++ b/src/main/resources/templates/finishing/finished-item-list.html @@ -19,7 +19,7 @@
-
+
diff --git a/src/main/resources/templates/job-card-view-pdf.html b/src/main/resources/templates/job-card-view-pdf.html index 06bb654..a29330e 100644 --- a/src/main/resources/templates/job-card-view-pdf.html +++ b/src/main/resources/templates/job-card-view-pdf.html @@ -96,8 +96,6 @@ - - @@ -113,15 +111,6 @@ diff --git a/src/main/resources/templates/quality-control/inventory-accounts.html b/src/main/resources/templates/quality-control/inventory-accounts.html index b5739df..5516d6d 100644 --- a/src/main/resources/templates/quality-control/inventory-accounts.html +++ b/src/main/resources/templates/quality-control/inventory-accounts.html @@ -16,7 +16,7 @@

Packaging Inventory Accounts

-
ID
- - - - - - - -
+
diff --git a/src/main/resources/templates/quality-control/qc-items-list.html b/src/main/resources/templates/quality-control/qc-items-list.html index 65336e9..d6b4b3d 100644 --- a/src/main/resources/templates/quality-control/qc-items-list.html +++ b/src/main/resources/templates/quality-control/qc-items-list.html @@ -19,7 +19,7 @@
-
+
diff --git a/src/main/resources/templates/stitching/_finished-item-sidebar.html b/src/main/resources/templates/stitching/_finished-item-sidebar.html index 5b5ff78..46e2c32 100644 --- a/src/main/resources/templates/stitching/_finished-item-sidebar.html +++ b/src/main/resources/templates/stitching/_finished-item-sidebar.html @@ -20,8 +20,8 @@
- - + +
diff --git a/src/main/resources/templates/stitching/stitched-offline-items.html b/src/main/resources/templates/stitching/stitched-offline-items.html index 3b6f2bc..aa3a619 100644 --- a/src/main/resources/templates/stitching/stitched-offline-items.html +++ b/src/main/resources/templates/stitching/stitched-offline-items.html @@ -20,11 +20,12 @@
ID
+ data-order="[[ 0, "dsc" ]]"> + @@ -41,6 +42,7 @@ + -- 2.40.1 From f7f8cf8df32386f8c8ccf43dd160487116c5952c Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Wed, 12 Mar 2025 23:53:28 -0700 Subject: [PATCH 2/5] set min value and remove max in stitching side bar --- .../resources/templates/stitching/_finished-item-sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/stitching/_finished-item-sidebar.html b/src/main/resources/templates/stitching/_finished-item-sidebar.html index 46e2c32..10ffed6 100644 --- a/src/main/resources/templates/stitching/_finished-item-sidebar.html +++ b/src/main/resources/templates/stitching/_finished-item-sidebar.html @@ -21,7 +21,7 @@
- +
-- 2.40.1 From 9a6514c724f2ba086e4f20d779efc44040211e0f Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Thu, 13 Mar 2025 01:32:16 -0700 Subject: [PATCH 3/5] fixed comments --- .../utopiaindustries/controller/StitchingController.java | 4 ++-- .../querybuilder/ctp/StichedOfflineItemQueryBuilder.java | 4 ++-- .../java/com/utopiaindustries/service/BundleService.java | 6 +++--- src/main/resources/templates/cutting/bundles.html | 2 +- src/main/resources/templates/cutting/master-bundles.html | 2 +- .../templates/stitching/stitched-offline-items.html | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/utopiaindustries/controller/StitchingController.java b/src/main/java/com/utopiaindustries/controller/StitchingController.java index b54bc11..8930c48 100644 --- a/src/main/java/com/utopiaindustries/controller/StitchingController.java +++ b/src/main/java/com/utopiaindustries/controller/StitchingController.java @@ -93,13 +93,13 @@ public class StitchingController { @RequestParam( value = "sku", required = false ) String sku, @RequestParam( value = "start-date", required = false) String startDate, @RequestParam( value = "end-date", required = false ) String endDate, - @RequestParam(value = "bundle-id", required = false) Long bundleID, + @RequestParam(value = "bundle-id", required = false) Long bundleId, @RequestParam( value = "count", required = false, defaultValue = "100") Long count, Model model ,RedirectAttributes redirect){ LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); - List itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleID ,count ); + List itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleId ,count ); model.addAttribute("items", itemList ) ; model.addAttribute("startDate", startDate1); model.addAttribute("endDate", endDate1); diff --git a/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java b/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java index 453498d..b86c9d7 100644 --- a/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java +++ b/src/main/java/com/utopiaindustries/querybuilder/ctp/StichedOfflineItemQueryBuilder.java @@ -8,7 +8,7 @@ import java.time.LocalDate; public class StichedOfflineItemQueryBuilder { - public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleID, Long count) { + public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count) { // format date String formattedDate; String formattedEndDate; @@ -35,7 +35,7 @@ public class StichedOfflineItemQueryBuilder { .and() .columnEquals("item_id", itemId ) .and() - .columnEquals("bundle_id", bundleID ) + .columnEquals("bundle_id", bundleId ) .and() .columnEqualToOrGreaterThan("created_at", startDate1) .and() diff --git a/src/main/java/com/utopiaindustries/service/BundleService.java b/src/main/java/com/utopiaindustries/service/BundleService.java index 8cc618b..fcd1fdc 100644 --- a/src/main/java/com/utopiaindustries/service/BundleService.java +++ b/src/main/java/com/utopiaindustries/service/BundleService.java @@ -125,13 +125,13 @@ public class BundleService { /* * find finished Items by params * */ - public List getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleID, Long count ){ + public List getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count ){ List stitchingOfflineItems = new ArrayList<>(); if( count == null ){ count = 100L; } - if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleID) ) ){ - String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleID , count ); + if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){ + String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleId , count ); System.out.println( query ); stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query ); } else { diff --git a/src/main/resources/templates/cutting/bundles.html b/src/main/resources/templates/cutting/bundles.html index f61f5c5..dc998c1 100644 --- a/src/main/resources/templates/cutting/bundles.html +++ b/src/main/resources/templates/cutting/bundles.html @@ -18,7 +18,7 @@
-
ID Item IDBundle ID Sku Created At Created By
+
diff --git a/src/main/resources/templates/cutting/master-bundles.html b/src/main/resources/templates/cutting/master-bundles.html index 0e32bf5..8531518 100644 --- a/src/main/resources/templates/cutting/master-bundles.html +++ b/src/main/resources/templates/cutting/master-bundles.html @@ -19,7 +19,7 @@
ID
+ data-order="[[ 0, "desc" ]]"> diff --git a/src/main/resources/templates/stitching/stitched-offline-items.html b/src/main/resources/templates/stitching/stitched-offline-items.html index aa3a619..d6e5a91 100644 --- a/src/main/resources/templates/stitching/stitched-offline-items.html +++ b/src/main/resources/templates/stitching/stitched-offline-items.html @@ -20,7 +20,7 @@
+ data-order="[[ 0, "desc" ]]"> -- 2.40.1 From 760a667adb882d0b90565a87ba66a97705b5da4d Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Thu, 13 Mar 2025 01:33:59 -0700 Subject: [PATCH 4/5] fixed comments --- src/main/resources/templates/quality-control/qc-items-list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/quality-control/qc-items-list.html b/src/main/resources/templates/quality-control/qc-items-list.html index d6b4b3d..1432cc6 100644 --- a/src/main/resources/templates/quality-control/qc-items-list.html +++ b/src/main/resources/templates/quality-control/qc-items-list.html @@ -19,7 +19,7 @@
-
ID
+
-- 2.40.1 From 7596eb05f15cf3ed3a37b04bf1a9778c416d7999 Mon Sep 17 00:00:00 2001 From: Usama Khan Date: Thu, 13 Mar 2025 01:35:59 -0700 Subject: [PATCH 5/5] fixed comments --- src/main/resources/templates/finishing/finished-item-list.html | 2 +- .../resources/templates/quality-control/inventory-accounts.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/finishing/finished-item-list.html b/src/main/resources/templates/finishing/finished-item-list.html index 76bead2..283d652 100644 --- a/src/main/resources/templates/finishing/finished-item-list.html +++ b/src/main/resources/templates/finishing/finished-item-list.html @@ -19,7 +19,7 @@
-
ID
+
diff --git a/src/main/resources/templates/quality-control/inventory-accounts.html b/src/main/resources/templates/quality-control/inventory-accounts.html index 5516d6d..49c4769 100644 --- a/src/main/resources/templates/quality-control/inventory-accounts.html +++ b/src/main/resources/templates/quality-control/inventory-accounts.html @@ -16,7 +16,7 @@

Packaging Inventory Accounts

-
ID
+
-- 2.40.1