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.model.ctp.JobCardWrapper;
|
||||
import com.utopiaindustries.service.*;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Controller
|
||||
|
@ -61,8 +61,12 @@ public class CuttingController {
|
|||
@RequestParam( value = "site-id", required = false ) String siteId,
|
||||
@RequestParam( value = "count", required = false ) Long count,
|
||||
Model model ){
|
||||
|
||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , "PROCESS", "1", false) );
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -73,7 +77,7 @@ public class CuttingController {
|
|||
@ModelAttribute JobCardWrapper wrapper ){
|
||||
try {
|
||||
inventoryService.receiveJobCardInventory( jobCardId, wrapper );
|
||||
redirectAttributes.addFlashAttribute("success", "Inventory Success Received" );
|
||||
redirectAttributes.addFlashAttribute("success", "Inventory Successfully Received by Job Card ID: " +jobCardId );
|
||||
} catch ( Exception ex ){
|
||||
redirectAttributes.addFlashAttribute("error", ex.getMessage() );
|
||||
}
|
||||
|
@ -105,6 +109,7 @@ public class CuttingController {
|
|||
@GetMapping( "/bundles" )
|
||||
public String showBundles( @RequestParam( value = "id", required = false ) String id,
|
||||
@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 = "master-id" , required = false ) String masterId,
|
||||
@RequestParam( value = "type", required = false) String type,
|
||||
|
@ -113,8 +118,14 @@ public class CuttingController {
|
|||
@RequestParam( value = "end-date", required = false) String endDate,
|
||||
@RequestParam( value = "count", required = false ) Long count,
|
||||
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() );
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -125,8 +136,17 @@ public class CuttingController {
|
|||
@RequestParam(value = "start-date", required = false) String startDate,
|
||||
@RequestParam(value = "end-date", required = false) String endDate,
|
||||
@RequestParam(value = "count", required = false) Long count,
|
||||
Model model ){
|
||||
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, jobCardId, startDate, endDate, count ) );
|
||||
@RequestParam( value = "exceptionCheck", required = false, defaultValue = "false") boolean exceptionCheck,
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -139,9 +159,11 @@ public class CuttingController {
|
|||
|
||||
|
||||
@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 {
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,13 @@ import com.utopiaindustries.service.BundleService;
|
|||
import com.utopiaindustries.service.InventoryAccountService;
|
||||
import com.utopiaindustries.service.InventoryService;
|
||||
import com.utopiaindustries.service.LocationService;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
|
@ -48,8 +50,13 @@ public class FinishingController {
|
|||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||
@RequestParam( value = "count", required = false ) Long count,
|
||||
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 ) ;
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -70,6 +77,9 @@ public class FinishingController {
|
|||
// 5 for Finishing
|
||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "5" , false ));
|
||||
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";
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public class InventoryAccountController {
|
|||
RedirectAttributes redirectAttributes ){
|
||||
try {
|
||||
inventoryAccountService.saveAccount( inventoryAccount );
|
||||
redirectAttributes.addFlashAttribute("success", "Inventory Account Successfully Added" );
|
||||
redirectAttributes.addFlashAttribute("success", inventoryAccount.getTitle() + " Successfully Added" );
|
||||
} catch ( Exception e ){
|
||||
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class InventoryAccountController {
|
|||
RedirectAttributes redirectAttributes ){
|
||||
try {
|
||||
inventoryAccountService.saveAccount( inventoryAccount );
|
||||
redirectAttributes.addFlashAttribute("success", "Inventory Account Successfully Added" );
|
||||
redirectAttributes.addFlashAttribute("success", inventoryAccount.getTitle() + " Successfully update" );
|
||||
} catch ( Exception e ){
|
||||
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||
}
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
package com.utopiaindustries.controller;
|
||||
|
||||
import com.utopiaindustries.auth.JobCardRole;
|
||||
import com.utopiaindustries.dao.ctp.JobCardDAO;
|
||||
import com.utopiaindustries.model.ctp.JobCard;
|
||||
import com.utopiaindustries.model.ctp.JobCardItem;
|
||||
import com.utopiaindustries.service.InventoryAccountService;
|
||||
import com.utopiaindustries.service.JobCardService;
|
||||
import com.utopiaindustries.service.LocationService;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
@JobCardRole
|
||||
|
@ -20,19 +26,20 @@ public class JobCardController {
|
|||
private final JobCardService jobCardService;
|
||||
private final LocationService locationService;
|
||||
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.locationService = locationService;
|
||||
this.inventoryAccountService = inventoryAccountService;
|
||||
this.jobCardDAO = jobCardDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all job cards
|
||||
* */
|
||||
@GetMapping
|
||||
public String showJobCardList( @RequestParam( value = "id", required = false ) String id,
|
||||
@RequestParam( value = "code", required = false ) String code,
|
||||
public String showJobCardList( @RequestParam( value = "code", required = false ) String code,
|
||||
@RequestParam( value = "status", required = false ) String status,
|
||||
@RequestParam( value = "inventory-status" , required = false) String inventoryStatus,
|
||||
@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 = "limit" , required = false) Long limit,
|
||||
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("statuses", JobCard.Status.values() );
|
||||
model.addAttribute("invStatuses", JobCard.InventoryStatus.values() );
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -131,7 +144,6 @@ public class JobCardController {
|
|||
@PathVariable long id,
|
||||
RedirectAttributes redirectAttributes,
|
||||
Model model ){
|
||||
|
||||
try {
|
||||
jobCard.setStatus(JobCard.Status.POSTED.name() );
|
||||
jobCardService.save( jobCard );
|
||||
|
@ -141,4 +153,33 @@ public class JobCardController {
|
|||
}
|
||||
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.service.InventoryAccountService;
|
||||
import com.utopiaindustries.service.LocationService;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Controller
|
||||
@PackagingRole
|
||||
@RequestMapping("/packaging" )
|
||||
|
@ -41,8 +44,9 @@ public class PackagingController {
|
|||
Model model ){
|
||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , null, null,true ) );
|
||||
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";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,11 +7,13 @@ import com.utopiaindustries.service.BundleService;
|
|||
import com.utopiaindustries.service.InventoryAccountService;
|
||||
import com.utopiaindustries.service.InventoryService;
|
||||
import com.utopiaindustries.service.LocationService;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
|
@ -64,8 +66,13 @@ public class QualityControlController {
|
|||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||
@RequestParam( value = "count", required = false ) Long count,
|
||||
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 ) ;
|
||||
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";
|
||||
}
|
||||
|
||||
|
|
|
@ -34,10 +34,8 @@ public class ReportingController {
|
|||
Model model ){
|
||||
|
||||
Map<String, Map<String, List<SummaryInventoryReport>>> getDataByFilteration = summaryInventoryReportService.findByFilter(itemId,sku,startDate,endDate);
|
||||
|
||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(7) : LocalDate.parse(startDate);
|
||||
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||
|
||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(6) : LocalDate.parse(startDate);
|
||||
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now().plusDays(1) : LocalDate.parse(endDate);
|
||||
ArrayList<LocalDate> arrayList = generateDateList(startDate1,endDate1);
|
||||
model.addAttribute("dateLimits", arrayList);
|
||||
model.addAttribute("tableData", getDataByFilteration);
|
||||
|
|
|
@ -4,13 +4,13 @@ import com.utopiaindustries.auth.StitchingRole;
|
|||
import com.utopiaindustries.model.ctp.JobCard;
|
||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||
import com.utopiaindustries.service.*;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -75,8 +75,13 @@ public class StitchingController {
|
|||
@RequestParam( value = "count", required = false ) Long count,
|
||||
Model model ) {
|
||||
// 2 for stitching
|
||||
|
||||
|
||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -91,9 +96,23 @@ public class StitchingController {
|
|||
@RequestParam( value = "end-date", required = false ) String endDate,
|
||||
@RequestParam( value = "job-card-id", required = false ) String jobCardId,
|
||||
@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 );
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -110,17 +129,22 @@ public class StitchingController {
|
|||
Model model ){
|
||||
try {
|
||||
inventoryService.createStitchingOfflineItemsFromJobCard( jobCard );
|
||||
redirectAttributes.addFlashAttribute("success", "Finished Item Created Successfully");
|
||||
redirectAttributes.addFlashAttribute("message", "Finished Item Created Successfully");
|
||||
} catch ( Exception exception ){
|
||||
redirectAttributes.addFlashAttribute( "error", exception.getMessage() );
|
||||
exception.printStackTrace();
|
||||
redirectAttributes.addFlashAttribute( "message", exception.getMessage() );
|
||||
}
|
||||
return "redirect:/stitching/stitching-offline-items";
|
||||
}
|
||||
|
||||
@PostMapping( "/generate-barcodes" )
|
||||
public ResponseEntity<InputStreamResource> generateBarcode(@RequestParam( name = "ids" ) Long[] ids,
|
||||
@RequestParam( name = "artifactType" ) String artifactType ) throws Exception {
|
||||
|
||||
public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids,
|
||||
@RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
|
||||
if (ids == null){
|
||||
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
|
||||
public int[] saveAll( List<Authority> authorities ) {
|
||||
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
|
||||
if (authorities == null){
|
||||
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[0]) );
|
||||
}
|
||||
for ( Authority authority: authorities ) {
|
||||
MapSqlParameterSource params = prepareInsertQueryParams( authority );
|
||||
batchArgs.add( params );
|
||||
}
|
||||
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 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_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 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() );
|
||||
}
|
||||
|
||||
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 ){
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
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;
|
||||
|
||||
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||
import com.utopiaindustries.model.ctp.JobCard;
|
||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
|
@ -9,6 +11,7 @@ import org.springframework.jdbc.support.KeyHolder;
|
|||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
|
@ -19,10 +22,13 @@ public class FinishedItemDAO {
|
|||
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_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 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_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_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 );
|
||||
|
@ -98,6 +104,10 @@ public class FinishedItemDAO {
|
|||
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 ){
|
||||
if( ids == null || ids.isEmpty() ) return new ArrayList<>();
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
|
@ -112,6 +122,12 @@ public class FinishedItemDAO {
|
|||
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 ){
|
||||
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 ){
|
||||
if( stitchedItemIds == null || stitchedItemIds.isEmpty() ) return new ArrayList<>();
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
params.addValue("stitched_item_ids", stitchedItemIds );
|
||||
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 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 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 );
|
||||
|
|
|
@ -21,6 +21,7 @@ public class JobCardDAO {
|
|||
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_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||
private final String SELECT_ALL_QUERY_WITH_LIMIT = String.format( "SELECT * FROM %s ORDER BY id DESC limit :limit", TABLE_NAME );
|
||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, 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 );
|
||||
|
@ -56,6 +57,7 @@ public class JobCardDAO {
|
|||
.orElse( new JobCard() );
|
||||
}
|
||||
|
||||
|
||||
// find all
|
||||
public List<JobCard> findAll() {
|
||||
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, new JobCardRowMapper() );
|
||||
|
@ -110,4 +112,10 @@ public class JobCardDAO {
|
|||
public List<JobCard> findByQuery( String query ){
|
||||
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 java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
|
@ -19,9 +20,11 @@ public class StitchingOfflineItemDAO {
|
|||
private final String TABLE_NAME = "cut_to_pack.stitching_offline_item";
|
||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", 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 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_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 );
|
||||
|
@ -103,6 +106,12 @@ public class StitchingOfflineItemDAO {
|
|||
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 ){
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
params.addValue("term", "%" + term + "%" );
|
||||
|
@ -115,4 +124,20 @@ public class StitchingOfflineItemDAO {
|
|||
params.addValue("job_card_id", masterId );
|
||||
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")
|
||||
.setColumns("*")
|
||||
.where()
|
||||
.columnEquals("id", id)
|
||||
.and()
|
||||
.columnLikeTitle("title", title)
|
||||
.or()
|
||||
.columnEquals("id", id)
|
||||
.and()
|
||||
.columnEquals("active", active)
|
||||
.and()
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.time.LocalDate;
|
|||
|
||||
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
|
||||
String formattedDate;
|
||||
String formattedEndDate;
|
||||
|
@ -30,9 +30,9 @@ public class JobCardQueryBuilder {
|
|||
.setTable( "cut_to_pack.job_card" )
|
||||
.setColumns( "*" )
|
||||
.where()
|
||||
.columnEquals( "id", id )
|
||||
.columnEquals("created_by",createdBy)
|
||||
.and()
|
||||
.columnEquals( "code", code )
|
||||
.columnLike( "code" , "%" + code +"%" )
|
||||
.and()
|
||||
.columnEquals( "status", status )
|
||||
.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;
|
||||
|
||||
import com.utopiaindustries.dao.ctp.FinishedItemDAO;
|
||||
import com.utopiaindustries.dao.ctp.StitchingOfflineItemDAO;
|
||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -13,14 +14,18 @@ import java.util.List;
|
|||
@RequestMapping( "/rest/stitching-offline-items" )
|
||||
public class StitchingItemsRestController {
|
||||
|
||||
private final FinishedItemDAO finishedItemDAO;
|
||||
|
||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||
|
||||
public StitchingItemsRestController(StitchingOfflineItemDAO stitchingOfflineItemDAO) {
|
||||
public StitchingItemsRestController(StitchingOfflineItemDAO stitchingOfflineItemDAO, FinishedItemDAO finishedItemDAO) {
|
||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||
this.finishedItemDAO = finishedItemDAO;
|
||||
}
|
||||
|
||||
@GetMapping( "/search" )
|
||||
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.FinishedItemQueryBuilder;
|
||||
import com.utopiaindustries.querybuilder.ctp.MasterBundleQueryBuilder;
|
||||
import com.utopiaindustries.querybuilder.ctp.StichedOfflineItemQueryBuilder;
|
||||
import com.utopiaindustries.util.NumberUtils;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
@ -99,7 +100,7 @@ public class BundleService {
|
|||
count = 100L;
|
||||
}
|
||||
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 );
|
||||
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
||||
} else {
|
||||
|
|
|
@ -51,4 +51,13 @@ public class InventoryArtifactService {
|
|||
finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) );
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,6 +155,8 @@ public class InventoryService {
|
|||
|
||||
if ( transactionType.equalsIgnoreCase( InventoryTransactionLeg.Type.IN.name( ))) {
|
||||
initialBalance = initialBalance.add( inventoryTransactionLeg.getQuantity( ));
|
||||
}else if(transactionType.equalsIgnoreCase( InventoryTransactionLeg.Type.OUT.name( )) && inventoryTransactionLeg.getQuantity().equals(BigDecimal.ZERO)){
|
||||
initialBalance = BigDecimal.ZERO;
|
||||
} else {
|
||||
initialBalance = initialBalance.subtract( inventoryTransactionLeg.getQuantity( ));
|
||||
}
|
||||
|
@ -256,12 +258,14 @@ public class InventoryService {
|
|||
throw new RuntimeException( "Item cant be Empty | null");
|
||||
}
|
||||
for ( JobCardItem jobCardItem : cardItems) {
|
||||
if( jobCardItem.getTotalProduction() != null ){
|
||||
int finalQuantity = jobCardItem.getActualProduction( ).compareTo( jobCardItem.getTotalProduction( ).add( jobCardItem.getProduction( )));
|
||||
if ( finalQuantity < 0) {
|
||||
throw new RuntimeException( " Items cant be generated because it exceeds from limit of expected Production");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAllBundleAreReceived( long jobCardId,
|
||||
List<JobCardItem> jobCardItems) {
|
||||
|
@ -295,11 +299,15 @@ public class InventoryService {
|
|||
public void createStitchingOfflineItemsFromJobCard( JobCard jobCard) {
|
||||
List<JobCardItem> jobCardItems = jobCard.getItems( );
|
||||
List<JobCardItem> updatedItems = new ArrayList<>( );
|
||||
|
||||
// validate items
|
||||
validateItems( jobCardItems);
|
||||
// check whether all bundles are received against finish goods
|
||||
checkAllBundleAreReceived( jobCard.getId( ), jobCardItems);
|
||||
for ( JobCardItem item : jobCardItems) {
|
||||
if(item.getTotalProduction() == null){
|
||||
item.setTotalProduction(BigDecimal.ZERO);
|
||||
}
|
||||
// select which has inventory
|
||||
if ( item.getProduction( ).compareTo( BigDecimal.ZERO ) != 0 ) {
|
||||
// production is completed out bundles
|
||||
|
|
|
@ -9,12 +9,14 @@ import com.utopiaindustries.model.uind.Item;
|
|||
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
|
||||
import com.utopiaindustries.util.StringUtils;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
@ -31,8 +33,10 @@ public class JobCardService {
|
|||
private final LocationSiteDAO locationSiteDAO;
|
||||
private final PurchaseOrderDAO purchaseOrderDAO;
|
||||
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.cutPieceTypeDAO = cutPieceTypeDAO;
|
||||
this.jobCardItemDAO = jobCardItemDAO;
|
||||
|
@ -41,6 +45,8 @@ public class JobCardService {
|
|||
this.locationSiteDAO = locationSiteDAO;
|
||||
this.purchaseOrderDAO = purchaseOrderDAO;
|
||||
this.userInventoryAccountDAO = userInventoryAccountDAO;
|
||||
this.finishedItemDAO = finishedItemDAO;
|
||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -63,8 +69,7 @@ public class JobCardService {
|
|||
/*
|
||||
* get cards
|
||||
* */
|
||||
public List<JobCard> getCards( String id,
|
||||
String code,
|
||||
public List<JobCard> getCards( String code,
|
||||
String status,
|
||||
String inventoryStatus,
|
||||
String customer,
|
||||
|
@ -79,9 +84,14 @@ public class JobCardService {
|
|||
if( limit == null ){
|
||||
limit = 100L;
|
||||
}
|
||||
if( StringUtils.isAnyNotNullOrEmpty( id, 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 );
|
||||
if( StringUtils.isAnyNotNullOrEmpty( code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate ) ){
|
||||
String query = JobCardQueryBuilder.buildQuery(code, authentication.getName(), status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate, limit );
|
||||
System.out.println( query );
|
||||
for (GrantedAuthority role : authentication.getAuthorities()){
|
||||
if (role.toString().equals("ROLE_ADMIN")){
|
||||
return jobCards = jobCardDAO.findByAllWithLimit(limit);
|
||||
}
|
||||
}
|
||||
jobCards = jobCardDAO.findByQuery( query );
|
||||
}else {
|
||||
jobCards = jobCardDAO.findByUserAndLimit( authentication.getName(), limit );
|
||||
|
@ -115,6 +125,7 @@ public class JobCardService {
|
|||
@Transactional( rollbackFor = Exception.class )
|
||||
public void save(JobCard jobCard) {
|
||||
if (jobCard != null && jobCard.getItems() != null) {
|
||||
jobCard.setInventoryStatus(String.valueOf(JobCard.InventoryStatus.NOT_RECEIVED_YET));
|
||||
long jobCardId = jobCardDAO.save( jobCard );
|
||||
jobCard.setId( jobCardId );
|
||||
generateCode( jobCard );
|
||||
|
@ -192,9 +203,6 @@ public class JobCardService {
|
|||
return jobCard;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* find card recursively
|
||||
* */
|
||||
|
@ -255,5 +263,31 @@ public class JobCardService {
|
|||
public List<JobCardItem> getJobCardItems( long 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 ){
|
||||
List<Authority> newRoles = user.getAuthorities();
|
||||
if(newRoles != null) {
|
||||
newRoles.forEach(authority -> authority.setUsername(user.getUsername()));
|
||||
}
|
||||
List<UserInventoryAccount> newInventoryAccounts = user.getInventoryAccounts();
|
||||
if( newInventoryAccounts != null ){
|
||||
newInventoryAccounts.forEach(account -> account.setUsername( user.getUsername() ));
|
||||
userInventoryAccountDAO.saveAll( newInventoryAccounts );
|
||||
}
|
||||
|
||||
// save
|
||||
authorityDAO.saveAll( newRoles );
|
||||
userInventoryAccountDAO.saveAll( newInventoryAccounts );
|
||||
}
|
||||
|
||||
private void deletePreviousRolesAndAccounts( User user ){
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
},
|
||||
template : `
|
||||
<table class="table table-bordered bg-white col-sm-8">
|
||||
<table class="table table-bordered bg-white col-sm-12">
|
||||
<thead>
|
||||
<tr>
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
`
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
},
|
||||
template: `
|
||||
<table class="table table-bordered bg-white col-sm-8">
|
||||
<table class="table table-bordered bg-white col-sm-12">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
<span class="form-control" readonly>{{item.expectedProduction}}</span>
|
||||
</td>
|
||||
<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>
|
||||
<span class="form-control" >{{ populateCuttingAccount() }}</span>
|
||||
{{ populateCuttingAccount() }}
|
||||
</td>
|
||||
</tr>
|
||||
`
|
||||
|
@ -61,14 +61,14 @@
|
|||
<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">
|
||||
<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 v-for="(type,index) in $types"
|
||||
v-bind:selected="type.title === piece.type"
|
||||
v-bind:value="type.title">{{type.title}}</option>
|
||||
</select>
|
||||
</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/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -81,7 +81,7 @@
|
|||
|
||||
},
|
||||
template : `
|
||||
<table class="table table-bordered bg-white col-sm-12">
|
||||
<table class="table table-bordered bg-white w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item</th>
|
||||
|
@ -89,7 +89,8 @@
|
|||
<th>Cut Pieces</th>
|
||||
<th>Expected Production</th>
|
||||
<th>Actual Production</th>
|
||||
<th>Account</th>
|
||||
<th style="width: 312px" >Account</th>
|
||||
</tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging') ? 'active' : ''}">Packaging</a>
|
||||
</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"
|
||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting') ? 'active' : ''}">Reporting</a>
|
||||
</li>
|
||||
|
|
|
@ -48,7 +48,8 @@
|
|||
<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}"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<div class="form-row">
|
||||
<div class="col-sm-3 form-group">
|
||||
<label>Job Order</label>
|
||||
<input class="form-control" th:field="*{jobOrderId}" required>
|
||||
<input type="number" class="form-control" th:field="*{jobOrderId}" required>
|
||||
</div>
|
||||
<div class="col-sm-3 form-group">
|
||||
<label>Customer</label>
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
||||
<h5 class="mb-4">Refine Your Search</h5>
|
||||
<div class="form-group">
|
||||
<label>ID</label>
|
||||
<input type="text" class="form-control" name="id" maxlength="100" th:value="${param['id']}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Code</label>
|
||||
<label>ID/Code</label>
|
||||
<input type="text" class="form-control" name="code" maxlength="100" th:value="${param['code']}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<input type="text" class="form-control" name="jc-id" maxlength="100" th:value="${param['jc-id']}">
|
||||
</div>
|
||||
<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']}">
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
v-bind:disabled="hasDuplicates() || bundles.length === 0">
|
||||
Submit
|
||||
</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>
|
||||
</form>
|
||||
<script th:inline="javascript">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
<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">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -38,7 +38,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<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="*{itemId}"></td>
|
||||
<td th:text="*{sku}"></td>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<div class="bg-light p-3 mb-3" v-if="jobCard.id !== undefined">
|
||||
<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>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
|
@ -65,7 +65,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<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>
|
||||
</form>
|
||||
<script th:inline="javascript">
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
<td th:text="${item.createdBy}"></td>
|
||||
<td ctp:formatdatetime="${item.createdAt}"></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.equals('ALTER')}" class="badge" style="background: yellow">REVERTED</span>
|
||||
<div th:if="${item.isSegregated && !item.qaStatus.equals('ALTER')}">
|
||||
<span th:if="${not item.isSegregated && item.qaStatus != ('ALTER')}" class="badge badge-danger">PENDING</span>
|
||||
<span th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}" class="badge badge-warning">REVERTED</span>
|
||||
<div th:if="${item.isSegregated && item.qaStatus != ('ALTER')}">
|
||||
<span class="badge badge-APPROVED">DONE</span>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
<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>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4>No process found.</h4>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="col-sm-3 form-group">
|
||||
<label>Finishing Account</label>
|
||||
<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}"
|
||||
th:value="${account.id}"
|
||||
th:text="${account.title}"></option>
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
<td th:text="${item.createdBy}"></td>
|
||||
<td ctp:formatdatetime="${item.createdAt}"></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.equals('ALTER')}" class="badge" style="background: yellow">REVERTED</span>
|
||||
<div th:if="${item.isSegregated && !item.qaStatus.equals('ALTER')}">
|
||||
<span th:if="${not item.isSegregated && item.qaStatus != 'ALTER'}" class="badge badge-danger">PENDING</span>
|
||||
<span th:if="${not item.isSegregated && item.qaStatus == ('ALTER')}" class="badge badge-warning" >REVERTED</span>
|
||||
<div th:if="${item.isSegregated && item.qaStatus != ('ALTER')}">
|
||||
<span class="badge badge-APPROVED">DONE</span>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -7,10 +7,6 @@
|
|||
<div class="page-filters-sidebar">
|
||||
<form th:action="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}">
|
||||
<h5 class="mb-4">Refine Your Search</h5>
|
||||
<div class="form-group">
|
||||
<label>Item ID</label>
|
||||
<input type="text" class="form-control" name="item-id" maxlength="100" th:value="${param['item-id']}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>SKu</label>
|
||||
<input type="text" class="form-control" name="sku" maxlength="100" th:value="${param['sku']}">
|
||||
|
|
|
@ -29,11 +29,25 @@
|
|||
<td th:rowspan="${#lists.size(sku)}" th:text="${sku}" class="align-middle" rowspan="3" ></td>
|
||||
<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 " >
|
||||
<thead th:if="${data.getKey() == dates.toString()}">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>IN</th>
|
||||
<th>OUT</th>
|
||||
<th>BALANCE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<tr th:each="reportSummary : ${data.getValue()}" rowspan="3" >
|
||||
<td th:if="${data.getKey() == dates.toString()}" >
|
||||
<span th:text="${reportSummary.getParentDocumentType()} + ' ' + ${reportSummary.getParentDocumentPieceType()}"></span>
|
||||
</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" >
|
||||
<span th:text="${reportSummary.getTotalIn() - reportSummary.getTotalOut()}"></span>
|
||||
</td>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<td th:text="*{username}"></td>
|
||||
<td th:text="*{authorities}"></td>
|
||||
<td>
|
||||
<input type="checkbox" th:checked="*{enabled}" />
|
||||
<input onclick="return false;" type="checkbox" th:checked="*{enabled}" />
|
||||
</td>
|
||||
<td th:text="*{inventoryAccounts}"></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.
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