fixed bugs and add accounts active and in-active, Fixed username field

pull/1/head
usama.jameel 2025-01-06 11:10:42 +05:00
parent dbbc4da853
commit d8777f63b0
36 changed files with 125 additions and 171 deletions

View File

@ -109,7 +109,6 @@ 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,
@ -121,32 +120,25 @@ public class CuttingController {
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("bundles", bundleService.getBundles( id, sku, jobCardId, masterId, type, status, startDate1.toString(), endDate1.toString() ,count ) ); 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";
} }
@GetMapping( "/master-bundles") @GetMapping( "/master-bundles")
public String showMasterBundles( @RequestParam(value = "id" , required = false) String id, public String showMasterBundles( @RequestParam(value = "id" , required = false) String id,
@RequestParam(value = "jc-id", required = false ) String jobCardId, @RequestParam(value = "jc-id", required = false ) String jobCardId,
@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,
@RequestParam( value = "exceptionCheck", required = false, defaultValue = "false") boolean exceptionCheck, Model model){
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 startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
model.addAttribute("masterBundles", bundleService.getMasterBundles( id, jobCardId, startDate1.toString(), endDate1.toString(), count ) ); 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";
} }
@ -157,12 +149,22 @@ public class CuttingController {
return "/cutting/child-bundles"; return "/cutting/child-bundles";
} }
@PostMapping( "/generate-bundle-barcodes" )
@PostMapping( "/generate-barcodes" ) public Object generateBundleBarcode(@RequestParam( name = "ids", required = false ) Long[] ids,
public Object generateBarcode(@RequestParam( name = "ids", required = false ) Long[] ids, @RequestParam( name = "artifactType", required = true ) String artifactType , RedirectAttributes redirectAttributes) throws Exception {
@RequestParam( name = "artifactType", required = true ) String artifactType ) throws Exception {
if(ids == null){ 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"; redirectAttributes.addFlashAttribute("error", "Please Select At least One CheckBox." );
return "redirect:/cutting/bundles";
}
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
}
@PostMapping( "/generate-master-barcodes" )
public Object generateMasterBarcode(@RequestParam( name = "ids", required = false ) Long[] ids,
@RequestParam( name = "artifactType", required = true ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
if(ids == null){
redirectAttributes.addFlashAttribute("error", "Please Select At least One CheckBox." );
return "redirect:/cutting/master-bundles";
} }
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType ); return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
} }

View File

@ -50,13 +50,14 @@ 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 ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId ,count ); 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";
} }
@ -72,14 +73,11 @@ public class FinishingController {
@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 = "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, defaultValue = "100") Long count,
Model model ) { Model model ) {
// 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";
} }

View File

@ -50,17 +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(code, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId,createdStartDate, createdEndDate, limit );
LocalDate startDate = StringUtils.isNullOrEmpty(createdStartDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(createdStartDate);
LocalDate endDate = StringUtils.isNullOrEmpty(createdEndDate) ? LocalDate.now() : LocalDate.parse(createdEndDate);
String code1 = StringUtils.isNullOrEmpty(code) ? "" : code;
model.addAttribute("startDate", startDate);
model.addAttribute("endDate", endDate);
List<JobCard> cards = jobCardService.getCards(code1, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId,startDate.toString(), endDate.toString(), 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";
} }
@ -88,7 +88,6 @@ public class JobCardController {
public String saveJobCard( @ModelAttribute JobCard jobCard, public String saveJobCard( @ModelAttribute JobCard jobCard,
RedirectAttributes redirectAttributes, RedirectAttributes redirectAttributes,
Model model ){ Model model ){
try { try {
jobCard.setStatus( JobCard.Status.DRAFT.name() ); jobCard.setStatus( JobCard.Status.DRAFT.name() );
jobCard.setInventoryStatus( JobCard.InventoryStatus.NOT_RECEIVED_YET.name() ); jobCard.setInventoryStatus( JobCard.InventoryStatus.NOT_RECEIVED_YET.name() );
@ -154,7 +153,7 @@ public class JobCardController {
return "redirect:/job-cards"; return "redirect:/job-cards";
} }
@GetMapping( value = "/job-card-detail/{id}" ) @GetMapping( value = "/view/{id}" )
public String showJobCardDetail( @PathVariable("id") long id, public String showJobCardDetail( @PathVariable("id") long id,
Model model ){ Model model ){
List<JobCardItem> jobCardItems = jobCardService.findJobCardItemByJobCardId(id); List<JobCardItem> jobCardItems = jobCardService.findJobCardItemByJobCardId(id);

View File

@ -42,11 +42,11 @@ public class PackagingController {
@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 , null, null,true ) ); if(StringUtils.isNullOrEmpty( active )){
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 "redirect:/packaging/inventory-accounts?id=&title=&active=1&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
} }
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts( id, title, active, createdBy, startDate, endDate, siteId, count , null, null,true ) );
model.addAttribute("locations", locationService.findAll() );
return "/packaging/inventory-accounts"; return "/packaging/inventory-accounts";
} }
} }

