Compare commits

..

No commits in common. "main" and "po-store-category-items" have entirely different histories.

51 changed files with 439 additions and 1277 deletions

View File

@ -3,9 +3,9 @@ package com.utopiaindustries.controller;
import com.utopiaindustries.auth.CuttingRole;
import com.utopiaindustries.dao.ctp.BundleWrapper;
import com.utopiaindustries.model.ctp.JobCardWrapper;
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
import com.utopiaindustries.service.*;
import com.utopiaindustries.util.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
@ -13,7 +13,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
@Controller
@CuttingRole
@ -131,8 +130,6 @@ public class CuttingController {
@GetMapping( "/master-bundles")
public String showMasterBundles( @RequestParam(value = "id" , required = false) String id,
@RequestParam(value = "jc-id", required = false ) String jobCardId,
@RequestParam(value = "sku", required = false ) String sku,
@RequestParam(value = "status", required = false ) String status,
@RequestParam(value = "start-date", required = false) String startDate,
@RequestParam(value = "end-date", required = false) String endDate,
@RequestParam(value = "count", required = false) Long count,
@ -141,7 +138,7 @@ public class CuttingController {
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, sku, status, jobCardId, startDate1.toString(), endDate1.toString(), count ) );
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, jobCardId, startDate1.toString(), endDate1.toString(), count ) );
return "/cutting/master-bundles";
}
@ -185,41 +182,4 @@ public class CuttingController {
return "redirect:/cutting/master-bundles";
}
}
@PostMapping( "/generate-qrCode" )
public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids,
@RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
if (ids == null){
redirectAttributes.addFlashAttribute( "error", "Select At least One CheckBox" );
return "redirect:/cutting/cutting-items"; }
try {
barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
redirectAttributes.addFlashAttribute( "success", "Barcode generated successfully" );
return "redirect:/cutting/cutting-items";
}catch (Exception e){
redirectAttributes.addFlashAttribute( "error", e );
return "redirect:/cutting/cutting-items"; }
}
/*
* get finished items
* */
@GetMapping( "/cutting-items" )
public String getStitchingOfflineItems( @RequestParam(value = "id", required = false ) String id,
@RequestParam(value = "item-id", required = false ) String itemId,
@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 = "count", required = false, defaultValue = "100") Long count,
@RequestParam( value = "status", required = false) String status,
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, status, startDate, endDate, bundleId, count );
model.addAttribute("items", itemList ) ;
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
return "/stitching/stitched-offline-items";
}
}

View File

@ -48,7 +48,6 @@ public class FinishingController {
@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 = "status", required = false) String status,
@RequestParam(value = "count", required = false) Long count,
Model model) {
@ -56,7 +55,7 @@ public class FinishingController {
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
List<FinishedItem> itemList = bundleService.getFinishedItem(id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId, status, count);
List<FinishedItem> itemList = bundleService.getFinishedItem(id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId, count);
model.addAttribute("items", itemList);
return "finishing/finished-item-list";

View File

@ -2,7 +2,10 @@ package com.utopiaindustries.controller;
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
import com.utopiaindustries.model.ctp.POsDetails;
import com.utopiaindustries.service.*;
import com.utopiaindustries.service.InventoryAccountService;
import com.utopiaindustries.service.PurchaseOrderService;
import com.utopiaindustries.service.ReportingService;
import com.utopiaindustries.service.SummaryInventoryReportService;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -17,13 +20,11 @@ public class POStatusController {
private final ReportingService reportingService;
private final PurchaseOrderService purchaseOrderService;
private final JobCardItemService jobCardItemService;
public POStatusController(ReportingService reportingService, PurchaseOrderService purchaseOrderService, JobCardItemService jobCardItemService) {
public POStatusController(ReportingService reportingService, PurchaseOrderService purchaseOrderService) {
this.reportingService = reportingService;
this.purchaseOrderService = purchaseOrderService;
this.jobCardItemService = jobCardItemService;
}
@GetMapping
@ -32,30 +33,12 @@ public class POStatusController {
}
@GetMapping( "/all-pos")
public String poReport(@RequestParam(value = "poName", required = false) String poName,
@RequestParam(value = "size", required = false) String size,
@RequestParam(value = "color", required = false) String color,
@RequestParam(value = "count", required = false, defaultValue = "100") Long count,
Model model){
public String poReport(@RequestParam(value = "poName", required = false) String poName, Model model){
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
model.addAttribute("allPOs", reportingService.getAllPOs(poName, size, color, count));
model.addAttribute("allPOs", reportingService.getAllPOs(poName));
return "/reporting/po-report";
}
@GetMapping( "/po-items")
public String poReport(@RequestParam("poId") long poId,
@RequestParam(value = "size", required = false) String size,
@RequestParam(value = "color", required = false) String color,
Model model){
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
model.addAttribute("poJobcardItems", reportingService.getPoItemsSizeOrColor(poId, size, color));
return "/reporting/po-jobcard-items-table";
}
@GetMapping( value = "/po-report-view/{poId}" )
public String showJobCardDetail(@PathVariable("poId") long poId, @RequestParam(value = "select-date", required = false) String selectDate ,
Model model ){
@ -63,15 +46,11 @@ public class POStatusController {
return "/reporting/po-job-card-report";
}
@GetMapping(value = "/generate-po-pdf", produces = MediaType.APPLICATION_PDF_VALUE)
public ResponseEntity<InputStreamResource> sendPoAndReturnPdf(@ModelAttribute POsDetails pOsDetails,
@RequestParam(required = false, defaultValue = "true") boolean includeItemsDetail,
@RequestParam(required = false, defaultValue = "true") boolean includeJobCard,
@RequestParam(required = false, defaultValue = "true") boolean includeStoreDetails,
@RequestParam String color,
@RequestParam String size,
Model model) throws Exception{
return purchaseOrderService.generatePOPdf(pOsDetails, model, includeItemsDetail, includeStoreDetails, size, color);
return purchaseOrderService.generatePOPdf(pOsDetails, model, includeJobCard, includeStoreDetails);
}
}

View File

@ -64,14 +64,13 @@ public class QualityControlController {
@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 = "status", required = false) String status,
@RequestParam(value = "count", required = false, defaultValue = "100") Long count,
Model model) {
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
List<FinishedItem> itemList = bundleService.getFinishedItem(id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId, status, count);
List<FinishedItem> itemList = bundleService.getFinishedItem(id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId, count);
model.addAttribute("items", itemList);
return "/quality-control/qc-items-list";
}

View File

@ -78,27 +78,27 @@ public class ReportingController {
}
@GetMapping( value = "/cutting-report" )
public String cuttingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, @RequestParam(value = "count", required = false) Long count, Model model ){
public String cuttingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("accounts", inventoryAccountService.getAllCuttingAccounts() );
model.addAttribute("cutting",reportingService.getCuttingTableDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString(), count));
model.addAttribute("cutting",reportingService.getCuttingTableDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString()));
return "/reporting/cutting-report";
}
@GetMapping( value = "/stitching-report" )
public String stitchingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, @RequestParam(value = "count", required = false) Long count, Model model ){
public String stitchingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("accounts" , inventoryAccountService.findInventoryAccounts( 2L ) );
model.addAttribute("stitching",reportingService.getStitchingDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString(), count));
model.addAttribute("stitching",reportingService.getStitchingDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString()));
return "/reporting/stitching-report";
}
@ -109,14 +109,13 @@ public class ReportingController {
@RequestParam( value = "sku", required = false) String sku,
@RequestParam( value = "startDate", required = false) String startDate,
@RequestParam( value = "endDate", required = false) String endDate,
@RequestParam(value = "count", required = false) Long count,
Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("transactions", reportingService.stitchingItemsTransactions( jobCardId, accountId, sku, startDate1.toString(), endDate1.toString(), count ));
model.addAttribute("transactions", reportingService.stitchingItemsTransactions( jobCardId, accountId, sku, startDate1.toString(), endDate1.toString() ));
return "/reporting/accounts-transaction-table";
}

View File

@ -116,7 +116,7 @@ public class StitchingController {
RedirectAttributes redirectAttributes,
Model model ){
try {
// inventoryService.createStitchingOfflineItemsFromJobCard( bundleWrapper );
inventoryService.createStitchingOfflineItemsFromJobCard( bundleWrapper );
redirectAttributes.addFlashAttribute("success", "Stitch Items Created Successfully");
} catch ( Exception exception ){
exception.printStackTrace();
@ -124,4 +124,21 @@ public class StitchingController {
}
return "redirect:/stitching/create-stitching-items";
}
@PostMapping( "/generate-barcodes" )
public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids,
@RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
if (ids == null){
redirectAttributes.addFlashAttribute( "error", "Select At least One CheckBox" );
return "redirect:/stitching/stitching-offline-items";
}
try {
barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
redirectAttributes.addFlashAttribute( "success", "Barcode generated successfully" );
return "redirect:/stitching/stitching-offline-items";
}catch (Exception e){
redirectAttributes.addFlashAttribute( "error", e );
return "redirect:/stitching/stitching-offline-items";
}
}
}

View File

@ -205,6 +205,10 @@ public class InventoryTransactionLegDAO {
params.addValue("start_date", startDate );
params.addValue("end_date", endDate );
params.addValue("type", type );
System.out.println("Start Date: " + startDate);
System.out.println("End Date: " + endDate);
System.out.println("Params: " + params.getValues());
return namedParameterJdbcTemplate.query( SELECT_JOB_CARD_DATES , params, new InventoryTransactionLegRowMapper() );
}

View File

@ -26,7 +26,6 @@ public class JobCardDAO {
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, code, job_order_id, created_at, created_by, status, inventory_status, customer, lot_number, purchase_order_id, location_site_id, description, poQuantity, articleName) VALUES (:id, :code, :job_order_id, :created_at, :created_by, :status, :inventory_status, :customer, :lot_number, :purchase_order_id, :location_site_id, :description, :poQuantity, :articleName) ON DUPLICATE KEY UPDATE code = VALUES(code), job_order_id = VALUES(job_order_id), created_at = VALUES(created_at), created_by = VALUES(created_by), status = VALUES(status), inventory_status = VALUES(inventory_status), customer = VALUES(customer), lot_number = VALUES(lot_number), purchase_order_id = VALUES(purchase_order_id), location_site_id = VALUES(location_site_id), description = VALUES(description), poQuantity = VALUES(poQuantity), articleName = VALUES(articleName) ", TABLE_NAME );
private final String SELECT_BY_LIKE_CODE_AND_INV_STATUS_AND_STATUS = String.format( "SELECT * FROM %s WHERE code like :code AND status = :status AND inventory_status = :inventory_status", TABLE_NAME );
private final String SELECT_BY_LIKE_CODE = String.format( "SELECT * FROM %s WHERE code like :code", TABLE_NAME );
private final String SELECT_BY_LIKE_CODE_AND_PO_ID = String.format( "SELECT * FROM %s WHERE code like :code AND purchase_order_id = :purchase_order_id", TABLE_NAME );
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
// prepare query params
@ -96,13 +95,6 @@ public class JobCardDAO {
return namedParameterJdbcTemplate.query(SELECT_BY_LIKE_CODE, params, new JobCardRowMapper());
}
public List<JobCard> findLikeCodeAndPoID( String code, long poID ) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("code", "%" + code + "%");
params.addValue("purchase_order_id", poID);
return namedParameterJdbcTemplate.query(SELECT_BY_LIKE_CODE_AND_PO_ID, params, new JobCardRowMapper());
}
public List<JobCard> findLikeCode( String code , String inventoryStatus, String status ){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue( "code", "%" + code + "%" );

View File

@ -9,7 +9,6 @@ import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Repository
@ -23,16 +22,11 @@ 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, 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 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 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);
private final String SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE = String.format(
"SELECT * FROM %s WHERE job_card_id IN (:job_card_id) ",
TABLE_NAME
);
private final String SELECT_ALL_SIZE_GROUP_BY = String.format( "SELECT size FROM %s GROUP BY size", TABLE_NAME );
private final String SELECT_ALL_COLOR_GROUP_BY = String.format( "SELECT color FROM %s GROUP BY color", TABLE_NAME );
private final String SELECT_BY_JOB_CARD_IDS = String.format( "SELECT * FROM %s WHERE job_card_id IN (:job_card_id)", TABLE_NAME );
public JobCardItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
@ -54,8 +48,6 @@ 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;
@ -139,29 +131,9 @@ public class JobCardItemDAO {
return Boolean.TRUE.equals(allComplete);
}
//find By jobCard ids, color and size
public List<JobCardItem> findByJobCardIdsAndSizeColor(List<Long> ids, String size, String color){
public List<JobCardItem> findByJobCardIds(List<Long> ids){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("job_card_id", ids);
StringBuilder sql = new StringBuilder(SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE);
if (color != null && !color.isEmpty() && !"null".equalsIgnoreCase(color)) {
sql.append(" AND color = :color");
params.addValue("color", color);
}
if (size != null && !size.isEmpty() && !"null".equalsIgnoreCase(size)) {
sql.append(" AND size = :size");
params.addValue("size", size);
}
return namedParameterJdbcTemplate.query( sql.toString(), params, new JobCardItemRowMapper() );
return namedParameterJdbcTemplate.query( SELECT_BY_JOB_CARD_IDS, params, new JobCardItemRowMapper() );
}
public List<String> getAllSize() {
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_SIZE_GROUP_BY, new HashMap<>(), String.class);
}
public List<String> getAllColor() {
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_COLOR_GROUP_BY, new HashMap<>(), String.class);
}
}

