Compare commits
8 Commits
6cee2380a5
...
dbbc4da853
Author | SHA1 | Date |
---|---|---|
|
dbbc4da853 | |
|
60956b36ba | |
|
40a18eb266 | |
|
45a929fbfb | |
|
7f50fb2fb4 | |
|
4bf30ff247 | |
|
5da9b3c7d2 | |
|
f85249d084 |
|
@ -4,13 +4,13 @@ import com.utopiaindustries.auth.CuttingRole;
|
||||||
import com.utopiaindustries.dao.ctp.BundleWrapper;
|
import com.utopiaindustries.dao.ctp.BundleWrapper;
|
||||||
import com.utopiaindustries.model.ctp.JobCardWrapper;
|
import com.utopiaindustries.model.ctp.JobCardWrapper;
|
||||||
import com.utopiaindustries.service.*;
|
import com.utopiaindustries.service.*;
|
||||||
import org.springframework.core.io.InputStreamResource;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@ -61,8 +61,12 @@ public class CuttingController {
|
||||||
@RequestParam( value = "site-id", required = false ) String siteId,
|
@RequestParam( value = "site-id", required = false ) String siteId,
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ){
|
Model model ){
|
||||||
|
|
||||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , "PROCESS", "1", false) );
|
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , "PROCESS", "1", false) );
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
|
if(StringUtils.isNullOrEmpty( active )){
|
||||||
|
return "redirect:/cutting/inventory-accounts?id=&title=&active=1&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
|
||||||
|
}
|
||||||
return "/cutting/inventory-accounts";
|
return "/cutting/inventory-accounts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +77,7 @@ public class CuttingController {
|
||||||
@ModelAttribute JobCardWrapper wrapper ){
|
@ModelAttribute JobCardWrapper wrapper ){
|
||||||
try {
|
try {
|
||||||
inventoryService.receiveJobCardInventory( jobCardId, wrapper );
|
inventoryService.receiveJobCardInventory( jobCardId, wrapper );
|
||||||
redirectAttributes.addFlashAttribute("success", "Inventory Success Received" );
|
redirectAttributes.addFlashAttribute("success", "Inventory Successfully Received by Job Card ID: " +jobCardId );
|
||||||
} catch ( Exception ex ){
|
} catch ( Exception ex ){
|
||||||
redirectAttributes.addFlashAttribute("error", ex.getMessage() );
|
redirectAttributes.addFlashAttribute("error", ex.getMessage() );
|
||||||
}
|
}
|
||||||
|
@ -105,6 +109,7 @@ public class CuttingController {
|
||||||
@GetMapping( "/bundles" )
|
@GetMapping( "/bundles" )
|
||||||
public String showBundles( @RequestParam( value = "id", required = false ) String id,
|
public String showBundles( @RequestParam( value = "id", required = false ) String id,
|
||||||
@RequestParam( value = "sku", required = false) String sku,
|
@RequestParam( value = "sku", required = false) String sku,
|
||||||
|
@RequestParam( value = "exceptionCheck", required = false, defaultValue = "false") boolean exceptionCheck,
|
||||||
@RequestParam( value = "jc-id", required = false) String jobCardId,
|
@RequestParam( value = "jc-id", required = false) String jobCardId,
|
||||||
@RequestParam( value = "master-id" , required = false ) String masterId,
|
@RequestParam( value = "master-id" , required = false ) String masterId,
|
||||||
@RequestParam( value = "type", required = false) String type,
|
@RequestParam( value = "type", required = false) String type,
|
||||||
|
@ -112,9 +117,15 @@ public class CuttingController {
|
||||||
@RequestParam( value = "start-date", required = false) String startDate,
|
@RequestParam( value = "start-date", required = false) String startDate,
|
||||||
@RequestParam( value = "end-date", required = false) String endDate,
|
@RequestParam( value = "end-date", required = false) String endDate,
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ){
|
Model model){
|
||||||
model.addAttribute("bundles", bundleService.getBundles( id, sku, jobCardId, masterId, type, status, startDate, endDate ,count ) );
|
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
model.addAttribute("bundles", bundleService.getBundles( id, sku, jobCardId, masterId, type, status, startDate1.toString(), endDate1.toString() ,count ) );
|
||||||
model.addAttribute("types", jobCardService.getAllPieceTypes() );
|
model.addAttribute("types", jobCardService.getAllPieceTypes() );
|
||||||
|
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate )){
|
||||||
|
return "redirect:/cutting/bundles?id=&sku=&jc-id=&master-id=&type=&status=0&start-date="+startDate1+"&end-date="+endDate1+"&count=100";
|
||||||
|
}
|
||||||
return "/cutting/bundles";
|
return "/cutting/bundles";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +136,17 @@ public class CuttingController {
|
||||||
@RequestParam(value = "start-date", required = false) String startDate,
|
@RequestParam(value = "start-date", required = false) String startDate,
|
||||||
@RequestParam(value = "end-date", required = false) String endDate,
|
@RequestParam(value = "end-date", required = false) String endDate,
|
||||||
@RequestParam(value = "count", required = false) Long count,
|
@RequestParam(value = "count", required = false) Long count,
|
||||||
Model model ){
|
@RequestParam( value = "exceptionCheck", required = false, defaultValue = "false") boolean exceptionCheck,
|
||||||
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, jobCardId, startDate, endDate, count ) );
|
Model model, RedirectAttributes redirectAttributes ){
|
||||||
|
if(exceptionCheck){
|
||||||
|
redirectAttributes.addFlashAttribute("error", "Please Select At least One CheckBox." );
|
||||||
|
}
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, jobCardId, startDate1.toString(), endDate1.toString(), count ) );
|
||||||
|
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate ) || exceptionCheck ){
|
||||||
|
return "redirect:/cutting/master-bundles?id=&jc-id=&start-date="+startDate1+"&end-date="+endDate1+"&count=100";
|
||||||
|
}
|
||||||
return "/cutting/master-bundles";
|
return "/cutting/master-bundles";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,9 +159,11 @@ public class CuttingController {
|
||||||
|
|
||||||
|
|
||||||
@PostMapping( "/generate-barcodes" )
|
@PostMapping( "/generate-barcodes" )
|
||||||
public ResponseEntity<InputStreamResource> generateBarcode(@RequestParam( name = "ids", required = true ) Long[] ids,
|
public Object generateBarcode(@RequestParam( name = "ids", required = false ) Long[] ids,
|
||||||
@RequestParam( name = "artifactType", required = true ) String artifactType ) throws Exception {
|
@RequestParam( name = "artifactType", required = true ) String artifactType ) throws Exception {
|
||||||
|
if(ids == null){
|
||||||
|
return "redirect:/cutting/master-bundles?id=&jc-id=&start-date=2024-12-01&end-date=2024-12-31&count=100&exceptionCheck=true";
|
||||||
|
}
|
||||||
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
|
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,13 @@ import com.utopiaindustries.service.BundleService;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.InventoryService;
|
import com.utopiaindustries.service.InventoryService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@ -48,8 +50,13 @@ public class FinishingController {
|
||||||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ){
|
Model model ){
|
||||||
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate, endDate, jobCardId ,count );
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId ,count );
|
||||||
model.addAttribute("items", itemList ) ;
|
model.addAttribute("items", itemList ) ;
|
||||||
|
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate )){
|
||||||
|
return "redirect:/finishing/finished-items?id=&item-id=&sku=&job-card-id=&start-date="+startDate1+"&end-date="+endDate1+"&count=100";
|
||||||
|
}
|
||||||
return "finishing/finished-item-list";
|
return "finishing/finished-item-list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +77,9 @@ public class FinishingController {
|
||||||
// 5 for Finishing
|
// 5 for Finishing
|
||||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "5" , false ));
|
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "5" , false ));
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
|
if(count == null){
|
||||||
|
return "redirect:/finishing/inventory-accounts?id=&title=&active=&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
|
||||||
|
}
|
||||||
return "/finishing/inventory-accounts";
|
return "/finishing/inventory-accounts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class InventoryAccountController {
|
||||||
RedirectAttributes redirectAttributes ){
|
RedirectAttributes redirectAttributes ){
|
||||||
try {
|
try {
|
||||||
inventoryAccountService.saveAccount( inventoryAccount );
|
inventoryAccountService.saveAccount( inventoryAccount );
|
||||||
redirectAttributes.addFlashAttribute("success", "Inventory Account Successfully Added" );
|
redirectAttributes.addFlashAttribute("success", inventoryAccount.getTitle() + " Successfully Added" );
|
||||||
} catch ( Exception e ){
|
} catch ( Exception e ){
|
||||||
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public class InventoryAccountController {
|
||||||
RedirectAttributes redirectAttributes ){
|
RedirectAttributes redirectAttributes ){
|
||||||
try {
|
try {
|
||||||
inventoryAccountService.saveAccount( inventoryAccount );
|
inventoryAccountService.saveAccount( inventoryAccount );
|
||||||
redirectAttributes.addFlashAttribute("success", "Inventory Account Successfully Added" );
|
redirectAttributes.addFlashAttribute("success", inventoryAccount.getTitle() + " Successfully update" );
|
||||||
} catch ( Exception e ){
|
} catch ( Exception e ){
|
||||||
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
package com.utopiaindustries.controller;
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.JobCardRole;
|
import com.utopiaindustries.auth.JobCardRole;
|
||||||
|
import com.utopiaindustries.dao.ctp.JobCardDAO;
|
||||||
import com.utopiaindustries.model.ctp.JobCard;
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCardItem;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.JobCardService;
|
import com.utopiaindustries.service.JobCardService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@JobCardRole
|
@JobCardRole
|
||||||
|
@ -20,19 +26,20 @@ public class JobCardController {
|
||||||
private final JobCardService jobCardService;
|
private final JobCardService jobCardService;
|
||||||
private final LocationService locationService;
|
private final LocationService locationService;
|
||||||
private final InventoryAccountService inventoryAccountService;
|
private final InventoryAccountService inventoryAccountService;
|
||||||
|
private final JobCardDAO jobCardDAO;
|
||||||
|
|
||||||
public JobCardController(JobCardService jobCardService, LocationService locationService, InventoryAccountService inventoryAccountService){
|
public JobCardController(JobCardService jobCardService, LocationService locationService, InventoryAccountService inventoryAccountService, JobCardDAO jobCardDAO){
|
||||||
this.jobCardService = jobCardService;
|
this.jobCardService = jobCardService;
|
||||||
this.locationService = locationService;
|
this.locationService = locationService;
|
||||||
this.inventoryAccountService = inventoryAccountService;
|
this.inventoryAccountService = inventoryAccountService;
|
||||||
|
this.jobCardDAO = jobCardDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get all job cards
|
* get all job cards
|
||||||
* */
|
* */
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String showJobCardList( @RequestParam( value = "id", required = false ) String id,
|
public String showJobCardList( @RequestParam( value = "code", required = false ) String code,
|
||||||
@RequestParam( value = "code", required = false ) String code,
|
|
||||||
@RequestParam( value = "status", required = false ) String status,
|
@RequestParam( value = "status", required = false ) String status,
|
||||||
@RequestParam( value = "inventory-status" , required = false) String inventoryStatus,
|
@RequestParam( value = "inventory-status" , required = false) String inventoryStatus,
|
||||||
@RequestParam( value = "customer" ,required = false ) String customer,
|
@RequestParam( value = "customer" ,required = false ) String customer,
|
||||||
|
@ -43,11 +50,17 @@ public class JobCardController {
|
||||||
@RequestParam( value = "created-end-date", required = false ) String createdEndDate,
|
@RequestParam( value = "created-end-date", required = false ) String createdEndDate,
|
||||||
@RequestParam( value = "limit" , required = false) Long limit,
|
@RequestParam( value = "limit" , required = false) Long limit,
|
||||||
Model model ){
|
Model model ){
|
||||||
List<JobCard> cards = jobCardService.getCards( id, code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId,createdStartDate, createdEndDate, limit );
|
List<JobCard> cards = jobCardService.getCards(code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId,createdStartDate, createdEndDate, limit );
|
||||||
model.addAttribute("cards", cards );
|
model.addAttribute("cards", cards );
|
||||||
model.addAttribute("statuses", JobCard.Status.values() );
|
model.addAttribute("statuses", JobCard.Status.values() );
|
||||||
model.addAttribute("invStatuses", JobCard.InventoryStatus.values() );
|
model.addAttribute("invStatuses", JobCard.InventoryStatus.values() );
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
|
LocalDate startDate = StringUtils.isNullOrEmpty(createdStartDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(createdStartDate);
|
||||||
|
LocalDate endDate = StringUtils.isNullOrEmpty(createdEndDate) ? LocalDate.now() : LocalDate.parse(createdEndDate);
|
||||||
|
if(StringUtils.isNullOrEmpty( createdStartDate) || StringUtils.isNullOrEmpty( createdEndDate )){
|
||||||
|
return "redirect:/job-cards/?code=&status=&inventory-status=&customer=&lot-number=&purchase-order-id=&purchase-order-code=&purchaseOrderTitle=&site-id=&site-title=&created-start-date="+startDate+"&created-end-date="+endDate+"&limit=100";
|
||||||
|
}
|
||||||
|
|
||||||
return "job-card-list";
|
return "job-card-list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +144,6 @@ public class JobCardController {
|
||||||
@PathVariable long id,
|
@PathVariable long id,
|
||||||
RedirectAttributes redirectAttributes,
|
RedirectAttributes redirectAttributes,
|
||||||
Model model ){
|
Model model ){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
jobCard.setStatus(JobCard.Status.POSTED.name() );
|
jobCard.setStatus(JobCard.Status.POSTED.name() );
|
||||||
jobCardService.save( jobCard );
|
jobCardService.save( jobCard );
|
||||||
|
@ -141,4 +153,33 @@ public class JobCardController {
|
||||||
}
|
}
|
||||||
return "redirect:/job-cards";
|
return "redirect:/job-cards";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping( value = "/job-card-detail/{id}" )
|
||||||
|
public String showJobCardDetail( @PathVariable("id") long id,
|
||||||
|
Model model ){
|
||||||
|
List<JobCardItem> jobCardItems = jobCardService.findJobCardItemByJobCardId(id);
|
||||||
|
List<Long> jobCardItemIds = jobCardItems.stream()
|
||||||
|
.map(JobCardItem::getItemId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<Long> itemIds = jobCardItems.stream()
|
||||||
|
.map(JobCardItem::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
model.addAttribute( "card", jobCardService.findByID(id));
|
||||||
|
model.addAttribute("jobCardItems", jobCardItems);
|
||||||
|
model.addAttribute("cutPiece",jobCardService.findCutPieceByJobCardItemIds(itemIds));
|
||||||
|
model.addAttribute("finishItem",jobCardService.findFinishItemByJobCardId(id));
|
||||||
|
model.addAttribute("stitchingItem",jobCardService.findStitchItemByJobCardId(id));
|
||||||
|
model.addAttribute("totalFinishItem",jobCardService.totalFinishItem(jobCardItemIds, id));
|
||||||
|
model.addAttribute("totalStitchingItem",jobCardService.totalStitchingItem(jobCardItemIds, id));
|
||||||
|
return "job-card-view";
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
|
||||||
|
ArrayList<LocalDate> localDates = new ArrayList<>();
|
||||||
|
while (start.isBefore(end)) {
|
||||||
|
localDates.add(start);
|
||||||
|
start = start.plusDays(1);
|
||||||
|
}
|
||||||
|
return localDates;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,15 @@ package com.utopiaindustries.controller;
|
||||||
import com.utopiaindustries.auth.PackagingRole;
|
import com.utopiaindustries.auth.PackagingRole;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
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.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@PackagingRole
|
@PackagingRole
|
||||||
@RequestMapping("/packaging" )
|
@RequestMapping("/packaging" )
|
||||||
|
@ -41,8 +44,9 @@ public class PackagingController {
|
||||||
Model model ){
|
Model model ){
|
||||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , null, null,true ) );
|
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , null, null,true ) );
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
|
if(count == null){
|
||||||
|
return "redirect:/packaging/inventory-accounts?id=&title=&active=1&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
|
||||||
|
}
|
||||||
return "/packaging/inventory-accounts";
|
return "/packaging/inventory-accounts";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,13 @@ import com.utopiaindustries.service.BundleService;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.InventoryService;
|
import com.utopiaindustries.service.InventoryService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@ -64,8 +66,13 @@ public class QualityControlController {
|
||||||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ){
|
Model model ){
|
||||||
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate, endDate, jobCardId ,count );
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId ,count );
|
||||||
model.addAttribute("items", itemList ) ;
|
model.addAttribute("items", itemList ) ;
|
||||||
|
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate )){
|
||||||
|
return "redirect:/quality-control/qc-finished-items?id=&item-id=&sku=&job-card-id=&start-date="+startDate1+"&end-date="+endDate1+"&count=100";
|
||||||
|
}
|
||||||
return "/quality-control/qc-items-list";
|
return "/quality-control/qc-items-list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,8 @@ public class ReportingController {
|
||||||
Model model ){
|
Model model ){
|
||||||
|
|
||||||
Map<String, Map<String, List<SummaryInventoryReport>>> getDataByFilteration = summaryInventoryReportService.findByFilter(itemId,sku,startDate,endDate);
|
Map<String, Map<String, List<SummaryInventoryReport>>> getDataByFilteration = summaryInventoryReportService.findByFilter(itemId,sku,startDate,endDate);
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(6) : LocalDate.parse(startDate);
|
||||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(7) : LocalDate.parse(startDate);
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now().plusDays(1) : LocalDate.parse(endDate);
|
||||||
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
|
||||||
|
|
||||||
ArrayList<LocalDate> arrayList = generateDateList(startDate1,endDate1);
|
ArrayList<LocalDate> arrayList = generateDateList(startDate1,endDate1);
|
||||||
model.addAttribute("dateLimits", arrayList);
|
model.addAttribute("dateLimits", arrayList);
|
||||||
model.addAttribute("tableData", getDataByFilteration);
|
model.addAttribute("tableData", getDataByFilteration);
|
||||||
|
|
|
@ -4,13 +4,13 @@ import com.utopiaindustries.auth.StitchingRole;
|
||||||
import com.utopiaindustries.model.ctp.JobCard;
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import com.utopiaindustries.service.*;
|
import com.utopiaindustries.service.*;
|
||||||
import org.springframework.core.io.InputStreamResource;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -75,8 +75,13 @@ 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){
|
||||||
|
return "redirect:/stitching/inventory-accounts?id=&title=&active=1&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
|
||||||
|
}
|
||||||
return "/stitching/inventory-accounts";
|
return "/stitching/inventory-accounts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,9 +96,23 @@ public class StitchingController {
|
||||||
@RequestParam( value = "end-date", required = false ) String endDate,
|
@RequestParam( value = "end-date", required = false ) String endDate,
|
||||||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ){
|
Model model
|
||||||
|
,RedirectAttributes redirect){
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, jobCardId ,count );
|
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, jobCardId ,count );
|
||||||
model.addAttribute("items", itemList ) ;
|
model.addAttribute("items", itemList ) ;
|
||||||
|
if(model.getAttribute("message") != null){
|
||||||
|
if(model.getAttribute("message").equals("Finished Item Created Successfully") ){
|
||||||
|
redirect.addFlashAttribute("success", model.getAttribute("message"));
|
||||||
|
|
||||||
|
}else {
|
||||||
|
redirect.addFlashAttribute("error", model.getAttribute("message"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate )){
|
||||||
|
return "redirect:/stitching/stitching-offline-items?id=&item-id=&sku=&job-card-id=&start-date="+startDate1+"&end-date="+endDate1+"&count=100";
|
||||||
|
}
|
||||||
return "/stitching/stitched-offline-items";
|
return "/stitching/stitched-offline-items";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,17 +129,22 @@ public class StitchingController {
|
||||||
Model model ){
|
Model model ){
|
||||||
try {
|
try {
|
||||||
inventoryService.createStitchingOfflineItemsFromJobCard( jobCard );
|
inventoryService.createStitchingOfflineItemsFromJobCard( jobCard );
|
||||||
redirectAttributes.addFlashAttribute("success", "Finished Item Created Successfully");
|
redirectAttributes.addFlashAttribute("message", "Finished Item Created Successfully");
|
||||||
} catch ( Exception exception ){
|
} catch ( Exception exception ){
|
||||||
redirectAttributes.addFlashAttribute( "error", exception.getMessage() );
|
exception.printStackTrace();
|
||||||
|
redirectAttributes.addFlashAttribute( "message", exception.getMessage() );
|
||||||
}
|
}
|
||||||
return "redirect:/stitching/stitching-offline-items";
|
return "redirect:/stitching/stitching-offline-items";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping( "/generate-barcodes" )
|
@PostMapping( "/generate-barcodes" )
|
||||||
public ResponseEntity<InputStreamResource> generateBarcode(@RequestParam( name = "ids" ) Long[] ids,
|
public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids,
|
||||||
@RequestParam( name = "artifactType" ) String artifactType ) throws Exception {
|
@RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
|
||||||
|
if (ids == null){
|
||||||
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
|
redirectAttributes.addFlashAttribute( "message", "Select At least One CheckBox" );
|
||||||
|
return "redirect:/stitching/stitching-offline-items";
|
||||||
|
}else {
|
||||||
|
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,11 +82,13 @@ public class AuthorityDAO {
|
||||||
// save all
|
// save all
|
||||||
public int[] saveAll( List<Authority> authorities ) {
|
public int[] saveAll( List<Authority> authorities ) {
|
||||||
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
|
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
|
||||||
|
if (authorities == null){
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[0]) );
|
||||||
|
}
|
||||||
for ( Authority authority: authorities ) {
|
for ( Authority authority: authorities ) {
|
||||||
MapSqlParameterSource params = prepareInsertQueryParams( authority );
|
MapSqlParameterSource params = prepareInsertQueryParams( authority );
|
||||||
batchArgs.add( params );
|
batchArgs.add( params );
|
||||||
}
|
}
|
||||||
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[authorities.size()]) );
|
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[authorities.size()]) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class CutPieceDAO {
|
||||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String SELECT_BY_ITEM_IDS = String.format( "SELECT * FROM %s WHERE job_card_item_id IN (:item_ids)", TABLE_NAME );
|
private final String SELECT_BY_ITEM_IDS = String.format( "SELECT * FROM %s WHERE job_card_item_id IN (:item_ids)", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_ITEM_IDS_AND_GROUP_BY = String.format( "SELECT id,job_card_item_id,type,SUM(quantity) AS quantity FROM %s WHERE job_card_item_id IN (:item_ids) GROUP BY job_card_item_id, type", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_item_id, type, quantity) VALUES (:id, :job_card_item_id, :type, :quantity) ON DUPLICATE KEY UPDATE job_card_item_id = VALUES(job_card_item_id), type = VALUES(type), quantity = VALUES(quantity)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_item_id, type, quantity) VALUES (:id, :job_card_item_id, :type, :quantity) ON DUPLICATE KEY UPDATE job_card_item_id = VALUES(job_card_item_id), type = VALUES(type), quantity = VALUES(quantity)", TABLE_NAME );
|
||||||
private final String DELETE_BY_ITEM_ID = String.format( "DELETE FROM %s WHERE job_card_item_id = :job_card_item_id", TABLE_NAME );
|
private final String DELETE_BY_ITEM_ID = String.format( "DELETE FROM %s WHERE job_card_item_id = :job_card_item_id", TABLE_NAME );
|
||||||
|
|
||||||
|
@ -86,6 +87,14 @@ public class CutPieceDAO {
|
||||||
return namedParameterJdbcTemplate.query(SELECT_BY_ITEM_IDS, params, new CutPieceRowMapper() );
|
return namedParameterJdbcTemplate.query(SELECT_BY_ITEM_IDS, params, new CutPieceRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CutPiece> findByJobCardItemIdsWithGroupByType( List<Long> itemIds ){
|
||||||
|
if( itemIds == null || itemIds.isEmpty() )
|
||||||
|
return new ArrayList<>();
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("item_ids", itemIds );
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_ITEM_IDS_AND_GROUP_BY, params, new CutPieceRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
public boolean deleteByItemId( long jobCardItemId ){
|
public boolean deleteByItemId( long jobCardItemId ){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("job_card_item_id", jobCardItemId );
|
params.addValue("job_card_item_id", jobCardItemId );
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class FinishOfflineItemRowMapper implements RowMapper<FinishedItem> {
|
||||||
|
public FinishedItem mapRow(ResultSet rs, int rowNum ) throws SQLException {
|
||||||
|
FinishedItem finishedItem = new FinishedItem();
|
||||||
|
finishedItem.setId( rs.getLong( "id" ) );
|
||||||
|
finishedItem.setItemId( rs.getLong( "item_id" ) );
|
||||||
|
finishedItem.setSku( rs.getString( "sku" ) );
|
||||||
|
finishedItem.setBarcode( rs.getString( "barcode" ) );
|
||||||
|
if ( rs.getTimestamp( "created_at" ) != null ) {
|
||||||
|
finishedItem.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
||||||
|
}
|
||||||
|
finishedItem.setCreatedBy( rs.getString( "created_by" ) );
|
||||||
|
finishedItem.setJobCardId( rs.getLong("job_card_id") );
|
||||||
|
finishedItem.setIsQa( rs.getBoolean("is_qa"));
|
||||||
|
finishedItem.setQaStatus( rs.getString("qa_status" ) );
|
||||||
|
return finishedItem;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
package com.utopiaindustries.dao.ctp;
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
import com.utopiaindustries.model.ctp.FinishedItem;
|
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import com.utopiaindustries.util.KeyHolderFunctions;
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
@ -9,6 +11,7 @@ import org.springframework.jdbc.support.KeyHolder;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@ -19,10 +22,13 @@ public class FinishedItemDAO {
|
||||||
private final String TABLE_NAME = "cut_to_pack.finished_item";
|
private final String TABLE_NAME = "cut_to_pack.finished_item";
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
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 = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
|
private final String SELECT_QUERY_BY_BARCODE_QA_STATUS = String.format( "SELECT case when EXISTS ( SELECT * FROM %s WHERE barcode = :barcode AND (qa_status = 'APPROVED' OR qa_status = 'WASHED') ) then true else false End as Result", TABLE_NAME );
|
||||||
|
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, stitched_item_id, is_segregated, qa_status) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :stitched_item_id, :is_segregated, :qa_status) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), stitched_item_id = VALUES(stitched_item_id), is_segregated = VALUES(is_segregated), qa_status = VALUES(qa_status)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, stitched_item_id, is_segregated, qa_status) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :stitched_item_id, :is_segregated, :qa_status) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), stitched_item_id = VALUES(stitched_item_id), is_segregated = VALUES(is_segregated), qa_status = VALUES(qa_status)", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
||||||
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
||||||
|
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME );
|
||||||
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated ORDER BY ID DESC", TABLE_NAME );
|
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated ORDER BY ID DESC", TABLE_NAME );
|
||||||
private final String SELECT_BY_STITCHED_ITEM_ID = String.format( "SELECT * FROM %s WHERE stitched_item_id = :stitched_item_id", TABLE_NAME );
|
private final String SELECT_BY_STITCHED_ITEM_ID = String.format( "SELECT * FROM %s WHERE stitched_item_id = :stitched_item_id", TABLE_NAME );
|
||||||
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 SELECT_BY_STITCHED_ITEM_IDS = String.format( "SELECT * FROM %s WHERE stitched_item_id IN (:stitched_item_ids)", TABLE_NAME );
|
||||||
|
@ -98,6 +104,10 @@ public class FinishedItemDAO {
|
||||||
return namedParameterJdbcTemplate.query( query, new FinishedItemRowMapper() );
|
return namedParameterJdbcTemplate.query( query, new FinishedItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<FinishedItem> findFinishOfflineItemByQuery(String query ){
|
||||||
|
return namedParameterJdbcTemplate.query( query, new FinishedItemRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
public List<FinishedItem> findByIds(List<Long> ids ){
|
public List<FinishedItem> findByIds(List<Long> ids ){
|
||||||
if( ids == null || ids.isEmpty() ) return new ArrayList<>();
|
if( ids == null || ids.isEmpty() ) return new ArrayList<>();
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
@ -112,6 +122,12 @@ public class FinishedItemDAO {
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_TERM , params, new FinishedItemRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_BY_TERM , params, new FinishedItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find By job card Id
|
||||||
|
public List<FinishedItem> findByJobCardId(long jobCardId ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "job_card_id", jobCardId );
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_QUERY_BY_JOB_CARD, params, new FinishedItemRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
public FinishedItem findByStitchedItem( long stitchedItemId ){
|
public FinishedItem findByStitchedItem( long stitchedItemId ){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
@ -123,10 +139,37 @@ public class FinishedItemDAO {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<Long, Long> findTotalCount(List<Long> itemIds, long jobCardId) {
|
||||||
|
HashMap<Long, Long> totalCounts = new HashMap<>();
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
for (long id : itemIds) {
|
||||||
|
params.addValue("job_card_id", jobCardId);
|
||||||
|
params.addValue("item_id", id);
|
||||||
|
Long total = namedParameterJdbcTemplate.queryForObject(FIND_TOTAL_COUNT, params, Long.class);
|
||||||
|
if (total != null) {
|
||||||
|
totalCounts.put(id, total);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return totalCounts;
|
||||||
|
}
|
||||||
|
|
||||||
public List<FinishedItem> findByStitchedItemIds( List<Long> stitchedItemIds ){
|
public List<FinishedItem> findByStitchedItemIds( List<Long> stitchedItemIds ){
|
||||||
if( stitchedItemIds == null || stitchedItemIds.isEmpty() ) return new ArrayList<>();
|
if( stitchedItemIds == null || stitchedItemIds.isEmpty() ) return new ArrayList<>();
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("stitched_item_ids", stitchedItemIds );
|
params.addValue("stitched_item_ids", stitchedItemIds );
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_STITCHED_ITEM_IDS, params, new FinishedItemRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_BY_STITCHED_ITEM_IDS, params, new FinishedItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StitchingOfflineItem> findByBarcodeAndApprovedStatus( List<StitchingOfflineItem> finishedItems ){
|
||||||
|
List<StitchingOfflineItem> items = new ArrayList<>();
|
||||||
|
for (StitchingOfflineItem item : finishedItems){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("barcode", item.getBarcode() );
|
||||||
|
boolean check =Boolean.TRUE.equals(namedParameterJdbcTemplate.queryForObject( SELECT_QUERY_BY_BARCODE_QA_STATUS, params, Boolean.class ));
|
||||||
|
if(!check){
|
||||||
|
items.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ public class InventoryAccountDAO {
|
||||||
|
|
||||||
private final String TABLE_NAME = "cut_to_pack.inventory_account";
|
private final String TABLE_NAME = "cut_to_pack.inventory_account";
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
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 = String.format( "SELECT * FROM %s ORDER BY title DESC", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, title, parent_entity_type, parent_entity_id, active, created_by, created_at, location_site_id, notes, is_packaging) VALUES (:id, :title, :parent_entity_type, :parent_entity_id, :active, :created_by, :created_at, :location_site_id, :notes, :is_packaging) ON DUPLICATE KEY UPDATE title = VALUES(title), parent_entity_type = VALUES(parent_entity_type), parent_entity_id = VALUES(parent_entity_id), active = VALUES(active), created_by = VALUES(created_by), created_at = VALUES(created_at), location_site_id = VALUES(location_site_id), notes = VALUES(notes), is_packaging = VALUES(is_packaging)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, title, parent_entity_type, parent_entity_id, active, created_by, created_at, location_site_id, notes, is_packaging) VALUES (:id, :title, :parent_entity_type, :parent_entity_id, :active, :created_by, :created_at, :location_site_id, :notes, :is_packaging) ON DUPLICATE KEY UPDATE title = VALUES(title), parent_entity_type = VALUES(parent_entity_type), parent_entity_id = VALUES(parent_entity_id), active = VALUES(active), created_by = VALUES(created_by), created_at = VALUES(created_at), location_site_id = VALUES(location_site_id), notes = VALUES(notes), is_packaging = VALUES(is_packaging)", TABLE_NAME );
|
||||||
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class JobCardDAO {
|
||||||
private final String TABLE_NAME = "cut_to_pack.job_card";
|
private final String TABLE_NAME = "cut_to_pack.job_card";
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
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 = 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 DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, code, job_order_id, created_at, created_by, status, inventory_status, customer, lot_number, purchase_order_id, location_site_id, description) VALUES (:id, :code, :job_order_id, :created_at, :created_by, :status, :inventory_status, :customer, :lot_number, :purchase_order_id, :location_site_id, :description) ON DUPLICATE KEY UPDATE code = VALUES(code), job_order_id = VALUES(job_order_id), created_at = VALUES(created_at), created_by = VALUES(created_by), status = VALUES(status), inventory_status = VALUES(inventory_status), customer = VALUES(customer), lot_number = VALUES(lot_number), purchase_order_id = VALUES(purchase_order_id), location_site_id = VALUES(location_site_id), description = VALUES(description)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, code, job_order_id, created_at, created_by, status, inventory_status, customer, lot_number, purchase_order_id, location_site_id, description) VALUES (:id, :code, :job_order_id, :created_at, :created_by, :status, :inventory_status, :customer, :lot_number, :purchase_order_id, :location_site_id, :description) ON DUPLICATE KEY UPDATE code = VALUES(code), job_order_id = VALUES(job_order_id), created_at = VALUES(created_at), created_by = VALUES(created_by), status = VALUES(status), inventory_status = VALUES(inventory_status), customer = VALUES(customer), lot_number = VALUES(lot_number), purchase_order_id = VALUES(purchase_order_id), location_site_id = VALUES(location_site_id), description = VALUES(description)", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIKE_CODE_AND_INV_STATUS_AND_STATUS = String.format( "SELECT * FROM %s WHERE code like :code AND status = :status AND inventory_status = :inventory_status", TABLE_NAME );
|
private final String SELECT_BY_LIKE_CODE_AND_INV_STATUS_AND_STATUS = String.format( "SELECT * FROM %s WHERE code like :code AND status = :status AND inventory_status = :inventory_status", TABLE_NAME );
|
||||||
|
@ -56,6 +57,7 @@ public class JobCardDAO {
|
||||||
.orElse( new JobCard() );
|
.orElse( new JobCard() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// find all
|
// find all
|
||||||
public List<JobCard> findAll() {
|
public List<JobCard> findAll() {
|
||||||
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new JobCardRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new JobCardRowMapper() );
|
||||||
|
@ -110,4 +112,10 @@ public class JobCardDAO {
|
||||||
public List<JobCard> findByQuery( String query ){
|
public List<JobCard> findByQuery( String query ){
|
||||||
return namedParameterJdbcTemplate.query( query, new JobCardRowMapper() );
|
return namedParameterJdbcTemplate.query( query, new JobCardRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<JobCard> findByAllWithLimit(Long limit){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("limit", limit.intValue());
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY_WITH_LIMIT, params, new JobCardRowMapper() );
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ import org.springframework.jdbc.support.KeyHolder;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@ -19,9 +20,11 @@ public class StitchingOfflineItemDAO {
|
||||||
private final String TABLE_NAME = "cut_to_pack.stitching_offline_item";
|
private final String TABLE_NAME = "cut_to_pack.stitching_offline_item";
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
private final String SELECT_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 = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
|
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, qa_remarks, qa_status) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), qa_remarks = VALUES(qa_remarks), qa_status = VALUES(qa_status)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, qa_remarks, qa_status) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), qa_remarks = VALUES(qa_remarks), qa_status = VALUES(qa_status)", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
||||||
|
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME );
|
||||||
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
||||||
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term ORDER BY ID DESC", TABLE_NAME );
|
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term ORDER BY ID DESC", TABLE_NAME );
|
||||||
private final String SELECT_BY_MASTER_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
private final String SELECT_BY_MASTER_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
||||||
|
@ -103,6 +106,12 @@ public class StitchingOfflineItemDAO {
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_IDS , params, new StitchingOfflineItemRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_BY_IDS , params, new StitchingOfflineItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StitchingOfflineItem> findByJobCardId(long jobCardId){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "job_card_id", jobCardId );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_QUERY_BY_JOB_CARD , params, new StitchingOfflineItemRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
public List<StitchingOfflineItem> findByTerm( String term ){
|
public List<StitchingOfflineItem> findByTerm( String term ){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("term", "%" + term + "%" );
|
params.addValue("term", "%" + term + "%" );
|
||||||
|
@ -115,4 +124,20 @@ public class StitchingOfflineItemDAO {
|
||||||
params.addValue("job_card_id", masterId );
|
params.addValue("job_card_id", masterId );
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_MASTER_ID , params, new StitchingOfflineItemRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_BY_MASTER_ID , params, new StitchingOfflineItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<Long, Long> findTotalCount(List<Long> itemIds, long jobCardId) {
|
||||||
|
HashMap<Long, Long> totalCounts = new HashMap<>();
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
for (long id : itemIds) {
|
||||||
|
params.addValue("job_card_id", jobCardId);
|
||||||
|
params.addValue("item_id", id);
|
||||||
|
Long total = namedParameterJdbcTemplate.queryForObject(FIND_TOTAL_COUNT, params, Long.class);
|
||||||
|
|
||||||
|
if (total != null) {
|
||||||
|
totalCounts.put(id, total);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return totalCounts;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,9 +42,9 @@ public class InventoryAccountQueryBuilder {
|
||||||
.setTable("cut_to_pack.inventory_account")
|
.setTable("cut_to_pack.inventory_account")
|
||||||
.setColumns("*")
|
.setColumns("*")
|
||||||
.where()
|
.where()
|
||||||
.columnEquals("id", id)
|
|
||||||
.and()
|
|
||||||
.columnLikeTitle("title", title)
|
.columnLikeTitle("title", title)
|
||||||
|
.or()
|
||||||
|
.columnEquals("id", id)
|
||||||
.and()
|
.and()
|
||||||
.columnEquals("active", active)
|
.columnEquals("active", active)
|
||||||
.and()
|
.and()
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
public class JobCardQueryBuilder {
|
public class JobCardQueryBuilder {
|
||||||
|
|
||||||
public static String buildQuery( String id, String code, String createdBy, String status, String inventoryStatus, String customer, String lotNumber, String purchaseOrderId, String locationSiteId, String startDate, String endDate, Long count ){
|
public static String buildQuery(String code, String createdBy, String status, String inventoryStatus, String customer, String lotNumber, String purchaseOrderId, String locationSiteId, String startDate, String endDate, Long count ){
|
||||||
// format date
|
// format date
|
||||||
String formattedDate;
|
String formattedDate;
|
||||||
String formattedEndDate;
|
String formattedEndDate;
|
||||||
|
@ -30,9 +30,9 @@ public class JobCardQueryBuilder {
|
||||||
.setTable( "cut_to_pack.job_card" )
|
.setTable( "cut_to_pack.job_card" )
|
||||||
.setColumns( "*" )
|
.setColumns( "*" )
|
||||||
.where()
|
.where()
|
||||||
.columnEquals( "id", id )
|
.columnEquals("created_by",createdBy)
|
||||||
.and()
|
.and()
|
||||||
.columnEquals( "code", code )
|
.columnLike( "code" , "%" + code +"%" )
|
||||||
.and()
|
.and()
|
||||||
.columnEquals( "status", status )
|
.columnEquals( "status", status )
|
||||||
.and()
|
.and()
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
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 StichedOfflineItemQueryBuilder {
|
||||||
|
|
||||||
|
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, String jobCardId, Long count) {
|
||||||
|
// format date
|
||||||
|
String formattedDate;
|
||||||
|
String formattedEndDate;
|
||||||
|
String startDate1 = "";
|
||||||
|
String endDate1 = "";
|
||||||
|
if (!StringUtils.isNullOrEmpty( createdStartDate)) {
|
||||||
|
formattedDate = CTPDateTimeFormat.getMySQLFormattedDateString(createdStartDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
formattedEndDate = CTPDateTimeFormat.getMySQLFormattedDateString(createdEndDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
startDate1 = String.format("'%s 00:00:01'", formattedDate);
|
||||||
|
if (!StringUtils.isNullOrEmpty(createdEndDate)) {
|
||||||
|
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.stitching_offline_item")
|
||||||
|
.setColumns("*")
|
||||||
|
.where()
|
||||||
|
.columnEquals("id", id)
|
||||||
|
.and()
|
||||||
|
.columnEquals("sku", sku)
|
||||||
|
.and()
|
||||||
|
.columnEquals("item_id", itemId )
|
||||||
|
.and()
|
||||||
|
.columnEquals("job_card_id", jobCardId )
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrGreaterThan("created_at", startDate1)
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrLessThan("created_at", endDate1 )
|
||||||
|
.orderBy("id","DESC")
|
||||||
|
.limit(count)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.utopiaindustries.restcontroller;
|
package com.utopiaindustries.restcontroller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.FinishedItemDAO;
|
||||||
import com.utopiaindustries.dao.ctp.StitchingOfflineItemDAO;
|
import com.utopiaindustries.dao.ctp.StitchingOfflineItemDAO;
|
||||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -13,14 +14,18 @@ import java.util.List;
|
||||||
@RequestMapping( "/rest/stitching-offline-items" )
|
@RequestMapping( "/rest/stitching-offline-items" )
|
||||||
public class StitchingItemsRestController {
|
public class StitchingItemsRestController {
|
||||||
|
|
||||||
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
|
|
||||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
|
|
||||||
public StitchingItemsRestController(StitchingOfflineItemDAO stitchingOfflineItemDAO) {
|
public StitchingItemsRestController(StitchingOfflineItemDAO stitchingOfflineItemDAO, FinishedItemDAO finishedItemDAO) {
|
||||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/search" )
|
@GetMapping( "/search" )
|
||||||
public List<StitchingOfflineItem> searchFinishedItems(@RequestParam( "term") String term ){
|
public List<StitchingOfflineItem> searchFinishedItems(@RequestParam( "term") String term ){
|
||||||
return stitchingOfflineItemDAO.findByTerm( term );
|
List<StitchingOfflineItem> items = stitchingOfflineItemDAO.findByTerm( term );
|
||||||
|
return finishedItemDAO.findByBarcodeAndApprovedStatus(items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import com.utopiaindustries.querybuilder.ctp.BundleQueryBuilder;
|
import com.utopiaindustries.querybuilder.ctp.BundleQueryBuilder;
|
||||||
import com.utopiaindustries.querybuilder.ctp.FinishedItemQueryBuilder;
|
import com.utopiaindustries.querybuilder.ctp.FinishedItemQueryBuilder;
|
||||||
import com.utopiaindustries.querybuilder.ctp.MasterBundleQueryBuilder;
|
import com.utopiaindustries.querybuilder.ctp.MasterBundleQueryBuilder;
|
||||||
|
import com.utopiaindustries.querybuilder.ctp.StichedOfflineItemQueryBuilder;
|
||||||
import com.utopiaindustries.util.NumberUtils;
|
import com.utopiaindustries.util.NumberUtils;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
|
@ -99,7 +100,7 @@ public class BundleService {
|
||||||
count = 100L;
|
count = 100L;
|
||||||
}
|
}
|
||||||
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId ) ){
|
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, jobCardId ) ){
|
||||||
String query = FinishedItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId , count );
|
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, jobCardId , count );
|
||||||
System.out.println( query );
|
System.out.println( query );
|
||||||
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -51,4 +51,13 @@ public class InventoryArtifactService {
|
||||||
finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) );
|
finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) );
|
||||||
return finishedItem;
|
return finishedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get finished Items By Job Card ID
|
||||||
|
* */
|
||||||
|
public FinishedItem findFinishedItemByJobCardId( long id ){
|
||||||
|
FinishedItem finishedItem = finishedItemDAO.find( id );
|
||||||
|
finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) );
|
||||||
|
return finishedItem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class InventoryService {
|
||||||
if ( jobCardId == 0 || jobCardWrapper.getItems( ) == null || jobCardWrapper.getItems( ).isEmpty( ) ) {
|
if ( jobCardId == 0 || jobCardWrapper.getItems( ) == null || jobCardWrapper.getItems( ).isEmpty( ) ) {
|
||||||
throw new RuntimeException( " JobCard can`t be empty");
|
throw new RuntimeException( " JobCard can`t be empty");
|
||||||
}
|
}
|
||||||
JobCard jobCard = jobCardDAO.find( jobCardId );
|
JobCard jobCard = jobCardDAO.find( jobCardId );
|
||||||
// get job cad items
|
// get job cad items
|
||||||
List<JobCardItemWrapper> jobCardItemWrappers = jobCardWrapper.getItems( );
|
List<JobCardItemWrapper> jobCardItemWrappers = jobCardWrapper.getItems( );
|
||||||
List<Long> jobCardItemWrapperIds = jobCardItemWrappers.stream( )
|
List<Long> jobCardItemWrapperIds = jobCardItemWrappers.stream( )
|
||||||
|
@ -155,6 +155,8 @@ public class InventoryService {
|
||||||
|
|
||||||
if ( transactionType.equalsIgnoreCase( InventoryTransactionLeg.Type.IN.name( ))) {
|
if ( transactionType.equalsIgnoreCase( InventoryTransactionLeg.Type.IN.name( ))) {
|
||||||
initialBalance = initialBalance.add( inventoryTransactionLeg.getQuantity( ));
|
initialBalance = initialBalance.add( inventoryTransactionLeg.getQuantity( ));
|
||||||
|
}else if(transactionType.equalsIgnoreCase( InventoryTransactionLeg.Type.OUT.name( )) && inventoryTransactionLeg.getQuantity().equals(BigDecimal.ZERO)){
|
||||||
|
initialBalance = BigDecimal.ZERO;
|
||||||
} else {
|
} else {
|
||||||
initialBalance = initialBalance.subtract( inventoryTransactionLeg.getQuantity( ));
|
initialBalance = initialBalance.subtract( inventoryTransactionLeg.getQuantity( ));
|
||||||
}
|
}
|
||||||
|
@ -256,9 +258,11 @@ public class InventoryService {
|
||||||
throw new RuntimeException( "Item cant be Empty | null");
|
throw new RuntimeException( "Item cant be Empty | null");
|
||||||
}
|
}
|
||||||
for ( JobCardItem jobCardItem : cardItems) {
|
for ( JobCardItem jobCardItem : cardItems) {
|
||||||
int finalQuantity = jobCardItem.getActualProduction( ).compareTo( jobCardItem.getTotalProduction( ).add( jobCardItem.getProduction( )));
|
if( jobCardItem.getTotalProduction() != null ){
|
||||||
if ( finalQuantity < 0) {
|
int finalQuantity = jobCardItem.getActualProduction( ).compareTo( jobCardItem.getTotalProduction( ).add( jobCardItem.getProduction( )));
|
||||||
throw new RuntimeException( " Items cant be generated because it exceeds from limit of expected Production");
|
if ( finalQuantity < 0) {
|
||||||
|
throw new RuntimeException( " Items cant be generated because it exceeds from limit of expected Production");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,11 +299,15 @@ public class InventoryService {
|
||||||
public void createStitchingOfflineItemsFromJobCard( JobCard jobCard) {
|
public void createStitchingOfflineItemsFromJobCard( JobCard jobCard) {
|
||||||
List<JobCardItem> jobCardItems = jobCard.getItems( );
|
List<JobCardItem> jobCardItems = jobCard.getItems( );
|
||||||
List<JobCardItem> updatedItems = new ArrayList<>( );
|
List<JobCardItem> updatedItems = new ArrayList<>( );
|
||||||
|
|
||||||
// validate items
|
// validate items
|
||||||
validateItems( jobCardItems);
|
validateItems( jobCardItems);
|
||||||
// check whether all bundles are received against finish goods
|
// check whether all bundles are received against finish goods
|
||||||
checkAllBundleAreReceived( jobCard.getId( ), jobCardItems);
|
checkAllBundleAreReceived( jobCard.getId( ), jobCardItems);
|
||||||
for ( JobCardItem item : jobCardItems) {
|
for ( JobCardItem item : jobCardItems) {
|
||||||
|
if(item.getTotalProduction() == null){
|
||||||
|
item.setTotalProduction(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
// select which has inventory
|
// select which has inventory
|
||||||
if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) {
|
if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) {
|
||||||
// production is completed out bundles
|
// production is completed out bundles
|
||||||
|
@ -439,7 +447,7 @@ public class InventoryService {
|
||||||
.stream( )
|
.stream( )
|
||||||
.collect( Collectors.toMap( InventoryTransactionLeg::getParentDocumentId, Function.identity( )));
|
.collect( Collectors.toMap( InventoryTransactionLeg::getParentDocumentId, Function.identity( )));
|
||||||
|
|
||||||
// get finished items from stitched items i f exists
|
// get finished items from stitched items if exists
|
||||||
List<Long> preCreatedFinishedItemIds = finishedItemDAO.findByStitchedItemIds( stitchedItemIds ).stream( ).
|
List<Long> preCreatedFinishedItemIds = finishedItemDAO.findByStitchedItemIds( stitchedItemIds ).stream( ).
|
||||||
map( FinishedItem::getId ).collect( Collectors.toList( ));
|
map( FinishedItem::getId ).collect( Collectors.toList( ));
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,14 @@ import com.utopiaindustries.model.uind.Item;
|
||||||
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
|
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
@ -31,8 +33,10 @@ public class JobCardService {
|
||||||
private final LocationSiteDAO locationSiteDAO;
|
private final LocationSiteDAO locationSiteDAO;
|
||||||
private final PurchaseOrderDAO purchaseOrderDAO;
|
private final PurchaseOrderDAO purchaseOrderDAO;
|
||||||
private final UserInventoryAccountDAO userInventoryAccountDAO;
|
private final UserInventoryAccountDAO userInventoryAccountDAO;
|
||||||
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
|
|
||||||
public JobCardService(JobCardDAO jobCardDAO, CutPieceTypeDAO cutPieceTypeDAO, JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, ItemDAO itemDAO, LocationSiteDAO locationSiteDAO, PurchaseOrderDAO purchaseOrderDAO, UserInventoryAccountDAO userInventoryAccountDAO) {
|
public JobCardService(JobCardDAO jobCardDAO, CutPieceTypeDAO cutPieceTypeDAO, JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, ItemDAO itemDAO, LocationSiteDAO locationSiteDAO, PurchaseOrderDAO purchaseOrderDAO, UserInventoryAccountDAO userInventoryAccountDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO) {
|
||||||
this.jobCardDAO = jobCardDAO;
|
this.jobCardDAO = jobCardDAO;
|
||||||
this.cutPieceTypeDAO = cutPieceTypeDAO;
|
this.cutPieceTypeDAO = cutPieceTypeDAO;
|
||||||
this.jobCardItemDAO = jobCardItemDAO;
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
|
@ -41,6 +45,8 @@ public class JobCardService {
|
||||||
this.locationSiteDAO = locationSiteDAO;
|
this.locationSiteDAO = locationSiteDAO;
|
||||||
this.purchaseOrderDAO = purchaseOrderDAO;
|
this.purchaseOrderDAO = purchaseOrderDAO;
|
||||||
this.userInventoryAccountDAO = userInventoryAccountDAO;
|
this.userInventoryAccountDAO = userInventoryAccountDAO;
|
||||||
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -63,8 +69,7 @@ public class JobCardService {
|
||||||
/*
|
/*
|
||||||
* get cards
|
* get cards
|
||||||
* */
|
* */
|
||||||
public List<JobCard> getCards( String id,
|
public List<JobCard> getCards( String code,
|
||||||
String code,
|
|
||||||
String status,
|
String status,
|
||||||
String inventoryStatus,
|
String inventoryStatus,
|
||||||
String customer,
|
String customer,
|
||||||
|
@ -79,11 +84,16 @@ public class JobCardService {
|
||||||
if( limit == null ){
|
if( limit == null ){
|
||||||
limit = 100L;
|
limit = 100L;
|
||||||
}
|
}
|
||||||
if( StringUtils.isAnyNotNullOrEmpty( id, code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate ) ){
|
if( StringUtils.isAnyNotNullOrEmpty( code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate ) ){
|
||||||
String query = JobCardQueryBuilder.buildQuery( id, code, authentication.getName(), status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate, limit );
|
String query = JobCardQueryBuilder.buildQuery(code, authentication.getName(), status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate, limit );
|
||||||
System.out.println( query );
|
System.out.println( query );
|
||||||
|
for (GrantedAuthority role : authentication.getAuthorities()){
|
||||||
|
if (role.toString().equals("ROLE_ADMIN")){
|
||||||
|
return jobCards = jobCardDAO.findByAllWithLimit(limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
jobCards = jobCardDAO.findByQuery( query );
|
jobCards = jobCardDAO.findByQuery( query );
|
||||||
} else {
|
}else {
|
||||||
jobCards = jobCardDAO.findByUserAndLimit( authentication.getName(), limit );
|
jobCards = jobCardDAO.findByUserAndLimit( authentication.getName(), limit );
|
||||||
}
|
}
|
||||||
return jobCards;
|
return jobCards;
|
||||||
|
@ -115,6 +125,7 @@ public class JobCardService {
|
||||||
@Transactional( rollbackFor = Exception.class )
|
@Transactional( rollbackFor = Exception.class )
|
||||||
public void save(JobCard jobCard) {
|
public void save(JobCard jobCard) {
|
||||||
if (jobCard != null && jobCard.getItems() != null) {
|
if (jobCard != null && jobCard.getItems() != null) {
|
||||||
|
jobCard.setInventoryStatus(String.valueOf(JobCard.InventoryStatus.NOT_RECEIVED_YET));
|
||||||
long jobCardId = jobCardDAO.save( jobCard );
|
long jobCardId = jobCardDAO.save( jobCard );
|
||||||
jobCard.setId( jobCardId );
|
jobCard.setId( jobCardId );
|
||||||
generateCode( jobCard );
|
generateCode( jobCard );
|
||||||
|
@ -192,9 +203,6 @@ public class JobCardService {
|
||||||
return jobCard;
|
return jobCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find card recursively
|
* find card recursively
|
||||||
* */
|
* */
|
||||||
|
@ -255,5 +263,31 @@ public class JobCardService {
|
||||||
public List<JobCardItem> getJobCardItems( long jobCardId ){
|
public List<JobCardItem> getJobCardItems( long jobCardId ){
|
||||||
return jobCardItemDAO.findByCardId( jobCardId );
|
return jobCardItemDAO.findByCardId( jobCardId );
|
||||||
}
|
}
|
||||||
|
public JobCard findByID( long jobCardId ){
|
||||||
|
return jobCardDAO.find( jobCardId );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JobCardItem> findJobCardItemByJobCardId( long jobCardId ){
|
||||||
|
return jobCardItemDAO.findByCardId(jobCardId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CutPiece> findCutPieceByJobCardItemIds( List<Long> itemIds ){
|
||||||
|
return cutPieceDAO.findByJobCardItemIdsWithGroupByType(itemIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FinishedItem> findFinishItemByJobCardId( long jobCardId ){
|
||||||
|
return finishedItemDAO.findByJobCardId( jobCardId );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StitchingOfflineItem> findStitchItemByJobCardId( long jobCardId ){
|
||||||
|
return stitchingOfflineItemDAO.findByJobCardId( jobCardId );
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<Long, Long> totalStitchingItem(List<Long> itemIds, long jobCardId ){
|
||||||
|
return stitchingOfflineItemDAO.findTotalCount( itemIds, jobCardId );
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<Long, Long> totalFinishItem(List<Long> itemIds, long jobCardId ){
|
||||||
|
return finishedItemDAO.findTotalCount( itemIds, jobCardId );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,13 +87,17 @@ public class UserService {
|
||||||
|
|
||||||
private void saveUserRolesAndAccounts( User user ){
|
private void saveUserRolesAndAccounts( User user ){
|
||||||
List<Authority> newRoles = user.getAuthorities();
|
List<Authority> newRoles = user.getAuthorities();
|
||||||
newRoles.forEach(authority -> authority.setUsername( user.getUsername() ));
|
if(newRoles != null) {
|
||||||
|
newRoles.forEach(authority -> authority.setUsername(user.getUsername()));
|
||||||
|
}
|
||||||
List<UserInventoryAccount> newInventoryAccounts = user.getInventoryAccounts();
|
List<UserInventoryAccount> newInventoryAccounts = user.getInventoryAccounts();
|
||||||
newInventoryAccounts.forEach(account -> account.setUsername( user.getUsername() ));
|
if( newInventoryAccounts != null ){
|
||||||
|
newInventoryAccounts.forEach(account -> account.setUsername( user.getUsername() ));
|
||||||
|
userInventoryAccountDAO.saveAll( newInventoryAccounts );
|
||||||
|
}
|
||||||
|
|
||||||
// save
|
// save
|
||||||
authorityDAO.saveAll( newRoles );
|
authorityDAO.saveAll( newRoles );
|
||||||
userInventoryAccountDAO.saveAll( newInventoryAccounts );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deletePreviousRolesAndAccounts( User user ){
|
private void deletePreviousRolesAndAccounts( User user ){
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template : `
|
template : `
|
||||||
<table class="table table-bordered bg-white col-sm-8">
|
<table class="table table-bordered bg-white col-sm-12">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
|
|
@ -191,7 +191,7 @@
|
||||||
<input type="number" class="form-control" v-bind:name="'items[' + pIndex + '].cutPieces[' + index +'].quantity'" v-model="piece.quantity" required>
|
<input type="number" class="form-control" v-bind:name="'items[' + pIndex + '].cutPieces[' + index +'].quantity'" v-model="piece.quantity" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
<span class="bi-trash2-fill" title="Remove Piece" v-on:click="removePiece" ></span>
|
<span class="bi-trash2-fill btn" title="Remove Piece" v-on:click="removePiece" ></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template: `
|
template: `
|
||||||
<table class="table table-bordered bg-white col-sm-8">
|
<table class="table table-bordered bg-white col-sm-12">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<td width="400">
|
<td width="400">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId" >
|
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId" >
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardItemId'" v-bind:value="item.id" >
|
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardItemId'" v-bind:value="item.id" >
|
||||||
<item-search
|
<item-search
|
||||||
v-bind:id-field-name="'items[' + index + '].itemId'"
|
v-bind:id-field-name="'items[' + index + '].itemId'"
|
||||||
v-bind:id="item.itemId"
|
v-bind:id="item.itemId"
|
||||||
v-bind:title="item.title"
|
v-bind:title="item.title"
|
||||||
|
@ -37,10 +37,10 @@
|
||||||
<span class="form-control" readonly>{{item.expectedProduction}}</span>
|
<span class="form-control" readonly>{{item.expectedProduction}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td width="200">
|
<td width="200">
|
||||||
<input class="form-control" type="number" v-bind:name="'items[' + index + '].actualProduction'" v-bind:max="item.expectedProduction" required>
|
<input class="form-control" min="0" type="number" v-bind:name="'items[' + index + '].actualProduction'" v-bind:max="item.expectedProduction" required>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="form-control" >{{ populateCuttingAccount() }}</span>
|
{{ populateCuttingAccount() }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`
|
`
|
||||||
|
@ -60,15 +60,15 @@
|
||||||
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].id'" v-bind:value="piece.id">
|
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].id'" v-bind:value="piece.id">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].jobCardItemId'" v-bind:value="piece.jobCardItemId">
|
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].jobCardItemId'" v-bind:value="piece.jobCardItemId">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].type'" v-bind:value="piece.type">
|
<input hidden="hidden" v-bind:name="'items[' + pIndex + '].pieces[' + index + '].type'" v-bind:value="piece.type">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<select class="form-control" v-bind:name="'pieces[' + index +'].type'" v-model="piece.type" disabled>
|
<select style="width: 150px;" class="form-control" v-bind:name="'pieces[' + index +'].type'" v-model="piece.type" disabled>
|
||||||
<option value="">Please Select</option>
|
<option value="">Please Select</option>
|
||||||
<option v-for="(type,index) in $types"
|
<option v-for="(type,index) in $types"
|
||||||
v-bind:selected="type.title === piece.type"
|
v-bind:selected="type.title === piece.type"
|
||||||
v-bind:value="type.title">{{type.title}}</option>
|
v-bind:value="type.title">{{type.title}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-6" style="padding-left: 40px;">
|
||||||
<input class="form-control" type="number" v-bind:name="'items[' + pIndex + '].pieces[' + index +'].quantity'" v-model="piece.quantity" required/>
|
<input class="form-control" type="number" v-bind:name="'items[' + pIndex + '].pieces[' + index +'].quantity'" v-model="piece.quantity" required/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
template : `
|
template : `
|
||||||
<table class="table table-bordered bg-white col-sm-12">
|
<table class="table table-bordered bg-white w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Item</th>
|
<th>Item</th>
|
||||||
|
@ -89,11 +89,12 @@
|
||||||
<th>Cut Pieces</th>
|
<th>Cut Pieces</th>
|
||||||
<th>Expected Production</th>
|
<th>Expected Production</th>
|
||||||
<th>Actual Production</th>
|
<th>Actual Production</th>
|
||||||
<th>Account</th>
|
<th style="width: 312px" >Account</th>
|
||||||
|
</tr>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<item-rows v-for="(item,index) in jobCard.items"
|
<item-rows v-for="(item,index) in jobCard.items"
|
||||||
v-bind:key="index"
|
v-bind:key="index"
|
||||||
v-bind:index="index"
|
v-bind:index="index"
|
||||||
v-bind:item="item">
|
v-bind:item="item">
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging') ? 'active' : ''}">Packaging</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging') ? 'active' : ''}">Packaging</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_PACKAGING', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_REPORTING', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/reporting/summary}" class="nav-link"
|
<a th:href="@{/reporting/summary}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting') ? 'active' : ''}">Reporting</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting') ? 'active' : ''}">Reporting</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -48,7 +48,8 @@
|
||||||
<div class="col-sm-3 form-group" data-vue-app th:with="id=*{locationSiteId},title=*{locationTitle}">
|
<div class="col-sm-3 form-group" data-vue-app th:with="id=*{locationSiteId},title=*{locationTitle}">
|
||||||
<location-site-search th:attr="id=${id},title=${title}"
|
<location-site-search th:attr="id=${id},title=${title}"
|
||||||
v-bind:label-text="'Location Site'"
|
v-bind:label-text="'Location Site'"
|
||||||
v-bind:id-field-name="'locationSiteId'">
|
v-bind:id-field-name="'locationSiteId'"
|
||||||
|
v-bind:required="true">
|
||||||
</location-site-search>
|
</location-site-search>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Job Order</label>
|
<label>Job Order</label>
|
||||||
<input class="form-control" th:field="*{jobOrderId}" required>
|
<input type="number" class="form-control" th:field="*{jobOrderId}" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Customer</label>
|
<label>Customer</label>
|
||||||
|
|
|
@ -8,11 +8,7 @@
|
||||||
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
||||||
<h5 class="mb-4">Refine Your Search</h5>
|
<h5 class="mb-4">Refine Your Search</h5>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>ID</label>
|
<label>ID/Code</label>
|
||||||
<input type="text" class="form-control" name="id" maxlength="100" th:value="${param['id']}">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Code</label>
|
|
||||||
<input type="text" class="form-control" name="code" maxlength="100" th:value="${param['code']}">
|
<input type="text" class="form-control" name="code" maxlength="100" th:value="${param['code']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<input type="text" class="form-control" name="jc-id" maxlength="100" th:value="${param['jc-id']}">
|
<input type="text" class="form-control" name="jc-id" maxlength="100" th:value="${param['jc-id']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Master Bundle ID</label>
|
<label>Master Barcode ID</label>
|
||||||
<input type="text" class="form-control" name="master-id" maxlength="100" th:value="${param['master-id']}">
|
<input type="text" class="form-control" name="master-id" maxlength="100" th:value="${param['master-id']}">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
v-bind:disabled="hasDuplicates() || bundles.length === 0">
|
v-bind:disabled="hasDuplicates() || bundles.length === 0">
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<a th:href="@{/cutting/bundles}" class="btn btn-light">Cancel</a>
|
<a th:href="@{/cutting/generate-master-barcode}" class="btn btn-light">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-12">
|
||||||
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm">
|
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="transaction : ${transactions}" th:object="${transaction}">
|
<tr th:if="${transaction.getBalance() > -1 }" th:each="transaction : ${transactions}" th:object="${transaction}">
|
||||||
<td th:text="*{id}"></td>
|
<td th:text="*{id}"></td>
|
||||||
<td th:text="*{itemId}"></td>
|
<td th:text="*{itemId}"></td>
|
||||||
<td th:text="*{sku}"></td>
|
<td th:text="*{sku}"></td>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-light p-3 mb-3" v-if="jobCard.id !== undefined">
|
<div class="bg-light p-3 mb-3" v-if="jobCard.id !== undefined">
|
||||||
<h6>Job Card Details</h6>
|
<h6>Job Card Details</h6>
|
||||||
<table class="table table-bordered bg-white col-sm-8">
|
<table class="table table-bordered bg-white col-sm-12">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Code</th>
|
<th>Code</th>
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-primary" type="submit">Receive Inventory</button>
|
<button class="btn btn-primary" type="submit">Receive Inventory</button>
|
||||||
<a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
|
<a th:href="@{/cutting/receive-inventory}" class="btn btn-light">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
|
|
|
@ -50,9 +50,9 @@
|
||||||
<td th:text="${item.createdBy}"></td>
|
<td th:text="${item.createdBy}"></td>
|
||||||
<td ctp:formatdatetime="${item.createdAt}"></td>
|
<td ctp:formatdatetime="${item.createdAt}"></td>
|
||||||
<td>
|
<td>
|
||||||
<span th:if="${not item.isSegregated && !item.qaStatus.equals('ALTER')}" class="badge badge-danger">PENDING</span>
|
<span th:if="${not item.isSegregated && item.qaStatus != ('ALTER')}" class="badge badge-danger">PENDING</span>
|
||||||
<span th:if="${not item.isSegregated && item.qaStatus.equals('ALTER')}" class="badge" style="background: yellow">REVERTED</span>
|
<span th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}" class="badge badge-warning">REVERTED</span>
|
||||||
<div th:if="${item.isSegregated && !item.qaStatus.equals('ALTER')}">
|
<div th:if="${item.isSegregated && item.qaStatus != ('ALTER')}">
|
||||||
<span class="badge badge-APPROVED">DONE</span>
|
<span class="badge badge-APPROVED">DONE</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="card : ${cards}" th:object="${card}">
|
<tr th:each="card : ${cards}" th:object="${card}">
|
||||||
<td th:text="*{code}"></td>
|
<td><a class="text-reset" th:href="@{'job-card-detail/' + *{getId()}}" th:text="*{code}"></a></td>
|
||||||
<td th:text="*{jobOrderId}"></td>
|
<td th:text="*{jobOrderId}"></td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge" th:classappend="'badge-' + *{status}" th:if="*{status}" th:text="*{status}"></span>
|
<span class="badge" th:classappend="'badge-' + *{status}" th:if="*{status}" th:text="*{status}"></span>
|
||||||
|
|
|
@ -0,0 +1,176 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:uind="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Job Card Detail')"></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">
|
||||||
|
<table class="table table-bordered" >
|
||||||
|
<thead class="thead-dark">
|
||||||
|
<tr>
|
||||||
|
<th colspan="2" class="text-center">
|
||||||
|
<span th:text="${card.getCode()}"></span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><i>Job Order ID</i></td>
|
||||||
|
<td>
|
||||||
|
<span >
|
||||||
|
<a class="text-reset" target="_blank" th:text="${card.getJobOrderId()}" ></a>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Card Status</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:text="${card.getStatus()}"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Inventory Status</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:text="${card.getInventoryStatus()}"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Customer</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:text="${card.getCustomer()}"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Lot Number</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:text="${card.getLotNumber()}"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Purchase Order ID</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:text="${card.getPurchaseOrderId()}"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Items</i></td>
|
||||||
|
<td class="m-0 p-0">
|
||||||
|
<table class="table mb-0 text-center">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Expected Production</th>
|
||||||
|
<th>Actual Production</th>
|
||||||
|
<th>Total Production</th>
|
||||||
|
<th>Total Stitching Item</th>
|
||||||
|
<th>Total Finish Item</th>
|
||||||
|
<th class="text-center font-lg">Cut Piece Items</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="cardItem : ${jobCardItems}">
|
||||||
|
<td th:text="${cardItem.getId()}"></td>
|
||||||
|
<td th:text="${cardItem.getItemId()}"></td>
|
||||||
|
<td th:text="${cardItem.getSku()}"></td>
|
||||||
|
<td th:text="${cardItem.getExpectedProduction()}"></td>
|
||||||
|
<td th:text="${cardItem.getActualProduction()}"></td>
|
||||||
|
<td th:text="${cardItem.getTotalProduction()}"></td>
|
||||||
|
<td th:text="${totalStitchingItem.get(cardItem.getItemId())}"></td>
|
||||||
|
<td th:text="${totalFinishItem.get(cardItem.getItemId())}"></td>
|
||||||
|
<td class="m-0 p-0">
|
||||||
|
<table class="table m-0 p-0">
|
||||||
|
<tbody>
|
||||||
|
<tr th:if="*{cardItem.getId() == cutPieceItem.getJobCardItemId()}" th:each="cutPieceItem : ${cutPiece}">
|
||||||
|
<td th:text="${cutPieceItem.getType()}"></td>
|
||||||
|
<td th:text="${cutPieceItem.getQuantity()}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Stitching Offline Items</i> <i ></i></td>
|
||||||
|
<td class="m-0 p-0 text-center">
|
||||||
|
|
||||||
|
<table th:if="${!stitchingItem.isEmpty() }" class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Bar Code</th>
|
||||||
|
<th>QA Status</th>
|
||||||
|
<th>QA Remarks</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="cardStitchingItem : ${stitchingItem}">
|
||||||
|
<td th:text="${cardStitchingItem.getId()}"></td>
|
||||||
|
<td th:text="${cardStitchingItem.getItemId()}">ad</td>
|
||||||
|
<td th:text="${cardStitchingItem.getSku()}"></td>
|
||||||
|
<td th:text="${cardStitchingItem.getBarcode()}"></td>
|
||||||
|
<td>
|
||||||
|
<span th:if="${cardStitchingItem.getQaStatus() == 'APPROVED'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-APPROVED"></span>
|
||||||
|
<span th:if="${cardStitchingItem.getQaStatus() == 'REJECT'}" th:text="${cardStitchingItem.getQaStatus()}" class="badge badge-warning"></span>
|
||||||
|
</td>
|
||||||
|
<td th:text="${cardStitchingItem.getQaRemarks()}"></td>
|
||||||
|
<td ctp:formatdatetime="${cardStitchingItem.getCreatedAt()}"></td>
|
||||||
|
<td th:text="${cardStitchingItem.getCreatedBy()}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<span th:if="${stitchingItem.isEmpty() }" class="p-5 text-center font-lg font-weight-bold" > No Data Available</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>Finish Items</i></td>
|
||||||
|
<td class="m-0 p-0 text-center">
|
||||||
|
<table th:if="${!finishItem.isEmpty() }" class="table mb-0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Bar Code</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="cardfinishItem : ${finishItem}">
|
||||||
|
<td th:text="${cardfinishItem.getId()}"></td>
|
||||||
|
<td th:text="${cardfinishItem.getItemId()}">ad</td>
|
||||||
|
<td th:text="${cardfinishItem.getSku()}"></td>
|
||||||
|
<td th:text="${cardfinishItem.getBarcode()}"></td>
|
||||||
|
<td>
|
||||||
|
<span th:if="${cardfinishItem.getQaStatus() == 'APPROVED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-APPROVED"></span>
|
||||||
|
<span th:if="${cardfinishItem.getQaStatus() == 'WASHED'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-danger"></span>
|
||||||
|
<span th:if="${cardfinishItem.getQaStatus() == 'ALTER'}" th:text="${cardfinishItem.getQaStatus()}" class="badge badge-warning"></span>
|
||||||
|
</td>
|
||||||
|
<td ctp:formatdatetime="${cardfinishItem.getCreatedAt()}"></td>
|
||||||
|
<td th:text="${cardfinishItem.getCreatedBy()}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<span th:if="${finishItem.isEmpty() }" class="p-5 text-center font-lg font-weight-bold" > No Data Available</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -29,7 +29,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<h4>No process found.</h4>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Finishing Account</label>
|
<label>Finishing Account</label>
|
||||||
<select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>
|
<select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>
|
||||||
<option value="">PLease select</option>
|
<option value="">Please select</option>
|
||||||
<option th:each="account : ${accounts}"
|
<option th:each="account : ${accounts}"
|
||||||
th:value="${account.id}"
|
th:value="${account.id}"
|
||||||
th:text="${account.title}"></option>
|
th:text="${account.title}"></option>
|
||||||
|
|
|
@ -50,9 +50,9 @@
|
||||||
<td th:text="${item.createdBy}"></td>
|
<td th:text="${item.createdBy}"></td>
|
||||||
<td ctp:formatdatetime="${item.createdAt}"></td>
|
<td ctp:formatdatetime="${item.createdAt}"></td>
|
||||||
<td>
|
<td>
|
||||||
<span th:if="${not item.isSegregated && !item.qaStatus.equals('ALTER')}" class="badge badge-danger">PENDING</span>
|
<span th:if="${not item.isSegregated && item.qaStatus != 'ALTER'}" class="badge badge-danger">PENDING</span>
|
||||||
<span th:if="${not item.isSegregated && item.qaStatus.equals('ALTER')}" class="badge" style="background: yellow">REVERTED</span>
|
<span th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}" class="badge badge-warning" >REVERTED</span>
|
||||||
<div th:if="${item.isSegregated && !item.qaStatus.equals('ALTER')}">
|
<div th:if="${item.isSegregated && item.qaStatus != ('ALTER')}">
|
||||||
<span class="badge badge-APPROVED">DONE</span>
|
<span class="badge badge-APPROVED">DONE</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -7,10 +7,6 @@
|
||||||
<div class="page-filters-sidebar">
|
<div class="page-filters-sidebar">
|
||||||
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
||||||
<h5 class="mb-4">Refine Your Search</h5>
|
<h5 class="mb-4">Refine Your Search</h5>
|
||||||
<div class="form-group">
|
|
||||||
<label>Item ID</label>
|
|
||||||
<input type="text" class="form-control" name="item-id" maxlength="100" th:value="${param['item-id']}">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>SKu</label>
|
<label>SKu</label>
|
||||||
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
|
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
|
||||||
|
|
|
@ -29,11 +29,25 @@
|
||||||
<td th:rowspan="${#lists.size(sku)}" th:text="${sku}" class="align-middle" rowspan="3" ></td>
|
<td th:rowspan="${#lists.size(sku)}" th:text="${sku}" class="align-middle" rowspan="3" ></td>
|
||||||
<td th:each="dates: ${dateLimits}" class="p-0 ">
|
<td th:each="dates: ${dateLimits}" class="p-0 ">
|
||||||
<table th:each="data : ${tableData.get(sku)}" class="table table-striped table-bordered table-hover font-sm m-0 " >
|
<table th:each="data : ${tableData.get(sku)}" class="table table-striped table-bordered table-hover font-sm m-0 " >
|
||||||
|
<thead th:if="${data.getKey() == dates.toString()}">
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>IN</th>
|
||||||
|
<th>OUT</th>
|
||||||
|
<th>BALANCE</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody >
|
<tbody >
|
||||||
<tr th:each="reportSummary : ${data.getValue()}" rowspan="3" >
|
<tr th:each="reportSummary : ${data.getValue()}" rowspan="3" >
|
||||||
<td th:if="${data.getKey() == dates.toString()}" >
|
<td th:if="${data.getKey() == dates.toString()}" >
|
||||||
<span th:text="${reportSummary.getParentDocumentType()} + ' ' + ${reportSummary.getParentDocumentPieceType()}"></span>
|
<span th:text="${reportSummary.getParentDocumentType()} + ' ' + ${reportSummary.getParentDocumentPieceType()}"></span>
|
||||||
</td>
|
</td>
|
||||||
|
<td th:if="${data.getKey() == dates.toString()}" class="w-25 text-center" >
|
||||||
|
<span th:text="${reportSummary.getTotalIn()}"></span>
|
||||||
|
</td>
|
||||||
|
<td th:if="${data.getKey() == dates.toString()}" class="w-25 text-center" >
|
||||||
|
<span th:text="${reportSummary.getTotalOut()}"></span>
|
||||||
|
</td>
|
||||||
<td th:if="${data.getKey() == dates.toString()}" class="w-25 text-center" >
|
<td th:if="${data.getKey() == dates.toString()}" class="w-25 text-center" >
|
||||||
<span th:text="${reportSummary.getTotalIn() - reportSummary.getTotalOut()}"></span>
|
<span th:text="${reportSummary.getTotalIn() - reportSummary.getTotalOut()}"></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
<span class="form-control">{{item.actualProduction}}</span>
|
<span class="form-control">{{item.actualProduction}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].totalProduction'" v-bind:value="item.totalProduction">
|
<input hidden="hidden" v-bind:name="'items[' + index + '].totalProduction'" v-bind:value="item.totalProduction">
|
||||||
<span class="form-control">{{item.totalProduction}}</span>
|
<span class="form-control">{{item.totalProduction}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<td th:text="*{username}"></td>
|
<td th:text="*{username}"></td>
|
||||||
<td th:text="*{authorities}"></td>
|
<td th:text="*{authorities}"></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" th:checked="*{enabled}" />
|
<input onclick="return false;" type="checkbox" th:checked="*{enabled}" />
|
||||||
</td>
|
</td>
|
||||||
<td th:text="*{inventoryAccounts}"></td>
|
<td th:text="*{inventoryAccounts}"></td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
application:
|
|
||||||
title: Cut To Pack Service
|
|
||||||
version: v1.0
|
|
||||||
|
|
||||||
spring:
|
|
||||||
resources:
|
|
||||||
chain:
|
|
||||||
cache: false
|
|
||||||
strategy:
|
|
||||||
content:
|
|
||||||
enabled: true
|
|
||||||
paths: /**
|
|
||||||
html-application-cache: true
|
|
||||||
enabled: true
|
|
||||||
cache:
|
|
||||||
period: 0
|
|
||||||
static-locations: file:./src/main/resources/static/
|
|
||||||
thymeleaf:
|
|
||||||
check-template-location: true
|
|
||||||
cache: false
|
|
||||||
prefix: file:./src/main/resources/templates/
|
|
||||||
uinddatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3306/uind_vms
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
logbackUrl: jdbc:mysql://192.168.90.108:3306/uind_logs?serverTimezone=Asia/Karachi
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: UINDMainPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
cosmosdatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3307
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: UINDCosmosPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
localdatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3306/cut_to_pack
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: CTPPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
|
|
||||||
server:
|
|
||||||
servlet:
|
|
||||||
context-path: /ctp
|
|
||||||
tomcat:
|
|
||||||
remoteip:
|
|
||||||
remote-ip-header: X-FORWARDED-FOR
|
|
||||||
max-parameter-count: 50000
|
|
||||||
port: 8080
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
mime-types: text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json, application/xml
|
|
||||||
min-response-size: 2KB
|
|
||||||
|
|
||||||
thymeleaf-layout-dialect:
|
|
||||||
version: 2.1.1
|
|
||||||
|
|
||||||
ctp:
|
|
||||||
cipher:
|
|
||||||
key: BC87A69BFCEC4A71E73B8DCCC4F14
|
|
||||||
seed-value : 7XYXo8Qq6D
|
|
|
@ -1,8 +0,0 @@
|
||||||
,-----. ,--. ,--------. ,------. ,--.
|
|
||||||
' .--./,--.,--.,-' '-. '--. .--',---. | .--. ' ,--,--.,---.| |,-.
|
|
||||||
| | | || |'-. .-' | | | .-. | | '--' |' ,-. | .--'| /
|
|
||||||
' '--'\' '' ' | | | | ' '-' ' | | --' \ '-' \ `--.| \ \
|
|
||||||
`-----' `----' `--' `--' `---' `--' `--`--'`---'`--'`--'
|
|
||||||
|
|
||||||
${application.title} ${application.version}
|
|
||||||
Powered by Spring Boot ${spring-boot.version}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue