add dashboard and fix some transaction issue

pull/23/head
Usama Khan 2025-05-19 17:04:18 +05:00
parent 437fcc8fb2
commit 2377a61578
12 changed files with 152 additions and 248 deletions

View File

@ -42,7 +42,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/login", "/rest/**")
.antMatchers("/login", "/rest/**","/dashboard/**")
.permitAll()
.antMatchers("/**")
.hasAnyRole("USER", "ADMIN")

View File

@ -20,12 +20,11 @@ public class DashboardController {
}
@GetMapping("/{lineNumber}")
public String getDashboard(@PathVariable("lineNumber") int lineNumber, Model model) {
public String getDashboard(@PathVariable("lineNumber") String lineNumber, Model model) {
model.addAttribute("phases", dashboardService.getPhasesProgressDayWise(lineNumber));
model.addAttribute("date", LocalDate.now());
model.addAttribute("day", LocalDate.now().getDayOfWeek());
model.addAttribute("line", "Line 1" );
model.addAttribute("detail", dashboardService.getLineDetails() );
model.addAttribute("detail", dashboardService.getLineDetails(lineNumber) );
return "dashboard";
}

View File

@ -34,7 +34,7 @@ public class FinishedItemDAO {
private final String SELECT_BY_STITCHED_ITEM_IDS = String.format("SELECT * FROM %s WHERE stitched_item_id IN (:stitched_item_ids)", TABLE_NAME);
private final String COUNT_TOTAL_FINISH_ITEM = String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_segregated IS TRUE ", TABLE_NAME);
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME);
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR operation_date >= :start_date) AND operation_date <= :end_date AND qa_status = :qa_status", TABLE_NAME );
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR operation_date >= :start_date) AND operation_date <= :end_date AND qa_status = :qa_status AND id in (:ids) AND is_packed = FALSE", TABLE_NAME );
public FinishedItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
@ -196,11 +196,12 @@ public class FinishedItemDAO {
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_AND_DATE, params, new FinishedItemRowMapper());
}
public Long findByOperationDoneDate(String startDate, String endDate, String qaStatus){
public Long findByOperationDoneDate(String startDate, String endDate, String qaStatus, List<Long> ids){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue( "start_date", startDate );
params.addValue( "end_date", endDate );
params.addValue( "qa_status", qaStatus );
params.addValue( "ids", ids );
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_QA_STATUS, params, Long.class);
return count != null ? count : 0;
}

View File

@ -49,6 +49,7 @@ public class InventoryTransactionLegDAO {
private final String SELECT_FIRST_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type ORDER BY transaction_leg_datetime ASC LIMIT 1", TABLE_NAME);
private final String SELECT_GROUP_By_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type GROUP BY account_id", TABLE_NAME);
private final String SELECT_TRANSACTIONS_REMAINING = String.format("SELECT parent_document_id as parentIds FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'IN' AND parent_document_id NOT IN (SELECT parent_document_id FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'OUT')", TABLE_NAME, TABLE_NAME);
private final String SELECT_PARENT_ID_BY_TYPE_GROUP = String.format("SELECT parent_document_id as parentIds FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'IN' GROUP BY parent_document_id", TABLE_NAME);
private final String SELECT_JOB_CARD_DATES = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type ", TABLE_NAME);
private final String SELECT_JOB_CARD_And_Date_Type_Account_Id = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type AND account_id IN (:account_ids)", TABLE_NAME);
@ -226,4 +227,11 @@ public class InventoryTransactionLegDAO {
params.addValue("parent_document_type", parentType );
return namedParameterJdbcTemplate.queryForList( SELECT_TRANSACTIONS_REMAINING , params, Long.class );
}
public List<Long> getInParentIdIdByDate(String parentType, Integer accountId){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("account_id", accountId );
params.addValue("parent_document_type", parentType );
return namedParameterJdbcTemplate.queryForList( SELECT_PARENT_ID_BY_TYPE_GROUP , params, Long.class );
}
}

View File

@ -39,7 +39,7 @@ public class PackagingItemsDAO {
"qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), account_title = VALUES(account_title)",
TABLE_NAME
);
private final String SELECT_BY_DATE = String.format( "SELECT * FROM %s WHERE created_at >=:start_date AND created_at <= :end_date", TABLE_NAME );
private final String SELECT_BY_DATE_AND_IDs = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR created_at >=:start_date) AND created_at <= :end_date AND id IN (:ids)", TABLE_NAME );
public PackagingItemsDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
@ -98,11 +98,13 @@ public class PackagingItemsDAO {
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_ID, params, new PackagingItemsRowMapper());
}
public List<PackagingItems> findByDate(String startDate, String endDate){
public Long findByDateANDIDs(String startDate, String endDate,List<Long> ids){
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue( "start_date", startDate );
params.addValue( "end_date", endDate );
return namedParameterJdbcTemplate.query( SELECT_BY_DATE , params, new PackagingItemsRowMapper() );
params.addValue( "ids", ids );
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_AND_IDs, params, Long.class);
return count != null ? count : 0;
}
}

View File

@ -4,8 +4,6 @@ import com.utopiaindustries.dao.ctp.*;
import com.utopiaindustries.model.ctp.*;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -14,36 +12,24 @@ import java.util.stream.Collectors;
@Service
public class DashboardService {
private final JobCardItemDAO jobCardItemDAO;
private final ProcessDAO processDAO;
private final BundleDAO bundleDAO;
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
private final InventoryTransactionDAO inventoryTransactionDAO;
private final JobCardDAO jobCardDAO;
private final CryptographyService cryptographyService;
private final MasterBundleDAO masterBundleDAO;
private final FinishedItemDAO finishedItemDAO;
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
private final InventoryAccountDAO inventoryAccountDAO;
private final PackagingItemsDAO packagingItemsDAO;
public DashboardService(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.processDAO = processDAO;
this.bundleDAO = bundleDAO;
public DashboardService(InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PackagingItemsDAO packagingItemsDAO) {
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
this.inventoryTransactionDAO = inventoryTransactionDAO;
this.jobCardDAO = jobCardDAO;
this.cryptographyService = cryptographyService;
this.masterBundleDAO = masterBundleDAO;
this.finishedItemDAO = finishedItemDAO;
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
this.inventoryAccountDAO = inventoryAccountDAO;
this.packagingItemsDAO = packagingItemsDAO;
}
public Map<String, Float> getPhasesProgressDayWise(int lineNo) {
public Map<String, Float> getPhasesProgressDayWise(String lineNo) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String cuttingAccount = "CUTTING ACCOUNT " + lineNo;
@ -53,6 +39,8 @@ public class DashboardService {
String startDate1 = LocalDateTime.now().withHour(0).withMinute(0).withSecond(1).format(formatter);
String endDate1 = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).format(formatter);
String startDateWithHour = LocalDateTime.now().minusHours(1).format(formatter);
String endDateWithHour = LocalDateTime.now().format(formatter);
HashMap<String, Float> progress = new HashMap<>();
@ -67,72 +55,74 @@ public class DashboardService {
.collect(Collectors.toMap(InventoryAccount::getTitle, e -> (int) e.getId()));
List<Long> stitchingItemIds = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY("STITCHING_OFFLINE", inventoryAccountMap.get(stitchingAccount));
List<Long> finishing = inventoryTransactionLegDAO.getInParentIdIdByDate("FINISHED_ITEM", inventoryAccountMap.get(finishingAccount));
List<Long> stitchingItemIds = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY( "STITCHING_OFFLINE",inventoryAccountMap.get(stitchingAccount));
List<Long> alterationByFinishing = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY( "FINISHED_ITEM",inventoryAccountMap.get(stitchingAccount));
List<Long> packagingItemIDs = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY("PACKAGING", inventoryAccountMap.get(packagingAccount));
Long approvedStitchingOfflineItems = 0L;
Long qcReject = 0L;
if (stitchingItemIds != null && !stitchingItemIds.isEmpty()){
if (stitchingItemIds != null && !stitchingItemIds.isEmpty()) {
approvedStitchingOfflineItems = stitchingOfflineItemDAO.findByQCDoneDateApproved(startDate1, endDate1, "APPROVED");
qcReject = stitchingOfflineItemDAO.findByQCDoneDate(null, endDate1, "REJECT",stitchingItemIds);
qcReject = stitchingOfflineItemDAO.findByQCDoneDate(null, endDate1, "REJECT", stitchingItemIds);
}
List<Long> finishedItem = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY( "FINISHED_ITEM",inventoryAccountMap.get(finishingAccount));
List<Long> packagingItems = inventoryTransactionLegDAO.getParentIDsOFRemainingINVENTORY( "PACKAGING",inventoryAccountMap.get(packagingAccount));
Long approvedFinishedItem = 0L;
Long alterFinishedItem = 0L;
Long bGradeFinishedItem = 0L;
Long alterationPieceFinish = 0L;
Long rejectFinishedItem = 0L;
Long washFinishedItem = 0L;
if(packagingItems != null && !packagingItems.isEmpty() ){
approvedFinishedItem = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1,"APPROVED");
bGradeFinishedItem = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1,"B GRADE");
rejectFinishedItem = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1,"REJECT");
washFinishedItem = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1,"WASHED");
Long approved = 0L;
Long operationNotPerformed = 0L;
if (finishing != null && !finishing.isEmpty()) {
approved = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1, "APPROVED", finishing);
operationNotPerformed = finishedItemDAO.findByOperationDoneDate(null, endDate1, "-", finishing);
rejectFinishedItem = finishedItemDAO.findByOperationDoneDate(null, endDate1, "REJECT", finishing);
washFinishedItem = finishedItemDAO.findByOperationDoneDate(startDate1, endDate1, "WASHED", finishing);
alterationPieceFinish = finishedItemDAO.findByOperationDoneDate(null, endDate1, "ALTER", finishing);
}
progress.put("Stitching",(float) approvedStitchingOfflineItems + qcReject + alterationByFinishing.size());
progress.put("totalWips", (float) stitchingItemIds.size());
progress.put("Alteration", (float) qcReject );
progress.put("finishing", (float) approvedFinishedItem);
progress.put("ALTER", (float) alterationByFinishing.size());
progress.put("Reject",(float) rejectFinishedItem);
progress.put("wash",(float) washFinishedItem);
progress.put("packaging",(float) packagingItems.size() );
Long packagingItems = 0L;
Long packagingItemsHourly = 0L;
if (packagingItemIDs != null && !packagingItemIDs.isEmpty()) {
packagingItems = packagingItemsDAO.findByDateANDIDs(startDate1, endDate1, packagingItemIDs);
packagingItemsHourly = packagingItemsDAO.findByDateANDIDs(startDateWithHour, endDateWithHour, packagingItemIDs);
}
progress.put("Stitching", (float) approvedStitchingOfflineItems + qcReject);
progress.put("totalWips", (float) stitchingItemIds.size() - qcReject);
progress.put("Alteration", (float) qcReject);
progress.put("finishing", (float) approved + operationNotPerformed);
progress.put("ALTER", (float) alterationPieceFinish);
progress.put("Reject", (float) rejectFinishedItem);
progress.put("wash", (float) washFinishedItem);
progress.put("packaging", (float) packagingItems);
progress.put("Shift Achieved", (float) packagingItems);
progress.put("Efficiency", (float) packagingItems / 1000 * 100);
progress.put("Hourly Achieved", Float.valueOf(packagingItemsHourly));
return progress;
}
public Map<String, String> getLineDetails() {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String startDate1 = LocalDateTime.now().withHour(0).withMinute(0).withSecond(1).format(formatter);
String endDate1 = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).format(formatter);
String startDateWithHour = LocalDateTime.now().minusHours(1).format(formatter);
String endDateWithHour =LocalDateTime.now().format(formatter);
public Map<String, String> getLineDetails(String lineNo) {
String cuttingAccount = "CUTTING ACCOUNT " + lineNo;
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findAll();
String articleNote = inventoryAccounts.stream()
.filter(e -> cuttingAccount.equals(e.getTitle()))
.map(InventoryAccount::getNotes).findFirst().orElse(null);
HashMap<String, String> details = new HashMap<>();
List<PackagingItems> packagingItems = packagingItemsDAO.findByDate(startDate1, endDate1);
List<PackagingItems> packagingItemsHourly = packagingItemsDAO.findByDate(startDateWithHour, endDateWithHour);
List<JobCard> jobCards = jobCardDAO.findAll();
int target = 1000;
int achieved = packagingItems.size();
details.put("Shift Target", 1000 + " pc");
details.put("Shift Achieved", achieved + " pc");
details.put("Hourly Target", 1000/24 + " pc");
details.put("Hourly Achieved", packagingItemsHourly.size() + " pc");
details.put("Efficiency",(float)achieved / target * 100 + " %" );
details.put("articleNote", articleNote);
details.put("Hourly Target", 1000 / 24 + " pc");
details.put("Total Induction", String.valueOf(jobCards.size()));
details.put("Total Machine", String.valueOf(30));
details.put("Total Worker", String.valueOf(30));
details.put("line", "Line " + lineNo);
return details;
}
}

View File

@ -506,6 +506,8 @@ public class InventoryService {
finishedItem.setBarcode(stitchingOfflineItem.getBarcode());
finishedItem.setCreatedBy(authentication.getName());
finishedItem.setCreatedAt(LocalDateTime.now());
finishedItem.setOperationDate(LocalDateTime.now());
finishedItem.setQaStatus("-");
finishedItem.setStitchedItemId(stitchingOfflineItem.getId());
finishedItem.setJobCardId(stitchingOfflineItem.getJobCardId());
finishedItem.setIsQa(true);

View File

@ -317,18 +317,22 @@ document.addEventListener("DOMContentLoaded", function () {
const rawValue = div.getAttribute('data-totalProduction') || "0";
const cleanValue = rawValue.replace(/[^0-9.-]+/g, '');
const maxValue = Number(cleanValue);
const aHeading = 'Achieved';
const aDataString = div.getAttribute('data-achieved');
const cleanValueAchieved = aDataString.replace(/[^0-9.-]+/g, '');
const aData = [Number(cleanValueAchieved)];
const bHeading = 'Stitching';
const bDataString = div.getAttribute('data-stitching');
const cleanValueStitch = bDataString.replace(/[^0-9.-]+/g, '');
const bData = [Number(cleanValueStitch)];
const cHeading = 'End Line Quality Checking';
const cDataString =div.getAttribute('data-quality');
const cleanValueQuality = cDataString.replace(/[^0-9.-]+/g, '');
const cData = [Number(cleanValueQuality)];
const cHeading = 'Achieved';
const cDataString = div.getAttribute('data-achieved');
const cleanValueAchieved = cDataString.replace(/[^0-9.-]+/g, '');
const cData = [Number(cleanValueAchieved)];
const aHeading = 'Stitching';
const aDataString = div.getAttribute('data-stitching');
const cleanValueStitch = aDataString.replace(/[^0-9.-]+/g, '');
const aData = [Number(cleanValueStitch)];
const bHeading = 'Packaging';
const bDataString =div.getAttribute('data-packaging');
const packaging = bDataString.replace(/[^0-9.-]+/g, '');
const bData = [Number(packaging)];
const dates = [div.getAttribute('data-dates')];
const divId = div.id;
dashboardChart(

View File

@ -45,6 +45,7 @@
<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">
<input hidden="hidden" v-bind:name="'items[' + index + '].operationDate'" v-bind:value="getFormattedDateTime(item.operationDate)">
<span> {{item.id}} </span>
</td>
<td> {{item.itemId}} </td>

View File

@ -20,6 +20,17 @@
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
<title th:text="${#strings.concat(title, ' - CTP')}"></title>
<style>
@keyframes blinker {
50% {
opacity: 0;
}
}
.blink {
animation: blinker 1s linear infinite;
}
</style>
</head>
<body>

View File

@ -3,79 +3,9 @@
xmlns:ctp="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Production Dashboard')">
<style>
/* Large screen specific styles */
@media (min-width: 1600px) {
body {
font-size: 1.1rem;
}
.header h1 {
font-size: 2.5rem;
}
.stats-panel h5 {
font-size: 1.5rem;
}
.card-title {
font-size: 1.3rem;
}
.card-text {
font-size: 2.5rem;
}
.dashboardBarChart {
min-height: 400px !important;
}
.card-img-top {
width: 200px !important;
height: auto;
}
.main-content {
padding: 2rem 3rem;
}
}
/* Extra large screens (4K and above) */
@media (min-width: 2500px) {
body {
font-size: 1.3rem;
}
.header h1 {
font-size: 3rem;
}
.stats-panel h5 {
font-size: 1.8rem;
}
.card-title {
font-size: 1.6rem;
}
.card-text {
font-size: 3rem;
}
.dashboardBarChart {
min-height: 500px !important;
}
.card-img-top {
width: 250px !important;
}
.main-content {
padding: 3rem 4rem;
}
}
</style>
</head>
<body class="m-0 p-0">
<div class="container-fluid px-0">
<header class="header shadow py-2 bg-black text-white" style="background-color: black !important;">
@ -91,45 +21,31 @@
<main class="container-fluid main-content">
<div class="row page-main g-4 p-3">
<div class="col-lg-6 ">
<div class="col-lg-6">
<!-- Title Row -->
<div class="mb-4 d-flex justify-content-between align-items-center">
<h1 class="fw-bold text-uppercase m-0" th:text="${{line}}">LINE NAME</h1>
<h1 class="fw-bold text-uppercase m-0" th:text="${detail.get('line')}"></h1>
<div class="text-end">
<h4 class="fw-bold m-0 text-end" th:text="${detail.get('Total Machine')} + ' Machines'">0</h4>
<h4 class="fw-bold m-0 text-end" th:text="dwawa">0</h4>
<h3 class="fw-bold m-0 text-end "
th:text=" 'Total Machines: '+ ${detail.get('Total Machine')} ">0</h3>
<h3 class="fw-bold m-0 text-end" th:text="'Article Name: ' + ${detail.get('articleNote')}">
0</h3>
</div>
</div>
<div class="row g-2">
<div class="col-lg-6 border border-black-50 p-2 d-flex flex-column align-items-center justify-content-center text-center text-white rounded " style="background-color: #516ec4;">
<!-- Total Target -->
<div class="w-100 d-flex align-items-center justify-content-between px-4 py-3">
<h4 class="fw-bold m-0 text-start">Shift Target</h4>
<h4 class="fw-bold m-0 text-end" th:text="${detail.get('Shift Target')}">0</h4>
</div>
<!-- Total Achieved -->
<div class="w-100 d-flex align-items-center justify-content-between px-4 py-3">
<h4 class="fw-bold m-0 text-start">Achieved</h4>
<h4 class="fw-bold m-0 text-end" th:text="${detail.get('Shift Achieved')}">0</h4>
</div>
<!-- Efficiency -->
<div class="w-100 d-flex align-items-center justify-content-between px-4 py-3">
<h4 class="fw-bold m-0 text-start">Efficiency</h4>
<h4 class="fw-bold m-0 text-end" th:text="${detail.get('Efficiency')}">0%</h4>
</div>
<div class="col-lg-6 border border-black-50 p-4 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
style="background-color: #516ec4; height: 100%; ">
<h1 class="fw-bold pt-5 pb-2" style="font-size: 6rem;" th:text="${detail.get('Shift Target')}">
%</h1>
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Shift Target</h1>
</div>
<div class="col-lg-6 p-3 d-flex flex-column align-items-center text-center text-white rounded " style="background-color: #72788a;">
<div class="w-100 d-flex align-items-center justify-content-between px-4 py-3">
<h4 class="fw-bold m-0 text-start">Hourly Target</h4>
<h4 class="fw-bold m-0 text-end" th:text="${detail.get('Hourly Target')}">0</h4>
</div>
<div class="col-lg-6 border border-black-50 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
style="background-color: #72788a;">
<h1 class="fw-bold pl-3 pr-3 pt-5 pb-2" style="font-size: 6rem;"
th:text="${(phases.get('Shift Achieved') != null ? phases.get('Shift Achieved').intValue() : 0) + ' Pcs'}"></h1>
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Achieved</h1>
</div>
</div>
</div>
@ -138,7 +54,7 @@
<div class="col-lg-6 d-flex">
<div class="card w-100 h-100">
<div class="container-fluid d-flex p-3 align-items-center">
<img style="width:200px" th:src="@{/img/stitchingImage.jpg}" class="card-img-top"
<img style="width:337px" th:src="@{/img/stitchingImage.jpg}" class="card-img-top"
alt="Stitching">
<div class="ps-4 text-center">
<h1 class="fw-bold text-uppercase m-0"
@ -146,63 +62,45 @@
<h4 class="pt-2 fw-bold text-uppercase m-0">Stitching Offline</h4>
</div>
</div>
<div class="card-body text-center d-flex justify-content-center p-4">
<div class="card-body text-center d-flex justify-content-center">
<div class="px-4 border-right" style="height: 150px">
<h2 class="card-text" th:text="${(phases.get('totalWips') != null ? phases.get('totalWips').intValue() : 0) + ' Pcs'}"></h2>
<h4 class="card-title">WIP QTY</h4>
<h1 class="card-text"
th:text="${(phases.get('totalWips') != null ? phases.get('totalWips').intValue() : 0) + ' Pcs'}"></h1>
<h2 class="card-title">WIP QTY</h2>
</div>
<div class="px-4" style="height: 150px">
<h2 class="card-text"
th:text="${(phases.get('Alteration') != null ? phases.get('Alteration').intValue() : 0) + ' Pcs'}"></h2>
<h4 class="card-title">Alteration</h4>
<h1 class="card-text text-danger fw-bold blink"
th:text="${(phases.get('Alteration') != null ? phases.get('Alteration').intValue() : 0) + ' Pcs'}"></h1>
<h2 class="card-title text-danger fw-bold text-uppercase blink">ALTERATION</h2>
</div>
</div>
</div>
</div>
<!-- Card 2: Quality -->
<!-- <div class="col-lg-3 d-flex">-->
<!-- <div class="card w-100 h-100">-->
<!-- <div class="container-fluid d-flex align-items-center">-->
<!-- <img style="width:200px;height:170px" th:src="@{/img/quality.png}" class="card-img-top"-->
<!-- alt="Quality">-->
<!-- <div class="ps-4 text-center">-->
<!-- <h1 class="fw-bold text-uppercase m-0"-->
<!-- th:text="${phases.get('Stitching')?.intValue() ?: 0}"></h1>-->
<!-- <h4 class="pt-2 fw-bold text-uppercase m-0">End Line QC</h4>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="card-body text-center d-flex justify-content-center ">-->
<!-- <div class="px-4 border-right" style="height: 150px">-->
<!-- <h2 class="card-text" th:text="${phases.get('StitchingDefectPiece')?.intValue() ?: 0}"></h2>-->
<!-- <h4 class="card-title">Defected QTY</h4>-->
<!-- </div>-->
<!-- <div class="px-4" style="height: 150px">-->
<!-- <h2 class="card-text"-->
<!-- th:text="${#numbers.formatDecimal(phases.get('StitchingDefectPieceRatio') ?: 0, 1, 2)} +' %'"></h2>-->
<!-- <h4 class="card-title">Defected Ratio</h4>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<!-- Second Row -->
<div class="row g-4 p-3">
<!-- Chart -->
<div class="col-lg-6 d-flex border border-black-50">
<div id="dashboardBarChart" class="dashboardBarChart w-100"
style="min-height: 400px;"
th:data-title="'Days Wise Progress'"
th:data-dates="${date}"
th:data-achieved="${detail.get('Shift Achieved')}"
th:data-stitching="${phases.get('Stitching')?.intValue() ?: 0}"
th:data-quality="${phases.get('Stitching')?.intValue() ?: 0}"
th:data-totalProduction="${detail.get('Shift Target')}"
th:data-fontSize="22">
<div class="col-lg-6 d-flex flex-column" style="height: 100%;">
<div class="row g-3 flex-grow-2" style="height: 100%;">
<div class="col-lg-6 border border-black-50 p-5 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
style="background-color: #516ec4; height: 100%; ">
<h1 class="fw-bold pl-3 pr-3 pt-5 pb-2" style="font-size: 6rem;"
th:text="${phases.get('Efficiency') + ' %'}">0%</h1>
<h1 class="fw-bold m-0 text-start pl-3 pr-3 pb-5 pt-2" style="font-size: 5rem;">Efficiency</h1>
</div>
<div class="col-lg-6 border border-black-50 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
style="background-color: #72788a;">
<h1 class="fw-bold pl-3 pr-3 pt-5 pb-2" style="font-size: 6rem;"
th:text="${detail.get('Hourly Target') }"></h1>
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Hourly Target</h1>
</div>
</div>
</div>
<!-- Card 3: Finishing -->
<div class="col-lg-3 d-flex">
<div class="card w-100 h-100">
@ -214,21 +112,21 @@
<h4 class="pt-2 fw-bold text-uppercase m-0">Finishing</h4>
</div>
</div>
<div class="card-body text-center d-flex justify-content-center">
<div class="px-4 border-right" >
<h2 class="card-text" th:text="${phases.get('Reject')?.intValue() ?: 0} + ' Pcs'"></h2>
<h4 class="card-title">REJECTION</h4>
<div class="card-body p-0 text-center d-flex justify-content-center">
<div class="px-2 border-right">
<h1 class="card-text" th:text="${phases.get('Reject')?.intValue() ?: 0} + ' Pcs'"></h1>
<h2 class="card-title">REJECTION</h2>
</div>
<div class="px-4" >
<h2 class="card-text"
th:text="${phases.get('ALTER')?.intValue() ?: 0} + ' Pcs'"></h2>
<h4 class="card-title">ALTERATION</h4>
<div class="px-2">
<h1 class="card-text blink text-danger fw-bold "
th:text="${phases.get('ALTER')?.intValue() ?: 0} + ' Pcs'"></h1>
<h2 class="card-title blink text-danger fw-bold ">ALTERATION</h2>
</div>
</div>
<div class="card-body text-center d-flex justify-content-center">
<div class="px-4">
<h2 class="card-text" th:text="${phases.get('wash')?.intValue() ?: 0} + ' Pcs'"></h2>
<h4 class="card-title">WASH/STAMP</h4>
<div class="card-body p-0 text-center d-flex justify-content-center">
<div class="px-2 ">
<h1 class="card-text" th:text="${phases.get('wash')?.intValue() ?: 0} + ' Pcs'"></h1>
<h2 class="card-title">WASH/STAMP</h2>
</div>
</div>
</div>
@ -246,18 +144,6 @@
</div>
</div>
<div class="card-body text-center d-flex justify-content-center p-4">
<!-- <div class="px-4" style="height: 150px">-->
<!-- <h2 class="card-text" th:text="${phases.get('packaging')?.intValue() ?: 0}"></h2>-->
<!-- <h4 class="card-title">A GRADE</h4>-->
<!-- </div>-->
<!-- <div class="px-4 border-right" style="height: 150px">-->
<!-- <h2 class="card-text" th:text="${phases.get('B Grade')?.intValue() ?: 0}"></h2>-->
<!-- <h4 class="card-title">B GRADE</h4>-->
<!-- </div>-->
<!-- <div class="px-4" style="height: 150px">-->
<!-- <h2 class="card-text" th:text="${phases.get('C Grade')?.intValue() ?: 0}"></h2>-->
<!-- <h4 class="card-title">C GRADE</h4>-->
<!-- </div>-->
</div>
</div>
</div>
@ -267,4 +153,4 @@
<script th:src="@{/js/charts.js}"></script>
</body>
</html>
</html>

View File

@ -39,7 +39,7 @@
</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>
<a th:href="@{/packaging/receive-inventory}" class="btn btn-light">Cancel</a>
</form>
<script th:inline="javascript">
window.ctp.accounts = [[${accounts}]];