update-job-card-print #17

Merged
saif.haq merged 5 commits from update-job-card-print into main 2025-03-13 07:38:19 +00:00
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 = "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<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("startDate", startDate1);
model.addAttribute("endDate", endDate1);

View File

@ -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()

View File

@ -125,13 +125,13 @@ public class BundleService {
/*
* 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<>();
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 {

View File

@ -18,7 +18,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-bundle-barcodes}" method="post">
<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;desc&quot; ]]">
<thead>
<tr>
<th>ID</th>

View File

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

View File

@ -19,7 +19,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post">
<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;desc&quot; ]]">
<thead>
<tr>
<th>ID</th>

View File

@ -96,8 +96,6 @@
<td th:text="'Expected Production'"></td>
<td th:text="'Actual 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>
</tr>
</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="${totalFinishItem.get(cardItem.getItemId())}"></td>
<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>
</tr>
</tbody>

View File

@ -16,7 +16,7 @@
<h3>Packaging Inventory Accounts</h3>
</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;desc&quot; ]]">
<thead>
<tr>
<th></th>

View File

@ -19,7 +19,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post">
<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;desc&quot; ]]">
<thead>
<tr>
<th>ID</th>

View File

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

View File

@ -20,11 +20,12 @@
<form th:action="@{/stitching/generate-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="FinishedItem">
<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;desc&quot; ]]">
<thead>
<tr>
<th>ID</th>
<th>Item ID</th>
<th>Bundle ID</th>
<th>Sku</th>
<th>Created At</th>
<th>Created By</th>
@ -41,6 +42,7 @@
<tr th:each="item : ${items}" th:object="${item}">
<td th:text="*{id}"></td>
<td th:text="*{itemId}"></td>
<td th:text="*{bundleId}"></td>
<td th:text="*{sku}"></td>
<td ctp:formatdatetime="*{createdAt}"></td>
<td th:text="*{createdBy}"></td>