fixed job card print and add bundle id in stitching offline item and make table dsc order

update-job-card-print
Usama Khan 2025-03-12 23:42:39 -07:00
parent 229be993d5
commit be08c72056
11 changed files with 17 additions and 26 deletions

View File

@ -93,13 +93,13 @@ public class StitchingController {
@RequestParam( value = "sku", required = false ) String sku, @RequestParam( value = "sku", required = false ) String sku,
@RequestParam( value = "start-date", required = false) String startDate, @RequestParam( value = "start-date", required = false) String startDate,
@RequestParam( value = "end-date", required = false ) String endDate, @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, @RequestParam( value = "count", required = false, defaultValue = "100") Long count,
Model model Model model
,RedirectAttributes redirect){ ,RedirectAttributes redirect){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, jobCardId ,count ); List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleID ,count );
model.addAttribute("items", itemList ) ; model.addAttribute("items", itemList ) ;
model.addAttribute("startDate", startDate1); model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1); model.addAttribute("endDate", endDate1);

View File

@ -8,7 +8,7 @@ import java.time.LocalDate;
public class StichedOfflineItemQueryBuilder { 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 // format date
String formattedDate; String formattedDate;
String formattedEndDate; String formattedEndDate;
@ -35,7 +35,7 @@ public class StichedOfflineItemQueryBuilder {
.and() .and()
.columnEquals("item_id", itemId ) .columnEquals("item_id", itemId )
.and() .and()
.columnEquals("job_card_id", jobCardId ) .columnEquals("bundle_id", bundleID )
.and() .and()
.columnEqualToOrGreaterThan("created_at", startDate1) .columnEqualToOrGreaterThan("created_at", startDate1)
.and() .and()

View File

@ -125,13 +125,13 @@ public class BundleService {
/* /*
* find finished Items by params * find finished Items by params
* */ * */
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count ){ public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleID, Long count ){
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>(); List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
if( count == null ){ if( count == null ){
count = 100L; count = 100L;
} }
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId ) ){ if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleID) ) ){
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId , count ); String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleID , count );
System.out.println( query ); System.out.println( query );
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query ); stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
} else { } else {

View File

@ -18,7 +18,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-bundle-barcodes}" method="post"> <form th:action="@{/cutting/generate-bundle-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="Bundle"> <input hidden="hidden" name="artifactType" value="Bundle">
<table class="table table-striped" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table class="table table-striped" data-table data-order="[[ 0, &quot;dsc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>

View File

@ -19,7 +19,7 @@
<form th:action="@{/cutting/generate-master-barcodes}" method="post"> <form th:action="@{/cutting/generate-master-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="MasterBundle"> <input hidden="hidden" name="artifactType" value="MasterBundle">
<table class="table table-striped table-bordered" data-bundle-table <table class="table table-striped table-bordered" data-bundle-table
data-order="[[ 0, &quot;asc&quot; ]]"> data-order="[[ 0, &quot;dsc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>

View File

@ -19,7 +19,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post"> <form th:action="@{/cutting/generate-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="Bundle"> <input hidden="hidden" name="artifactType" value="Bundle">
<table class="table table-striped" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table class="table table-striped" data-table data-order="[[ 0, &quot;dsc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>

View File

@ -96,8 +96,6 @@
<td th:text="'Expected Production'"></td> <td th:text="'Expected Production'"></td>
<td th:text="'Actual Production'"></td> <td th:text="'Actual Production'"></td>
<td th:text="'Total Production'"></td> <td th:text="'Total Production'"></td>
<td th:text="'Total Stitching Item'"></td>
<td th:text="'Total Finish Item'"></td>
<td th:text="'Cut Piece Items'"></td> <td th:text="'Cut Piece Items'"></td>
</tr> </tr>
</thead> </thead>
@ -113,15 +111,6 @@
<td style="border: 1px solid black;" th:text="${totalStitchingItem.get(cardItem.getItemId())}"></td> <td style="border: 1px solid black;" th:text="${totalStitchingItem.get(cardItem.getItemId())}"></td>
<td style="border: 1px solid black;" th:text="${totalFinishItem.get(cardItem.getItemId())}"></td> <td style="border: 1px solid black;" th:text="${totalFinishItem.get(cardItem.getItemId())}"></td>
<td style="margin:0px; padding:0px"> <td style="margin:0px; padding:0px">
<table class="bordered">
<tbody>
<tr th:each="cutPieceItem : ${cutPiece}"
th:if="*{cardItem.getId() == cutPieceItem.getJobCardItemId()}">
<td style="border: 1px solid black;" th:text="${cutPieceItem.getType()}"></td>
<td style="border: 1px solid black;" th:text="${cutPieceItem.getQuantity()}"></td>
</tr>
</tbody>
</table>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -16,7 +16,7 @@
<h3>Packaging Inventory Accounts</h3> <h3>Packaging Inventory Accounts</h3>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<table class="table table-striped" data-account-table data-order="[[ 0, &quot;asc&quot; ]]"> <table class="table table-striped" data-account-table data-order="[[ 0, &quot;dsc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>

View File

@ -19,7 +19,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post"> <form th:action="@{/cutting/generate-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="Bundle"> <input hidden="hidden" name="artifactType" value="Bundle">
<table class="table table-striped" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table class="table table-striped" data-table data-order="[[ 0, &quot;dcs&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>

View File

@ -20,8 +20,8 @@
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}"> <input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Master Bundle ID</label> <label>Bundle ID</label>
<input type="text" class="form-control" name="job-card-id" maxlength="100" th:value="${param['job-card-id']}"> <input type="number" class="form-control" name="bundle-id" maxlength="100" th:value="${param['bundle-id' ?: 100]}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Start Date</label> <label>Start Date</label>

View File

@ -20,11 +20,12 @@
<form th:action="@{/stitching/generate-barcodes}" method="post"> <form th:action="@{/stitching/generate-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="FinishedItem"> <input hidden="hidden" name="artifactType" value="FinishedItem">
<table th:if="${ #lists != null && #lists.size(items) != 0 }" class="table table-striped table-bordered" data-table <table th:if="${ #lists != null && #lists.size(items) != 0 }" class="table table-striped table-bordered" data-table
data-order="[[ 0, &quot;asc&quot; ]]"> data-order="[[ 0, &quot;dsc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Item ID</th> <th>Item ID</th>
<th>Bundle ID</th>
<th>Sku</th> <th>Sku</th>
<th>Created At</th> <th>Created At</th>
<th>Created By</th> <th>Created By</th>
@ -41,6 +42,7 @@
<tr th:each="item : ${items}" th:object="${item}"> <tr th:each="item : ${items}" th:object="${item}">
<td th:text="*{id}"></td> <td th:text="*{id}"></td>
<td th:text="*{itemId}"></td> <td th:text="*{itemId}"></td>
<td th:text="*{bundleId}"></td>
<td th:text="*{sku}"></td> <td th:text="*{sku}"></td>
<td ctp:formatdatetime="*{createdAt}"></td> <td ctp:formatdatetime="*{createdAt}"></td>
<td th:text="*{createdBy}"></td> <td th:text="*{createdBy}"></td>