View File

@ -64,15 +64,14 @@ public class QualityControlController {
@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 = "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, defaultValue = "100") Long count,
Model model ){ Model model ){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
List<FinishedItem> itemList = bundleService.getFinishedItem( id, itemId, sku, startDate1.toString(), endDate1.toString(), jobCardId ,count ); 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";
} }

View File

@ -27,21 +27,16 @@ public class ReportingController {
} }
@GetMapping( "/summary") @GetMapping( "/summary")
public String showMasterBundles(@RequestParam(value = "item-id", required = false ) String itemId, public String showMasterBundles(@RequestParam(value = "item-id", required = false ) String itemId, @RequestParam(value = "sku" , required = false) String sku, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, Model model ){
@RequestParam(value = "sku" , required = false) String sku,
@RequestParam(value = "start-date", required = false) String startDate,
@RequestParam(value = "end-date", required = false) String endDate,
Model model ){
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(6) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now().plusDays(1) : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now().plusDays(1) : LocalDate.parse(endDate);
model.addAttribute("startDate", startDate1);
model.addAttribute("endDate", endDate1);
Map<String, Map<String, List<SummaryInventoryReport>>> getDataByFilteration = summaryInventoryReportService.findByFilter(itemId,sku,startDate,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);
if(StringUtils.isNullOrEmpty( startDate) || StringUtils.isNullOrEmpty( endDate )){
return "redirect:/reporting/summary?item-id=&sku=&start-date="+startDate1.toString()+"&end-date="+endDate1;
}
return "/reporting/inventory-summary"; return "/reporting/inventory-summary";
} }

View File

@ -95,24 +95,15 @@ public class StitchingController {
@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 = "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, defaultValue = "100") Long count,
Model model Model model
,RedirectAttributes redirect){ ,RedirectAttributes redirect){
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate); LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate); LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, 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){ model.addAttribute("startDate", startDate1);
if(model.getAttribute("message").equals("Finished Item Created Successfully") ){ model.addAttribute("endDate", endDate1);
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";
} }
@ -129,10 +120,10 @@ public class StitchingController {
Model model ){ Model model ){
try { try {
inventoryService.createStitchingOfflineItemsFromJobCard( jobCard ); inventoryService.createStitchingOfflineItemsFromJobCard( jobCard );
redirectAttributes.addFlashAttribute("message", "Finished Item Created Successfully"); redirectAttributes.addFlashAttribute("success", "Finished Item Created Successfully");
} catch ( Exception exception ){ } catch ( Exception exception ){
exception.printStackTrace(); exception.printStackTrace();
redirectAttributes.addFlashAttribute( "message", exception.getMessage() ); redirectAttributes.addFlashAttribute( "error", exception.getMessage() );
} }
return "redirect:/stitching/stitching-offline-items"; return "redirect:/stitching/stitching-offline-items";
} }
@ -141,10 +132,9 @@ public class StitchingController {
public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids, public Object generateBarcode(@RequestParam( name = "ids" ,required = false) Long[] ids,
@RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception { @RequestParam( name = "artifactType" ) String artifactType, RedirectAttributes redirectAttributes ) throws Exception {
if (ids == null){ if (ids == null){
redirectAttributes.addFlashAttribute( "message", "Select At least One CheckBox" ); redirectAttributes.addFlashAttribute( "error", "Select At least One CheckBox" );
return "redirect:/stitching/stitching-offline-items"; return "redirect:/stitching/stitching-offline-items";
}else { }
return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType ); return barcodeService.generateBarcodes( Arrays.asList( ids ), artifactType );
} }
} }
}

View File