View File

@ -22,8 +22,6 @@ 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

@ -23,24 +23,22 @@ public class PurchaseOrderCTPDao {
private final String TABLE_NAME = "cut_to_pack.purchase_order";
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY created_at DESC LIMIT :limit ", TABLE_NAME );
private final String SELECT_BY_PO_CODE = String.format("SELECT * FROM %s WHERE purchase_order_code = :purchase_order_code ORDER BY created_at DESC LIMIT :limit", TABLE_NAME);
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ", TABLE_NAME );
private final String SELECT_BY_PO_CODE = String.format( "SELECT * FROM %s WHERE purchase_order_code = :purchase_order_code", TABLE_NAME );
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
private final String INSERT_QUERY = String.format(
"INSERT INTO %s (id, purchase_order_code, purchase_order_quantity, purchase_order_quantity_required, article_name, created_by, status, po_status) " +
"VALUES (:id, :purchase_order_code, :purchase_order_quantity, :purchase_order_quantity_required, :article_name, :created_by, :status, :po_status) " +
"INSERT INTO %s (id, purchase_order_code, purchase_order_quantity, purchase_order_quantity_required, article_name, created_by, status) " +
"VALUES (:id, :purchase_order_code, :purchase_order_quantity, :purchase_order_quantity_required, :article_name, :created_by, :status) " +
"ON DUPLICATE KEY UPDATE " +
"purchase_order_code = VALUES(purchase_order_code), " +
"purchase_order_quantity = VALUES(purchase_order_quantity), " +
"purchase_order_quantity_required = VALUES(purchase_order_quantity_required), " +
"article_name = VALUES(article_name), " +
"created_by = VALUES(created_by), " +
"status = VALUES(status)," +
"po_status = VALUES(po_status)",
"status = VALUES(status)",
TABLE_NAME);
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE purchase_order_code LIKE :term AND po_status = false limit 100 offset 0", TABLE_NAME );
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE purchase_order_code LIKE :term limit 100 offset 0", TABLE_NAME );
// prepare query params
@ -52,8 +50,7 @@ public class PurchaseOrderCTPDao {
.addValue("purchase_order_quantity_required", purchaseOrderCTP.getPurchaseOrderQuantityRequired())
.addValue("article_name", purchaseOrderCTP.getArticleName())
.addValue("created_by", purchaseOrderCTP.getCreatedBy())
.addValue("status", purchaseOrderCTP.getStatus())
.addValue("po_status", purchaseOrderCTP.getPoStatus());
.addValue("status", purchaseOrderCTP.getStatus());
return params;
}
@ -70,10 +67,8 @@ public class PurchaseOrderCTPDao {
// find all
public List<PurchaseOrderCTP> findAll(Long limit) {
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("limit", limit);
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, params, new PurchaseOrderCTPRowMapper() );
public List<PurchaseOrderCTP> findAll() {
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new PurchaseOrderCTPRowMapper() );
}
// save
@ -101,16 +96,10 @@ public class PurchaseOrderCTPDao {
return namedParameterJdbcTemplate.update( DELETE_QUERY, params ) > 0;
}
/*
* find by query
* */
public List<PurchaseOrderCTP> findByQuery(String query ){
return namedParameterJdbcTemplate.query( query, new PurchaseOrderCTPRowMapper() );
}
/*
* find by created by
* */
public List<PurchaseOrderCTP> findByUserAndLimit(String createdBy, Long limit ){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("limit", limit.intValue() );
@ -118,13 +107,9 @@ public class PurchaseOrderCTPDao {
return namedParameterJdbcTemplate.query( SELECT_BY_LIMIT, params, new PurchaseOrderCTPRowMapper() );
}
/*
* find by po code
* */
public List<PurchaseOrderCTP> findByPoCode(String poCode, Long limit ){
public List<PurchaseOrderCTP> findByPoCode(String poCode){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("purchase_order_code", poCode);
params.addValue("limit", limit);
return namedParameterJdbcTemplate.query( SELECT_BY_PO_CODE, params, new PurchaseOrderCTPRowMapper() );
}

View File

@ -19,7 +19,6 @@ public class PurchaseOrderCTPRowMapper implements RowMapper<PurchaseOrderCTP> {
}
PurchaseOrderCTP.setCreatedBy(rs.getString("created_by"));
PurchaseOrderCTP.setStatus(rs.getString("status"));
PurchaseOrderCTP.setPoStatus(rs.getBoolean("po_status"));
return PurchaseOrderCTP;
}
}

View File

@ -22,19 +22,19 @@ public class StitchingOfflineItemDAO {
private final String TABLE_NAME = "cut_to_pack.stitching_offline_item";
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND inline_received = TRUE", TABLE_NAME );
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, qa_remarks, qa_status,bundle_id, qc_done_at, inline_received) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status, :bundle_id, :qc_done_at, :inline_received) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), qa_remarks = VALUES(qa_remarks), qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), qc_done_at = VALUES(qc_done_at), inline_received = VALUES(inline_received)", TABLE_NAME );
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, qa_remarks, qa_status,bundle_id, qc_done_at) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status, :bundle_id, :qc_done_at) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), qa_remarks = VALUES(qa_remarks), qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), qc_done_at = VALUES(qc_done_at)", TABLE_NAME );
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id AND inline_received = TRUE", TABLE_NAME );
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME );
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term AND inline_received = TRUE ORDER BY ID DESC", TABLE_NAME );
private final String SELECT_BY_BUNDLE_ID = String.format( "SELECT * FROM %s WHERE bundle_id = :bundle_id", TABLE_NAME );
private final String COUNT_TOTAL_QA_ITEMS= String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND inline_received = TRUE AND is_qa IS TRUE",TABLE_NAME);
private final String SELECT_BY_TIME_AND_CARD_ID= String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND inline_received = TRUE ORDER BY created_at DESC LIMIT 1;",TABLE_NAME);
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND inline_received = TRUE AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME );
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND inline_received = TRUE AND qc_done_at <= :end_date AND qa_status = :qa_status AND id IN (:ids)", TABLE_NAME );
private final String SELECT_BY_DATE_QA_STATUS_APPROVED= String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND inline_received = TRUE AND qc_done_at <= :end_date AND qa_status = :qa_status", TABLE_NAME );
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term ORDER BY ID DESC", TABLE_NAME );
private final String SELECT_BY_MASTER_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
private final String COUNT_TOTAL_QA_ITEMS= String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_qa IS TRUE",TABLE_NAME);
private final String SELECT_BY_TIME_AND_CARD_ID= String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id ORDER BY created_at DESC LIMIT 1;",TABLE_NAME);
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME );
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND qc_done_at <= :end_date AND qa_status = :qa_status AND id IN (:ids)", TABLE_NAME );
private final String SELECT_BY_DATE_QA_STATUS_APPROVED= String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND qc_done_at <= :end_date AND qa_status = :qa_status", TABLE_NAME );
public StitchingOfflineItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
@ -54,8 +54,7 @@ public class StitchingOfflineItemDAO {
.addValue("is_qa", stitchingOfflineItem.getIsQa() )
.addValue("qa_remarks", stitchingOfflineItem.getQaRemarks() )
.addValue("qc_done_at", stitchingOfflineItem.getQcDoneAt() )
.addValue("qa_status", stitchingOfflineItem.getQaStatus() )
.addValue("inline_received", stitchingOfflineItem.isInlineReceived() );
.addValue("qa_status", stitchingOfflineItem.getQaStatus() );
return params;
}
@ -129,10 +128,10 @@ public class StitchingOfflineItemDAO {
return namedParameterJdbcTemplate.query( SELECT_BY_TERM , params, new StitchingOfflineItemRowMapper() );
}
public List<StitchingOfflineItem> findByBundleId( long bundleId ){
public List<StitchingOfflineItem> findByMasterId( long masterId ){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("bundle_id", bundleId );
return namedParameterJdbcTemplate.query( SELECT_BY_BUNDLE_ID , params, new StitchingOfflineItemRowMapper() );
params.addValue("job_card_id", masterId );
return namedParameterJdbcTemplate.query( SELECT_BY_MASTER_ID , params, new StitchingOfflineItemRowMapper() );
}
public HashMap<Long, Long> findTotalStitchingOfflineItems(List<Long> itemIds, long jobCardId) {

View File

@ -25,7 +25,6 @@ public class StitchingOfflineItemRowMapper implements RowMapper<StitchingOffline
stitchingOfflineItem.setCreatedBy( rs.getString( "created_by" ) );
stitchingOfflineItem.setJobCardId( rs.getLong("job_card_id") );
stitchingOfflineItem.setIsQa( rs.getBoolean("is_qa"));
stitchingOfflineItem.setInlineReceived( rs.getBoolean("inline_received"));
stitchingOfflineItem.setQaStatus( rs.getString("qa_status" ) );
stitchingOfflineItem.setQaRemarks( rs.getString("qa_remarks") );
return stitchingOfflineItem;

View File

@ -19,8 +19,6 @@ 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;
@ -178,22 +176,6 @@ 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

@ -9,24 +9,17 @@ public class POsDetails {
private long poRequiredQuantity;
// items detail
private long actualCutting;
private long balanceToCutting;
private long cuttingReceived;
private long cuttingOki;
private long cuttingReject;
private long stitchingIn;
private long stitchingWips;
private long stitchingOut;
private long finishIn;
private long finishRej;
private long finishQaApproved;
private long storeReceived;
private long storeWaiting;
private long packagingIn;
private long packagingOut;
private long packagingStock;
private long shippedScan;
private long shippedNet;
private long totalCutting;
private long remainingCutting;
private long totalStitching;
private long remainingStitching;
private long totalEndLineQC;
private long remainingEndLineQC;
private long totalFinishing;
private long remainingFinishing;
private long totalAGradeItem;
private long totalBGradeItem;
private long totalCGradeItem;
private boolean poStatus;
public long getPoQuantity() {
@ -53,6 +46,94 @@ public class POsDetails {
this.articleTitle = articleTitle;
}
public long getTotalCutting() {
return totalCutting;
}
public void setTotalCutting(long totalCutting) {
this.totalCutting = totalCutting;
}
public long getRemainingCutting() {
return remainingCutting;
}
public void setRemainingCutting(long remainingCutting) {
this.remainingCutting = remainingCutting;
}
public long getTotalStitching() {
return totalStitching;
}
public void setTotalStitching(long totalStitching) {
this.totalStitching = totalStitching;
}
public long getRemainingStitching() {
return remainingStitching;
}
public void setRemainingStitching(long remainingStitching) {
this.remainingStitching = remainingStitching;
}
public long getTotalEndLineQC() {
return totalEndLineQC;
}
public void setTotalEndLineQC(long totalEndLineQC) {
this.totalEndLineQC = totalEndLineQC;
}
public long getRemainingEndLineQC() {
return remainingEndLineQC;
}
public void setRemainingEndLineQC(long remainingEndLineQC) {
this.remainingEndLineQC = remainingEndLineQC;
}
public long getTotalFinishing() {
return totalFinishing;
}
public void setTotalFinishing(long totalFinishing) {
this.totalFinishing = totalFinishing;
}
public long getRemainingFinishing() {
return remainingFinishing;
}
public void setRemainingFinishing(long remainingFinishing) {
this.remainingFinishing = remainingFinishing;
}
public long getTotalAGradeItem() {
return totalAGradeItem;
}
public void setTotalAGradeItem(long totalAGradeItem) {
this.totalAGradeItem = totalAGradeItem;
}
public long getTotalBGradeItem() {
return totalBGradeItem;
}
public void setTotalBGradeItem(long totalBGradeItem) {
this.totalBGradeItem = totalBGradeItem;
}
public long getTotalCGradeItem() {
return totalCGradeItem;
}
public void setTotalCGradeItem(long totalCGradeItem) {
this.totalCGradeItem = totalCGradeItem;
}
public long getPoId() {
return poId;
}
@ -69,150 +150,6 @@ public class POsDetails {
this.poRequiredQuantity = poRequiredQuantity;
}
public long getActualCutting() {
return actualCutting;
}
public void setActualCutting(long actualCutting) {
this.actualCutting = actualCutting;
}
public long getBalanceToCutting() {
return balanceToCutting;
}
public void setBalanceToCutting(long balanceToCutting) {
this.balanceToCutting = balanceToCutting;
}
public long getCuttingReceived() {
return cuttingReceived;
}
public void setCuttingReceived(long cuttingReceived) {
this.cuttingReceived = cuttingReceived;
}
public long getCuttingOki() {
return cuttingOki;
}
public void setCuttingOki(long cuttingOki) {
this.cuttingOki = cuttingOki;
}
public long getCuttingReject() {
return cuttingReject;
}
public void setCuttingReject(long cuttingReject) {
this.cuttingReject = cuttingReject;
}
public long getStitchingIn() {
return stitchingIn;
}
public void setStitchingIn(long stitchingIn) {
this.stitchingIn = stitchingIn;
}
public long getStitchingWips() {
return stitchingWips;
}
public void setStitchingWips(long stitchingWips) {
this.stitchingWips = stitchingWips;
}
public long getStitchingOut() {
return stitchingOut;
}
public void setStitchingOut(long stitchingOut) {
this.stitchingOut = stitchingOut;
}
public long getFinishIn() {
return finishIn;
}
public void setFinishIn(long finishIn) {
this.finishIn = finishIn;
}
public long getFinishRej() {
return finishRej;
}
public void setFinishRej(long finishRej) {
this.finishRej = finishRej;
}
public long getFinishQaApproved() {
return finishQaApproved;
}
public void setFinishQaApproved(long finishQaApproved) {
this.finishQaApproved = finishQaApproved;
}
public long getStoreReceived() {
return storeReceived;
}
public void setStoreReceived(long storeReceived) {
this.storeReceived = storeReceived;
}
public long getStoreWaiting() {
return storeWaiting;
}
public void setStoreWaiting(long storeWaiting) {
this.storeWaiting = storeWaiting;
}
public long getPackagingIn() {
return packagingIn;
}
public void setPackagingIn(long packagingIn) {
this.packagingIn = packagingIn;
}
public long getPackagingOut() {
return packagingOut;
}
public void setPackagingOut(long packagingOut) {
this.packagingOut = packagingOut;
}
public long getPackagingStock() {
return packagingStock;
}
public void setPackagingStock(long packagingStock) {
this.packagingStock = packagingStock;
}
public long getShippedScan() {
return shippedScan;
}
public void setShippedScan(long shippedScan) {
this.shippedScan = shippedScan;
}
public long getShippedNet() {
return shippedNet;
}
public void setShippedNet(long shippedNet) {
this.shippedNet = shippedNet;
}
public boolean isPoStatus() {
return poStatus;
}
@ -224,29 +161,17 @@ public class POsDetails {
@Override
public String toString() {
return "POsDetails{" +
"poId=" + poId +
", poNumber='" + poNumber + '\'' +
", articleTitle='" + articleTitle + '\'' +
", poQuantity=" + poQuantity +
", poRequiredQuantity=" + poRequiredQuantity +
", actualCutting=" + actualCutting +
", balanceToCutting=" + balanceToCutting +
", cuttingReceived=" + cuttingReceived +
", cuttingOki=" + cuttingOki +
", cuttingReject=" + cuttingReject +
", stitchingIn=" + stitchingIn +
", stitchingWips=" + stitchingWips +
", stitchingOut=" + stitchingOut +
", finishIn=" + finishIn +
", finishRej=" + finishRej +
", finishQaApproved=" + finishQaApproved +
", storeReceived=" + storeReceived +
", storeWaiting=" + storeWaiting +
", packagingIn=" + packagingIn +
", packagingOut=" + packagingOut +
", packagingStock=" + packagingStock +
", shippedScan=" + shippedScan +
", shippedNet=" + shippedNet +
"totalCutting=" + totalCutting +
", remainingCutting=" + remainingCutting +
", totalStitching=" + totalStitching +
", remainingStitching=" + remainingStitching +
", totalEndLineQC=" + totalEndLineQC +
", remainingEndLineQC=" + remainingEndLineQC +
", totalFinishing=" + totalFinishing +
", remainingFinishing=" + remainingFinishing +
", totalAGradeItem=" + totalAGradeItem +
", totalBGradeItem=" + totalBGradeItem +
", totalCGradeItem=" + totalCGradeItem +
'}';
}
}

View File

@ -1,58 +0,0 @@
package com.utopiaindustries.model.ctp;
public class PoItemsWrapper {
private int totalCutting;
private int totalStitching;
private int totalProduction;
private String size;
private String color;
private String sku;
public int getTotalCutting() {
return totalCutting;
}
public void setTotalCutting(int totalCutting) {
this.totalCutting = totalCutting;
}
public int getTotalStitching() {
return totalStitching;
}
public void setTotalStitching(int totalStitching) {
this.totalStitching = totalStitching;
}
public int getTotalProduction() {
return totalProduction;
}
public void setTotalProduction(int totalProduction) {
this.totalProduction = totalProduction;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
}

View File

@ -14,7 +14,6 @@ public class PurchaseOrderCTP {
private long purchaseOrderQuantity;
private long purchaseOrderQuantityRequired;
private String articleName;
private boolean poStatus;
private String createdBy;
private LocalDateTime createdAt;
private String status;
@ -82,12 +81,4 @@ public class PurchaseOrderCTP {
public void setStatus(String status) {
this.status = status;
}
public boolean getPoStatus() {
return poStatus;
}
public void setPoStatus(boolean poStatus) {
this.poStatus = poStatus;
}
}

View File

@ -23,8 +23,6 @@ public class StitchingOfflineItem implements InventoryArtifact {
private String qaRemarks;
private String qaStatus;
private long bundleId;
private boolean inlineReceived;
@Override
public String getType() {
@ -139,14 +137,6 @@ public class StitchingOfflineItem implements InventoryArtifact {
this.qcDoneAt = qcDoneAt;
}
public boolean isInlineReceived() {
return inlineReceived;
}
public void setInlineReceived(boolean inlineReceived) {
this.inlineReceived = inlineReceived;
}
@Override
public String toString() {
return "StitchingOfflineItem{" +

View File

@ -3,8 +3,6 @@ package com.utopiaindustries.querybuilder;
import com.utopiaindustries.util.MySQLUtils;
import com.utopiaindustries.util.StringUtils;
import java.util.List;
public class QueryBuilder {
private StringBuilder query;
private String table;

View File

@ -9,7 +9,7 @@ import java.time.LocalDate;
public class FinishedItemQueryBuilder {
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, String status, Long count) {
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count) {
// format date
String formattedDate;
String formattedEndDate;
@ -38,8 +38,6 @@ public class FinishedItemQueryBuilder {
.and()
.columnEquals("job_card_id", jobCardId )
.and()
.columnEquals("qa_status", status )
.and()
.columnEqualToOrGreaterThan("created_at", startDate1)
.and()
.columnEqualToOrLessThan("created_at", endDate1 )

View File

@ -9,7 +9,7 @@ import java.time.LocalDate;
public class MasterBundleQueryBuilder {
public static String buildQuery( String id, String sku, String status, String jobCardId, String startDate, String endDate, Long count ){
public static String buildQuery( String id, String jobCardId, String startDate, String endDate, Long count ){
// format date
String formattedDate;
String formattedEndDate;
@ -26,7 +26,8 @@ public class MasterBundleQueryBuilder {
endDate1 = String.format("'%s 23:59:59'", LocalDate.now() );
}
}
QueryBuilder queryBuilder = new QueryBuilder()
return ( new QueryBuilder() )
.setTable( "cut_to_pack.master_bundle" )
.setColumns( "*" )
.where()
@ -34,24 +35,10 @@ public class MasterBundleQueryBuilder {
.and()
.columnEquals( "job_card_id", jobCardId )
.and()
.columnEquals( "sku", sku )
.and()
.columnEqualToOrGreaterThan("created_at" , startDate1 )
.and()
.columnEqualToOrLessThan( "created_at", endDate1 );
if (! StringUtils.isNullOrEmpty( status ) ) {
if (status.equalsIgnoreCase("1")) {
queryBuilder.and()
.columnGreaterThan("is_received", "0");
} else {
queryBuilder.and()
.columnEquals("is_received", "0");
}
}
queryBuilder.limit( count.intValue() );
return queryBuilder.build();
.columnEqualToOrLessThan( "created_at", endDate1 )
.limit( count.intValue() )
.build();
}
}

View File

@ -75,7 +75,7 @@ public class SummaryInventoryReportQueryBuilder {
String startDate,
String endDate,
String type,
String parentDocumentType, Long count) {
String parentDocumentType) {
QueryBuilder qb = new QueryBuilder()
.setTable(TABLE_NAME)
@ -98,7 +98,6 @@ public class SummaryInventoryReportQueryBuilder {
qb.and()
.columnEquals("sku", sku );
}
qb.orderBy("transaction_leg_datetime", "DESC").limit(count);
return qb.build();
}
}

View File

@ -23,13 +23,6 @@ public class JobCardRestController {
return jobCardService.searchJobCards( term , filter );
}
//search job card for avs integration
@GetMapping( "/search-avs-jobcard" )
public List<JobCard> searchJobCardByTermAndPOId( @RequestParam(value = "term", required = false) String term,
@RequestParam(value = "poId") long poID){
return jobCardService.searchJobCardsByTermAndPoId( term , poID );
}
@GetMapping ( "/{id}/items" )
public List<JobCardItem> getJobCardItems( @PathVariable( "id" ) long jobCardId ){
return jobCardService.getJobCardItems( jobCardId );

View File

@ -29,17 +29,13 @@ public class BundleService {
private final CryptographyService cryptographyService;
private final FinishedItemDAO finishedItemDAO;
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
private final InventoryService inventoryService;
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
public BundleService(BundleDAO bundleDAO, MasterBundleDAO masterBundleDAO, CryptographyService cryptographyService, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryService inventoryService, InventoryTransactionLegDAO inventoryTransactionLegDAO) {
public BundleService(BundleDAO bundleDAO, MasterBundleDAO masterBundleDAO, CryptographyService cryptographyService, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO) {
this.bundleDAO = bundleDAO;
this.masterBundleDAO = masterBundleDAO;
this.cryptographyService = cryptographyService;
this.finishedItemDAO = finishedItemDAO;
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
this.inventoryService = inventoryService;
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
}
/*
@ -92,13 +88,13 @@ public class BundleService {
/*
* find master bundles by params
* */
public List<MasterBundle> getMasterBundles( String id, String sku, String status, String jobCardId, String startDate, String endDate, Long count ){
List<MasterBundle> bundles;
public List<MasterBundle> getMasterBundles( String id, String jobCardId, String startDate, String endDate, Long count ){
List<MasterBundle> bundles = new ArrayList<>();
if( count == null ){
count = 100L;
}
if( StringUtils.isAnyNotNullOrEmpty(id, jobCardId, startDate, endDate, sku, status) ){
String query = MasterBundleQueryBuilder.buildQuery( id, sku, status, jobCardId, startDate, endDate , count );
if( StringUtils.isAnyNotNullOrEmpty(id, jobCardId, startDate, endDate ) ){
String query = MasterBundleQueryBuilder.buildQuery( id, jobCardId, startDate, endDate , count );
System.out.println( query );
bundles = masterBundleDAO.findByQuery( query );
} else {
@ -110,13 +106,13 @@ public class BundleService {
/*
* find finished Items by params
* */
public List<FinishedItem> getFinishedItem(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, String status ,Long count ){
public List<FinishedItem> getFinishedItem(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count ){
List<FinishedItem> finishedItems = new ArrayList<>();
if( count == null ){
count = 100L;
}
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId, status ) ){
String query = FinishedItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId, status, count );
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId ) ){
String query = FinishedItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId , count );
System.out.println( query );
finishedItems = finishedItemDAO.findByQuery( query );
} else {
@ -173,7 +169,6 @@ public class BundleService {
List<Bundle> newBundles = new ArrayList<>();
for( Bundle bundle : wrapper.getBundles() ){
bundle.setMasterBundleId( id );
bundle.setCurrentProduction(bundle.getWrapQuantity());
newBundles.add( bundle );
// sku and item in master bundle
if( StringUtils.isNullOrEmpty( sku ) ){
@ -193,8 +188,6 @@ public class BundleService {
masterBundleDAO.save( masterBundle );
//save child bundles
bundleDAO.saveAll( newBundles );
inventoryService.createStitchingOfflineItemsFromBundle(newBundles);
return id;
}
return 0;

View File

@ -77,11 +77,11 @@ public class DashboardService {
Long approvedStitchingOfflineItemsThenReject = 0L;
long qcReject = 0L;
if (stitchingItemIds != null && !stitchingItemIds.isEmpty()) {
approvedStitchingOfflineItems = stitchingOfflineItemDAO.findByQCOperationDateAndApproved(startDate1, endDate1, "APPROVED");
qcReject = stitchingOfflineItemDAO.findByQCOperationDateAndIds(startDate1, endDate1, "REJECT", stitchingItemIds);
remaininfQcAlterPieces = stitchingOfflineItemDAO.findByQCOperationDateAndIds(null, forPreviousDate, "REJECT", stitchingItemIds);
}
if(stitchingOutIds != null && !stitchingOutIds.isEmpty()) {
approvedStitchingOfflineItems = stitchingOfflineItemDAO.findByQCOperationDateAndIds(startDate1, endDate1, "APPROVED", stitchingOutIds);
approvedStitchingOfflineItemsThenReject = stitchingOfflineItemDAO.findByQCOperationDateAndIds(startDate1, endDate1, "REJECT", stitchingOutIds);
}
//set finishing related details

View File

@ -285,11 +285,6 @@ public class InventoryService {
masterBundle.setIsReceived(true);
masterBundle.setAccountId(toAccount);
masterBundleDAO.save(masterBundle);
//create transaction of offline items And items already create when master bundle create
BundleWrapper bundleWrapper = new BundleWrapper();
bundleWrapper.setBundles(bundles);
createStitchingOfflineItemsTransactionWhenReceivedMasterBundle(bundleWrapper);
}
}
@ -334,63 +329,59 @@ public class InventoryService {
}
/*
* create stitch items from master bundles
* create finished items from master bundles
* */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
public void createStitchingOfflineItemsFromBundle(List<Bundle> bundles) {
for (Bundle subBundle : bundles) {
public void createStitchingOfflineItemsFromJobCard(BundleWrapper wrapper) {
List<JobCardItem> updatedItems = new ArrayList<>();
List<Bundle> updateBundles = new ArrayList<>();
JobCard jobCard = null;
//switching table transaction in Transaction Table
InventoryTransaction transaction = createInventoryTransaction("Against Movement from Stitching to Stitched Offline Item");
inventoryTransactionDAO.save(transaction);
//TransactionLeg Transaction
List<Long> bundleIds = wrapper.getBundles().stream().map(Bundle::getId).collect(Collectors.toList());
Map<Long, InventoryTransactionLeg> lastBundleIdInTransactionMap = inventoryTransactionLegDAO
.findLastTransactionByParentIdAndParentType(InventoryTransactionLeg.Type.IN.name(), bundleIds, InventoryArtifactType.STITCH_BUNDLE.name())
.stream()
.collect(Collectors.toMap(InventoryTransactionLeg::getParentDocumentId, Function.identity()));
for (Bundle subBundle : wrapper.getBundles()) {
long accountId = masterBundleDAO.find(subBundle.getMasterBundleId()).getAccountId();
if (subBundle.getCurrentProduction() != null && subBundle.getCurrentProduction().compareTo(BigDecimal.ZERO) != 0) {
Bundle bundle = bundleDAO.find(subBundle.getId());
jobCard = jobCardDAO.find(subBundle.getJobCardId());
long production = (bundle.getProduction() == null) ? 0 : bundle.getProduction().longValue();
long wrapQuantity = bundle.getWrapQuantity().longValue();
JobCardItem jobCardItem = jobCardItemDAO.findByCardIdAndItemId(subBundle.getJobCardId(), subBundle.getItemId());
BigDecimal previousTotalProduction = jobCardItem.getTotalProduction() == null ? BigDecimal.ZERO : jobCardItem.getTotalProduction();
InventoryTransactionLeg lastInvTransaction = lastBundleIdInTransactionMap.getOrDefault(subBundle.getId(), null);
if (lastInvTransaction != null) {
if (wrapQuantity == production + subBundle.getCurrentProduction().longValue()) {
// OUT
long fromAccount = lastInvTransaction.getAccountId();
createInventoryTransactionLeg(transaction, subBundle, accountId, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.STITCH_BUNDLE.name());
}
}
// create stitchingOfflineItems items
createStitchingOfflineItems(subBundle.getCurrentProduction(), jobCardItem, subBundle.getId());
List<StitchingOfflineItem> stitchingOfflineItems = createStitchingOfflineItems(subBundle.getCurrentProduction(), jobCardItem, subBundle.getId());
// create IN Transactions of Finished Items into account
createTransactions(stitchingOfflineItems, accountId, InventoryArtifactType.STITCHING_OFFLINE.name());
// update bundle production
BigDecimal pro = BigDecimal.valueOf(subBundle.getCurrentProduction().longValue());
jobCardItem.setTotalProduction(previousTotalProduction.add(subBundle.getCurrentProduction()));
jobCardItem.setJobCardId(jobCard.getId());
updatedItems.add(jobCardItem);
BigDecimal pro = BigDecimal.valueOf(production + subBundle.getCurrentProduction().longValue());
bundle.setProduction(pro);
bundleDAO.save(bundle);
}
}
}
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
public void createStitchingOfflineItemsTransactionWhenReceivedMasterBundle(BundleWrapper wrapper) {
List<JobCardItem> updatedItems = new ArrayList<>();
//switching table transaction in Transaction Table
InventoryTransaction transaction = createInventoryTransaction("Against Movement from Stitching to Stitched Offline Item");
inventoryTransactionDAO.save(transaction);
//TransactionLeg Transaction
List<Long> bundleIds = wrapper.getBundles().stream().map(Bundle::getId).collect(Collectors.toList());
for (Bundle subBundle : wrapper.getBundles()) {
long accountId = masterBundleDAO.find(subBundle.getMasterBundleId()).getAccountId();
// OUT
createInventoryTransactionLeg(transaction, subBundle, accountId, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.STITCH_BUNDLE.name());
// find stitchingOfflineItems items
List<StitchingOfflineItem> stitchingOfflineItems = stitchingOfflineItemDAO.findByBundleId(subBundle.getId());
// create IN Transactions of Finished Items into account
createTransactions(stitchingOfflineItems, accountId, InventoryArtifactType.STITCHING_OFFLINE.name());
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
List<StitchingOfflineItem> updatedStitchItems = stitchingOfflineItems.stream().map(e-> {
e.setInlineReceived(true);
e.setCreatedBy(authentication.getName());
return e;
}).collect(Collectors.toList());
stitchingOfflineItemDAO.saveAll(updatedStitchItems);
JobCardItem jobCardItem = jobCardItemDAO.findByCardIdAndItemId(subBundle.getJobCardId(), subBundle.getItemId());
BigDecimal previousTotalProduction = jobCardItem.getTotalProduction() == null ? BigDecimal.ZERO : jobCardItem.getTotalProduction();
//update job card item and then add in list
jobCardItem.setTotalProduction(previousTotalProduction.add(subBundle.getWrapQuantity()));
updatedItems.add(jobCardItem);
}
jobCardItemDAO.saveAll(updatedItems);
}
/*
* create finished items
* */
@ -555,7 +546,6 @@ public class InventoryService {
}
stitchingOfflineItem.setIsQa(false);
}
stitchingOfflineItem.setInlineReceived(true);
stitchingOfflineItem.setQaStatus(qaStatus);
stitchingOfflineItem.setQcDoneAt(LocalDateTime.now());
updatedStitchedItems.add(stitchingOfflineItem);

View File

@ -1,23 +0,0 @@
package com.utopiaindustries.service;
import com.utopiaindustries.dao.ctp.JobCardItemDAO;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class JobCardItemService {
private final JobCardItemDAO jobCardItemDAO;
public JobCardItemService(JobCardItemDAO jobCardItemDAO) {
this.jobCardItemDAO = jobCardItemDAO;
}
public List<String> getAllSizesOFItems() {
return jobCardItemDAO.getAllSize();
}
public List<String> getAllColorOFItems() {
return jobCardItemDAO.getAllColor();
}
}

View File

@ -78,13 +78,6 @@ public class JobCardService {
return cards;
}
/*
* search by code and po id
* */
public List<JobCard> searchJobCardsByTermAndPoId( String term, long id ){
return jobCardDAO.findLikeCodeAndPoID( term, id );
}
/*
* get cards

View File

@ -17,6 +17,6 @@ public class PackagingService {
public void createPackagingItem(FinishedItemWrapper wrapper){
inventoryService.createPackagingItemAndTransaction(wrapper, wrapper.getAccountId());
}
}
}

View File

@ -13,7 +13,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -24,15 +23,13 @@ public class PurchaseOrderService {
private final PurchaseOrderDAO purchaseOrderDAO;
private final PurchaseOrderCTPService purchaseOrderCTPService;
private final HTMLBuilder htmlBuilder;
private final PDFResponseEntityInputStreamResource pdfGenerator;
private final ReportingService reportingService;
private PDFResponseEntityInputStreamResource pdfGenerator;
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO, PurchaseOrderCTPService purchaseOrderCTPService, HTMLBuilder htmlBuilder, PDFResponseEntityInputStreamResource pdfGenerator, ReportingService reportingService) {
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO, PurchaseOrderCTPService purchaseOrderCTPService, HTMLBuilder htmlBuilder, PDFResponseEntityInputStreamResource pdfGenerator) {
this.purchaseOrderDAO = purchaseOrderDAO;
this.purchaseOrderCTPService = purchaseOrderCTPService;
this.htmlBuilder = htmlBuilder;
this.pdfGenerator = pdfGenerator;
this.reportingService = reportingService;
}
public List<PurchaseOrder> findByTerm( String term ){
@ -40,29 +37,20 @@ public class PurchaseOrderService {
}
/**
* Print po pdf *
* Print Job card *
* **/
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean includeItemsDetail, boolean storeDetail, String size, String color ) throws Exception {
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean jobCardDetail, boolean storeDetail ) throws Exception {
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
model.addAttribute("poDetail", pOsDetails);
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
model.addAttribute("date", LocalDateTime.now());
if (includeItemsDetail){
model.addAttribute("showItems", true);
model.addAttribute("poItems", reportingService.getPoItemsSizeOrColor(pOsDetails.getPoId(), size, color));
}else {
model.addAttribute("showItems", false);
}
if (storeDetail && !storeItems.isEmpty()){
model.addAttribute("showStore", true);
model.addAttribute("store", storeItems);
}else {
model.addAttribute("showStore", false);
}
String htmlStr = htmlBuilder.buildHTML( "po-status-pdf", model );
// return pdf
return pdfGenerator.generatePdf( htmlStr, "Po-status", "inline" );
}

View File

@ -30,9 +30,8 @@ public class ReportingService {
private final InventoryAccountDAO inventoryAccountDAO;
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
private final StoreItemDao storeItemDao;
private final PackagingItemsDAO packagingItemsDAO;
public ReportingService(JobCardItemDAO jobCardItemDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PurchaseOrderCTPDao purchaseOrderCTPDao, StoreItemDao storeItemDao, PackagingItemsDAO packagingItemsDAO) {
public ReportingService(JobCardItemDAO jobCardItemDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PurchaseOrderCTPDao purchaseOrderCTPDao, StoreItemDao storeItemDao) {
this.jobCardItemDAO = jobCardItemDAO;
this.bundleDAO = bundleDAO;
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
@ -42,7 +41,6 @@ public class ReportingService {
this.inventoryAccountDAO = inventoryAccountDAO;
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
this.storeItemDao = storeItemDao;
this.packagingItemsDAO = packagingItemsDAO;
}
public Map<String, Integer> getJobCardProgress(String jobCardID) {
@ -437,105 +435,69 @@ public class ReportingService {
return barChartData;
}
/*
* find all po for po-online-status
* */
public List<POsDetails> getAllPOs(String poCode, String size, String color, Long count) {
public List<POsDetails> getAllPOs(String poCode) {
List<POsDetails> pOsDetailsList = new ArrayList<>();
List<PurchaseOrderCTP> purchaseOrderCTPList;
if (poCode != null && !poCode.isEmpty()) {
purchaseOrderCTPList = purchaseOrderCTPDao.findByPoCode(poCode, count);
purchaseOrderCTPList = purchaseOrderCTPDao.findByPoCode(poCode);
}else {
purchaseOrderCTPList = purchaseOrderCTPDao.findAll(count);
purchaseOrderCTPList = purchaseOrderCTPDao.findAll();
}
Map<String,Integer> jobCardCompleteItems = new HashMap<>();
for (PurchaseOrderCTP pos : purchaseOrderCTPList) {
List<JobCard> jobCards = jobCardDAO.findByPoId(pos.getId());
BigDecimal totalProduction = BigDecimal.ZERO;
BigDecimal expectedProduction = BigDecimal.ZERO;
BigDecimal actualProduction = BigDecimal.ZERO;
long stitchingIn = 0L;
long stitchingOut = 0L;
long finishApprovedItem = 0L;
long finishRejectItem = 0L;
long storeItems = 0L;
long packagingItems = 0L;
Long qaProgressItems = 0L;
Long totalFinishItem = 0L;
Long totalRejectPieces = 0L;
POsDetails pOsDetails = new POsDetails();
for (JobCard jobCard : jobCards) {
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCard.getId());
totalProduction = totalProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getTotalProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
List<Long> jobCardIds = jobCards.stream()
.map(JobCard::getId)
.collect(Collectors.toList());
List<JobCardItem> jobCardItems = new ArrayList<>();
if (!jobCardIds.isEmpty()) {
jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds,size, color);
}else {
jobCardItems = new ArrayList<>();
}
expectedProduction = expectedProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
actualProduction = actualProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
if(!jobCardItems.isEmpty() || (StringUtils.isNullOrEmpty(size) || StringUtils.isNullOrEmpty(color))) {
for (JobCardItem jobCardItem : jobCardItems) {
//stitching detail
stitchingIn += Optional.of(stitchingOfflineItemDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
stitchingOut += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCardItem.getJobCardId())).orElse(0L);
//finishItems detail
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(jobCardItem.getJobCardId());
finishApprovedItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("APPROVED")).count();
finishRejectItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("REJECT")).count();
//reject store details
storeItems += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCardItem.getJobCardId())).orElse(0L);
//reject packaging details
packagingItems += Optional.of(packagingItemsDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
actualProduction = actualProduction.add(jobCardItems.stream()
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
.reduce(BigDecimal.ZERO, BigDecimal::add));
qaProgressItems += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCard.getId())).orElse(0L);
totalFinishItem += Optional.ofNullable(finishedItemDAO.calculateTotalFinishItem(jobCard.getId())).orElse(0L);
totalRejectPieces += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCard.getId())).orElse(0L);
jobCardCompleteItems = getSegregateItems(String.valueOf(jobCard.getId()));
if (jobCardCompleteItems == null) {
jobCardCompleteItems = new HashMap<>();
}
pOsDetails.setPoId(pos.getId());
pOsDetails.setPoNumber(pos.getPurchaseOrderCode());
pOsDetails.setArticleTitle(pos.getArticleName());
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
pOsDetails.setActualCutting(expectedProduction.longValue());
pOsDetails.setBalanceToCutting(pos.getPurchaseOrderQuantityRequired() - expectedProduction.longValue());
pOsDetails.setCuttingReceived(expectedProduction.longValue());
pOsDetails.setCuttingOki(expectedProduction.intValue());
pOsDetails.setCuttingReject(expectedProduction.subtract(expectedProduction).intValue());
pOsDetails.setStitchingIn(stitchingIn);
pOsDetails.setStitchingOut(stitchingOut);
pOsDetails.setStitchingWips(stitchingIn - stitchingOut);
pOsDetails.setFinishIn(stitchingOut);
pOsDetails.setFinishRej(finishRejectItem);
pOsDetails.setFinishQaApproved(finishApprovedItem);
pOsDetails.setStoreReceived(storeItems);
pOsDetails.setStoreWaiting(finishRejectItem - storeItems);
pOsDetails.setFinishQaApproved(finishApprovedItem);
pOsDetails.setPackagingIn(packagingItems);
pOsDetails.setPackagingOut(packagingItems);
pOsDetails.setPackagingStock(0);
pOsDetails.setShippedScan(packagingItems);
pOsDetails.setShippedNet(packagingItems);
pOsDetails.setPackagingStock(0);
pOsDetails.setPoStatus(pos.getPoStatus());
pOsDetailsList.add(pOsDetails);
}
pOsDetails.setPoId(pos.getId());
pOsDetails.setPoNumber(pos.getPurchaseOrderCode());
pOsDetails.setArticleTitle(pos.getArticleName());
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
pOsDetails.setTotalCutting(actualProduction.intValue());
pOsDetails.setTotalStitching(qaProgressItems);
pOsDetails.setTotalEndLineQC(qaProgressItems.intValue());
pOsDetails.setTotalFinishing(totalFinishItem);
pOsDetails.setPoStatus(false);
pOsDetails.setRemainingCutting(pos.getPurchaseOrderQuantityRequired() - actualProduction.intValue());
pOsDetails.setRemainingStitching(pos.getPurchaseOrderQuantityRequired() - qaProgressItems);
pOsDetails.setRemainingEndLineQC(pos.getPurchaseOrderQuantityRequired() - qaProgressItems);
pOsDetails.setRemainingFinishing(pos.getPurchaseOrderQuantityRequired() - totalFinishItem);
pOsDetails.setTotalAGradeItem(jobCardCompleteItems.getOrDefault("A GRADE", 0));
pOsDetails.setTotalBGradeItem(totalRejectPieces.intValue());
pOsDetailsList.add(pOsDetails);
}
return pOsDetailsList;
}
/*
* find all job cards of specific po
* */
public HashMap<String, Map<String, Integer>> getAllPoJobCards(long poId, String selectDate) {
String startDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 00:00:01": null;
String endDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 23:59:59": null;
@ -604,37 +566,7 @@ public class ReportingService {
return poJobCardItemsProgress;
}
//get po related items size, poId or color
public HashMap<String, PoItemsWrapper> getPoItemsSizeOrColor(long poId, String size, String color) {
List<JobCard> jobCards = jobCardDAO.findByPoId(poId);
List<Long> jobCardIds = jobCards.stream()
.map(JobCard::getId)
.collect(Collectors.toList());
HashMap<String, PoItemsWrapper> poItemsWrapperHashMap = new HashMap<>();
if(!jobCardIds.isEmpty()){
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, size, color);
jobCardItems.forEach(e -> {
String sku = e.getSku();
PoItemsWrapper poItemsWrapper = poItemsWrapperHashMap.getOrDefault(sku, new PoItemsWrapper());
poItemsWrapper.setColor(e.getColor());
poItemsWrapper.setSize(e.getSize());
poItemsWrapper.setSku(e.getSku());
poItemsWrapper.setTotalCutting(
poItemsWrapper.getTotalCutting() + (e.getActualProduction() != null ? e.getActualProduction().intValue() : 0)
);
poItemsWrapper.setTotalProduction(
poItemsWrapper.getTotalProduction() + (e.getExpectedProduction() != null ? e.getExpectedProduction().intValue() : 0)
);
poItemsWrapperHashMap.put(sku, poItemsWrapper);
});
}
return poItemsWrapperHashMap;
}
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate, Long count) {
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate) {
Map<String, Object> cuttingDetails = new HashMap<>();
long jobCardIdTemp = 0L;
String startDate1 = null;
@ -659,7 +591,7 @@ public class ReportingService {
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, null, startDate1, endDate1, "IN","BUNDLE", count);
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, null, startDate1, endDate1, "IN","BUNDLE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
Map<String, Integer> dateWiseProduction = new TreeMap<>();
@ -675,7 +607,7 @@ public class ReportingService {
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
List<Long> jobCardIds = entry.getValue();
if (!jobCardIds.isEmpty()) {
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, null, null);
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIds(jobCardIds);
int totalProduction = jobCardItems.stream()
.filter(item -> item.getActualProduction() != null)
.mapToInt(item -> item.getActualProduction().intValue())
@ -732,7 +664,7 @@ public class ReportingService {
return cuttingDetails;
}
public Map<String, Object> getStitchingDetails(String jobCardId, String stitchingLine, String startDate, String endDate, Long count) {
public Map<String, Object> getStitchingDetails(String jobCardId, String stitchingLine, String startDate, String endDate) {
Map<String, Object> stitchingDetails = new HashMap<>();
long jobCardIdTemp = 0L;
String startDate1 = null;
@ -757,7 +689,7 @@ public class ReportingService {
inventoryAccountIds = List.of(Long.parseLong(stitchingLine));
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds,null, startDate1, endDate1, "IN","STITCHING_OFFLINE", count);
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds,null, startDate1, endDate1, "IN","STITCHING_OFFLINE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
Map<String, Integer> dateWiseProduction = new TreeMap<>();
@ -831,7 +763,7 @@ public class ReportingService {
return stitchingDetails;
}
public List<StitchingOfflineItem> stitchingItemsTransactions(String jobCardId, String accountId, String sku, String startDate, String endDate, Long count) {
public List<StitchingOfflineItem> stitchingItemsTransactions(String jobCardId, String accountId, String sku, String startDate, String endDate) {
List<Long> accountID = new ArrayList<>();
String startDate1 = null;
String endDate1 = null;
@ -848,7 +780,7 @@ public class ReportingService {
}
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(Long.parseLong(jobCardId), accountID, sku, startDate1, endDate1,"IN","STITCHING_OFFLINE", count);
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(Long.parseLong(jobCardId), accountID, sku, startDate1, endDate1,"IN","STITCHING_OFFLINE");
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
List<Long> stitchingItemsList = inventoryTransactionLegs.stream()
.map(InventoryTransactionLeg::getParentDocumentId)

View File

@ -123,36 +123,28 @@
<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-2 form-group">
<div class="col-sm-1 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-2 form-group">
<div class="col-sm-1 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-2 form-group">
<div class="col-sm-1 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-2 form-group">
<div class="col-sm-1 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-2 form-group">
<div class="col-sm-1 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>

View File

@ -78,9 +78,9 @@
<a th:href="@{/store/}" class="nav-link"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/store') ? 'active' : ''}">Store</a>
</li>
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_PURCHASE_ORDER', 'ROLE_ADMIN')">
<a th:href="@{/po-status/}" class="nav-link"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/po-status') ? 'active' : ''}">Online PO Status</a>
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/po-status') ? 'active' : ''}">
<a th:href="@{/po-status/}" class="nav-link">Online PO Status</a>
</li>
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_REPORTING', 'ROLE_ADMIN')">
<a th:href="@{/reporting/}" class="nav-link"
@ -181,11 +181,6 @@
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/cutting/master-bundles') ? 'active' : ''}">
<a th:href="@{/cutting/master-bundles}" class="nav-link">Master Bundles</a>
</li>
<li class="nav-item"
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/cutting/cutting-items') ? 'active' : ''}">
<a th:href="@{/cutting/cutting-items}" class="nav-link">Generate Stitching QR</a>
</li>
</ul>
</nav>
<!--Second level of reporting-->

View File

@ -40,12 +40,10 @@
<input type="text" class="form-control" name="lot-number" maxlength="100" th:value="${param['lot-number']}">
</div>
<div class="form-group" data-vue-app th:with="id=${param['purchase-order-id']},title=${param['purchase-order-id']}">
<search-ctp-po
v-bind:id-field-name="'purchase-order-id'"
v-on:select-po="onPoSelect"
v-bind:required="false"
v-bind:selected="purchaseOrderCode">
</search-ctp-po>
<purchase-order-search th:attr="id=${id},title=${title}"
v-bind:id-field-name="'purchase-order-id'"
v-bind:code-field-name="'purchase-order-code'"
></purchase-order-search>
</div>
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}">
<location-site-search th:attr="id=${id},title=${title}"

View File

@ -11,23 +11,20 @@
<label>ID</label>
<input type="text" class="form-control" name="id" maxlength="100" th:value="${param['id']}">
</div>
<div class="form-group">
<label>Sku</label>
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
</div>
<!-- <div class="form-group">-->
<!-- <label>Item ID</label>-->
<!-- <input type="text" class="form-control" name="item-id" maxlength="100"-->
<!-- th:value="${param['item-id']}">-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label>Sku</label>-->
<!-- <input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">-->
<!-- </div>-->
<div class="form-group">
<label>Job Card ID</label>
<input type="text" class="form-control" name="jc-id" maxlength="100"
th:value="${param['jc-id']}">
</div>
<div class="form-group">
<label>Status</label>
<select name="status" class="form-control">
<option value="">All</option>
<option value="1" th:selected="${#strings.equals(param['status'], #strings.toString(1))}">Received</option>
<option value="0" th:selected="${#strings.equals(param['status'], #strings.toString(0))}">Not Received</option>
</select>
</div>
<div class="form-group">
<div class="form-group">
<label>Start Date</label>

View File

@ -29,7 +29,7 @@
<th>Sku</th>
<th>Created By</th>
<th>Created At</th>
<th>Status</th>
<th>Received</th>
<th>
<div class="mb-2">
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Master
@ -52,12 +52,7 @@
<td th:text="*{sku}"></td>
<td th:text="*{createdBy}"></td>
<td ctp:formatdatetime="*{createdAt}"></td>
<td>
<span th:if="${!bundle.isReceived}" class="badge badge-UN_TAGGED">NOT RECEIVED</span>
<div th:if="${bundle.isReceived}">
<span class="badge badge-TAGGED"> RECEIVED</span>
</div>
</td>
<td th:text="${bundle.isReceived ? 'YES' : 'NO'}"></td>
<td>
<div class="form-group form-check mb-0">
<input class="form-check-input" type="checkbox"

View File

@ -7,7 +7,7 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<!-- sidebar starts -->
<aside class="col-sm-2" th:replace="/finishing/_finished-item-sidebar :: sidebar"></aside>
<aside class="col-sm-2" th:replace="/stitching/_finished-item-sidebar :: sidebar"></aside>
<!-- sidebar ends -->
<!--header starts-->
<div class="col-sm">
@ -26,6 +26,7 @@
<th>Item ID</th>
<th>Sku</th>
<th>Job Card ID</th>
<th>Is QA</th>
<th>Created At</th>
<th>Created By</th>
<th>Segregated</th>
@ -37,19 +38,23 @@
<td th:text="${item.itemId}"></td>
<td th:text="${item.sku}"></td>
<td th:text="${item.jobCardId}"></td>
<td>
<span th:if="${not item.isQa}" class="badge badge-danger">NOT PERFORMED</span>
<div th:if="${item.isQa}">
<span class="badge badge-APPROVED">PERFORMED</span>
</div>
<div th:if="${item.qaStatus != null }">
<span th:text="${item.qaStatus}"></span>
</div>
</td>
<td th:text="${item.createdBy}"></td>
<td ctp:formatdatetime="${item.createdAt}"></td>
<td>
<div th:if="${not item.isSegregated && item.qaStatus != ('ALTER')}" >
<span class="badge badge-danger">PENDING</span>
</div>
<div th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}">
<span class="badge badge-warning">REVERTED</span>
</div>
<span th:if="${not item.isSegregated && item.qaStatus != ('ALTER')}" class="badge badge-danger">PENDING</span>
<span th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}" class="badge badge-warning">REVERTED</span>
<div th:if="${item.isSegregated && item.qaStatus != ('ALTER')}">
<span class="badge badge-APPROVED">DONE</span>
</div>
<span th:text="${item.qaStatus}"></span>
</td>
</tr>
</tbody>

View File

@ -2,65 +2,51 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml"
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:uind="http://www.w3.org/1999/xhtml"
xml:lang="en"
lang="en"
xmlns:th="http://www.thymeleaf.org">
<head>
<title>Job Card</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:400,400i&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" th:href="@{|${baseUrl}/css/print.css|}">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:400,400i" rel="stylesheet">
<style type="text/css">
@page {
size: landscape;
margin: 10mm;
}
@media print {
body {
transform: rotate(0deg); /* Not needed for @page landscape */
width: 100%;
}
}
.td-value{
text-align: center;
border: 1px solid black;
}
</style>
</head>
<body>
<div class="container-fluid">
<table>
<tr>
<td width="50%">
<td width="400">
<img width="200" th:src="@{|${baseUrl}/img/utopia-industries.png|}" alt="Utopia Industries">
</td>
<td width="50%">
<td width="400">
<table class="bordered">
<tr class="tr-header">
<td colspan="2" style="text-align: center" th:text="'PO Online Status'"></td>
<td colspan="2" th:text="'PO Online Status'"></td>
</tr>
<tbody>
<tr>
<td style="width: 40%;"><i>PO Code</i></td>
<td style="width: 60%;">
<td style="width: 40%; border: 1px solid black;"><i>PO Code</i></td>
<td style="width: 60%; border: 1px solid black;">
<a class="text-reset" target="_blank" th:text="${poDetail.getPoNumber()}"></a>
</td>
</tr>
<tr>
<td style="width: 40%;"><i>Article Name</i></td>
<td style="width: 60%;">
<td style="width: 40%; border: 1px solid black;"><i>Article Name</i></td>
<td style="width: 60%; border: 1px solid black;">
<a class="text-reset" target="_blank" th:text="${poDetail.getArticleTitle()}"></a>
</td>
</tr>
<tr>
<td class="align-middle"><i>PO Quantity</i></td>
<td><span th:text="${poDetail.getPoQuantity()}"></span></td>
<td class="align-middle" style="border: 1px solid black;"><i>PO Quantity</i></td>
<td style="border: 1px solid black;"><span th:text="${poDetail.getPoQuantity()}"></span></td>
</tr>
<tr>
<td class="align-middle"><i>PO Status</i></td>
<td>
<td class="align-middle" style="border: 1px solid black;"><i>PO Required Excess+</i></td>
<td style="border: 1px solid black;"><span th:text="${poDetail.getPoRequiredQuantity()}"></span></td>
</tr>
<tr>
<td class="align-middle" style="border: 1px solid black;"><i>PO Status</i></td>
<td style="border: 1px solid black;">
<span th:if="*{poDetail.isPoStatus}" th:text="'CLOSE'"></span>
<span th:if="*{!poDetail.isPoStatus}" th:text="'OPEN'"></span>
</td>
@ -71,118 +57,52 @@
</tr>
</table>
<table style="margin-top: 10px;">
<table class="bordered" style="width: 100%; margin-top: 10px; border-collapse: collapse; ">
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;">PO Details</h5>
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;" ctp:formatdatetime="${date}"></h5>
<thead>
<thead >
<tr class="tr-header">
<td style="width: 90px; text-align: center"></td>
<td style="width: 60px; text-align: center">Cutting Insp.</td>
<td style="width: 140px; text-align: center">Stitching</td>
<td style="width: 65px; text-align: center">Finished</td>
<td style="width: 90px; text-align: center; padding-left: 40px">Rej. Store</td>
<td style="width: 100px; text-align: center">Packaging</td>
<td style="width: 80px; text-align: center">Shipped</td>
</tr>
</thead>
</table>
<table >
<thead>
<tr class="tr-header">
<td style="width: 50px; text-align: center" >Req.+ Excess</td>
<td style="width: 50px; text-align: center" >Actual Cut</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Bal.To Cut</td>
<td style="width: 50px; text-align: center;">Rcvd.</td>
<td style="width: 50px; text-align: center">Ok</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Rej.</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">WIP</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Out</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">Rej</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">QA Approv.</td>
<td style="width: 50px; text-align: center">Rcvd.</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">waiting</td>
<td style="width: 50px; text-align: center">In</td>
<td style="width: 50px; text-align: center">Out</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Stock</td>
<td style="width: 50px; text-align: center">Scan</td>
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Net</td>
<td>Cutting</td>
<td>Cutting Balance</td>
<td>Stitching</td>
<td>Stitching Balance</td>
<td>End Line QC</td>
<td>End Line QC Balance</td>
<td>Finishing Items</td>
<td>Finishing Items Balance</td>
<td>A Grade Items</td>
<td>Reject Items In Store</td>
</tr>
</thead>
<tbody>
<tr >
<td th:text="${poDetail.getPoRequiredQuantity()}" class="td-value"></td>
<td th:text="${poDetail.getActualCutting()}" class="td-value"></td>
<td th:text="${poDetail.getBalanceToCutting()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingReceived()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingOki()}" class="td-value"></td>
<td th:text="${poDetail.getCuttingReject()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingIn()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingWips()}" class="td-value"></td>
<td th:text="${poDetail.getStitchingOut()}" class="td-value"></td>
<td th:text="${poDetail.getFinishIn()}" class="td-value"></td>
<td th:text="${poDetail.getFinishRej()}" class="td-value"></td>
<td th:text="${poDetail.getFinishQaApproved()}" class="td-value"></td>
<td th:text="${poDetail.getStoreReceived()}" class="td-value"></td>
<td th:text="${poDetail.getStoreWaiting()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingIn()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingOut()}" class="td-value"></td>
<td th:text="${poDetail.getPackagingStock()}" class="td-value"></td>
<td th:text="${poDetail.getShippedScan()}" class="td-value"></td>
<td th:text="${poDetail.getShippedNet()}" class="td-value"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalCutting()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingCutting()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalStitching()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingStitching()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalEndLineQC()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingEndLineQC()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalFinishing()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getRemainingFinishing()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalAGradeItem()}"></td>
<td style="border: 1px solid black;" th:text="${poDetail.getTotalBGradeItem()}"></td>
</tr>
</tbody>
</table>
<table>
<table class="bordered" style="width: 50%; margin-top: 20px;" th:if="${showStore}">
<tr class="tr-header">
<td colspan="2" th:text="'Reject Items In Store'"></td>
</tr>
<tbody>
<tr>
<td style="width: 50%; margin-top: 20px;" th:if="${showStore}">
<table class="bordered" style="margin-top: 10px;">
<tr class="tr-header">
<td colspan="2" style="text-align: center" th:text="'Reject Items In Store'"></td>
</tr>
<tbody>
<tr th:each="heading : ${store.keySet()}"
th:if="${store != null and not store.isEmpty()}">
<td style="width: 40%;"><i th:text="${heading}"></i></td>
<td style="width: 60%;">
<a class="text-reset" target="_blank" th:text="${store.get(heading)}"></a>
</td>
</tr>
</tbody>
</table>
</td>
<td style="width: 50%; margin-top: 20px;" th:if="${showItems && poItems.values() != null and not poItems.values().isEmpty() }">
<table class="bordered" style="margin-top: 10px;">
<thead>
<tr class="tr-header">
<td>Sku</td>
<td>Color</td>
<td>Size</td>
<td>Expected Production</td>
<td>Total Cutting</td>
</tr>
</thead>
<tbody>
<tr th:each="items : ${poItems.values()}" th:object="${items}">
<td th:text="*{sku}"></td>
<td th:text="*{color}"></td>
<td th:text="*{size}"></td>
<td th:text="*{totalProduction}"></td>
<td th:text="*{totalCutting}"></td>
</tr>
</tbody>
</table>
<tr th:each="heading : ${store.keySet()}"
th:if="${store != null and not store.isEmpty()}">
<td style="width: 40%; border: 1px solid black;"><i th:text="${heading}"></i></td>
<td style="width: 60%; border: 1px solid black;">
<a class="text-reset" target="_blank" th:text="${store.get(heading)}"></a>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@ -10,6 +10,7 @@
<div th:replace="_notices :: page-notices"></div>
<form th:action="${purchaseOrder.id} != null ? @{/purchase-order/edit/(id=${purchaseOrder.id})} : @{/purchase-order/edit}"
method="POST"
th:object="${purchaseOrder}"
id="jobCardApp">
<div class="bg-light p-3 mb-3">
<h6 class="mb-3">Info</h6>
@ -33,12 +34,6 @@
<label>Article Name</label>
<input type="text" class="form-control" th:field="${purchaseOrder.articleName}" required>
</div>
<div class="col-sm-1 form-group">
<label for="active">Status OPEN/CLOSE</label>
<div class="form-check">
<input class="custom-control-label:" type="checkbox" id="active" th:field="*{purchaseOrder.poStatus}"/>
</div>
</div>
</div>
</div>

View File

@ -28,7 +28,6 @@
<th>Created At</th>
<th>Created By</th>
<th>Status</th>
<th>PO Status</th>
<th>Action</th>
</tr>
@ -45,12 +44,6 @@
<span class="badge font-sm" th:classappend="'badge-' + ${order.status}" th:if="${order.status}" th:text="${order.status}"></span>
<span th:unless="${order.status}">-</span>
</td>
<td>
<span th:if="${!order.poStatus}" class="badge badge-APPROVED">OPEN</span>
<div th:if="${order.poStatus}">
<span class="badge badge-danger" >CLOSE</span>
</div>
</td>
<td>
<th:block >
<a th:href="@{'/purchase-order/edit/' + ${order.id}}" class="btn btn-sm btn-secondary" title="Edit">

View File

@ -7,7 +7,7 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<!-- sidebar starts -->
<aside class="col-sm-2" th:replace="/finishing/_finished-item-sidebar :: sidebar"></aside>
<aside class="col-sm-2" th:replace="/stitching/_finished-item-sidebar :: sidebar"></aside>
<!-- sidebar ends -->
<!--header starts-->
<div class="col-sm">

View File

@ -32,10 +32,6 @@
</option>
</select>
</div>
<div class="form-group">
<label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
</div>
<input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"
class="btn btn-secondary btn-block">Reset</a>

View File

@ -3,17 +3,6 @@
xmlns:ctp="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Cutting Report')"></head>
<style>
div.dataTables_wrapper div.dataTables_filter {
text-align: left !important;
}
div.dataTables_wrapper .dt-buttons {
text-align: left !important;
}
div.dataTables_wrapper div.dataTables_info {
text-align: left !important;
}
</style>
<body>
<div class="container-fluid">
@ -44,8 +33,8 @@
class="p-0 text-center">
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center"
th:text="${cuttingAccount.title}"></div>
<table class="table table-bordered mt-2 datatable">
<thead>
<table class="table table-bordered mt-2">
<thead class="">
<tr>
<th>Job Card</th>
<th>PO Number</th>
@ -88,37 +77,8 @@
</div>
</main>
</div>
<!-- Load chart logic -->
<!-- Load JavaScript file -->
<script th:src="@{/js/charts.js}"></script>
<!-- DataTables Initialization -->
<script>
const dataTableConfig = {
pageLength: 5,
searching: true,
lengthChange: false,
processing: false,
info: true,
paging: true,
dom: `
<'row mb-2 mt-2'<'col-sm-6'f><'col-sm-6'B>>
<'row'<'col-sm-12'tr>>
<'row mt-2'<'col-sm-6'i><'col-sm-6 text-end'p>>`
,
buttons: []
};
$(document).ready(function () {
$('table.datatable').each(function () {
const $table = $(this);
if (!$.fn.DataTable.isDataTable($table)) {
$table.DataTable(dataTableConfig);
}
});
});
</script>
</body>
</html>
</html>

View File

@ -1,63 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-8">
<table th:if="${#lists != null && #lists.size(poJobcardItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-order="[[ 0, &quot;desc&quot; ]]" data-dropdown-icon-summary >
<thead>
<tr>
<th>Sku</th>
<th>Color</th>
<th>Size</th>
<th>Expected Production</th>
<th>Total Cutting</th>
</tr>
</thead>
<tbody>
<tr th:each="poItems : ${poJobcardItems.values()}" th:object="${poItems}">
<td th:text="*{sku}"></td>
<td th:text="*{color}"></td>
<td th:text="*{size}"></td>
<td th:text="*{totalProduction}"></td>
<td th:text="*{totalCutting}"></td>
</tr>
</tbody>
</table>
<h5 th:if="${#lists.size(poJobcardItems.keySet()) == 0}" class="mt-2">No Items found.</h5>
</div>
</div>
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
<script th:inline="javascript">
// Initialize DataTables for each individual table
$('table[data-dropdown-icon-summary]').each(function () {
const $table = $(this);
// Prevent reinitializing if already done
if (!$.fn.DataTable.isDataTable($table)) {
$table.DataTable({
paging: false,
searching: false,
lengthChange: false,
info: false,
dom: 't',
buttons: [{
extend: 'excel',
text: '',
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none'
}]
});
}
});
</script>
</body>
</html>

View File

@ -11,32 +11,6 @@
<label>PO Code</label>
<input type="text" class="form-control" name="poName" th:value="${param['poName'] ?: poName}">
</div>
<div class="form-group">
<label>Size</label>
<select class="form-control" name="size">
<option value="">Please Select</option>
<option th:each="size: ${allSize}"
th:value="${size}"
th:text="${size}"
th:selected="${param['size'] == null ? false : #strings.equals(param['size'], size) }">
</option>
</select>
</div>
<div class="form-group">
<label>Color</label>
<select class="form-control" name="color">
<option value="">Please Select</option>
<option th:each="color: ${allColor}"
th:value="${color}"
th:text="${color}"
th:selected="${param['color'] == null ? false : #strings.equals(param['color'], color) }">
</option>
</select>
</div>
<div class="form-group">
<label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
</div>
<input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"
class="btn btn-secondary btn-block">Reset</a>

View File

@ -7,36 +7,25 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<aside class="col-sm-2" th:replace="/reporting/po-report-sidebar :: sidebar"></aside>
<div class="col-lg-10 col-sm-10" style="overflow-x: auto;">
<h3>All PO's</h3>
<div class="table-responsive"> <!-- Bootstrap responsive table wrapper -->
<table th:if="${ #lists != null && #lists.size(allPOs) != 0 }"
class="table table-striped font-sm" data-order="[[ 0, &quot;desc&quot; ]]" style="min-width: 1500px;">
<div class="col-lg-10 col-sm-10">
<h3>All PO's </h3>
<table th:if="${ #lists != null && #lists.size(allPOs) != 0 }" class="table table-striped font-sm" data-account-tables data-order="[[ 0, &quot;asc&quot; ]]">
<thead>
<tr>
<th>PO Number</th>
<th>PO Article</th>
<th>PO Quantity</th>
<th>Req+ Excess</th>
<th>Cut.</th>
<th>Cut Bal.</th>
<th>Cut Recv.</th>
<th>Cut oki</th>
<th>Cut Rej.</th>
<th>Stit. In</th>
<th>Stit. Out</th>
<th>Stit. Wips</th>
<th>finish In</th>
<th>finish Rej.</th>
<th>finish QA APP.</th>
<th>Rej. Store Rcvd</th>
<th>Rej. Store Waiting</th>
<th>Packed In</th>
<th>Packed Out</th>
<th>Packed Stock</th>
<th>Shipped Scan</th>
<th>Shipped Net</th>
<th></th>
<th>Cutting</th>
<th>Cutting Balance</th>
<th>Stitching</th>
<th>Stitching Balance</th>
<th>End Line QC</th>
<th>End Line QC Balance</th>
<th>Finishing Items</th>
<th>Finishing Items Balance</th>
<th>A Grade Items</th>
<th>Reject Items In Store</th>
<th></th>
<th>PO Status</th>
<th>Generate PDF</th>
@ -50,34 +39,21 @@
<td th:text="${poDetail.articleTitle}"></td>
<td th:text="${poDetail.poQuantity}"></td>
<td th:text="${poDetail.poRequiredQuantity}"></td>
<td th:text="${poDetail.actualCutting}"></td>
<td th:text="${poDetail.balanceToCutting}"></td>
<td th:text="${poDetail.cuttingReceived}"></td>
<td th:text="${poDetail.cuttingOki}"></td>
<td th:text="${poDetail.cuttingReject}"></td>
<td th:text="${poDetail.stitchingIn}"></td>
<td th:text="${poDetail.stitchingOut}"></td>
<td th:text="${poDetail.stitchingWips}"></td>
<td th:text="${poDetail.finishIn}"></td>
<td th:text="${poDetail.finishRej}"></td>
<td th:text="${poDetail.finishQaApproved}"></td>
<td th:text="${poDetail.storeReceived}"></td>
<td th:text="${poDetail.storeWaiting}"></td>
<td th:text="${poDetail.packagingIn}"></td>
<td th:text="${poDetail.packagingOut}"></td>
<td th:text="${poDetail.packagingStock}"></td>
<td th:text="${poDetail.shippedScan}"></td>
<td th:text="${poDetail.shippedNet}"></td>
<td th:text="${poDetail.totalCutting}"></td>
<td th:text="${poDetail.remainingCutting}"></td>
<td th:text="${poDetail.totalStitching}"></td>
<td th:text="${poDetail.remainingStitching}"></td>
<td th:text="${poDetail.totalEndLineQC}"></td>
<td th:text="${poDetail.remainingEndLineQC}"></td>
<td th:text="${poDetail.totalFinishing}"></td>
<td th:text="${poDetail.remainingFinishing}"></td>
<td th:text="${poDetail.totalAGradeItem}"></td>
<td th:text="${poDetail.totalBGradeItem}"></td>
<td data-show-dropdown-transactions
th:data-po-id="${poDetail.poId}"
title="Store-Items">
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
</td>
<td data-show-dropdown-summary
th:data-po-id="${poDetail.poId}" title="Summary">
<span data-dropdown-icon-summary class="bi bi-caret-right"></span>
</td>
<td>
<span class="badge font-sm badge-danger" th:if="*{poDetail.poStatus}" th:text="'CLOSE'"></span>
<span class="badge font-sm badge-ACTIVE" th:if="*{!poDetail.poStatus}" th:text="'OPEN'"></span>
@ -91,25 +67,18 @@
<input type="hidden" name="articleTitle" th:value="${poDetail.articleTitle}"/>
<input type="hidden" name="poQuantity" th:value="${poDetail.poQuantity}"/>
<input type="hidden" name="poRequiredQuantity" th:value="${poDetail.poRequiredQuantity}"/>
<input type="hidden" name="actualCutting" th:value="${poDetail.actualCutting}"/>
<input type="hidden" name="balanceToCutting" th:value="${poDetail.balanceToCutting}"/>
<input type="hidden" name="cuttingReceived" th:value="${poDetail.cuttingReceived}"/>
<input type="hidden" name="cuttingOki" th:value="${poDetail.cuttingOki}"/>
<input type="hidden" name="cuttingReject" th:value="${poDetail.cuttingReject}"/>
<input type="hidden" name="stitchingIn" th:value="${poDetail.stitchingIn}"/>
<input type="hidden" name="stitchingOut" th:value="${poDetail.stitchingOut}"/>
<input type="hidden" name="stitchingWips" th:value="${poDetail.stitchingWips}"/>
<input type="hidden" name="finishIn" th:value="${poDetail.finishIn}"/>
<input type="hidden" name="finishRej" th:value="${poDetail.finishRej}"/>
<input type="hidden" name="finishQaApproved" th:value="${poDetail.finishQaApproved}"/>
<input type="hidden" name="storeReceived" th:value="${poDetail.storeReceived}"/>
<input type="hidden" name="storeWaiting" th:value="${poDetail.storeWaiting}"/>
<input type="hidden" name="packagingIn" th:value="${poDetail.packagingIn}"/>
<input type="hidden" name="packagingOut" th:value="${poDetail.packagingOut}"/>
<input type="hidden" name="packagingStock" th:value="${poDetail.packagingStock}"/>
<input type="hidden" name="shippedScan" th:value="${poDetail.shippedScan}"/>
<input type="hidden" name="shippedNet" th:value="${poDetail.shippedNet}"/>
<input type="hidden" name="totalCutting" th:value="${poDetail.totalCutting}"/>
<input type="hidden" name="remainingCutting" th:value="${poDetail.remainingCutting}"/>
<input type="hidden" name="totalStitching" th:value="${poDetail.totalStitching}"/>
<input type="hidden" name="remainingStitching" th:value="${poDetail.remainingStitching}"/>
<input type="hidden" name="totalEndLineQC" th:value="${poDetail.totalEndLineQC}"/>
<input type="hidden" name="remainingEndLineQC" th:value="${poDetail.remainingEndLineQC}"/>
<input type="hidden" name="totalFinishing" th:value="${poDetail.totalFinishing}"/>
<input type="hidden" name="remainingFinishing" th:value="${poDetail.remainingFinishing}"/>
<input type="hidden" name="totalAGradeItem" th:value="${poDetail.totalAGradeItem}"/>
<input type="hidden" name="totalBGradeItem" th:value="${poDetail.totalBGradeItem}"/>
<input type="hidden" name="poStatus" th:value="${poDetail.poStatus}"/>
<a href="javascript:void(0);"
th:onclick="'showPdfOptions(' + ${poDetail.poId} + ')'"
class="btn btn-sm btn-secondary"
@ -123,7 +92,6 @@
</table>
<h4 th:if="${#lists.size(allPOs) == 0 }">No PO found.</h4>
</div>
</div>
<div class="modal fade" id="pdfOptionsModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
@ -131,12 +99,12 @@
<h5 class="modal-title">Select PDF Options</h5>
</div>
<div class="modal-body">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="includeItemsDetail" name="includeItemsDetail" value="true" checked>
<label class="form-check-label" for="includeItemsDetail">
Include Items Details
</label>
</div>
<!-- <div class="form-check">-->
<!-- <input class="form-check-input" type="checkbox" id="includeJobCard" name="includeJobCard" value="true" checked>-->
<!-- <label class="form-check-label" for="includeJobCard">-->
<!-- Include Job Card Details-->
<!-- </label>-->
<!-- </div>-->
<div class="form-check">
<input class="form-check-input" type="checkbox" id="includeStoreDetails" name="includeStoreDetails" value="true" checked>
<label class="form-check-label" for="includeStoreDetails">
@ -154,14 +122,6 @@
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
<script>
const params = new URLSearchParams(window.location.search);
// Extract individual parameters
const size = params.get("size");
const color = params.get("color");
// PDF Generation Functions
let currentPoIdForPdf = null;
@ -178,40 +138,17 @@
// Remove existing options if they exist
const existingJobCard = form.querySelector('input[name="includeJobCard"]');
const existingStoreDetails = form.querySelector('input[name="includeStoreDetails"]');
const existingItemsDetail = form.querySelector('input[name="includeItemsDetail"]');
if (existingJobCard) form.removeChild(existingJobCard);
if (existingStoreDetails) form.removeChild(existingStoreDetails);
if (existingItemsDetail) form.removeChild(existingItemsDetail);
// Add store detail params
// Add params to show store details in pdf
const includeStoreDetails = document.createElement('input');
includeStoreDetails.type = 'hidden';
includeStoreDetails.name = 'includeStoreDetails';
includeStoreDetails.value = document.getElementById('includeStoreDetails').checked;
form.appendChild(includeStoreDetails);
// Add item color params
const itemColors = document.createElement('input');
itemColors.type = 'hidden';
itemColors.name = 'color';
itemColors.value = color
form.appendChild(itemColors);
// Add item size params
const itemSize = document.createElement('input');
itemSize.type = 'hidden';
itemSize.name = 'size';
itemSize.value = size;
form.appendChild(itemSize);
// Add add items details checkbox params
const includeItemsDetails = document.createElement('input');
includeItemsDetails.type = 'hidden';
includeItemsDetails.name = 'includeItemsDetail';
includeItemsDetails.value = document.getElementById('includeItemsDetail').checked;
form.appendChild(includeItemsDetails);
form.submit();
$('#pdfOptionsModal').modal('hide');
}
@ -224,7 +161,7 @@
$('table[data-account-table]').each(function () {
$(this).DataTable({
paging: false,
pageLength: 10,
pageLength: 100,
searching: false,
lengthChange: false,
processing: false,
@ -259,61 +196,8 @@
$row.child(`<span class="spinner-border text-center spinner-border-md" role="status"></span>`).show();
$.ajax({
url: `/ctp/purchase-order/store-items/${poId}`,
success: function(data) {
if (data.includes('page-login') ||
data.includes('login__form') ||
data.includes('Sign in')) {
// Redirect to login page
window.location.href = '/ctp/login?logout';
} else {
$row.child(data).show();
}
},
error: function(xhr) {
if (xhr.status === 401) {
window.location.href = '/ctp/login?logout';
} else {
$row.child('<span class="text-danger">Error loading data</span>').show();
}
}
});
}
});
$body.on( 'click', '[data-show-dropdown-summary]', function( e ) {
e.preventDefault();
const $this = $(this);
const $tr = $this.closest('tr');
const $table = $this.closest('table');
const dataTable = $table.DataTable();
const $row = dataTable.row($tr);
const $spanDropdown = $tr.find( '[data-dropdown-icon-summary]' );
const poId = $this.data('po-id');
$spanDropdown.toggleClass( 'bi-caret-right bi-caret-down' );
if( $row.child.isShown() ){
$row.child.hide();
}
else {
$row.child(`<span class="spinner-border text-center spinner-border-md" role="status"></span>`).show();
$.ajax({
url: `/ctp/po-status/po-items?poId=${poId}&size=${size}&color=${color}`,
success: function( data ){
if (data.includes('page-login') ||
data.includes('login__form') ||
data.includes('Sign in')) {
// Redirect to login page
window.location.href = '/ctp/login?logout';
} else {
$row.child(data).show();
}
},
error: function(xhr) {
if (xhr.status === 401) {
window.location.href = '/ctp/login?logout';
} else {
$row.child('<span class="text-danger">Error loading data</span>').show();
}
success: function (data) {
$row.child(data).show();
}
});
}

View File

@ -8,7 +8,7 @@
<div class="container">
<div class="row">
<div class="col-sm-8">
<table th:if="${#lists != null && #lists.size(storeItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-order="[[ 0, &quot;desc&quot; ]]" data-account-tables >
<table th:if="${#lists != null && #lists.size(storeItems.keySet()) != 0 }" class="table table-bordered font-sm mb-4" data-account-tables >
<thead>
<tr>
<th th:each="heading : ${storeItems.keySet()}" th:text="${heading}"></th>
@ -20,7 +20,7 @@
</tr>
</tbody>
</table>
<h5 th:if="${#lists.size(storeItems.keySet()) == 0}" class="mt-2">No Items found.</h5>
<h5 th:if="${#lists.size(storeItems.keySet()) == 0}" class="mt-2">No Inventory Transactions found.</h5>
</div>
</div>
</div>

View File

@ -33,13 +33,10 @@
</div>
<div class="form-group">
<label>Status</label>
<select name="status" class="form-control">
<option value="">All</option>
<option value="APPROVED" th:selected="${#strings.equals(param['status'], 'APPROVED')}">APPROVED</option>
<option value="REJECT" th:selected="${#strings.equals(param['status'], 'REJECT')}">REJECT</option>
<option value="WASHED" th:selected="${#strings.equals(param['status'], 'WASHED')}">WASHED</option>
<option value="ALTER" th:selected="${#strings.equals(param['status'], 'ALTER')}">ALTER</option>
<option value="B GRADE" th:selected="${#strings.equals(param['status'], 'B GRADE')}">B GRADE</option>
<select class="form-control" name="status">
<option value="" th:selected="${param.status == null}">Please Select</option>
<option value="APPROVED" th:selected="${param.status == 'true'}">Approved</option>
<option value="REJECT" th:selected="${param.status == 'false'}">Reject</option>
</select>
</div>

View File

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Home Page')"></head>
<body>
<!-- sidebar starts -->
<aside class="col-sm-2" th:fragment="sidebar">
<div class="page-filters-sidebar">
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
<h5 class="mb-4">Refine Your Search</h5>
<div class="form-group">
<label>ID</label>
<input type="text" class="form-control" name="id" maxlength="100" th:value="${param['id']}">
</div>
<div class="form-group">
<label>Item ID</label>
<input type="text" class="form-control" name="item-id" maxlength="100" th:value="${param['item-id']}">
</div>
<div class="form-group">
<label>SKu</label>
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
</div>
<div class="form-group">
<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>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date'] ?: startDate}">
</div>
<div class="form-group">
<label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div>
<div class="form-group">
<label>Status</label>
<select class="form-control" name="status">
<option value="" th:selected="${param.status == null}">Please Select</option>
<option value="APPROVED" th:selected="${param.status == 'true'}">Approved</option>
<option value="REJECT" th:selected="${param.status == 'false'}">Reject</option>
</select>
</div>
<div class="form-group">
<label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
</div>
<input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" class="btn btn-secondary btn-block">Reset</a>
</form>
</div>
</aside>
<!-- sidebar ends -->
<div th:fragment="page-footer-scripts">
<script th:src="@{/js/vendor/lazyload-db.js}"></script>
<script th:src="@{/js/main.js}"></script>
</div>
</body>
</html>

View File

@ -7,13 +7,17 @@
<header class="row page-header" th:replace="_fragments :: page-header"></header>
<main class="row page-main">
<!-- sidebar starts -->
<aside class="col-sm-2" th:replace="/stitching/_stitching-sidebar :: sidebar"></aside>
<aside class="col-sm-2" th:replace="/stitching/_finished-item-sidebar :: sidebar"></aside>
<!-- sidebar ends -->
<!--header starts-->
<div class="col-sm">
<div th:replace="_notices :: page-notices"></div>
<div class="mb-4 d-flex justify-content-between">
<h3>Stitching WIP's</h3>
<a th:href="@{/stitching/create-stitching-items}" class="btn btn-primary">Create Stitching WIP's</a>
</div>
<div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-qrCode}" method="post">
<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;desc&quot; ]]">
@ -26,8 +30,8 @@
<th>Created At</th>
<th>Created By</th>
<th>Is QA</th>
<th th:if="${!#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/stitching/stitching-offline-items')}">
<div class="mb-2" >
<th>
<div class="mb-2">
<button class="btn btn-sm btn-outline-primary" type="submit">Generate QR code</button>
</div>
<div><input type="checkbox" data-checkbox-all></div>
@ -50,7 +54,7 @@
<div th:text="*{qaStatus}"></div>
<div th:text="*{qaRemarks}"></div>
</td>
<td th:if="${!#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/stitching/stitching-offline-items')}">
<td>
<div class="form-group form-check mb-0">
<input class="form-check-input" type="checkbox"
th:value="*{id}"
@ -62,7 +66,7 @@
</tbody>
</table>
</form>
<h4 th:if="${#lists.size(items) == 0}">No Stitching Items found.</h4>
<h4 th:if="${#lists.size(items) == 0}">No Finished Items found.</h4>
</div>
</main>
</div>