add size and color in job card item

add-size-color-field-jobcarditems
usama.jameel 2025-06-18 11:46:10 +05:00
parent c2e04a0284
commit 5bcb2affa6
4 changed files with 36 additions and 6 deletions

View File

@ -22,7 +22,7 @@ public class JobCardItemDAO {
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
private final String SELECT_BY_CARD_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id", TABLE_NAME );
private final String SELECT_BY_CARD_ID_AND_ITEM_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id AND item_id = :item_id ", TABLE_NAME );
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_id, item_id, sku, expected_production, actual_production, total_production, account_id, length, width, gsm, wt_ply, ply, is_complete) VALUES (:id, :job_card_id, :item_id, :sku, :expected_production, :actual_production, :total_production, :account_id, :length, :width, :gsm, :wt_ply, :ply, :is_complete) ON DUPLICATE KEY UPDATE job_card_id = VALUES(job_card_id), item_id = VALUES(item_id), sku = VALUES(sku), expected_production = VALUES(expected_production), actual_production = VALUES(actual_production), total_production = VALUES(total_production), account_id = VALUES(account_id), length = VALUES(length), width = VALUES(width), gsm = VALUES(gsm), wt_ply = VALUES(wt_ply), ply = VALUES(ply), is_complete =VALUES(is_complete) ", TABLE_NAME );
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_id, item_id, sku, expected_production, actual_production, total_production, account_id, length, width, gsm, wt_ply, ply, is_complete, size, color) VALUES (:id, :job_card_id, :item_id, :sku, :expected_production, :actual_production, :total_production, :account_id, :length, :width, :gsm, :wt_ply, :ply, :is_complete, :size, :color) ON DUPLICATE KEY UPDATE job_card_id = VALUES(job_card_id), item_id = VALUES(item_id), sku = VALUES(sku), expected_production = VALUES(expected_production), actual_production = VALUES(actual_production), total_production = VALUES(total_production), account_id = VALUES(account_id), length = VALUES(length), width = VALUES(width), gsm = VALUES(gsm), wt_ply = VALUES(wt_ply), ply = VALUES(ply), is_complete = VALUES(is_complete), size =VALUES(size), color =VALUES(color) ", TABLE_NAME );
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
private final String SELECT_BY_JOB_CARD_AND_ACCOUNT_IDS = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND account_id IN (:account_ids) AND is_complete = FALSE ", TABLE_NAME );
private final String SELECT_ALL_ACTIVE_ITEM = String.format("SELECT CASE WHEN MIN(is_complete) = TRUE THEN TRUE ELSE FALSE END FROM %s WHERE job_card_id = :job_card_id AND id IN (:id)", TABLE_NAME);
@ -48,6 +48,8 @@ public class JobCardItemDAO {
.addValue("gsm", jobCardItem.getGsm() )
.addValue("wt_ply", jobCardItem.getWtPly() )
.addValue("ply", jobCardItem.getPly() )
.addValue("size", jobCardItem.getSize() )
.addValue("color", jobCardItem.getColor() )
.addValue("is_complete", jobCardItem.isComplete() );
return params;

View File

@ -22,6 +22,8 @@ public class JobCardItemRowMapper implements RowMapper<JobCardItem> {
jobCardItem.setGsm( rs.getString("gsm" ) );
jobCardItem.setWtPly( rs.getString("wt_ply" ) );
jobCardItem.setPly( rs.getString("ply" ) );
jobCardItem.setColor( rs.getString("color" ) );
jobCardItem.setSize( rs.getString("size" ) );
jobCardItem.setComplete( rs.getBoolean("is_complete" ) );
return jobCardItem;
}

View File

@ -19,6 +19,8 @@ public class JobCardItem {
private String gsm;
private String wtPly;
private String ply;
private String color;
private String size;
// wrapper
private List<CutPiece> cutPieces;
private String title;
@ -176,6 +178,22 @@ public class JobCardItem {
isComplete = complete;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;

View File

@ -123,28 +123,36 @@
<div class="col-sm-3 form-group">
<label>Sku</label>
<span class="form-control" readonly >{{item.sku}}</span>
</div>
<div class="col-sm-2 form-group">
<label>Size</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].size'" v-model="item.size" required>
</div>
<div class="col-sm-2 form-group">
<label>Color</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].color'" v-model="item.color" required>
</div>
<div class="col-sm-2 form-group">
<label>Expected Quantity</label>
<input type="number" class="form-control" v-bind:name="'items[' + index + '].expectedProduction'" v-model="item.expectedProduction" required>
</div>
<div class="col-sm-1 form-group">
<div class="col-sm-2 form-group">
<label>Length</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].length'" v-model="item.length" required>
</div>
<div class="col-sm-1 form-group">
<div class="col-sm-2 form-group">
<label>Width</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].width'" v-model="item.width" required>
</div>
<div class="col-sm-1 form-group">
<div class="col-sm-2 form-group">
<label>GSM</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].gsm'" v-model="item.gsm" required>
</div>
<div class="col-sm-1 form-group">
<div class="col-sm-2 form-group">
<label>WT./Ply</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].wtPly'" v-model="item.wtPly" required>
</div>
<div class="col-sm-1 form-group">
<div class="col-sm-2 form-group">
<label>Number of Ply</label>
<input type="text" class="form-control" v-bind:name="'items[' + index + '].ply'" v-model="item.ply" required>
</div>