@ -33,7 +33,7 @@ public class UserController {
model.addAttribute("user", userService.createEmptyUser() ); model.addAttribute("user", userService.createEmptyUser() );
model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts() ); model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts() );
model.addAttribute("roles", Roles.values() ); model.addAttribute("roles", Roles.values() );
model.addAttribute("isNew", true ); model.addAttribute("isNew", false );
return "_user-fragment"; return "_user-fragment";
} }
@ -42,6 +42,7 @@ public class UserController {
model.addAttribute("user", userService.getUser( username ) ); model.addAttribute("user", userService.getUser( username ) );
model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts() ); model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts() );
model.addAttribute("roles", Roles.values() ); model.addAttribute("roles", Roles.values() );
model.addAttribute("isNew", true );
return "_user-fragment"; return "_user-fragment";
} }
@ -50,12 +51,12 @@ public class UserController {
@ModelAttribute User user , @ModelAttribute User user ,
RedirectAttributes redirectAttributes ){ RedirectAttributes redirectAttributes ){
try { try {
userService.saveUser( user ); userService.saveUser( user, true );
redirectAttributes.addFlashAttribute("success", "User Successfully Saved!" ); redirectAttributes.addFlashAttribute("success", "User Successfully Saved!" );
} catch ( Exception e ){ } catch ( Exception e ){
redirectAttributes.addFlashAttribute("error", e.getMessage() ); redirectAttributes.addFlashAttribute("error", e.getMessage() );
} }
return "redirect:/users"; return "redirect:/users/new";
} }
@PostMapping( "/edit/{username}" ) @PostMapping( "/edit/{username}" )
@ -63,7 +64,7 @@ public class UserController {
@ModelAttribute User user, @ModelAttribute User user,
RedirectAttributes redirectAttributes ){ RedirectAttributes redirectAttributes ){
try { try {
userService.saveUser( user ); userService.saveUser( user, false );
redirectAttributes.addFlashAttribute("success", "User Successfully Edited!" ); redirectAttributes.addFlashAttribute("success", "User Successfully Edited!" );
} catch ( Exception e ){ } catch ( Exception e ){
redirectAttributes.addFlashAttribute("error", e.getMessage() ); redirectAttributes.addFlashAttribute("error", e.getMessage() );

View File

@ -82,9 +82,6 @@ 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 );

View File

@ -1,25 +0,0 @@
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;
}
}

View File

