Compare commits
8 Commits
add-report
...
main
Author | SHA1 | Date |
---|---|---|
|
75f4d8ef09 | |
|
35102e0b3d | |
|
cef37b40e6 | |
|
b1b4c6b634 | |
|
6ac6a42a60 | |
|
4a94cac214 | |
|
4c01a5ee1a | |
|
eb9c4cce02 |
|
@ -0,0 +1,15 @@
|
||||||
|
package com.utopiaindustries.auth;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
|
@PreAuthorize( "hasAnyRole('ROLE_PURCHASE_ORDER','ROLE_ADMIN')")
|
||||||
|
public @interface PurchaseOrderCTPRole {
|
||||||
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
package com.utopiaindustries.controller;
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.PackagingRole;
|
import com.utopiaindustries.auth.PackagingRole;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
import com.utopiaindustries.service.PackagingService;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ -17,19 +18,39 @@ import java.time.LocalDate;
|
||||||
@RequestMapping("/packaging" )
|
@RequestMapping("/packaging" )
|
||||||
public class PackagingController {
|
public class PackagingController {
|
||||||
|
|
||||||
|
|
||||||
private final InventoryAccountService inventoryAccountService;
|
private final InventoryAccountService inventoryAccountService;
|
||||||
|
private final PackagingService packagingService;
|
||||||
private final LocationService locationService;
|
private final LocationService locationService;
|
||||||
|
|
||||||
public PackagingController(InventoryAccountService inventoryAccountService, LocationService locationService) {
|
public PackagingController(InventoryAccountService inventoryAccountService, PackagingService packagingService, LocationService locationService) {
|
||||||
this.inventoryAccountService = inventoryAccountService;
|
this.inventoryAccountService = inventoryAccountService;
|
||||||
|
this.packagingService = packagingService;
|
||||||
this.locationService = locationService;
|
this.locationService = locationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String showHome(Model model ){
|
public String showHome(Model model ){
|
||||||
return "redirect:/packaging/inventory-accounts";
|
return "redirect:/packaging/receive-inventory";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/receive-inventory")
|
||||||
|
public String packagingItemReceive( Model model ){
|
||||||
|
model.addAttribute("wrapper", new FinishedItemWrapper() );
|
||||||
|
return "/packaging/receive-inventory-form";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping( "/packaging-items" )
|
||||||
|
public String packagingItems( @ModelAttribute FinishedItemWrapper wrapper,
|
||||||
|
RedirectAttributes redirectAttributes,
|
||||||
|
Model model ){
|
||||||
|
try {
|
||||||
|
packagingService.createPackagingItem( wrapper );
|
||||||
|
redirectAttributes.addFlashAttribute("success", "Items Successfully received !" );
|
||||||
|
} catch ( Exception e ){
|
||||||
|
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||||
|
}
|
||||||
|
return "redirect:/finishing/finished-items";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/inventory-accounts" )
|
@GetMapping( "/inventory-accounts" )
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.service.PurchaseOrderCTPService;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/purchase-order")
|
||||||
|
@PurchaseOrderCTPRole
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPController {
|
||||||
|
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
||||||
|
|
||||||
|
public PurchaseOrderCTPController(PurchaseOrderCTPService purchaseOrderCTPService) {
|
||||||
|
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String showJobCardList( @RequestParam( value = "purchaseOrderCode", required = false ) String purchaseOrderCode,
|
||||||
|
@RequestParam( value = "articleName", required = false ) String articleName,
|
||||||
|
@RequestParam( value = "created-start-date", required = false ) String createdStartDate,
|
||||||
|
@RequestParam( value = "created-end-date", required = false ) String createdEndDate,
|
||||||
|
@RequestParam( value = "limit" , required = false) Long limit,
|
||||||
|
Model model ){
|
||||||
|
|
||||||
|
LocalDate startDate = StringUtils.isNullOrEmpty(createdStartDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(createdStartDate);
|
||||||
|
LocalDate endDate = StringUtils.isNullOrEmpty(createdEndDate) ? LocalDate.now() : LocalDate.parse(createdEndDate);
|
||||||
|
model.addAttribute("purchaseOrder", purchaseOrderCTPService.getAllPurchaseOrderCtp(purchaseOrderCode, articleName, startDate.toString(), endDate.toString(), limit) );
|
||||||
|
model.addAttribute("startDate", startDate);
|
||||||
|
model.addAttribute("endDate", endDate);
|
||||||
|
return "job-card-list";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/new" )
|
||||||
|
public String showPurchaseOrderCTPForm( Model model ){
|
||||||
|
model.addAttribute("purchaseOrder", purchaseOrderCTPService.createNewPurchaseOrderCTP() );
|
||||||
|
return "/purchaseOrder/purchase-order-form";
|
||||||
|
}
|
||||||
|
}
|
|
@ -95,6 +95,36 @@ public class ReportingController {
|
||||||
return "/reporting/cutting-report";
|
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, 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()));
|
||||||
|
|
||||||
|
return "/reporting/stitching-report";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/inventory-transactions" )
|
||||||
|
public String getInventoryTransactionsByAccount( @RequestParam( value = "account-id", required = false) String accountId,
|
||||||
|
@RequestParam( value = "jobCard-id", required = false) String jobCardId,
|
||||||
|
@RequestParam( value = "sku", required = false) String sku,
|
||||||
|
@RequestParam( value = "startDate", required = false) String startDate,
|
||||||
|
@RequestParam( value = "endDate", 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("transactions", reportingService.stitchingItemsTransactions( jobCardId, accountId, sku, startDate1.toString(), endDate1.toString() ));
|
||||||
|
return "/reporting/accounts-transaction-table";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
|
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
|
||||||
ArrayList<LocalDate> localDates = new ArrayList<>();
|
ArrayList<LocalDate> localDates = new ArrayList<>();
|
||||||
while (start.isBefore(end)) {
|
while (start.isBefore(end)) {
|
||||||
|
|
|
@ -74,8 +74,6 @@ public class StitchingController {
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ) {
|
Model model ) {
|
||||||
// 2 for stitching
|
// 2 for stitching
|
||||||
|
|
||||||
|
|
||||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
|
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
if(count == null){
|
if(count == null){
|
||||||
|
@ -95,11 +93,11 @@ public class StitchingController {
|
||||||
@RequestParam( value = "end-date", required = false ) String endDate,
|
@RequestParam( value = "end-date", required = false ) String endDate,
|
||||||
@RequestParam(value = "bundle-id", required = false) Long bundleId,
|
@RequestParam(value = "bundle-id", required = false) Long bundleId,
|
||||||
@RequestParam( value = "count", required = false, defaultValue = "100") Long count,
|
@RequestParam( value = "count", required = false, defaultValue = "100") Long count,
|
||||||
Model model
|
@RequestParam( value = "status", required = false) String status,
|
||||||
,RedirectAttributes redirect){
|
Model model, RedirectAttributes redirect){
|
||||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleId ,count );
|
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, status, startDate, endDate, bundleId ,count );
|
||||||
model.addAttribute("items", itemList ) ;
|
model.addAttribute("items", itemList ) ;
|
||||||
model.addAttribute("startDate", startDate1);
|
model.addAttribute("startDate", startDate1);
|
||||||
model.addAttribute("endDate", endDate1);
|
model.addAttribute("endDate", endDate1);
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PackagingItems;
|
||||||
|
import com.utopiaindustries.model.ctp.PackagingItemsRowMapper;
|
||||||
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
|
import org.springframework.jdbc.support.KeyHolder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class PackagingItemsDAO {
|
||||||
|
|
||||||
|
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
private static final String TABLE_NAME = "packaging_items";
|
||||||
|
|
||||||
|
private static final String SELECT_BY_ID = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_ALL = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
|
||||||
|
private static final String DELETE_BY_ID = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_BY_JOB_CARD_ID = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
|
||||||
|
|
||||||
|
private static final String INSERT_QUERY = String.format(
|
||||||
|
"INSERT INTO %s (" +
|
||||||
|
"id, item_id, sku, barcode, job_card_id, created_at, created_by, " +
|
||||||
|
"is_qa, finish_item_id, is_segregated, account_id, qa_status, bundle_id, account_title" +
|
||||||
|
") VALUES (" +
|
||||||
|
":id, :item_id, :sku, :barcode, :job_card_id, :created_at, :created_by, " +
|
||||||
|
":is_qa, :finish_item_id, :is_segregated, :account_id, :qa_status, :bundle_id, :account_title" +
|
||||||
|
") ON DUPLICATE KEY UPDATE " +
|
||||||
|
"item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), " +
|
||||||
|
"job_card_id = VALUES(job_card_id), created_at = VALUES(created_at), created_by = VALUES(created_by), " +
|
||||||
|
"is_qa = VALUES(is_qa), finish_item_id = VALUES(finish_item_id), " +
|
||||||
|
"is_segregated = VALUES(is_segregated), account_id = VALUES(account_id), " +
|
||||||
|
"qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), account_title = VALUES(account_title)",
|
||||||
|
TABLE_NAME
|
||||||
|
);
|
||||||
|
|
||||||
|
public PackagingItemsDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MapSqlParameterSource prepareParams(PackagingItems item) {
|
||||||
|
return new MapSqlParameterSource()
|
||||||
|
.addValue("id", item.getId())
|
||||||
|
.addValue("item_id", item.getItemId())
|
||||||
|
.addValue("sku", item.getSku())
|
||||||
|
.addValue("barcode", item.getBarcode())
|
||||||
|
.addValue("job_card_id", item.getJobCardId())
|
||||||
|
.addValue("created_at", item.getCreatedAt())
|
||||||
|
.addValue("created_by", item.getCreatedBy())
|
||||||
|
.addValue("is_qa", item.getIsQa())
|
||||||
|
.addValue("finish_item_id", item.getFinishedItemId())
|
||||||
|
.addValue("is_segregated", item.getIsSegregated())
|
||||||
|
.addValue("account_id", item.getAccountId())
|
||||||
|
.addValue("qa_status", item.getQaStatus())
|
||||||
|
.addValue("bundle_id", item.getBundleId())
|
||||||
|
.addValue("account_title", item.getAccountTitle());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PackagingItems find(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_ID, params, new PackagingItemsRowMapper())
|
||||||
|
.stream().findFirst().orElse(new PackagingItems());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PackagingItems> findAll() {
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_ALL, new PackagingItemsRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long save(PackagingItems item) {
|
||||||
|
KeyHolder keyHolder = new GeneratedKeyHolder();
|
||||||
|
MapSqlParameterSource params = prepareParams(item);
|
||||||
|
namedParameterJdbcTemplate.update(INSERT_QUERY, params, keyHolder);
|
||||||
|
return KeyHolderFunctions.getKey(item.getId(), keyHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] saveAll(List<PackagingItems> items) {
|
||||||
|
List<MapSqlParameterSource> batchParams = new ArrayList<>();
|
||||||
|
for (PackagingItems item : items) {
|
||||||
|
batchParams.add(prepareParams(item));
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate(INSERT_QUERY, batchParams.toArray(new MapSqlParameterSource[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean delete(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.update(DELETE_BY_ID, params) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PackagingItems> findByJobCardId(long jobCardId) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("job_card_id", jobCardId);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_ID, params, new PackagingItemsRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
|
import org.springframework.jdbc.support.KeyHolder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class PurchaseOrderCTPDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
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 id DESC", TABLE_NAME );
|
||||||
|
private final String SELECT_ALL_QUERY_WITH_LIMIT = String.format( "SELECT * FROM %s ORDER BY id DESC limit :limit", 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) " +
|
||||||
|
"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)",
|
||||||
|
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
|
||||||
|
private MapSqlParameterSource prepareInsertQueryParams(PurchaseOrderCTP purchaseOrderCTP) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("id", purchaseOrderCTP.getId())
|
||||||
|
.addValue("purchase_order_code", purchaseOrderCTP.getPurchaseOrderCode())
|
||||||
|
.addValue("purchase_order_quantity", purchaseOrderCTP.getPurchaseOrderQuantity())
|
||||||
|
.addValue("purchase_order_quantity_required", purchaseOrderCTP.getPurchaseOrderQuantityRequired())
|
||||||
|
.addValue("article_name", purchaseOrderCTP.getArticleName())
|
||||||
|
.addValue("created_by", purchaseOrderCTP.getCreatedBy())
|
||||||
|
.addValue("status", purchaseOrderCTP.getStatus());
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// find
|
||||||
|
public PurchaseOrderCTP find(long id ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "id", id );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_QUERY, params, new PurchaseOrderCTPRowMapper() )
|
||||||
|
.stream()
|
||||||
|
.findFirst()
|
||||||
|
.orElse( new PurchaseOrderCTP() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// find all
|
||||||
|
public List<PurchaseOrderCTP> findAll() {
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// save
|
||||||
|
public long save( PurchaseOrderCTP PurchaseOrderCTP) {
|
||||||
|
KeyHolder keyHolder = new GeneratedKeyHolder();
|
||||||
|
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
|
||||||
|
namedParameterJdbcTemplate.update( INSERT_QUERY, params, keyHolder );
|
||||||
|
return KeyHolderFunctions.getKey( PurchaseOrderCTP.getId(), keyHolder );
|
||||||
|
}
|
||||||
|
|
||||||
|
// save all
|
||||||
|
public int[] saveAll( List<PurchaseOrderCTP> purchaseOrderCTPS) {
|
||||||
|
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
|
||||||
|
for ( PurchaseOrderCTP PurchaseOrderCTP : purchaseOrderCTPS) {
|
||||||
|
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
|
||||||
|
batchArgs.add( params );
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[purchaseOrderCTPS.size()]) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete
|
||||||
|
public boolean delete( long id ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "id", id );
|
||||||
|
return namedParameterJdbcTemplate.update( DELETE_QUERY, params ) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> findByQuery(String query ){
|
||||||
|
return namedParameterJdbcTemplate.query( query, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> findByUserAndLimit(String createdBy, Long limit ){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("limit", limit.intValue() );
|
||||||
|
params.addValue("created_by", createdBy );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_BY_LIMIT, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> findByAllWithLimit(Long limit){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("limit", limit.intValue());
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY_WITH_LIMIT, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPRowMapper implements RowMapper<PurchaseOrderCTP> {
|
||||||
|
public PurchaseOrderCTP mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
|
PurchaseOrderCTP PurchaseOrderCTP = new PurchaseOrderCTP();
|
||||||
|
PurchaseOrderCTP.setId(rs.getLong("id"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderCode(rs.getString("purchase_order_code"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderQuantity(rs.getInt("purchase_order_quantity"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderQuantityRequired(rs.getInt("purchase_order_quantity_required"));
|
||||||
|
PurchaseOrderCTP.setArticleName(rs.getString("article_name"));
|
||||||
|
if (rs.getTimestamp("created_at") != null) {
|
||||||
|
PurchaseOrderCTP.setCreatedAt(rs.getTimestamp("created_at").toLocalDateTime());
|
||||||
|
}
|
||||||
|
PurchaseOrderCTP.setCreatedBy(rs.getString("created_by"));
|
||||||
|
PurchaseOrderCTP.setStatus(rs.getString("status"));
|
||||||
|
return PurchaseOrderCTP;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ public enum BarcodeStickerSize {
|
||||||
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
|
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
|
||||||
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
|
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
|
||||||
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
|
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
|
||||||
SIZE_1_X_2( 67.69f, 128.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
|
SIZE_1_X_2( 67.69f, 139.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
|
||||||
|
|
||||||
private final float width;
|
private final float width;
|
||||||
private final float height;
|
private final float height;
|
||||||
|
|
|
@ -4,7 +4,7 @@ public class CuttingJobCardItemWrapper {
|
||||||
private long jobCardId;
|
private long jobCardId;
|
||||||
private String poName;
|
private String poName;
|
||||||
private String sku;
|
private String sku;
|
||||||
private Long totalCutting;
|
private Long total;
|
||||||
private String width;
|
private String width;
|
||||||
private String length;
|
private String length;
|
||||||
private String gsm;
|
private String gsm;
|
||||||
|
@ -13,8 +13,8 @@ public class CuttingJobCardItemWrapper {
|
||||||
private String articleName;
|
private String articleName;
|
||||||
private boolean isComplete;
|
private boolean isComplete;
|
||||||
private String jobCardCode;
|
private String jobCardCode;
|
||||||
private String cuttingOperatorName;
|
private String operatorName;
|
||||||
private long cuttingAccountId;
|
private long accountId;
|
||||||
|
|
||||||
public long getJobCardId() {
|
public long getJobCardId() {
|
||||||
return jobCardId;
|
return jobCardId;
|
||||||
|
@ -40,14 +40,6 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.sku = sku;
|
this.sku = sku;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getTotalCutting() {
|
|
||||||
return totalCutting;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalCutting(Long totalCutting) {
|
|
||||||
this.totalCutting = totalCutting;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWidth() {
|
public String getWidth() {
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
@ -104,13 +96,6 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.jobCardCode = jobCardCode;
|
this.jobCardCode = jobCardCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getCuttingAccountId() {
|
|
||||||
return cuttingAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCuttingAccountId(long cuttingAccountId) {
|
|
||||||
this.cuttingAccountId = cuttingAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLength() {
|
public String getLength() {
|
||||||
return length;
|
return length;
|
||||||
|
@ -120,31 +105,47 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.length = length;
|
this.length = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingOperatorName() {
|
public String getOperatorName() {
|
||||||
return cuttingOperatorName;
|
return operatorName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingOperatorName(String cuttingOperatorName) {
|
public void setOperatorName(String operatorName) {
|
||||||
this.cuttingOperatorName = cuttingOperatorName;
|
this.operatorName = operatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(Long total) {
|
||||||
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CuttingJobCardItemWrapper{" +
|
return "CuttingJobCardItemWrapper{" +
|
||||||
"cuttingAccountId=" + cuttingAccountId +
|
"jobCardId=" + jobCardId +
|
||||||
", cuttingOperatorName='" + cuttingOperatorName + '\'' +
|
|
||||||
", jobCardCode='" + jobCardCode + '\'' +
|
|
||||||
", isComplete=" + isComplete +
|
|
||||||
", articleName='" + articleName + '\'' +
|
|
||||||
", ply='" + ply + '\'' +
|
|
||||||
", wtPly='" + wtPly + '\'' +
|
|
||||||
", gsm='" + gsm + '\'' +
|
|
||||||
", length='" + length + '\'' +
|
|
||||||
", width='" + width + '\'' +
|
|
||||||
", totalCutting=" + totalCutting +
|
|
||||||
", sku='" + sku + '\'' +
|
|
||||||
", poName='" + poName + '\'' +
|
", poName='" + poName + '\'' +
|
||||||
", jobCardId=" + jobCardId +
|
", sku='" + sku + '\'' +
|
||||||
|
", total=" + total +
|
||||||
|
", width='" + width + '\'' +
|
||||||
|
", length='" + length + '\'' +
|
||||||
|
", gsm='" + gsm + '\'' +
|
||||||
|
", wtPly='" + wtPly + '\'' +
|
||||||
|
", ply='" + ply + '\'' +
|
||||||
|
", articleName='" + articleName + '\'' +
|
||||||
|
", isComplete=" + isComplete +
|
||||||
|
", jobCardCode='" + jobCardCode + '\'' +
|
||||||
|
", operatorName='" + operatorName + '\'' +
|
||||||
|
", accountId=" + accountId +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ public enum InventoryArtifactType {
|
||||||
BUNDLE,
|
BUNDLE,
|
||||||
STITCHING_OFFLINE,
|
STITCHING_OFFLINE,
|
||||||
FINISHED_ITEM,
|
FINISHED_ITEM,
|
||||||
STITCH_BUNDLE
|
STITCH_BUNDLE,
|
||||||
|
PACKAGING
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class PackagingItems implements InventoryArtifact {
|
||||||
|
private long id;
|
||||||
|
private long itemId;
|
||||||
|
private String sku;
|
||||||
|
private String barcode;
|
||||||
|
private long jobCardId;
|
||||||
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String createdBy;
|
||||||
|
private boolean isQa;
|
||||||
|
private long finishedItemId;
|
||||||
|
private boolean isSegregated;
|
||||||
|
// wrapper
|
||||||
|
private JobCard jobCard;
|
||||||
|
private long accountId;
|
||||||
|
private String qaStatus;
|
||||||
|
private long bundleId;
|
||||||
|
private String accountTitle;
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(long itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getJobCardId() {
|
||||||
|
return jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobCardId(long jobCardId) {
|
||||||
|
this.jobCardId = jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsQa() {
|
||||||
|
return isQa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsQa(boolean qa) {
|
||||||
|
isQa = qa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFinishedItemId() {
|
||||||
|
return finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishedItemId(long finishedItemId) {
|
||||||
|
this.finishedItemId = finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JobCard getJobCard() {
|
||||||
|
return jobCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobCard(JobCard jobCard) {
|
||||||
|
this.jobCard = jobCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsSegregated() {
|
||||||
|
return isSegregated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsSegregated(boolean segregated) {
|
||||||
|
isSegregated = segregated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQaStatus() {
|
||||||
|
return qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQaStatus(String qaStatus) {
|
||||||
|
this.qaStatus = qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getWrapQuantity(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMasterBundleId(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getBundleId(){
|
||||||
|
return bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundleId(long bundleId) {
|
||||||
|
this.bundleId = bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccountTitle() {
|
||||||
|
return accountTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountTitle(String accountTitle) {
|
||||||
|
this.accountTitle = accountTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PackagingItems{" +
|
||||||
|
"id=" + id +
|
||||||
|
", itemId=" + itemId +
|
||||||
|
", sku='" + sku + '\'' +
|
||||||
|
", barcode='" + barcode + '\'' +
|
||||||
|
", jobCardId=" + jobCardId +
|
||||||
|
", createdAt=" + createdAt +
|
||||||
|
", createdBy='" + createdBy + '\'' +
|
||||||
|
", isQa=" + isQa +
|
||||||
|
", finishedItemId=" + finishedItemId +
|
||||||
|
", isSegregated=" + isSegregated +
|
||||||
|
", jobCard=" + jobCard +
|
||||||
|
", accountId=" + accountId +
|
||||||
|
", qaStatus='" + qaStatus + '\'' +
|
||||||
|
", bundleId=" + bundleId +
|
||||||
|
", accountTitle='" + accountTitle + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class PackagingItemsRowMapper implements RowMapper<PackagingItems> {
|
||||||
|
@Override
|
||||||
|
public PackagingItems mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
|
PackagingItems item = new PackagingItems();
|
||||||
|
item.setId(rs.getLong("id"));
|
||||||
|
item.setItemId(rs.getLong("item_id"));
|
||||||
|
item.setSku(rs.getString("sku"));
|
||||||
|
item.setBarcode(rs.getString("barcode"));
|
||||||
|
item.setJobCardId(rs.getLong("job_card_id"));
|
||||||
|
item.setCreatedAt(rs.getTimestamp("created_at") != null ? rs.getTimestamp("created_at").toLocalDateTime() : null);
|
||||||
|
item.setCreatedBy(rs.getString("created_by"));
|
||||||
|
item.setIsQa(rs.getBoolean("is_qa"));
|
||||||
|
item.setFinishedItemId(rs.getLong("finish_item_id"));
|
||||||
|
item.setIsSegregated(rs.getBoolean("is_segregated"));
|
||||||
|
item.setAccountId(rs.getLong("account_id"));
|
||||||
|
item.setQaStatus(rs.getString("qa_status"));
|
||||||
|
item.setBundleId(rs.getLong("bundle_id"));
|
||||||
|
item.setAccountTitle(rs.getString("account_title"));
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTP {
|
||||||
|
|
||||||
|
public enum Status{
|
||||||
|
DRAFT,
|
||||||
|
POSTED,
|
||||||
|
}
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private String purchaseOrderCode;
|
||||||
|
private long purchaseOrderQuantity;
|
||||||
|
private long purchaseOrderQuantityRequired;
|
||||||
|
private String articleName;
|
||||||
|
private String createdBy;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPurchaseOrderCode() {
|
||||||
|
return purchaseOrderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderCode(String purchaseOrderCode) {
|
||||||
|
this.purchaseOrderCode = purchaseOrderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPurchaseOrderQuantity() {
|
||||||
|
return purchaseOrderQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderQuantity(long purchaseOrderQuantity) {
|
||||||
|
this.purchaseOrderQuantity = purchaseOrderQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPurchaseOrderQuantityRequired() {
|
||||||
|
return purchaseOrderQuantityRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderQuantityRequired(long purchaseOrderQuantityRequired) {
|
||||||
|
this.purchaseOrderQuantityRequired = purchaseOrderQuantityRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArticleName() {
|
||||||
|
return articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleName(String articleName) {
|
||||||
|
this.articleName = articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.utopiaindustries.querybuilder.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.querybuilder.QueryBuilder;
|
||||||
|
import com.utopiaindustries.util.CTPDateTimeFormat;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPQueryBuilder {
|
||||||
|
public static String buildQuery(String purchaseOrderCode, String articleName, String createdBy, String startDate, String endDate, Long count ){
|
||||||
|
// format date
|
||||||
|
String formattedDate;
|
||||||
|
String formattedEndDate;
|
||||||
|
String startDate1 = "";
|
||||||
|
String endDate1 = "";
|
||||||
|
String purchaseOrderCode1 = purchaseOrderCode == null ? "" : purchaseOrderCode;
|
||||||
|
String articleName1 = articleName == null ? "" : articleName;
|
||||||
|
if ( ! StringUtils.isNullOrEmpty( startDate ) ) {
|
||||||
|
formattedDate = CTPDateTimeFormat.getMySQLFormattedDateString( startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
|
||||||
|
formattedEndDate = CTPDateTimeFormat.getMySQLFormattedDateString( endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
|
||||||
|
startDate1 = String.format( "'%s 00:00:01'", formattedDate );
|
||||||
|
if ( ! StringUtils.isNullOrEmpty( endDate ) ) {
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEndDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", LocalDate.now() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (new QueryBuilder())
|
||||||
|
.setTable("cut_to_pack.purchase_order")
|
||||||
|
.setColumns("*")
|
||||||
|
.where()
|
||||||
|
.columnEquals("created_by", createdBy)
|
||||||
|
.and()
|
||||||
|
.columnLike("purchase_order_code", "%" + purchaseOrderCode1 + "%")
|
||||||
|
.and()
|
||||||
|
.columnLike("article_name", articleName)
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrGreaterThan("created_at", startDate1)
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrLessThan("created_at", endDate1)
|
||||||
|
.limit(count.intValue())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
public class StichedOfflineItemQueryBuilder {
|
public class StichedOfflineItemQueryBuilder {
|
||||||
|
|
||||||
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count) {
|
public static String buildQuery(String id, String itemId, String sku, String QaStatus,String createdStartDate, String createdEndDate, Long bundleId, Long count) {
|
||||||
// format date
|
// format date
|
||||||
String formattedDate;
|
String formattedDate;
|
||||||
String formattedEndDate;
|
String formattedEndDate;
|
||||||
|
@ -24,8 +24,7 @@ public class StichedOfflineItemQueryBuilder {
|
||||||
endDate1 = String.format("'%s 23:59:59'", LocalDate.now());
|
endDate1 = String.format("'%s 23:59:59'", LocalDate.now());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QueryBuilder qb = (new QueryBuilder())
|
||||||
return ( new QueryBuilder() )
|
|
||||||
.setTable("cut_to_pack.stitching_offline_item")
|
.setTable("cut_to_pack.stitching_offline_item")
|
||||||
.setColumns("*")
|
.setColumns("*")
|
||||||
.where()
|
.where()
|
||||||
|
@ -39,11 +38,14 @@ public class StichedOfflineItemQueryBuilder {
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrGreaterThan("created_at", startDate1)
|
.columnEqualToOrGreaterThan("created_at", startDate1)
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrLessThan("created_at", endDate1 )
|
.columnEqualToOrLessThan("created_at", endDate1);
|
||||||
.orderBy("id","DESC")
|
if (!StringUtils.isNullOrEmpty(QaStatus)) {
|
||||||
.limit(count)
|
qb.and().columnEquals("qa_status", QaStatus);
|
||||||
.build();
|
}
|
||||||
|
qb.orderBy("id", "DESC")
|
||||||
|
.limit(count);
|
||||||
|
|
||||||
|
return qb.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,11 @@ public class SummaryInventoryReportQueryBuilder {
|
||||||
|
|
||||||
public static String cuttingQueryBuild(long jobCardId,
|
public static String cuttingQueryBuild(long jobCardId,
|
||||||
List<Long> account,
|
List<Long> account,
|
||||||
|
String sku,
|
||||||
String startDate,
|
String startDate,
|
||||||
String endDate,String type) {
|
String endDate,
|
||||||
|
String type,
|
||||||
|
String parentDocumentType) {
|
||||||
|
|
||||||
QueryBuilder qb = new QueryBuilder()
|
QueryBuilder qb = new QueryBuilder()
|
||||||
.setTable(TABLE_NAME)
|
.setTable(TABLE_NAME)
|
||||||
|
@ -84,11 +87,17 @@ public class SummaryInventoryReportQueryBuilder {
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrLessThan("transaction_leg_datetime",endDate)
|
.columnEqualToOrLessThan("transaction_leg_datetime",endDate)
|
||||||
.and()
|
.and()
|
||||||
.columnEquals("type",type);
|
.columnEquals("type",type)
|
||||||
|
.and()
|
||||||
|
.columnEquals("parent_document_type",parentDocumentType);
|
||||||
if (jobCardId != 0){
|
if (jobCardId != 0){
|
||||||
qb.and()
|
qb.and()
|
||||||
.columnEquals("job_card_id", jobCardId );
|
.columnEquals("job_card_id", jobCardId );
|
||||||
}
|
}
|
||||||
|
if (!StringUtils.isNullOrEmpty(sku)){
|
||||||
|
qb.and()
|
||||||
|
.columnEquals("sku", sku );
|
||||||
|
}
|
||||||
return qb.build();
|
return qb.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,4 +24,9 @@ public class FinishedItemRestController {
|
||||||
@RequestParam( "is-segregated") boolean isSegregated ){
|
@RequestParam( "is-segregated") boolean isSegregated ){
|
||||||
return finishedItemDAO.findByTerm( term, isSegregated );
|
return finishedItemDAO.findByTerm( term, isSegregated );
|
||||||
}
|
}
|
||||||
|
@GetMapping( "/search-packaging" )
|
||||||
|
public List<FinishedItem> searchFinishedItemsForPackaging(@RequestParam( "term") String term,
|
||||||
|
@RequestParam( "is-segregated") boolean isSegregated ){
|
||||||
|
return finishedItemDAO.findByTerm( term, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,7 @@ public class BarcodeService {
|
||||||
float qrY =stickerSize.getMarginLeft()+50 ;
|
float qrY =stickerSize.getMarginLeft()+50 ;
|
||||||
float qrX = stickerSize.getMarginTop();
|
float qrX = stickerSize.getMarginTop();
|
||||||
|
|
||||||
qrCodeImage.setFixedPosition(qrX - 16, qrY-40);
|
qrCodeImage.setFixedPosition(qrX - 16, qrY-35);
|
||||||
document.add(qrCodeImage);
|
document.add(qrCodeImage);
|
||||||
|
|
||||||
float textX = stickerSize.getMarginLeft() + 40;
|
float textX = stickerSize.getMarginLeft() + 40;
|
||||||
|
@ -323,18 +323,33 @@ public class BarcodeService {
|
||||||
String combinedText = sku + " \\ " + jobCardCode + " \\ " + artifact.getBundleId();
|
String combinedText = sku + " \\ " + jobCardCode + " \\ " + artifact.getBundleId();
|
||||||
combinedText = combinedText.replaceAll("\\s+", "");
|
combinedText = combinedText.replaceAll("\\s+", "");
|
||||||
|
|
||||||
int maxLength = 14;
|
int maxLength = 12;
|
||||||
|
int start = 0;
|
||||||
|
int lineCount = 0;
|
||||||
List<String> lines = new ArrayList<>();
|
List<String> lines = new ArrayList<>();
|
||||||
for (int i = 0; i < 5; i++) {
|
|
||||||
int start = i * maxLength;
|
while (start < combinedText.length() && lineCount < 5) {
|
||||||
if (start < combinedText.length()) {
|
int end = Math.min(start + maxLength, combinedText.length());
|
||||||
String part = combinedText.substring(start, Math.min(start + maxLength, combinedText.length())).replaceAll("\\s+", "");
|
String part = combinedText.substring(start, end);
|
||||||
lines.add(part);
|
|
||||||
|
if (part.matches(".*[^a-zA-Z0-9 ].*")) {
|
||||||
|
if(combinedText.length() - start<=17 && combinedText.length() - start>0){
|
||||||
|
end = Math.min(start + maxLength + 5, combinedText.length());
|
||||||
|
part = combinedText.substring(start, end);
|
||||||
|
}else {
|
||||||
|
end = Math.min(start + maxLength + 3, combinedText.length());
|
||||||
|
part = combinedText.substring(start, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part = part.replaceAll("\\s+", "");
|
||||||
|
lines.add(part);
|
||||||
|
start = end;
|
||||||
|
lineCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float labelWidth = 67.69f;
|
float labelWidth = 67.69f;
|
||||||
float textBoxWidth = 220;
|
float textBoxWidth = 120f;
|
||||||
float textY1 = textY-23;
|
float textY1 = textY-23;
|
||||||
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
|
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
|
||||||
|
|
||||||
|
@ -343,21 +358,26 @@ public class BarcodeService {
|
||||||
.setFontColor(ColorConstants.BLACK)
|
.setFontColor(ColorConstants.BLACK)
|
||||||
.setFontSize(stickerSize.getTextSize()+2)
|
.setFontSize(stickerSize.getTextSize()+2)
|
||||||
.setTextAlignment(TextAlignment.CENTER)
|
.setTextAlignment(TextAlignment.CENTER)
|
||||||
.setFixedPosition(textXCenter, textY1-18, textBoxWidth);
|
.setFixedPosition(textXCenter, textY1-13, textBoxWidth);
|
||||||
|
|
||||||
document.add(rotatedText);
|
document.add(rotatedText);
|
||||||
textY1 -= 6;
|
textY1 -= 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER_OBLIQUE);
|
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER);
|
||||||
String id = String.valueOf(artifact.getId());
|
String id = String.valueOf(artifact.getId());
|
||||||
|
float textSize = stickerSize.getTextSize() + 6;
|
||||||
|
float charWidth = textSize * 0.6f;
|
||||||
|
float idWidth = id.length() * charWidth;
|
||||||
|
float xCentered = (labelWidth / 2f) - (idWidth / 2f);
|
||||||
|
|
||||||
document.add(new Paragraph(id)
|
document.add(new Paragraph(id)
|
||||||
.setFont(font)
|
.setFont(font)
|
||||||
.setBold()
|
.setBold()
|
||||||
.setFontColor(ColorConstants.BLACK)
|
.setFontColor(ColorConstants.BLACK)
|
||||||
.setFontSize(stickerSize.getTextSize() + 8)
|
.setFontSize(textSize)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setFixedPosition(xCentered, textY + 18, 100));
|
||||||
.setFixedPosition(textX - 25, textY + 13, 100));
|
|
||||||
|
|
||||||
float dottedLine = textY - 65;
|
float dottedLine = textY - 65;
|
||||||
for(int i= 0 ;i<16;i++){
|
for(int i= 0 ;i<16;i++){
|
||||||
|
@ -367,7 +387,7 @@ public class BarcodeService {
|
||||||
.setBold()
|
.setBold()
|
||||||
.setRotationAngle(-Math.PI / 2)
|
.setRotationAngle(-Math.PI / 2)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setTextAlignment(TextAlignment.LEFT)
|
||||||
.setFixedPosition(dottedLine,textX+45, 100));
|
.setFixedPosition(dottedLine,textX+55, 100));
|
||||||
|
|
||||||
dottedLine += 7;
|
dottedLine += 7;
|
||||||
}
|
}
|
||||||
|
@ -380,7 +400,7 @@ public class BarcodeService {
|
||||||
.setBold()
|
.setBold()
|
||||||
.setRotationAngle(-Math.PI / 2)
|
.setRotationAngle(-Math.PI / 2)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setTextAlignment(TextAlignment.LEFT)
|
||||||
.setFixedPosition(dottedLine2,textX+80, 100));
|
.setFixedPosition(dottedLine2,textX+90, 100));
|
||||||
|
|
||||||
dottedLine2 += 7;
|
dottedLine2 += 7;
|
||||||
}
|
}
|
||||||
|
@ -389,9 +409,11 @@ public class BarcodeService {
|
||||||
document.add(new AreaBreak());
|
document.add(new AreaBreak());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdfDoc.getNumberOfPages() > artifacts.size()) {
|
if (pdfDoc.getNumberOfPages() > artifacts.size()) {
|
||||||
pdfDoc.removePage(pdfDoc.getNumberOfPages());
|
pdfDoc.removePage(pdfDoc.getNumberOfPages());
|
||||||
}
|
}
|
||||||
|
|
||||||
document.close();
|
document.close();
|
||||||
sendPdfToZebraPrinter(pdfPath.toFile());
|
sendPdfToZebraPrinter(pdfPath.toFile());
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,13 +125,13 @@ public class BundleService {
|
||||||
/*
|
/*
|
||||||
* find finished Items by params
|
* find finished Items by params
|
||||||
* */
|
* */
|
||||||
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
|
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku,String status, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
|
||||||
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
|
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
|
||||||
if( count == null ){
|
if( count == null ){
|
||||||
count = 100L;
|
count = 100L;
|
||||||
}
|
}
|
||||||
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){
|
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){
|
||||||
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleId , count );
|
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, status,createdStartDate, createdEndDate, bundleId , count );
|
||||||
System.out.println( query );
|
System.out.println( query );
|
||||||
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -28,8 +28,9 @@ public class InventoryService {
|
||||||
private final MasterBundleDAO masterBundleDAO;
|
private final MasterBundleDAO masterBundleDAO;
|
||||||
private final FinishedItemDAO finishedItemDAO;
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
public InventoryService( JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO) {
|
public InventoryService(JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, PackagingItemsDAO packagingItemsDAO) {
|
||||||
this.jobCardItemDAO = jobCardItemDAO;
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
this.cutPieceDAO = cutPieceDAO;
|
this.cutPieceDAO = cutPieceDAO;
|
||||||
this.bundleDAO = bundleDAO;
|
this.bundleDAO = bundleDAO;
|
||||||
|
@ -40,6 +41,7 @@ public class InventoryService {
|
||||||
this.masterBundleDAO = masterBundleDAO;
|
this.masterBundleDAO = masterBundleDAO;
|
||||||
this.finishedItemDAO = finishedItemDAO;
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateJobCardInventoryStatus( JobCard card ){
|
private void updateJobCardInventoryStatus( JobCard card ){
|
||||||
|
@ -601,27 +603,93 @@ public class InventoryService {
|
||||||
* item is approved and grade is selected then fI is move to grade account
|
* item is approved and grade is selected then fI is move to grade account
|
||||||
*/
|
*/
|
||||||
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getAccountId( ) != 0) {
|
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getAccountId( ) != 0) {
|
||||||
|
finishedItem.setIsSegregated( true);
|
||||||
|
}
|
||||||
|
updatedItems.add( finishedItem);
|
||||||
|
}
|
||||||
|
// save finish items
|
||||||
|
finishedItemDAO.saveAll( updatedItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Packaging items
|
||||||
|
* */
|
||||||
|
@Transactional( rollbackFor = Exception.class, propagation = Propagation.NESTED )
|
||||||
|
public void createPackagingItemAndTransaction( FinishedItemWrapper wrapper) {
|
||||||
|
if ( wrapper != null && wrapper.getItems( ) != null) {
|
||||||
|
|
||||||
|
List<FinishedItem> items = wrapper.getItems( );
|
||||||
|
List<FinishedItem> updatedItems = new ArrayList<>( );
|
||||||
|
List<PackagingItems> packagingItems = new ArrayList<>( );
|
||||||
|
// finished ids
|
||||||
|
List<Long> finishedItemIds = items.stream( ).map( FinishedItem::getId)
|
||||||
|
.collect( Collectors.toList( ));
|
||||||
|
// stitched ids
|
||||||
|
List<Long> stitchedItemIds = items.stream( ).map( FinishedItem::getStitchedItemId)
|
||||||
|
.collect( Collectors.toList( ));
|
||||||
|
|
||||||
|
// find parent doc type last IN transaction map
|
||||||
|
Map<Long, InventoryTransactionLeg> lastFinishedItemIdInTransactionMap = inventoryTransactionLegDAO
|
||||||
|
.findLastTransactionByParentIdAndParentType( InventoryTransactionLeg.Type.IN.name( ), finishedItemIds, InventoryArtifactType.FINISHED_ITEM.name( ))
|
||||||
|
.stream( )
|
||||||
|
.collect( Collectors.toMap( InventoryTransactionLeg::getParentDocumentId, Function.identity( )));
|
||||||
|
|
||||||
|
// create transaction
|
||||||
|
InventoryTransaction transaction = createInventoryTransaction( "Against Segregation of Finished Items");
|
||||||
|
|
||||||
|
|
||||||
|
// create IN and OUT for all approved items
|
||||||
|
for ( FinishedItem finishedItem : items) {
|
||||||
|
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault( finishedItem.getId( ), null);
|
||||||
|
finishedItem.setIsQa( true);
|
||||||
|
|
||||||
|
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getIsSegregated( )) {
|
||||||
// create OUT and IN transactions for FI
|
// create OUT and IN transactions for FI
|
||||||
|
PackagingItems packagingItems1 = (createPackagingItem(finishedItem));
|
||||||
|
packagingItems1.setId(packagingItemsDAO.save(packagingItems1));
|
||||||
if ( lastInvTransaction != null) {
|
if ( lastInvTransaction != null) {
|
||||||
// OUT
|
// OUT
|
||||||
long fromAccount = lastInvTransaction.getAccountId( );
|
long fromAccount = lastInvTransaction.getAccountId( );
|
||||||
createInventoryTransactionLeg( transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
createInventoryTransactionLeg( transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
||||||
// IN
|
// IN
|
||||||
createInventoryTransactionLeg( transaction, finishedItem, finishedItem.getAccountId( ), InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
createInventoryTransactionLeg( transaction, packagingItems1, 8, InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.PACKAGING.name( ));
|
||||||
}
|
}
|
||||||
finishedItem.setIsSegregated( true);
|
finishedItem.setIsSegregated( true);
|
||||||
|
packagingItems.add(packagingItems1);
|
||||||
}
|
}
|
||||||
updatedItems.add( finishedItem);
|
updatedItems.add( finishedItem);
|
||||||
}
|
}
|
||||||
finishedItemDAO.saveAll( updatedItems);
|
|
||||||
// save finish items
|
// save finish items
|
||||||
|
finishedItemDAO.saveAll( updatedItems);
|
||||||
|
System.out.println(packagingItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find item summary by account
|
* find item summary by account
|
||||||
* */
|
* */
|
||||||
public List<InventorySummary> findItemSummaryByAccountId( long accountId) {
|
public List<InventorySummary> findItemSummaryByAccountId( long accountId) {
|
||||||
return inventoryTransactionLegDAO.findSummaryByAccountId( accountId);
|
return inventoryTransactionLegDAO.findSummaryByAccountId( accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PackagingItems createPackagingItem(FinishedItem finishedItem){
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext( ).getAuthentication( );
|
||||||
|
PackagingItems packagingItems = new PackagingItems();
|
||||||
|
packagingItems.setItemId(finishedItem.getItemId());
|
||||||
|
packagingItems.setAccountId(finishedItem.getAccountId());
|
||||||
|
packagingItems.setFinishedItemId(finishedItem.getId());
|
||||||
|
packagingItems.setJobCardId(finishedItem.getJobCardId());
|
||||||
|
packagingItems.setJobCard(finishedItem.getJobCard());
|
||||||
|
packagingItems.setSku(finishedItem.getSku());
|
||||||
|
packagingItems.setBarcode(finishedItem.getBarcode());
|
||||||
|
packagingItems.setCreatedAt(LocalDateTime.now());
|
||||||
|
packagingItems.setCreatedBy(authentication.getName( ));
|
||||||
|
packagingItems.setIsQa(finishedItem.getIsQa());
|
||||||
|
packagingItems.setIsSegregated(finishedItem.getIsSegregated());
|
||||||
|
packagingItems.setQaStatus(finishedItem.getQaStatus());
|
||||||
|
return packagingItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.PackagingItemsDAO;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PackagingService {
|
||||||
|
|
||||||
|
private final InventoryService inventoryService;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
|
public PackagingService(InventoryService inventoryService, PackagingItemsDAO packagingItemsDAO) {
|
||||||
|
this.inventoryService = inventoryService;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createPackagingItem(FinishedItemWrapper wrapper){
|
||||||
|
inventoryService.createPackagingItemAndTransaction(wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.PurchaseOrderCTPDao;
|
||||||
|
import com.utopiaindustries.model.ctp.*;
|
||||||
|
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
|
||||||
|
import com.utopiaindustries.querybuilder.ctp.PurchaseOrderCTPQueryBuilder;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PurchaseOrderCTPService {
|
||||||
|
|
||||||
|
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
|
||||||
|
|
||||||
|
public PurchaseOrderCTPService(PurchaseOrderCTPDao purchaseOrderCTPDao) {
|
||||||
|
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search by id
|
||||||
|
* */
|
||||||
|
public PurchaseOrderCTP searchPurchaseOrderById(long id){
|
||||||
|
return purchaseOrderCTPDao.find(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* create new job card
|
||||||
|
* */
|
||||||
|
public PurchaseOrderCTP createNewPurchaseOrderCTP() {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
PurchaseOrderCTP purchaseOrderCTP = new PurchaseOrderCTP();
|
||||||
|
purchaseOrderCTP.setCreatedBy( authentication.getName() );
|
||||||
|
purchaseOrderCTP.setCreatedAt( LocalDateTime.now() );
|
||||||
|
return purchaseOrderCTP;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* save card
|
||||||
|
* */
|
||||||
|
@Transactional( rollbackFor = Exception.class )
|
||||||
|
public void save(PurchaseOrderCTP purchaseOrderCTP) {
|
||||||
|
purchaseOrderCTPDao.save(purchaseOrderCTP);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> getAllPurchaseOrderCtp(String purchaseOrderCode, String articleName, String StartDate, String EndDate, Long limit) {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
List<PurchaseOrderCTP> list = new ArrayList<>();
|
||||||
|
String createdBy = authentication.getName();
|
||||||
|
if( limit == null ){
|
||||||
|
limit = 100L;
|
||||||
|
}
|
||||||
|
if( !StringUtils.isAnyNotNullOrEmpty(purchaseOrderCode, articleName) ){
|
||||||
|
for (GrantedAuthority role : authentication.getAuthorities()){
|
||||||
|
if (role.toString().equals("ROLE_ADMIN")){
|
||||||
|
createdBy = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String query = PurchaseOrderCTPQueryBuilder.buildQuery(purchaseOrderCode, articleName, createdBy, StartDate, EndDate, limit );
|
||||||
|
System.out.println( query );
|
||||||
|
list = purchaseOrderCTPDao.findByQuery( query );
|
||||||
|
}else {
|
||||||
|
list = purchaseOrderCTPDao.findByUserAndLimit( authentication.getName(), limit );
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -32,8 +32,9 @@ public class ReportingService {
|
||||||
private final FinishedItemDAO finishedItemDAO;
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
private final InventoryAccountDAO inventoryAccountDAO;
|
private final InventoryAccountDAO inventoryAccountDAO;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
public ReportingService( JobCardItemDAO jobCardItemDAO, ProcessDAO processDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO) {
|
public ReportingService(JobCardItemDAO jobCardItemDAO, ProcessDAO processDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PackagingItemsDAO packagingItemsDAO) {
|
||||||
this.jobCardItemDAO = jobCardItemDAO;
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
this.processDAO = processDAO;
|
this.processDAO = processDAO;
|
||||||
this.bundleDAO = bundleDAO;
|
this.bundleDAO = bundleDAO;
|
||||||
|
@ -45,6 +46,7 @@ public class ReportingService {
|
||||||
this.finishedItemDAO = finishedItemDAO;
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
this.inventoryAccountDAO = inventoryAccountDAO;
|
this.inventoryAccountDAO = inventoryAccountDAO;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Integer> getJobCardProgress(String jobCardID) {
|
public Map<String, Integer> getJobCardProgress(String jobCardID) {
|
||||||
|
@ -213,8 +215,14 @@ public class ReportingService {
|
||||||
HashMap<String,Integer> gradingItems = new HashMap<>();
|
HashMap<String,Integer> gradingItems = new HashMap<>();
|
||||||
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
|
||||||
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
|
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
|
||||||
|
List<PackagingItems> packagingItems = packagingItemsDAO.findByJobCardId(Long.parseLong(jobCardID));
|
||||||
|
|
||||||
List<Long> finishItemsIds = finishedItems.stream()
|
List<Long> finishItemsIds = finishedItems.stream()
|
||||||
.map(FinishedItem::getId).collect(Collectors.toList());
|
.map(FinishedItem::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<Long> packagingItemsIds = packagingItems.stream()
|
||||||
|
.map(PackagingItems::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
if (finishItemsIds.isEmpty()){
|
if (finishItemsIds.isEmpty()){
|
||||||
gradingItems.put("A GRADE",0);
|
gradingItems.put("A GRADE",0);
|
||||||
gradingItems.put("B GRADE",0);
|
gradingItems.put("B GRADE",0);
|
||||||
|
@ -222,9 +230,14 @@ public class ReportingService {
|
||||||
return gradingItems;
|
return gradingItems;
|
||||||
}else {
|
}else {
|
||||||
for (InventoryAccount inventoryAccount : inventoryAccounts){
|
for (InventoryAccount inventoryAccount : inventoryAccounts){
|
||||||
|
if (inventoryAccount.getIsPackaging()){
|
||||||
|
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(packagingItemsIds,(int) inventoryAccount.getId());
|
||||||
|
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
|
||||||
|
}else {
|
||||||
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(finishItemsIds,(int) inventoryAccount.getId());
|
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(finishItemsIds,(int) inventoryAccount.getId());
|
||||||
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
|
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return gradingItems;
|
return gradingItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,6 +384,8 @@ public class ReportingService {
|
||||||
if (jobCardID == null) {
|
if (jobCardID == null) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS",6L);
|
||||||
|
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(Long.parseLong(jobCardID));
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(Long.parseLong(jobCardID));
|
||||||
BigDecimal actualProduction = jobCardItems.stream()
|
BigDecimal actualProduction = jobCardItems.stream()
|
||||||
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
||||||
|
@ -426,7 +441,8 @@ public class ReportingService {
|
||||||
qualityList.set(index, 0);
|
qualityList.set(index, 0);
|
||||||
}
|
}
|
||||||
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
|
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
|
||||||
}else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(8) || leg.getAccountId().equals(9) || leg.getAccountId().equals(10))) {
|
}
|
||||||
|
else if ("PACKAGING".equals(leg.getParentDocumentType()) && inventoryAccounts.stream().anyMatch(e -> e.getId() == leg.getAccountId().longValue())) {
|
||||||
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
|
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
|
||||||
finishItems.set(index, 0);
|
finishItems.set(index, 0);
|
||||||
}
|
}
|
||||||
|
@ -618,7 +634,7 @@ public class ReportingService {
|
||||||
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
|
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
|
||||||
}
|
}
|
||||||
|
|
||||||
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, startDate1, endDate1, "IN");
|
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, null, startDate1, endDate1, "IN","BUNDLE");
|
||||||
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
||||||
|
|
||||||
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
||||||
|
@ -670,15 +686,15 @@ public class ReportingService {
|
||||||
wrapper.setGsm(item.getGsm());
|
wrapper.setGsm(item.getGsm());
|
||||||
wrapper.setPly(item.getPly());
|
wrapper.setPly(item.getPly());
|
||||||
wrapper.setSku(item.getSku());
|
wrapper.setSku(item.getSku());
|
||||||
wrapper.setTotalCutting(item.getActualProduction().longValue());
|
wrapper.setTotal(item.getActualProduction().longValue());
|
||||||
wrapper.setWidth(item.getWidth());
|
wrapper.setWidth(item.getWidth());
|
||||||
wrapper.setWtPly(item.getWtPly());
|
wrapper.setWtPly(item.getWtPly());
|
||||||
wrapper.setComplete(item.isComplete());
|
wrapper.setComplete(item.isComplete());
|
||||||
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
||||||
wrapper.setCuttingOperatorName(bundle.getCreatedBy());
|
wrapper.setOperatorName(bundle.getCreatedBy());
|
||||||
wrapper.setJobCardId(item.getJobCardId());
|
wrapper.setJobCardId(item.getJobCardId());
|
||||||
wrapper.setLength(item.getLength());
|
wrapper.setLength(item.getLength());
|
||||||
wrapper.setCuttingAccountId(accountId);
|
wrapper.setAccountId(accountId);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
@ -691,6 +707,129 @@ public class ReportingService {
|
||||||
return cuttingDetails;
|
return cuttingDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
String endDate1 = null;
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(startDate)) {
|
||||||
|
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
|
||||||
|
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
|
||||||
|
: LocalDate.now().toString();
|
||||||
|
|
||||||
|
startDate1 = String.format("'%s 00:00:01'", formattedStart);
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS", 2L);
|
||||||
|
List<Long> inventoryAccountIds = inventoryAccounts.stream().map(InventoryAccount::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(jobCardId)) {
|
||||||
|
jobCardIdTemp = Long.parseLong(jobCardId);
|
||||||
|
} else if (!StringUtils.isNullOrEmpty(stitchingLine)) {
|
||||||
|
inventoryAccountIds = List.of(Long.parseLong(stitchingLine));
|
||||||
|
}
|
||||||
|
|
||||||
|
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds,null, startDate1, endDate1, "IN","STITCHING_OFFLINE");
|
||||||
|
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
||||||
|
|
||||||
|
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
|
||||||
|
|
||||||
|
Map<LocalDate, List<Long>> dateWiseJobCardIds = inventoryTransactionLegs.stream()
|
||||||
|
.filter(e -> e.getTransactionLegDateTime() != null && e.getJobCardId() != 0)
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
e -> e.getTransactionLegDateTime().toLocalDate(),
|
||||||
|
Collectors.mapping(InventoryTransactionLeg::getJobCardId, Collectors.toList())
|
||||||
|
));
|
||||||
|
|
||||||
|
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
||||||
|
LocalDate date = entry.getKey();
|
||||||
|
List<Long> jobCardIds = entry.getValue();
|
||||||
|
|
||||||
|
if (!jobCardIds.isEmpty()) {
|
||||||
|
int totalProduction = inventoryTransactionLegs.stream()
|
||||||
|
.filter(item -> jobCardIds.contains(item.getJobCardId()) &&
|
||||||
|
"STITCHING_OFFLINE".equals(item.getParentDocumentType()) && item.getTransactionLegDateTime().toLocalDate().equals(date))
|
||||||
|
.mapToInt(item -> item.getQuantity().intValue())
|
||||||
|
.sum();
|
||||||
|
|
||||||
|
dateWiseProduction.put(date.format(formatter), totalProduction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> distinctJobCardIds = inventoryTransactionLegs.stream()
|
||||||
|
.map(InventoryTransactionLeg::getJobCardId)
|
||||||
|
.filter(id -> id != 0)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<Long, List<CuttingJobCardItemWrapper>> jobCardItemsStitchingDetailsMap = new HashMap<>();
|
||||||
|
Map<String, Integer> totalStitchingBasedOnAccountID = new HashMap<>();
|
||||||
|
|
||||||
|
for (long jobCardIdEntry : distinctJobCardIds) {
|
||||||
|
Long accountId = inventoryTransactionLegs.stream()
|
||||||
|
.filter(e -> e.getJobCardId() == jobCardIdEntry)
|
||||||
|
.map(e -> e.getAccountId().longValue())
|
||||||
|
.findFirst()
|
||||||
|
.orElse(0L);
|
||||||
|
|
||||||
|
JobCard jobCard = jobCardDAO.find(jobCardIdEntry);
|
||||||
|
List<StitchingOfflineItem> stitchingOfflineItem = stitchingOfflineItemDAO.findByJobCardId(jobCardIdEntry);
|
||||||
|
|
||||||
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCardIdEntry);
|
||||||
|
|
||||||
|
List<CuttingJobCardItemWrapper> wrappers = jobCardItems.stream().map(item -> {
|
||||||
|
CuttingJobCardItemWrapper wrapper = new CuttingJobCardItemWrapper();
|
||||||
|
wrapper.setArticleName(jobCard.getArticleName());
|
||||||
|
wrapper.setJobCardId(jobCard.getId());
|
||||||
|
wrapper.setJobCardCode(jobCard.getCode());
|
||||||
|
wrapper.setSku(item.getSku());
|
||||||
|
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
||||||
|
wrapper.setJobCardId(item.getJobCardId());
|
||||||
|
wrapper.setOperatorName(stitchingOfflineItem.get(0).getCreatedBy());
|
||||||
|
wrapper.setAccountId(accountId);
|
||||||
|
return wrapper;
|
||||||
|
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
totalStitchingBasedOnAccountID.put(jobCard.getId()+stitchingOfflineItem.get(0).getSku(), stitchingOfflineItem.size());
|
||||||
|
jobCardItemsStitchingDetailsMap.computeIfAbsent(accountId, k -> new ArrayList<>()).addAll(wrappers);
|
||||||
|
}
|
||||||
|
|
||||||
|
stitchingDetails.put("totalStitchingBasedOnAccountID", totalStitchingBasedOnAccountID);
|
||||||
|
stitchingDetails.put("jobCardItemsStitchingDetailsMap", jobCardItemsStitchingDetailsMap);
|
||||||
|
stitchingDetails.put("Date Wise Stitching", dateWiseProduction);
|
||||||
|
|
||||||
|
stitchingDetails.put("stitchingAccount", inventoryAccounts);
|
||||||
|
return stitchingDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(startDate) && !StringUtils.isNullOrEmpty(accountId) && !StringUtils.isNullOrEmpty(jobCardId)) {
|
||||||
|
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
|
||||||
|
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
|
||||||
|
: LocalDate.now().toString();
|
||||||
|
|
||||||
|
startDate1 = String.format("'%s 00:00:01'", formattedStart);
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
|
||||||
|
accountID.add(Long.parseLong(accountId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return stitchingOfflineItemDAO.findByIds(stitchingItemsList);
|
||||||
|
}
|
||||||
|
|
||||||
private StringBuilder generateTime(LocalDateTime startDate, LocalDateTime endDate){
|
private StringBuilder generateTime(LocalDateTime startDate, LocalDateTime endDate){
|
||||||
StringBuilder totalTime = new StringBuilder();
|
StringBuilder totalTime = new StringBuilder();
|
||||||
|
|
|
@ -185,7 +185,12 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
format: '{value}%'
|
format: '{value}%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
legend: {
|
||||||
|
itemStyle: {
|
||||||
|
fontSize: 10-fontSize,
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
},
|
||||||
scrollbar: {
|
scrollbar: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
|
@ -196,7 +201,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initializeGauges();
|
initializeGauges();
|
||||||
function initializeGauges() {
|
function initializeGauges() {
|
||||||
|
|
||||||
|
@ -256,7 +260,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
createBarChart( divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, datesArray, fontSize, maxValue);
|
createBarChart( divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, datesArray, fontSize, maxValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
const cuttingBarChart = document.querySelectorAll('.cuttingBarChart');
|
const cuttingBarChart = document.querySelectorAll('.singleBarChart');
|
||||||
cuttingBarChart.forEach(function (div) {
|
cuttingBarChart.forEach(function (div) {
|
||||||
const title = div.getAttribute('data-title');
|
const title = div.getAttribute('data-title');
|
||||||
const height = div.getAttribute('data-height');
|
const height = div.getAttribute('data-height');
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
},
|
},
|
||||||
methods : {
|
methods : {
|
||||||
onItemSelect: function (id, item) {
|
onItemSelect: function (id, item) {
|
||||||
console.log("wdwawdwwadwwdwda",item.id)
|
|
||||||
this.items.push(item);
|
this.items.push(item);
|
||||||
},
|
},
|
||||||
removeItem: function (index) {
|
removeItem: function (index) {
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
( async function(){
|
||||||
|
|
||||||
|
Vue.prototype.$accounts = window.ctp.accounts;
|
||||||
|
|
||||||
|
Vue.component('finish-item-table',{
|
||||||
|
props : [ 'items' ],
|
||||||
|
methods: {
|
||||||
|
getFormattedDateTime: function (dateTime) {
|
||||||
|
if (!!dateTime) {
|
||||||
|
return dateTime.split('T')[0] + ' ' + dateTime.split('T')[1];
|
||||||
|
}
|
||||||
|
return luxon.DateTime.now().toFormat('yyyy-MM-dd HH:mm:ss');
|
||||||
|
},
|
||||||
|
removeItem: function (index) {
|
||||||
|
this.$emit('remove-item', index)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template : `
|
||||||
|
<table class="table table-bordered bg-white col-sm-12">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Job Card ID</th>
|
||||||
|
<th>Barcode</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(item,index) in items">
|
||||||
|
<td>
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode" >
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].qaStatus'" v-bind:value="item.qaStatus">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].accountId'" v-bind:value="item.accountId">
|
||||||
|
<span> {{item.id}} </span>
|
||||||
|
</td>
|
||||||
|
<td> {{item.itemId}} </td>
|
||||||
|
<td> {{item.sku}} </td>
|
||||||
|
<td> {{item.createdBy}} </td>
|
||||||
|
<td> {{ getFormattedDateTime( item.createdAt) }} </td>
|
||||||
|
<td> {{item.jobCardId}}</td>
|
||||||
|
<td> {{item.barcode}} </td>
|
||||||
|
<td > {{item.qaStatus}} </td>
|
||||||
|
<td>
|
||||||
|
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
|
||||||
|
<i class="bi bi-trash"></i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
`,
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
let app = new Vue({
|
||||||
|
el : '#packagingApp',
|
||||||
|
data : {
|
||||||
|
items : []
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
onItemSelect: function (id, item) {
|
||||||
|
this.items.push(item);
|
||||||
|
},
|
||||||
|
removeItem: function (index) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
},
|
||||||
|
hasDuplicates: function () {
|
||||||
|
const ids = this.items.map(item => item.id);
|
||||||
|
const uniqueIds = new Set(ids);
|
||||||
|
return ids.length !== uniqueIds.size;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted : function () {
|
||||||
|
console.log( this.$accounts )
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})(jQuery)
|
|
@ -31,6 +31,10 @@
|
||||||
<img th:src="@{/img/utopia-industries-white.svg}" class="page-header__logo" alt="Utopia Industries">
|
<img th:src="@{/img/utopia-industries-white.svg}" class="page-header__logo" alt="Utopia Industries">
|
||||||
</a>
|
</a>
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
|
<!-- <li class="nav-item" sec:authorize="hasAnyRole('ROLE_PURCHASE_ORDER', 'ROLE_ADMIN')">-->
|
||||||
|
<!-- <a th:href="@{/purchase-order/}" class="nav-link"-->
|
||||||
|
<!-- th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">Purchase Order</a>-->
|
||||||
|
<!-- </li>-->
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_JOB_CARD', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_JOB_CARD', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/job-cards/}" class="nav-link"
|
<a th:href="@{/job-cards/}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards') ? 'active' : ''}">Job Cards</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards') ? 'active' : ''}">Job Cards</a>
|
||||||
|
@ -91,6 +95,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<!-- second level purchase Order-->
|
||||||
|
<!-- <nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"-->
|
||||||
|
<!-- th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order')}">-->
|
||||||
|
<!-- <ul class="navbar-nav">-->
|
||||||
|
<!-- <li class="nav-item"-->
|
||||||
|
<!-- th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">-->
|
||||||
|
<!-- <a th:href="@{/purchase-order/}" class="nav-link">Cards</a>-->
|
||||||
|
<!-- </li>-->
|
||||||
|
<!-- </ul>-->
|
||||||
|
<!-- </nav>-->
|
||||||
<!-- second level job cards-->
|
<!-- second level job cards-->
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards')}">
|
||||||
|
@ -144,6 +158,10 @@
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/cutting-report') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/cutting-report') ? 'active' : ''}">
|
||||||
<a th:href="@{/reporting/cutting-report}" class="nav-link">Cutting Tables Report</a>
|
<a th:href="@{/reporting/cutting-report}" class="nav-link">Cutting Tables Report</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/stitching-report') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/reporting/stitching-report}" class="nav-link">Stitching Line Report</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item"
|
<li class="nav-item"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/summary') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/summary') ? 'active' : ''}">
|
||||||
<a th:href="@{/reporting/summary}" class="nav-link">Summary</a>
|
<a th:href="@{/reporting/summary}" class="nav-link">Summary</a>
|
||||||
|
@ -204,6 +222,10 @@
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging')}">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/receive-inventory') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/packaging/receive-inventory}" class="nav-link">Receive Inventory</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item"
|
<li class="nav-item"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/inventory-accounts') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/inventory-accounts') ? 'active' : ''}">
|
||||||
<a th:href="@{/packaging/inventory-accounts}" class="nav-link">Inventory Accounts</a>
|
<a th:href="@{/packaging/inventory-accounts}" class="nav-link">Inventory Accounts</a>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<th>Created By</th>
|
<th>Created By</th>
|
||||||
<th>
|
<th>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Barcode</button>
|
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Bundle Barcode</button>
|
||||||
</div>
|
</div>
|
||||||
<div><input type="checkbox" data-checkbox-all></div>
|
<div><input type="checkbox" data-checkbox-all></div>
|
||||||
</th>
|
</th>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<form th:action="@{/cutting/generate-master-barcodes}" method="post">
|
<form th:action="@{/cutting/generate-master-barcodes}" method="post">
|
||||||
<input hidden="hidden" name="artifactType" value="MasterBundle">
|
<input hidden="hidden" name="artifactType" value="MasterBundle">
|
||||||
<table class="table table-striped table-bordered" data-bundle-table
|
<table class="table table-striped table-bordered" data-bundle-table
|
||||||
data-order="[[ 0, "desc" ]]">
|
data-order="[[ 6, "desc" ]]">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<th>Received</th>
|
<th>Received</th>
|
||||||
<th>
|
<th>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button class="btn btn-sm btn-outline-primary" type="submit">Generate
|
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Master
|
||||||
Barcode
|
Barcode
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div th:replace="_notices :: page-notices"></div>
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
<h3 class="pb-2">Receive Inventory</h3>
|
<h3 class="pb-2">Receive Inventory Against Job Card</h3>
|
||||||
<form th:action="@{/cutting/receive-inventory}"
|
<form th:action="@{/cutting/receive-inventory}"
|
||||||
method="POST"
|
method="POST"
|
||||||
id="receiveInvApp"
|
id="receiveInvApp"
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:v-bind="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Segregate Finished Items')"></head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
|
<h3>Receive Finished Items</h3>
|
||||||
|
</div>
|
||||||
|
<form th:action="'/ctp/packaging/packaging-items'" method="post" id="packagingApp">
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<search-item
|
||||||
|
url="/ctp/rest/finished-items/search-packaging"
|
||||||
|
v-on:finished-item-select="onItemSelect">
|
||||||
|
</search-item>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<!-- <label>Packaging Account</label>-->
|
||||||
|
<!-- <select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>-->
|
||||||
|
<!-- <option value="">PLease select</option>-->
|
||||||
|
<!-- <option th:each="account : ${accounts}"-->
|
||||||
|
<!-- th:value="${account.id}"-->
|
||||||
|
<!-- th:text="${account.title}"></option>-->
|
||||||
|
<!-- </select>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<h6 class="mb-3">Search Finished Items</h6>
|
||||||
|
<finish-item-table
|
||||||
|
v-bind:items="items"
|
||||||
|
v-on:remove-item="removeItem"
|
||||||
|
></finish-item-table>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-danger" v-if="hasDuplicates()" >Duplicate Item Selected</div>
|
||||||
|
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
|
||||||
|
<a th:href="@{/finishing/finished-items}" class="btn btn-light">Cancel</a>
|
||||||
|
</form>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
window.ctp.accounts = [[${accounts}]];
|
||||||
|
</script>
|
||||||
|
<script th:src="@{/js/vendor/compressor.min.js}"></script>
|
||||||
|
<script th:src="@{/js/packaging/packaging-item-form.js}"></script>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Home Page')"></head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<div class="col-sm" th:fragment="cardFragment">
|
||||||
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
|
<form th:action="@{ ${purchaseOrderCTP.id} ? ('/purchase-order/edit/' + ${purchaseOrderCTP.id}) : '/purchase-order/edit' }"
|
||||||
|
method="POST"
|
||||||
|
th:object="${purchaseOrderCTP}"
|
||||||
|
id="purchaseOrderApp">
|
||||||
|
<input hidden="hidden" th:field="*{id}">
|
||||||
|
<input hidden="hidden" th:field="*{order}">
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<h6 class="mb-3">Info</h6>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Job Order</label>
|
||||||
|
<input type="number" class="form-control" th:field="*{jobOrderId}" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button class="btn btn-secondary" type="submit" name="user" value="draft" v-bind:disabled="hasEmptyItems()">Save Draft</button>
|
||||||
|
<button class="btn btn-primary" type="submit" name="user" value="post" v-bind:disabled="hasEmptyItems()">Post</button>
|
||||||
|
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -13,7 +13,7 @@
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div th:replace="_notices :: page-notices"></div>
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
<div class="mb-4 d-flex justify-content-between">
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
<h3>Finished Items</h3>
|
<h3>QC Items</h3>
|
||||||
<a th:href="@{/quality-control/qc-finished-item}" class="btn btn-primary">Add Items For QC</a>
|
<a th:href="@{/quality-control/qc-finished-item}" class="btn btn-primary">Add Items For QC</a>
|
||||||
</div>
|
</div>
|
||||||
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,113 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<style>
|
||||||
|
/* Custom CSS for full height and center alignment of span */
|
||||||
|
.vertical-divider {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center; /* Center horizontally */
|
||||||
|
align-items: center; /* Center vertically */
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-divider span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 1px;
|
||||||
|
background-color: #dee2e6;
|
||||||
|
height: 100%; /* Take full height of the parent div */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm mb-4" data-account-tables>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>SKU</th>
|
||||||
|
<th>QR Code</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Bundle Id</th>
|
||||||
|
<th>QA Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="transaction : ${transactions}" th:object="${transaction}">
|
||||||
|
<td th:text="*{id}"></td>
|
||||||
|
<td th:text="*{itemId}"></td>
|
||||||
|
<td th:text="*{sku}"></td>
|
||||||
|
<td th:text="*{barcode}"></td>
|
||||||
|
<td th:text="*{createdBy}"></td>
|
||||||
|
<td th:text="*{createdAt}"></td>
|
||||||
|
<td th:text="*{bundleId}"></td>
|
||||||
|
<td>
|
||||||
|
<span th:if="*{ not isQa}" class="badge badge-danger">NOT PERFORMED</span>
|
||||||
|
<div th:if="*{isQa}">
|
||||||
|
<span class="badge badge-APPROVED">PERFORMED</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- More rows as needed -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h5 th:if="${#lists.size(transactions) == 0}" class="mt-2">No Inventory Transactions 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-account-tables]').each(function () {
|
||||||
|
const $table = $(this);
|
||||||
|
|
||||||
|
// Prevent reinitializing if already done
|
||||||
|
if (!$.fn.DataTable.isDataTable($table)) {
|
||||||
|
$table.DataTable({
|
||||||
|
pageLength: 5,
|
||||||
|
searching: true,
|
||||||
|
lengthChange: false,
|
||||||
|
processing: false,
|
||||||
|
dom: `
|
||||||
|
<'row'<'col-sm-5'B><'col-sm-7'f>>
|
||||||
|
<'row'<'col-sm-12't>>
|
||||||
|
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
|
||||||
|
buttons: [{
|
||||||
|
extend: 'excel',
|
||||||
|
text: '',
|
||||||
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none' // Keep it hidden
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
(async function () {
|
||||||
|
const $selectAllCheckBox = $('[data-checkbox-all]');
|
||||||
|
|
||||||
|
$selectAllCheckBox.change(function () {
|
||||||
|
if ($selectAllCheckBox.prop('checked')) {
|
||||||
|
// When parent checkbox is checked, check all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', true);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// When parent checkbox is unchecked, uncheck all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(jQuery)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -22,7 +22,7 @@
|
||||||
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Cutting Account</label>
|
<label>Select Account</label>
|
||||||
<select class="form-control" name="accountId">
|
<select class="form-control" name="accountId">
|
||||||
<option value="">Please Select</option>
|
<option value="">Please Select</option>
|
||||||
<option th:each="account : ${accounts}"
|
<option th:each="account : ${accounts}"
|
||||||
|
|
|
@ -9,13 +9,10 @@
|
||||||
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
|
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
|
||||||
<div class="col-sm">
|
<div class="col-lg-10">
|
||||||
<table class="table table-striped" data-account-table data-order="[[ 0, "asc" ]]">
|
<div th:if="${cutting.get('Date Wise Cutting') != null}" class="d-flex justify-content-center">
|
||||||
<tbody>
|
<div class="border rounded-3 pt-2 mx-auto overflow-auto" style="height: 560px; width: 80%;">
|
||||||
<tr>
|
<div id="singleBarChart" class="singleBarChart" style="height: 500px; width: 1600px;"
|
||||||
<td th:if="${cutting.get('Date Wise Cutting') != null}" style="padding-left: 150px;">
|
|
||||||
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
|
|
||||||
<div id="cuttingBarChart" class="cuttingBarChart" style="height: 500px; width: 1600px;"
|
|
||||||
th:data-width="1600"
|
th:data-width="1600"
|
||||||
th:data-height="500"
|
th:data-height="500"
|
||||||
th:data-title="'Days Wise Progress'"
|
th:data-title="'Days Wise Progress'"
|
||||||
|
@ -29,11 +26,13 @@
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<div class="mt-3" th:if="${cutting.get('cuttingAccount') != null}"
|
||||||
<tr th:if="${cutting.get('cuttingAccount') != null}" th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
|
th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
|
||||||
<td th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}" class="p-0 text-center">
|
<div th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}"
|
||||||
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center" th:text="${cuttingAccount.title}"></div>
|
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">
|
<table class="table table-bordered mt-2">
|
||||||
<thead class="">
|
<thead class="">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -57,8 +56,8 @@
|
||||||
<td th:text="${wrap.poName}"></td>
|
<td th:text="${wrap.poName}"></td>
|
||||||
<td th:text="${wrap.sku}"></td>
|
<td th:text="${wrap.sku}"></td>
|
||||||
<td th:text="${wrap.articleName}"></td>
|
<td th:text="${wrap.articleName}"></td>
|
||||||
<td th:text="${wrap.totalCutting}"></td>
|
<td th:text="${wrap.total}"></td>
|
||||||
<td th:text="${wrap.cuttingOperatorName}"></td>
|
<td th:text="${wrap.operatorName}"></td>
|
||||||
<td th:text="${wrap.width}"></td>
|
<td th:text="${wrap.width}"></td>
|
||||||
<td th:text="${wrap.length}"></td>
|
<td th:text="${wrap.length}"></td>
|
||||||
<td th:text="${wrap.gsm}"></td>
|
<td th:text="${wrap.gsm}"></td>
|
||||||
|
@ -73,10 +72,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,38 +9,35 @@
|
||||||
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<aside class="col-sm-2" th:replace="/reporting/job-card-report-sidebar :: sidebar"></aside>
|
<aside class="col-sm-2" th:replace="/reporting/job-card-report-sidebar :: sidebar"></aside>
|
||||||
<div class="col-sm">
|
<div class="col-lg-10">
|
||||||
<table class="table " >
|
<div th:if="${jobCardProgress == null}" class="text-center my-5">
|
||||||
<thead>
|
<h2 class="fs-1">Please Select Job Card</h2>
|
||||||
<tr th:if="${jobCardProgress == null}">
|
</div>
|
||||||
<th colspan="5" style="font-size:26px; text-align: center;">Please Select Job card</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<div th:if="${jobCardProgress != null}">
|
||||||
<tr th:if="${jobCardProgress != null }">
|
<div class="border rounded-3 pt-4 ">
|
||||||
<td style="padding:0px;">
|
<h1 class="text-center mb-5">Job Card Report</h1>
|
||||||
<div style="border: 2px solid #d5d8dc; padding: 10px; border-radius: 10px; height: 370px;">
|
|
||||||
<h1 style="text-align: center;">Job Card Report</h1>
|
<div class="row justify-content-center align-items-start">
|
||||||
<div style="display: flex; align-items: center;">
|
<div class="text-center">
|
||||||
<div style="text-align: center;margin-top: -45px">
|
<div class="gauge-chart2"
|
||||||
<div style="width: 300px; height: 330px;"
|
|
||||||
th:id="'gauge-chart2'"
|
th:id="'gauge-chart2'"
|
||||||
class="gauge-chart2"
|
|
||||||
th:data-progress="${jobCardProgress.get('Job Card Progress')}"
|
th:data-progress="${jobCardProgress.get('Job Card Progress')}"
|
||||||
th:data-title="${'Job Card Progress'}"
|
th:data-title="'Job Card Progress'"
|
||||||
th:data-width="350"
|
th:data-width="350"
|
||||||
th:data-height="350"
|
th:data-height="350"
|
||||||
th:data-totalProduction="${totalProduction}"
|
th:data-totalProduction="${totalProduction}"
|
||||||
th:data-actualProduction="${completeProduction.get('Job Card Progress')}"
|
th:data-actualProduction="${completeProduction.get('Job Card Progress')}"
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30"
|
||||||
th:data-fontColor="'#17202a'"
|
th:data-fontColor="'#17202a'"
|
||||||
th:data-color="'#566573'"></div>
|
th:data-color="'#566573'">
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; ">
|
</div>
|
||||||
<div th:each="title, index : ${jobCardProgress.keySet()}" style="text-align: center; margin-top: 40px;">
|
<div class="d-flex flex-wrap justify-content-center gap-2 " style="margin-top: 70px;">
|
||||||
<div th:if ="${ title != 'Job Card Progress' }"
|
<div th:each="title, index : ${jobCardProgress.keySet()}"
|
||||||
th:id="'gauge-chart-' + ${index}" class="gauge-chart" style="width: 200px; height: 230px;"
|
th:if="${title != 'Job Card Progress'}" class="text-center">
|
||||||
|
<div class="gauge-chart"
|
||||||
|
th:id="'gauge-chart-' + ${index}"
|
||||||
th:data-progress="${jobCardProgress.get(title)}"
|
th:data-progress="${jobCardProgress.get(title)}"
|
||||||
th:data-totalProduction="${totalProduction}"
|
th:data-totalProduction="${totalProduction}"
|
||||||
th:data-actualProduction="${completeProduction.get(title)}"
|
th:data-actualProduction="${completeProduction.get(title)}"
|
||||||
|
@ -58,37 +55,38 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
<div th:if="${phasesTimes != null}" class="d-flex flex-column align-items-center my-2">
|
||||||
<tr th:if="${phasesTimes != null }">
|
<div class="d-flex flex-wrap gap-3">
|
||||||
<td style="display: flex; flex-direction: column; align-items: center; border: none !important; outline: none;">
|
<div th:each="phase, index : ${phasesTimes.keySet()}"
|
||||||
<div style="display: flex; gap: 10px;">
|
class="border rounded-3 text-center p-3 mr-3">
|
||||||
<div th:each="phase, index : ${phasesTimes.keySet()}" style="border: 2px solid #d5d8dc; border-radius: 10px; text-align: center; padding:20px;">
|
<h6 th:text="${phase}"></h6>
|
||||||
<H6 th:text="${phase}"></H6>
|
<h6 th:text="${phasesTimes.get(phase)}"></h6>
|
||||||
<H6 th:text="${phasesTimes.get(phase)}"></H6>
|
<h6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></h6>
|
||||||
<H6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></H6>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
<div class="my-5">
|
||||||
<!-- Cutting Details Column -->
|
<div class="row g-4">
|
||||||
<td th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
|
<div class="col-md-6"
|
||||||
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
|
th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}">
|
||||||
|
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
|
||||||
Cutting Detail
|
Cutting Detail
|
||||||
</div>
|
</div>
|
||||||
<table class="table" style="width: 100%; border-collapse: collapse;">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table class="table table-bordered align-middle">
|
||||||
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Cutting</th>
|
<th>Cutting</th>
|
||||||
<th>Cutting Date</th>
|
<th>Cutting Date</th>
|
||||||
<th>Cutting Table Descriptions</th>
|
<th>Descriptions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:if="${cuttingDetails != null}" th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
|
<tr th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
|
||||||
<td th:text="${cuttingDetails.get('accounts').get(detail).id}"></td>
|
<td th:text="${cuttingDetails.get('accounts').get(detail).id}"></td>
|
||||||
<td th:text="${cuttingDetails.get('accounts').get(detail).title}"></td>
|
<td th:text="${cuttingDetails.get('accounts').get(detail).title}"></td>
|
||||||
<td th:text="${cuttingDetails.get('personName').get(detail)}"></td>
|
<td th:text="${cuttingDetails.get('personName').get(detail)}"></td>
|
||||||
|
@ -100,43 +98,47 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Stitching Details Column -->
|
<div class="col-md-6"
|
||||||
<td th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
|
th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}">
|
||||||
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
|
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
|
||||||
Stitching Detail
|
Stitching Detail
|
||||||
</div>
|
</div>
|
||||||
<table class="table" style="width: 100%; border-collapse: collapse;">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table class="table table-bordered align-middle">
|
||||||
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Stitching</th>
|
<th>Stitching</th>
|
||||||
<th>Stitching Day</th>
|
<th>Stitching Day</th>
|
||||||
<th>Stitching Table Descriptions</th>
|
<th>Descriptions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody th:if="${stitchingDetails != null and stitchingDetails.get('accounts') != null}">
|
<tbody>
|
||||||
<tr th:each="detail : ${stitchingDetails.get('accounts').keySet()}">
|
<tr th:each="detail : ${stitchingDetails.get('accounts').keySet()}">
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).id}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).id}"></td>
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).title}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).title}"></td>
|
||||||
<td th:text="${stitchingDetails.get('personName') != null ? stitchingDetails.get('personName').get(detail) : ''}"></td>
|
<td th:text="${stitchingDetails.get('personName') != null ? stitchingDetails.get('personName').get(detail) : ''}"></td>
|
||||||
<td>
|
<td>
|
||||||
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
|
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
|
||||||
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
|
th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
|
||||||
|
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
|
||||||
|
ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).notes}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).notes}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div th:if="${dailyProgress != null}" class="d-flex justify-content-center my-5">
|
||||||
<tr th:if="${dailyProgress != null}">
|
<div class="border rounded-3 p-3 w-75 overflow-auto" style="height: 560px;">
|
||||||
<td colspan="5" style="padding-left: 150px;">
|
|
||||||
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
|
|
||||||
<div id="barChart" class="barChart" style="height: 500px; width: 1600px;"
|
<div id="barChart" class="barChart" style="height: 500px; width: 1600px;"
|
||||||
th:data-width="1600"
|
th:data-width="1600"
|
||||||
th:data-height="500"
|
th:data-height="500"
|
||||||
|
@ -147,13 +149,11 @@
|
||||||
th:data-quality="${dailyProgress.get('quality')}"
|
th:data-quality="${dailyProgress.get('quality')}"
|
||||||
th:data-finishing="${dailyProgress.get('finishing')}"
|
th:data-finishing="${dailyProgress.get('finishing')}"
|
||||||
th:data-totalProduction="${completeProduction.get('Cutting Progress')}"
|
th:data-totalProduction="${completeProduction.get('Cutting Progress')}"
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30">
|
||||||
></div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:if="${allJobCard != null}" th:each="jobCard : ${allJobCard.keySet()}" style="padding-bottom:10px">
|
<tr th:if="${allJobCard != null}" th:each="jobCard : ${allJobCard.keySet()}"
|
||||||
|
style="padding-bottom:10px">
|
||||||
<td class="m-0 pb-3">
|
<td class="m-0 pb-3">
|
||||||
<table class="table mb-0 table-bordered text-center">
|
<table class="table mb-0 table-bordered text-center">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -26,11 +27,15 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<span style="font-size: 14px; font-weight: bold;" th:text="'Total : ' + ${allJobCard.get(jobCard).get('Cutting Progress')}"></span>
|
<span style="font-size: 14px; font-weight: bold;"
|
||||||
|
th:text="'Total : ' + ${allJobCard.get(jobCard).get('Cutting Progress')}"></span>
|
||||||
<br>
|
<br>
|
||||||
<span style="font-size: 14px; font-weight: bold;" th:text="'Complete Products : ' + ${allJobCard.get(jobCard).get('Job Card Progress')}"></span>
|
<span style="font-size: 14px; font-weight: bold;"
|
||||||
|
th:text="'Complete Products : ' + ${allJobCard.get(jobCard).get('Job Card Progress')}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 14px;" th:if="${values != 'Job Card Progress'}" th:each="values : ${allJobCard.get(jobCard).keySet()}" th:text="${allJobCard.get(jobCard).get(values)}"></td>
|
<td style="font-size: 14px;" th:if="${values != 'Job Card Progress'}"
|
||||||
|
th:each="values : ${allJobCard.get(jobCard).keySet()}"
|
||||||
|
th:text="${allJobCard.get(jobCard).get(values)}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -0,0 +1,133 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<head th:replace="_fragments :: head('Stitching Report')"></head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
|
||||||
|
<div class="col-lg-10">
|
||||||
|
<div th:if="${stitching.get('Date Wise Stitching') != null}" class="d-flex justify-content-center">
|
||||||
|
<div class="border rounded-3 pt-2 mx-auto overflow-auto" style="height: 560px; width: 80%;">
|
||||||
|
<div id="singleBarChart" class="singleBarChart" style="height: 500px; width: 1600px;"
|
||||||
|
th:data-width="1600"
|
||||||
|
th:data-height="500"
|
||||||
|
th:data-title="'Days Wise Progress'"
|
||||||
|
th:data-dates="${stitching.get('Date Wise Stitching').keySet()}"
|
||||||
|
th:data-barData="${stitching.get('Date Wise Stitching').values()}"
|
||||||
|
th:data-barHeading="'Stitching'"
|
||||||
|
th:data-stitching="''"
|
||||||
|
th:data-quality="''"
|
||||||
|
th:data-finishing="''"
|
||||||
|
th:data-totalProduction="'30000'"
|
||||||
|
th:data-fontSize="30"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-3"
|
||||||
|
th:if="${stitching.get('stitchingAccount') != null && stitching.get('jobCardItemsStitchingDetailsMap').get(stitchingAccount.id) != null}"
|
||||||
|
th:each="stitchingAccount, index : ${stitching.get('stitchingAccount')}">
|
||||||
|
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center mb-2"
|
||||||
|
th:text="${stitchingAccount.title}"></div>
|
||||||
|
|
||||||
|
<table class="table table-striped " data-account-table th:data-account-id="${stitchingAccount.id}">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Job Card</th>
|
||||||
|
<th>PO Number</th>
|
||||||
|
<th>SKU</th>
|
||||||
|
<th>Article Name</th>
|
||||||
|
<th>Stitching Operator Name</th>
|
||||||
|
<th>Total Stitching</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="wrap, index : ${stitching.get('jobCardItemsStitchingDetailsMap').get(stitchingAccount.id)}">
|
||||||
|
<td data-show-dropdown-transactions
|
||||||
|
th:data-account-id="${stitchingAccount.id}"
|
||||||
|
th:data-jobcardid="${wrap.jobCardId}"
|
||||||
|
th:data-sku="${wrap.sku}"
|
||||||
|
th:data-start-date="${param['start-date'] ?: startDate}"
|
||||||
|
th:data-end-date="${param['end-date'] ?: endDate}"
|
||||||
|
title="Transactions">
|
||||||
|
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
|
||||||
|
</td>
|
||||||
|
<td th:text="${wrap.jobCardCode}"></td>
|
||||||
|
<td th:text="${wrap.poName}"></td>
|
||||||
|
<td th:text="${wrap.sku}"></td>
|
||||||
|
<td th:text="${wrap.articleName}"></td>
|
||||||
|
<td th:text="${wrap.operatorName}"></td>
|
||||||
|
<td th:text="${stitching.get('totalStitchingBasedOnAccountID').get(wrap.jobCardId+wrap.sku)}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
const $body = $('body');
|
||||||
|
|
||||||
|
// Initialize DataTables for each individual table
|
||||||
|
$('table[data-account-table]').each(function () {
|
||||||
|
$(this).DataTable({
|
||||||
|
paging: false,
|
||||||
|
pageLength: 100,
|
||||||
|
searching: false,
|
||||||
|
lengthChange: false,
|
||||||
|
processing: false,
|
||||||
|
dom: `
|
||||||
|
<'row'<'col-sm-5'B><'col-sm-7'f>>
|
||||||
|
<'row'<'col-sm-12't>>
|
||||||
|
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
|
||||||
|
buttons: [{
|
||||||
|
extend: 'excel',
|
||||||
|
text: '',
|
||||||
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none'
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Dropdown transactions toggle
|
||||||
|
$body.on('click', '[data-show-dropdown-transactions]', 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 = $this.find('[data-dropdown-icon-transactions]');
|
||||||
|
const accountId = $this.data('account-id');
|
||||||
|
const jobCardId = $this.data('jobcardid');
|
||||||
|
const sku = $this.data('sku');
|
||||||
|
const startDate = $this.data('start-date');
|
||||||
|
const endDate = $this.data('end-date');
|
||||||
|
|
||||||
|
$spanDropdown.toggleClass('bi-caret-right-fill bi-caret-down-fill');
|
||||||
|
|
||||||
|
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/reporting/inventory-transactions?account-id=${accountId}&jobCard-id=${jobCardId}&sku=${sku}&startDate=${startDate}&endDate=${endDate}`,
|
||||||
|
success: function (data) {
|
||||||
|
$row.child(data).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Load JavaScript file -->
|
||||||
|
<script th:src="@{/js/charts.js}"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -31,6 +31,15 @@
|
||||||
<label>End Date</label>
|
<label>End Date</label>
|
||||||
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
||||||
</div>
|
</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">
|
<div class="form-group">
|
||||||
<label>Count</label>
|
<label>Count</label>
|
||||||
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
|
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-primary" type="submit">Receive Inventory</button>
|
<button class="btn btn-primary" type="submit">Receive Master Bundle</button>
|
||||||
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
|
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div th:replace="_notices :: page-notices"></div>
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
<div class="mb-4 d-flex justify-content-between">
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
<h3>Stitching Offline Items</h3>
|
<h3>Stitching WIP's</h3>
|
||||||
<a th:href="@{/stitching/create-stitching-items}" class="btn btn-primary">Create Stitched Items</a>
|
<a th:href="@{/stitching/create-stitching-items}" class="btn btn-primary">Create Stitching WIP's</a>
|
||||||
</div>
|
</div>
|
||||||
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
||||||
<form th:action="@{/stitching/generate-barcodes}" method="post">
|
<form th:action="@{/stitching/generate-barcodes}" method="post">
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<th>Is QA</th>
|
<th>Is QA</th>
|
||||||
<th>
|
<th>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Barcode</button>
|
<button class="btn btn-sm btn-outline-primary" type="submit">Generate QR code</button>
|
||||||
</div>
|
</div>
|
||||||
<div><input type="checkbox" data-checkbox-all></div>
|
<div><input type="checkbox" data-checkbox-all></div>
|
||||||
</th>
|
</th>
|
||||||
|
|
Loading…
Reference in New Issue