@ -104,10 +104,6 @@ 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();
@ -139,7 +135,7 @@ public class FinishedItemDAO {
} }
public HashMap<Long, Long> findTotalCount(List<Long> itemIds, long jobCardId) { public HashMap<Long, Long> findTotalFinishedItems(List<Long> itemIds, long jobCardId) {
HashMap<Long, Long> totalCounts = new HashMap<>(); HashMap<Long, Long> totalCounts = new HashMap<>();
MapSqlParameterSource params = new MapSqlParameterSource(); MapSqlParameterSource params = new MapSqlParameterSource();
for (long id : itemIds) { for (long id : itemIds) {
@ -160,9 +156,9 @@ public class FinishedItemDAO {
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 ){ public List<StitchingOfflineItem> findByBarcodeAndApprovedStatus( List<StitchingOfflineItem> stitchingOfflineItems ){
List<StitchingOfflineItem> items = new ArrayList<>(); List<StitchingOfflineItem> items = new ArrayList<>();
for (StitchingOfflineItem item : finishedItems){ for (StitchingOfflineItem item : stitchingOfflineItems){
MapSqlParameterSource params = new MapSqlParameterSource(); MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("barcode", item.getBarcode() ); params.addValue("barcode", item.getBarcode() );
boolean check =Boolean.TRUE.equals(namedParameterJdbcTemplate.queryForObject( SELECT_QUERY_BY_BARCODE_QA_STATUS, params, Boolean.class )); boolean check =Boolean.TRUE.equals(namedParameterJdbcTemplate.queryForObject( SELECT_QUERY_BY_BARCODE_QA_STATUS, params, Boolean.class ));

View File

@ -22,11 +22,11 @@ public class InventoryAccountDAO {
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 );
private final String SELECT_BY_IDS_AND_PARENT_ID = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND parent_entity_id = :parent_entity_id", TABLE_NAME ); private final String SELECT_BY_IDS_AND_PARENT_ID = String.format( "SELECT * FROM %s WHERE active = TRUE AND id IN (:ids) AND parent_entity_id = :parent_entity_id", TABLE_NAME );
private final String SELECT_BY_IDS_AND_PARENT_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND parent_entity_id IN (:parent_entity_ids)", TABLE_NAME ); private final String SELECT_BY_IDS_AND_PARENT_IDS = String.format( "SELECT * FROM %s WHERE active = TRUE AND id IN (:ids) AND parent_entity_id IN (:parent_entity_ids)", TABLE_NAME );
private final String SELECT_BY_IDS_AND_PARENT_ENTITY_TYPE_AND_PARENT_ID_AND_COUNT = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND parent_entity_id = :parent_entity_id AND parent_entity_type = :parent_entity_type LIMIT :limit", TABLE_NAME ); private final String SELECT_BY_IDS_AND_PARENT_ENTITY_TYPE_AND_PARENT_ID_AND_COUNT = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND parent_entity_id = :parent_entity_id AND parent_entity_type = :parent_entity_type LIMIT :limit", TABLE_NAME );
private final String SELECT_BY_IDS_PACKAGING_AND_COUNT = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND is_packaging = :is_packaging LIMIT :limit", TABLE_NAME ); private final String SELECT_BY_IDS_PACKAGING_AND_COUNT = String.format( "SELECT * FROM %s WHERE id IN (:ids) AND is_packaging = :is_packaging LIMIT :limit", TABLE_NAME );
private final String SELECT_BY_PARENT_TYPE_AND_PARENT_ID = String.format( "SELECT * FROM %s WHERE parent_entity_type = :parent_entity_type AND parent_entity_id = :parent_entity_id" , TABLE_NAME ); private final String SELECT_BY_PARENT_TYPE_AND_PARENT_ID = String.format( "SELECT * FROM %s WHERE active = TRUE AND parent_entity_type = :parent_entity_type AND parent_entity_id = :parent_entity_id" , TABLE_NAME );
public InventoryAccountDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { public InventoryAccountDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;

View File

@ -125,7 +125,7 @@ public class StitchingOfflineItemDAO {
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) { public HashMap<Long, Long> findTotalStitchingOfflineItems(List<Long> itemIds, long jobCardId) {
HashMap<Long, Long> totalCounts = new HashMap<>(); HashMap<Long, Long> totalCounts = new HashMap<>();
MapSqlParameterSource params = new MapSqlParameterSource(); MapSqlParameterSource params = new MapSqlParameterSource();
for (long id : itemIds) { for (long id : itemIds) {

View File

@ -43,7 +43,7 @@ public class InventoryAccountQueryBuilder {
.setColumns("*") .setColumns("*")
.where() .where()
.columnLikeTitle("title", title) .columnLikeTitle("title", title)
.or() .and()
.columnEquals("id", id) .columnEquals("id", id)
.and() .and()
.columnEquals("active", active) .columnEquals("active", active)

View File

@ -98,6 +98,7 @@ public class InventoryAccountService {
} }
public List<Process> getAllProcess(){ public List<Process> getAllProcess(){
return processDAO.findAll(); return processDAO.findAll();
} }

View File

@ -55,7 +55,7 @@ public class InventoryArtifactService {
/* /*
* get finished Items By Job Card ID * get finished Items By Job Card ID
* */ * */
public FinishedItem findFinishedItemByJobCardId( long id ){ public FinishedItem findByJobCardId( long id ){
FinishedItem finishedItem = finishedItemDAO.find( id ); FinishedItem finishedItem = finishedItemDAO.find( id );
finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) ); finishedItem.setJobCard( jobCardDAO.find( finishedItem.getJobCardId() ) );
return finishedItem; return finishedItem;

View File

@ -81,17 +81,18 @@ public class JobCardService {
Long limit) { Long limit) {
List<JobCard> jobCards = new ArrayList<>(); List<JobCard> jobCards = new ArrayList<>();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String createdBy = authentication.getName();
if( limit == null ){ if( limit == null ){
limit = 100L; limit = 100L;
} }
if( StringUtils.isAnyNotNullOrEmpty( 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(code, authentication.getName(), status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate, limit );
System.out.println( query );
for (GrantedAuthority role : authentication.getAuthorities()){ for (GrantedAuthority role : authentication.getAuthorities()){
if (role.toString().equals("ROLE_ADMIN")){ if (role.toString().equals("ROLE_ADMIN")){
return jobCards = jobCardDAO.findByAllWithLimit(limit); createdBy = "";
} }
} }
String query = JobCardQueryBuilder.buildQuery(code, createdBy, status, inventoryStatus, customer, lotNumber, purchaseOrderId, locationSiteId, createdStartDate, createdEndDate, limit );
System.out.println( query );
jobCards = jobCardDAO.findByQuery( query ); jobCards = jobCardDAO.findByQuery( query );
}else { }else {
jobCards = jobCardDAO.findByUserAndLimit( authentication.getName(), limit ); jobCards = jobCardDAO.findByUserAndLimit( authentication.getName(), limit );
@ -283,11 +284,11 @@ public class JobCardService {
return stitchingOfflineItemDAO.findByJobCardId( jobCardId ); return stitchingOfflineItemDAO.findByJobCardId( jobCardId );
} }
public HashMap<Long, Long> totalStitchingItem(List<Long> itemIds, long jobCardId ){ public Map<Long, Long> totalStitchingItem(List<Long> itemIds, long jobCardId ){
return stitchingOfflineItemDAO.findTotalCount( itemIds, jobCardId ); return stitchingOfflineItemDAO.findTotalStitchingOfflineItems( itemIds, jobCardId );
} }
public HashMap<Long, Long> totalFinishItem(List<Long> itemIds, long jobCardId ){ public Map<Long, Long> totalFinishItem(List<Long> itemIds, long jobCardId ){
return finishedItemDAO.findTotalCount( itemIds, jobCardId ); return finishedItemDAO.findTotalFinishedItems( itemIds, jobCardId );
} }
} }

View File

@ -44,19 +44,19 @@ public class SummaryInventoryReportService {
} }
List<SummaryInventoryReport> summaries = summaryInventoryReportDao.findByFilter(itemId1, sku1, startDate1, endDate1); List<SummaryInventoryReport> summaries = summaryInventoryReportDao.findByFilter(itemId1, sku1, startDate1, endDate1);
Map<String, Map<String, List<SummaryInventoryReport>>> tableData = new HashMap<>(); Map<String, Map<String, List<SummaryInventoryReport>>> skuMapDateMap = new HashMap<>();
if(summaries == null) { if(summaries == null) {
tableData = null; skuMapDateMap = null;
}else { }else {
for (SummaryInventoryReport summary : summaries) { for (SummaryInventoryReport summary : summaries) {
tableData skuMapDateMap
.computeIfAbsent(summary.getSku(), k -> new HashMap<>()) // SKU as key .computeIfAbsent(summary.getSku(), k -> new HashMap<>()) // SKU as key
.computeIfAbsent(summary.getDate(), d -> new ArrayList<>()) // Date as key .computeIfAbsent(summary.getDate(), d -> new ArrayList<>()) // Date as key
.add(summary); .add(summary);
} }
} }
return tableData; return skuMapDateMap;
} }
} }

View File

@ -64,7 +64,10 @@ public class UserService {
* save user * save user
* */ * */
@Transactional @Transactional
public void saveUser( User user ){ public void saveUser( User user, boolean checkNewOrEdit ){
if(userDAO.findByUsername(user.getUsername()) != null && checkNewOrEdit ){
throw new RuntimeException("username already exists");
}
// save user // save user
createUser( user ); createUser( user );
// remove previous // remove previous
@ -89,15 +92,13 @@ public class UserService {
List<Authority> newRoles = user.getAuthorities(); List<Authority> newRoles = user.getAuthorities();
if(newRoles != null) { if(newRoles != null) {
newRoles.forEach(authority -> authority.setUsername(user.getUsername())); newRoles.forEach(authority -> authority.setUsername(user.getUsername()));
authorityDAO.saveAll( newRoles );
} }
List<UserInventoryAccount> newInventoryAccounts = user.getInventoryAccounts(); List<UserInventoryAccount> newInventoryAccounts = user.getInventoryAccounts();
if( newInventoryAccounts != null ){ if( newInventoryAccounts != null ){
newInventoryAccounts.forEach(account -> account.setUsername( user.getUsername() )); newInventoryAccounts.forEach(account -> account.setUsername( user.getUsername() ));
userInventoryAccountDAO.saveAll( newInventoryAccounts ); userInventoryAccountDAO.saveAll( newInventoryAccounts );
} }
// save
authorityDAO.saveAll( newRoles );
} }
private void deletePreviousRolesAndAccounts( User user ){ private void deletePreviousRolesAndAccounts( User user ){

View File

@ -53,16 +53,16 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>From Date</label> <label>From Date</label>
<input type="date" class="form-control" name="created-start-date" th:value="${param['created-start-date']}" > <input type="date" class="form-control" name="created-start-date" th:value="${param['created-start-date'] ?: startDate }" >
</div> </div>
<div class="form-group"> <div class="form-group">
<label>To Date</label> <label>To Date</label>
<input type="date" class="form-control" name="created-end-date" th:value="${param['created-end-date']}" > <input type="date" class="form-control" name="created-end-date" th:value="${param['created-end-date'] ?: endDate}" >
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Count</label> <label>Count</label>
<input type="number" class="form-control" name="limit" <input type="number" class="form-control" name="limit"
th:value="(${param['limit']} != null) ? ${param['limit']} : 100"> th:value="${param['limits'] ?: 100}">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" <a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"

View File

@ -22,11 +22,11 @@
<div class="form-row"> <div class="form-row">
<div class="col-sm-3 form-group"> <div class="col-sm-3 form-group">
<label>Username</label> <label>Username</label>
<input class="form-control" th:field="*{username}" requried> <input class="form-control" th:readonly="${isNew}" th:field="*{username}" requried>
</div> </div>
<div class="col-sm-3 form-group"> <div class="col-sm-3 form-group">
<label>Password</label> <label>Password</label>
<input class="form-control" th:field="*{newPassword}" th:required="${isNew != null && isNew}"> <input class="form-control" th:field="*{newPassword}" th:readonly="${isNew}" required>
</div> </div>
<div class="col-sm-3 form-group"> <div class="col-sm-3 form-group">
<label for="enable">Enabled</label> <label for="enable">Enabled</label>

View File

@ -46,15 +46,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Start Date</label> <label>Start Date</label>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date']}"> <input type="date" class="form-control" name="start-date" th:value="${param['start-date'] ?: startDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>End Date</label> <label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date']}"> <input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Count</label> <label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count']}"> <input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" class="btn btn-secondary btn-block">Reset</a> <a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" class="btn btn-secondary btn-block">Reset</a>

View File

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

View File

@ -28,16 +28,16 @@
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<label>Start Date</label> <label>Start Date</label>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date']}"> <input type="date" class="form-control" name="start-date" th:value="${param['start-date'] ?: startDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>End Date</label> <label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date']}"> <input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Count</label> <label>Count</label>
<input type="number" class="form-control" name="count" min="0" maxlength="100" <input type="number" class="form-control" name="count" min="0" maxlength="100"
th:value="${param['count']}"> th:value="${param['count'] ?: 100}">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">
<a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}" <a th:href="@{${#strings.replace(#httpServletRequest.requestURI, #request.getContextPath(), '')}}"

View File

@ -16,7 +16,7 @@
<h3>Bundles</h3> <h3>Bundles</h3>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post"> <form th:action="@{/cutting/generate-bundle-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="Bundle"> <input hidden="hidden" name="artifactType" value="Bundle">
<table class="table table-striped" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table class="table table-striped" data-table data-order="[[ 0, &quot;asc&quot; ]]">
<thead> <thead>

View File

@ -16,7 +16,7 @@
<h3>Master Bundles</h3> <h3>Master Bundles</h3>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/cutting/generate-barcodes}" method="post"> <form th:action="@{/cutting/generate-master-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="MasterBundle"> <input hidden="hidden" name="artifactType" value="MasterBundle">
<table class="table table-striped table-bordered" data-bundle-table <table class="table table-striped table-bordered" data-bundle-table
data-order="[[ 0, &quot;asc&quot; ]]"> data-order="[[ 0, &quot;asc&quot; ]]">

View File

@ -12,7 +12,6 @@
</div> </div>
<form th:action="'/ctp/finishing/segregate-inventory'" method="post" id="finishedApp"> <form th:action="'/ctp/finishing/segregate-inventory'" method="post" id="finishedApp">
<div class="bg-light p-3 mb-3"> <div class="bg-light p-3 mb-3">
<h6 class="mb-3">Search Finished Item</h6>
<div class="form-row"> <div class="form-row">
<div class="col-sm-3 form-group"> <div class="col-sm-3 form-group">
<finished-item-search <finished-item-search

View File

@ -17,7 +17,7 @@
<a th:href="@{/inventory-accounts/new}" class="btn btn-primary">Add New</a> <a th:href="@{/inventory-accounts/new}" class="btn btn-primary">Add New</a>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<table th:if="${#lists.size(accounts) != 0 && #lists != null }" class="table table-striped table-bordered" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table th:if="${#lists != null && #lists.size(accounts) != 0 }" class="table table-striped table-bordered" data-table data-order="[[ 0, &quot;asc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
@ -36,7 +36,7 @@
<td th:text="*{id}"></td> <td th:text="*{id}"></td>
<td th:text="*{title}"></td> <td th:text="*{title}"></td>
<td th:text="*{parentEntityType}"></td> <td th:text="*{parentEntityType}"></td>
<td th:text="*{active}"></td> <td th:text="*{active}" th:classappend="*{ active } ? 'badge badge-APPROVED' : 'badge badge-warning'"></td>
<td th:text="*{createdBy}"></td> <td th:text="*{createdBy}"></td>
<td ctp:formatdatetime="*{createdAt}"></td> <td ctp:formatdatetime="*{createdAt}"></td>
<td th:text="*{locationTitle}"></td> <td th:text="*{locationTitle}"></td>

View File

@ -16,7 +16,7 @@
<a th:href="@{/job-cards/new}" class="btn btn-primary">Add New</a> <a th:href="@{/job-cards/new}" class="btn btn-primary">Add New</a>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<table th:if="${#lists.size(cards) != 0 && #lists != null }" class="table table-striped font-sm" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table th:if="${ #lists != null && #lists.size(cards) != 0 }" class="table table-striped font-sm" data-table data-order="[[ 0, &quot;asc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>Code</th> <th>Code</th>
@ -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><a class="text-reset" th:href="@{'job-card-detail/' + *{getId()}}" th:text="*{code}"></a></td> <td><a class="text-reset" th:href="@{'/job-cards/view/' + *{id}}" 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>

View File

@ -13,11 +13,11 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Start Date</label> <label>Start Date</label>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date']}"> <input type="date" class="form-control" name="start-date" th:value="${param['start-date'] ?: startDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>End Date</label> <label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date']}"> <input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">

View File

@ -25,15 +25,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Start Date</label> <label>Start Date</label>
<input type="date" class="form-control" name="start-date" th:value="${param['start-date']}"> <input type="date" class="form-control" name="start-date" th:value="${param['start-date'] ?: startDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>End Date</label> <label>End Date</label>
<input type="date" class="form-control" name="end-date" th:value="${param['end-date']}"> <input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Count</label> <label>Count</label>
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count']}"> <input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
</div> </div>
<input type="submit" class="btn btn-secondary btn-block" value="Search"> <input type="submit" class="btn btn-secondary btn-block" value="Search">

View File

@ -19,7 +19,7 @@
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<form th:action="@{/stitching/generate-barcodes}" method="post"> <form th:action="@{/stitching/generate-barcodes}" method="post">
<input hidden="hidden" name="artifactType" value="FinishedItem"> <input hidden="hidden" name="artifactType" value="FinishedItem">
<table th:if="${#lists.size(items) != 0 && #lists != null }" class="table table-striped table-bordered" data-table <table th:if="${ #lists != null && #lists.size(items) != 0 }" class="table table-striped table-bordered" data-table
data-order="[[ 0, &quot;asc&quot; ]]"> data-order="[[ 0, &quot;asc&quot; ]]">
<thead> <thead>
<tr> <tr>

View File

@ -98,7 +98,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="@{/stitching/stitching-offline-items}" class="btn btn-light">Cancel</a>
</div> </div>
</form> </form>
<script th:inline="javascript"> <script th:inline="javascript">

View File

@ -17,7 +17,7 @@
<a th:href="@{/users/new}" class="btn btn-primary">Add New</a> <a th:href="@{/users/new}" class="btn btn-primary">Add New</a>
</div> </div>
<div th:replace="_fragments :: table-loading-skeleton"></div> <div th:replace="_fragments :: table-loading-skeleton"></div>
<table th:if="${#lists.size(users) != 0 && #lists != null }" class="table table-striped table-bordered" data-table data-order="[[ 0, &quot;asc&quot; ]]"> <table th:if="${ #lists != null && #lists.size(users) != 0 }" class="table table-striped table-bordered" data-table data-order="[[ 0, &quot;asc&quot; ]]">
<thead> <thead>
<tr> <tr>
<th>User</th> <th>User</th>