Compare commits
66 Commits
add-report
...
main
Author | SHA1 | Date |
---|---|---|
|
ffc1a8ac41 | |
|
b728efd305 | |
|
59b572d691 | |
|
b3b5597313 | |
|
9b8d525833 | |
|
77887df4ce | |
|
c9a3454bbb | |
|
2730157de7 | |
|
a8ce116a7c | |
|
06a5adbf93 | |
|
7704bbd655 | |
|
21194519e6 | |
|
dc0b83a65f | |
|
5bcb2affa6 | |
|
c2e04a0284 | |
|
b083a12b3a | |
|
a17a6b358c | |
|
d14a24fa3f | |
|
3d3f8c4c1e | |
|
2fa65059c4 | |
|
59a430de50 | |
|
c80cca6811 | |
|
b255071c2e | |
|
d6a9c6a87c | |
|
a0aa80ba8c | |
|
c8bffbb24a | |
|
98a4f33f5a | |
|
3d981345c3 | |
|
eb82cbd5b2 | |
|
e8b107ac72 | |
|
38d57343d5 | |
|
a241c2612a | |
|
5e8ecfa9ce | |
|
83febecee7 | |
|
a11e150a42 | |
|
96bd395261 | |
|
f365e30c3b | |
|
0a43acbcbe | |
|
4402a24fa4 | |
|
556502b7a2 | |
|
6b722b1965 | |
|
e2001174dd | |
|
29ccd209f6 | |
|
2bc6f810e3 | |
|
3c129e4e66 | |
|
f9de151794 | |
|
674804aaa4 | |
|
d8cc73a834 | |
|
2377a61578 | |
|
437fcc8fb2 | |
|
a1446670f5 | |
|
88cfa11682 | |
|
4d235b2975 | |
|
0353df0924 | |
|
cb01cddeff | |
|
b314d46426 | |
|
a45dcc7eca | |
|
37bb871c68 | |
|
35102e0b3d | |
|
cef37b40e6 | |
|
75f4d8ef09 | |
|
b1b4c6b634 | |
|
6ac6a42a60 | |
|
4a94cac214 | |
|
4c01a5ee1a | |
|
eb9c4cce02 |
|
@ -31,5 +31,10 @@
|
||||||
<option name="name" value="In project repo" />
|
<option name="name" value="In project repo" />
|
||||||
<option name="url" value="file:///D:\Project\cut-to-pack-service/libs" />
|
<option name="url" value="file:///D:\Project\cut-to-pack-service/libs" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="in-project" />
|
||||||
|
<option name="name" value="In project repo" />
|
||||||
|
<option name="url" value="file:///D:\ctp\Project\Cut-to-pack\cut-to-pack-service/libs" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="MavenProjectsManager">
|
<component name="MavenProjectsManager">
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.utopiaindustries.auth;
|
||||||
|
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
|
@PreAuthorize("hasAnyRole('ROLE_INVENTORY_ACCOUNT','ROLE_ADMIN')")
|
||||||
|
public @interface InventoryAccountRole {
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.utopiaindustries.auth;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
|
@PreAuthorize( "hasAnyRole('ROLE_PURCHASE_ORDER','ROLE_ADMIN')")
|
||||||
|
public @interface PurchaseOrderCTPRole {
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.utopiaindustries.auth;
|
||||||
|
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
|
@PreAuthorize( "hasAnyRole('ROLE_STORE','ROLE_ADMIN')")
|
||||||
|
public @interface StoreRole {
|
||||||
|
}
|
|
@ -35,22 +35,22 @@ public class DataSourceConfiguration {
|
||||||
|
|
||||||
/* COSMOS */
|
/* COSMOS */
|
||||||
|
|
||||||
@Bean(name = "dataSourceCosmos")
|
// @Bean(name = "dataSourceCosmos")
|
||||||
@ConfigurationProperties(prefix = "spring.cosmosdatasource")
|
// @ConfigurationProperties(prefix = "spring.cosmosdatasource")
|
||||||
public DataSource cosmosDataSource() {
|
// public DataSource cosmosDataSource() {
|
||||||
return DataSourceBuilder.create().build();
|
// return DataSourceBuilder.create().build();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
@Bean(name = "jdbcTemplateCosmos")
|
// @Bean(name = "jdbcTemplateCosmos")
|
||||||
public JdbcTemplate cosmosJdbcTemplate( @Qualifier( "dataSourceCosmos" ) DataSource ds ) {
|
// public JdbcTemplate cosmosJdbcTemplate( @Qualifier( "dataSourceCosmos" ) DataSource ds ) {
|
||||||
return new JdbcTemplate( ds );
|
// return new JdbcTemplate( ds );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Bean(name = "namedParameterJdbcTemplateCosmos")
|
// @Bean(name = "namedParameterJdbcTemplateCosmos")
|
||||||
public NamedParameterJdbcTemplate cosmosNamedParameterJdbcTemplate( @Qualifier( "dataSourceCosmos" ) DataSource ds ) {
|
// public NamedParameterJdbcTemplate cosmosNamedParameterJdbcTemplate( @Qualifier( "dataSourceCosmos" ) DataSource ds ) {
|
||||||
return new NamedParameterJdbcTemplate( ds );
|
// return new NamedParameterJdbcTemplate( ds );
|
||||||
}
|
// }
|
||||||
|
|
||||||
/* LOCAL */
|
/* LOCAL */
|
||||||
|
|
||||||
|
@ -73,6 +73,4 @@ public class DataSourceConfiguration {
|
||||||
public NamedParameterJdbcTemplate localNamedParameterJdbcTemplate( @Qualifier( "dataSourceLocal" ) DataSource ds ) {
|
public NamedParameterJdbcTemplate localNamedParameterJdbcTemplate( @Qualifier( "dataSourceLocal" ) DataSource ds ) {
|
||||||
return new NamedParameterJdbcTemplate( ds );
|
return new NamedParameterJdbcTemplate( ds );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
http.csrf().disable()
|
http.csrf().disable()
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/login", "/rest/**")
|
.antMatchers("/login", "/rest/**","/dashboard/**")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
.antMatchers("/**")
|
.antMatchers("/**")
|
||||||
.hasAnyRole("USER", "ADMIN")
|
.hasAnyRole("USER", "ADMIN")
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.service.DashboardService;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/dashboard")
|
||||||
|
public class DashboardController {
|
||||||
|
|
||||||
|
private final DashboardService dashboardService;
|
||||||
|
|
||||||
|
public DashboardController(DashboardService dashboardService) {
|
||||||
|
this.dashboardService = dashboardService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{lineNumber}")
|
||||||
|
public String getDashboard(@PathVariable("lineNumber") String lineNumber, Model model) {
|
||||||
|
model.addAttribute("refresh", true);
|
||||||
|
model.addAttribute("phases", dashboardService.getPhasesProgressDayWise(lineNumber));
|
||||||
|
model.addAttribute("date", LocalDate.now());
|
||||||
|
model.addAttribute("day", LocalDate.now().getDayOfWeek());
|
||||||
|
model.addAttribute("detail", dashboardService.getLineDetails(lineNumber) );
|
||||||
|
|
||||||
|
return "dashboard";
|
||||||
|
}
|
||||||
|
}
|
|
@ -83,7 +83,6 @@ public class FinishingController {
|
||||||
|
|
||||||
@GetMapping("segregate-inventory")
|
@GetMapping("segregate-inventory")
|
||||||
public String segregateFinishedItems(Model model) {
|
public String segregateFinishedItems(Model model) {
|
||||||
model.addAttribute("accounts", inventoryAccountService.findInventoryAccountsForFinishedItems() );
|
|
||||||
model.addAttribute("wrapper", new FinishedItemWrapper());
|
model.addAttribute("wrapper", new FinishedItemWrapper());
|
||||||
return "/finishing/segregate-inventory";
|
return "/finishing/segregate-inventory";
|
||||||
}
|
}
|
||||||
|
@ -94,12 +93,12 @@ public class FinishingController {
|
||||||
RedirectAttributes redirectAttributes,
|
RedirectAttributes redirectAttributes,
|
||||||
Model model) {
|
Model model) {
|
||||||
try {
|
try {
|
||||||
inventoryService.segregateFinishedItems( wrapper );
|
inventoryService.segregateFinishedItems(wrapper, wrapper.getQaStatus());
|
||||||
redirectAttributes.addFlashAttribute("success", "Items Successfully saved !");
|
redirectAttributes.addFlashAttribute("success", "Items Successfully saved !");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
redirectAttributes.addFlashAttribute("error", e.getMessage());
|
redirectAttributes.addFlashAttribute("error", e.getMessage());
|
||||||
}
|
}
|
||||||
return "redirect:/finishing/finished-items";
|
return "redirect:/finishing/segregate-inventory";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
package com.utopiaindustries.controller;
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.AdminRole;
|
import com.utopiaindustries.auth.InventoryAccountRole;
|
||||||
import com.utopiaindustries.model.ctp.InventoryAccount;
|
import com.utopiaindustries.model.ctp.InventoryAccount;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@AdminRole
|
@InventoryAccountRole
|
||||||
@RequestMapping( "/inventory-accounts" )
|
@RequestMapping( "/inventory-accounts" )
|
||||||
public class InventoryAccountController {
|
public class InventoryAccountController {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
|
||||||
|
import com.utopiaindustries.model.ctp.POsDetails;
|
||||||
|
import com.utopiaindustries.service.*;
|
||||||
|
import org.springframework.core.io.InputStreamResource;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/po-status")
|
||||||
|
@PurchaseOrderCTPRole
|
||||||
|
public class POStatusController {
|
||||||
|
|
||||||
|
private final ReportingService reportingService;
|
||||||
|
private final PurchaseOrderService purchaseOrderService;
|
||||||
|
private final JobCardItemService jobCardItemService;
|
||||||
|
|
||||||
|
|
||||||
|
public POStatusController(ReportingService reportingService, PurchaseOrderService purchaseOrderService, JobCardItemService jobCardItemService) {
|
||||||
|
this.reportingService = reportingService;
|
||||||
|
this.purchaseOrderService = purchaseOrderService;
|
||||||
|
this.jobCardItemService = jobCardItemService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String homePage( Model model ){
|
||||||
|
return "redirect:/po-status/all-pos";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/all-pos")
|
||||||
|
public String poReport(@RequestParam(value = "poName", required = false) String poName,
|
||||||
|
@RequestParam(value = "size", required = false) String size,
|
||||||
|
@RequestParam(value = "color", required = false) String color,
|
||||||
|
@RequestParam(value = "count", required = false, defaultValue = "100") Long count,
|
||||||
|
Model model){
|
||||||
|
|
||||||
|
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
|
||||||
|
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
|
||||||
|
model.addAttribute("allPOs", reportingService.getAllPOs(poName, size, color, count));
|
||||||
|
return "/reporting/po-report";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/po-items")
|
||||||
|
public String poReport(@RequestParam("poId") long poId,
|
||||||
|
@RequestParam(value = "size", required = false) String size,
|
||||||
|
@RequestParam(value = "color", required = false) String color,
|
||||||
|
Model model){
|
||||||
|
|
||||||
|
model.addAttribute("allSize",jobCardItemService.getAllSizesOFItems());
|
||||||
|
model.addAttribute("allColor",jobCardItemService.getAllColorOFItems());
|
||||||
|
model.addAttribute("poJobcardItems", reportingService.getPoItemsSizeOrColor(poId, size, color));
|
||||||
|
return "/reporting/po-jobcard-items-table";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( value = "/po-report-view/{poId}" )
|
||||||
|
public String showJobCardDetail(@PathVariable("poId") long poId, @RequestParam(value = "select-date", required = false) String selectDate ,
|
||||||
|
Model model ){
|
||||||
|
model.addAttribute("allJobCard", reportingService.getAllPoJobCards(poId, selectDate));
|
||||||
|
return "/reporting/po-job-card-report";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/generate-po-pdf", produces = MediaType.APPLICATION_PDF_VALUE)
|
||||||
|
public ResponseEntity<InputStreamResource> sendPoAndReturnPdf(@ModelAttribute POsDetails pOsDetails,
|
||||||
|
@RequestParam(required = false, defaultValue = "true") boolean includeItemsDetail,
|
||||||
|
@RequestParam(required = false, defaultValue = "true") boolean includeStoreDetails,
|
||||||
|
@RequestParam String color,
|
||||||
|
@RequestParam String size,
|
||||||
|
Model model) throws Exception{
|
||||||
|
return purchaseOrderService.generatePOPdf(pOsDetails, model, includeItemsDetail, includeStoreDetails, size, color);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
package com.utopiaindustries.controller;
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.PackagingRole;
|
import com.utopiaindustries.auth.PackagingRole;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
import com.utopiaindustries.service.LocationService;
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
import com.utopiaindustries.service.PackagingService;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ -17,19 +18,40 @@ import java.time.LocalDate;
|
||||||
@RequestMapping("/packaging" )
|
@RequestMapping("/packaging" )
|
||||||
public class PackagingController {
|
public class PackagingController {
|
||||||
|
|
||||||
|
|
||||||
private final InventoryAccountService inventoryAccountService;
|
private final InventoryAccountService inventoryAccountService;
|
||||||
|
private final PackagingService packagingService;
|
||||||
private final LocationService locationService;
|
private final LocationService locationService;
|
||||||
|
|
||||||
public PackagingController(InventoryAccountService inventoryAccountService, LocationService locationService) {
|
public PackagingController(InventoryAccountService inventoryAccountService, PackagingService packagingService, LocationService locationService) {
|
||||||
this.inventoryAccountService = inventoryAccountService;
|
this.inventoryAccountService = inventoryAccountService;
|
||||||
|
this.packagingService = packagingService;
|
||||||
this.locationService = locationService;
|
this.locationService = locationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String showHome(Model model ){
|
public String showHome(Model model ){
|
||||||
return "redirect:/packaging/inventory-accounts";
|
return "redirect:/packaging/receive-inventory";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/receive-inventory")
|
||||||
|
public String packagingItemReceive( Model model ){
|
||||||
|
model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts(6L));
|
||||||
|
model.addAttribute("wrapper", new FinishedItemWrapper() );
|
||||||
|
return "/packaging/receive-inventory-form";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping( "/packaging-items" )
|
||||||
|
public String packagingItems( @ModelAttribute FinishedItemWrapper wrapper,
|
||||||
|
RedirectAttributes redirectAttributes,
|
||||||
|
Model model ){
|
||||||
|
try {
|
||||||
|
packagingService.createPackagingItem( wrapper );
|
||||||
|
redirectAttributes.addFlashAttribute("success", "Items Successfully received !" );
|
||||||
|
} catch ( Exception e ){
|
||||||
|
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||||
|
}
|
||||||
|
return "redirect:/packaging/receive-inventory";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/inventory-accounts" )
|
@GetMapping( "/inventory-accounts" )
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.auth.PurchaseOrderCTPRole;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
|
import com.utopiaindustries.service.PurchaseOrderCTPService;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
import org.springframework.security.core.parameters.P;
|
||||||
|
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
|
||||||
|
@RequestMapping("/purchase-order")
|
||||||
|
@PurchaseOrderCTPRole
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPController {
|
||||||
|
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
||||||
|
|
||||||
|
public PurchaseOrderCTPController(PurchaseOrderCTPService purchaseOrderCTPService) {
|
||||||
|
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String showJobCardList( @RequestParam( value = "purchaseOrderCode", required = false ) String purchaseOrderCode,
|
||||||
|
@RequestParam( value = "articleName", required = false ) String articleName,
|
||||||
|
@RequestParam( value = "created-start-date", required = false ) String createdStartDate,
|
||||||
|
@RequestParam( value = "created-end-date", required = false ) String createdEndDate,
|
||||||
|
@RequestParam( value = "limit" , required = false) Long limit,
|
||||||
|
Model model ){
|
||||||
|
|
||||||
|
LocalDate startDate = StringUtils.isNullOrEmpty(createdStartDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(createdStartDate);
|
||||||
|
LocalDate endDate = StringUtils.isNullOrEmpty(createdEndDate) ? LocalDate.now() : LocalDate.parse(createdEndDate);
|
||||||
|
model.addAttribute("purchaseOrder", purchaseOrderCTPService.getAllPurchaseOrderCtp(purchaseOrderCode, articleName, startDate.toString(), endDate.toString(), limit) );
|
||||||
|
model.addAttribute("startDate", startDate);
|
||||||
|
model.addAttribute("endDate", endDate);
|
||||||
|
return "/purchaseOrder/purchase-order-list";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/new" )
|
||||||
|
public String showPurchaseOrderCTPForm( Model model ){
|
||||||
|
model.addAttribute("purchaseOrder", purchaseOrderCTPService.createNewPurchaseOrderCTP() );
|
||||||
|
return "/purchaseOrder/purchase-order-form";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( value = "/edit/{id}" )
|
||||||
|
public String showJobCardEditForm( @PathVariable("id") long id,
|
||||||
|
Model model ){
|
||||||
|
model.addAttribute("purchaseOrder", purchaseOrderCTPService.searchPurchaseOrderById( id ) );
|
||||||
|
return "/purchaseOrder/purchase-order-form";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* draft
|
||||||
|
* */
|
||||||
|
@PostMapping( value ="/edit" , params = "user=draft" )
|
||||||
|
public String saveJobCard( @ModelAttribute PurchaseOrderCTP purchaseOrderCTP,
|
||||||
|
RedirectAttributes redirectAttributes,
|
||||||
|
Model model ){
|
||||||
|
try {
|
||||||
|
purchaseOrderCTP.setStatus( PurchaseOrderCTP.Status.DRAFT.name() );
|
||||||
|
purchaseOrderCTPService.save( purchaseOrderCTP );
|
||||||
|
redirectAttributes.addFlashAttribute("success", "Successfully saved!" );
|
||||||
|
} catch ( Exception ex ){
|
||||||
|
redirectAttributes.addFlashAttribute("error", ex.getMessage() );
|
||||||
|
}
|
||||||
|
return "redirect:/purchase-order";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( value ="/edit" , params = "user=post" )
|
||||||
|
public String postJobCard( @ModelAttribute PurchaseOrderCTP purchaseOrderCTP,
|
||||||
|
RedirectAttributes redirectAttributes,
|
||||||
|
Model model ){
|
||||||
|
|
||||||
|
try {
|
||||||
|
purchaseOrderCTP.setStatus( PurchaseOrderCTP.Status.POSTED.name() );
|
||||||
|
purchaseOrderCTPService.save( purchaseOrderCTP );
|
||||||
|
redirectAttributes.addFlashAttribute("success", "Successfully saved!" );
|
||||||
|
} catch ( Exception ex ){
|
||||||
|
redirectAttributes.addFlashAttribute("error", ex.getMessage() );
|
||||||
|
}
|
||||||
|
return "redirect:/purchase-order";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/store-items/{id}" )
|
||||||
|
public String getPOStoreItems( @PathVariable("id") long poId,
|
||||||
|
Model model ){
|
||||||
|
model.addAttribute("storeItems", purchaseOrderCTPService.getStoreItemsByPoId( poId ));
|
||||||
|
return "/reporting/po-store-items-table";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -87,11 +87,11 @@ public class QualityControlController {
|
||||||
public String postFinishedItemsAfterQc(@ModelAttribute StitchedItemWrapper wrapper,
|
public String postFinishedItemsAfterQc(@ModelAttribute StitchedItemWrapper wrapper,
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
inventoryService.createFinishedItemsAgainstStitchedItems( wrapper );
|
inventoryService.createFinishedItemsAgainstStitchedItems(wrapper, wrapper.getQaStatus());
|
||||||
redirectAttributes.addFlashAttribute("success", " Finished Items Are Generated Against Stitched Items");
|
redirectAttributes.addFlashAttribute("success", " Finished Items Are Generated Against Stitched Items");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
redirectAttributes.addFlashAttribute("error", ex.getMessage());
|
redirectAttributes.addFlashAttribute("error", ex.getMessage());
|
||||||
}
|
}
|
||||||
return "redirect:/quality-control/qc-finished-items";
|
return "redirect:/quality-control/qc-finished-item";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
package com.utopiaindustries.controller;
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
import com.utopiaindustries.auth.ReportingRole;
|
import com.utopiaindustries.auth.ReportingRole;
|
||||||
|
import com.utopiaindustries.model.ctp.POsDetails;
|
||||||
import com.utopiaindustries.model.ctp.SummaryInventoryReport;
|
import com.utopiaindustries.model.ctp.SummaryInventoryReport;
|
||||||
import com.utopiaindustries.service.InventoryAccountService;
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
|
import com.utopiaindustries.service.PurchaseOrderService;
|
||||||
import com.utopiaindustries.service.ReportingService;
|
import com.utopiaindustries.service.ReportingService;
|
||||||
import com.utopiaindustries.service.SummaryInventoryReportService;
|
import com.utopiaindustries.service.SummaryInventoryReportService;
|
||||||
import com.utopiaindustries.util.StringUtils;
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
import org.springframework.core.io.InputStreamResource;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
@ -26,12 +28,19 @@ public class ReportingController {
|
||||||
private final ReportingService reportingService;
|
private final ReportingService reportingService;
|
||||||
private final SummaryInventoryReportService summaryInventoryReportService;
|
private final SummaryInventoryReportService summaryInventoryReportService;
|
||||||
private final InventoryAccountService inventoryAccountService;
|
private final InventoryAccountService inventoryAccountService;
|
||||||
|
private final PurchaseOrderService purchaseOrderService;
|
||||||
|
|
||||||
|
|
||||||
public ReportingController(SummaryInventoryReportService summaryInventoryReportService2, ReportingService reportingService, InventoryAccountService inventoryAccountService) {
|
public ReportingController(SummaryInventoryReportService summaryInventoryReportService2, ReportingService reportingService, InventoryAccountService inventoryAccountService, PurchaseOrderService purchaseOrderService) {
|
||||||
this.summaryInventoryReportService = summaryInventoryReportService2;
|
this.summaryInventoryReportService = summaryInventoryReportService2;
|
||||||
this.reportingService = reportingService;
|
this.reportingService = reportingService;
|
||||||
this.inventoryAccountService = inventoryAccountService;
|
this.inventoryAccountService = inventoryAccountService;
|
||||||
|
this.purchaseOrderService = purchaseOrderService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String homePage( Model model ){
|
||||||
|
return "redirect:/reporting/job-card-report";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/summary")
|
@GetMapping( "/summary")
|
||||||
|
@ -68,33 +77,49 @@ public class ReportingController {
|
||||||
return "/reporting/job-card-report";
|
return "/reporting/job-card-report";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping( "/po-report")
|
|
||||||
public String poReport(@RequestParam(value = "poName", required = false) String poName, Model model){
|
|
||||||
|
|
||||||
model.addAttribute("allPOs", reportingService.getAllPOs(poName));
|
|
||||||
return "/reporting/po-report";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping( value = "/po-report-view/{poNo}" )
|
|
||||||
public String showJobCardDetail( @PathVariable("poNo") String poNo, @RequestParam(value = "select-date", required = false) String selectDate ,
|
|
||||||
Model model ){
|
|
||||||
model.addAttribute("allJobCard", reportingService.getAllPoJobCards(poNo, selectDate));
|
|
||||||
return "/reporting/po-job-card-report";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping( value = "/cutting-report" )
|
@GetMapping( value = "/cutting-report" )
|
||||||
public String cuttingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, Model model ){
|
public String cuttingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, @RequestParam(value = "count", required = false) Long count, Model model ){
|
||||||
|
|
||||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : 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("startDate", startDate1);
|
||||||
model.addAttribute("endDate", endDate1);
|
model.addAttribute("endDate", endDate1);
|
||||||
model.addAttribute("accounts", inventoryAccountService.getAllCuttingAccounts() );
|
model.addAttribute("accounts", inventoryAccountService.getAllCuttingAccounts() );
|
||||||
model.addAttribute("cutting",reportingService.getCuttingTableDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString()));
|
model.addAttribute("cutting",reportingService.getCuttingTableDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString(), count));
|
||||||
|
|
||||||
return "/reporting/cutting-report";
|
return "/reporting/cutting-report";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping( value = "/stitching-report" )
|
||||||
|
public String stitchingReport(@RequestParam(value = "job-card-id", required = false ) String jobCardId, @RequestParam(value = "accountId" , required = false) String accountId, @RequestParam(value = "start-date", required = false) String startDate, @RequestParam(value = "end-date", required = false) String endDate, @RequestParam(value = "count", required = false) Long count, Model model ){
|
||||||
|
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
model.addAttribute("startDate", startDate1);
|
||||||
|
model.addAttribute("endDate", endDate1);
|
||||||
|
model.addAttribute("accounts" , inventoryAccountService.findInventoryAccounts( 2L ) );
|
||||||
|
model.addAttribute("stitching",reportingService.getStitchingDetails(jobCardId, accountId, startDate1.toString(), endDate1.toString(), count));
|
||||||
|
|
||||||
|
return "/reporting/stitching-report";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/inventory-transactions" )
|
||||||
|
public String getInventoryTransactionsByAccount( @RequestParam( value = "account-id", required = false) String accountId,
|
||||||
|
@RequestParam( value = "jobCard-id", required = false) String jobCardId,
|
||||||
|
@RequestParam( value = "sku", required = false) String sku,
|
||||||
|
@RequestParam( value = "startDate", required = false) String startDate,
|
||||||
|
@RequestParam( value = "endDate", required = false) String endDate,
|
||||||
|
@RequestParam(value = "count", required = false) Long count,
|
||||||
|
Model model ){
|
||||||
|
|
||||||
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(31) : LocalDate.parse(startDate);
|
||||||
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
|
model.addAttribute("startDate", startDate1);
|
||||||
|
model.addAttribute("endDate", endDate1);
|
||||||
|
model.addAttribute("transactions", reportingService.stitchingItemsTransactions( jobCardId, accountId, sku, startDate1.toString(), endDate1.toString(), count ));
|
||||||
|
return "/reporting/accounts-transaction-table";
|
||||||
|
}
|
||||||
|
|
||||||
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
|
private ArrayList<LocalDate> generateDateList(LocalDate start, LocalDate end) {
|
||||||
ArrayList<LocalDate> localDates = new ArrayList<>();
|
ArrayList<LocalDate> localDates = new ArrayList<>();
|
||||||
while (start.isBefore(end)) {
|
while (start.isBefore(end)) {
|
||||||
|
|
|
@ -74,8 +74,6 @@ public class StitchingController {
|
||||||
@RequestParam( value = "count", required = false ) Long count,
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
Model model ) {
|
Model model ) {
|
||||||
// 2 for stitching
|
// 2 for stitching
|
||||||
|
|
||||||
|
|
||||||
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
|
model.addAttribute("accounts", inventoryAccountService.getInventoryAccounts(id, title, active, createdBy, startDate, endDate, siteId, count, "PROCESS", "2", false));
|
||||||
model.addAttribute("locations", locationService.findAll() );
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
if(count == null){
|
if(count == null){
|
||||||
|
@ -95,11 +93,11 @@ public class StitchingController {
|
||||||
@RequestParam( value = "end-date", required = false ) String endDate,
|
@RequestParam( value = "end-date", required = false ) String endDate,
|
||||||
@RequestParam(value = "bundle-id", required = false) Long bundleId,
|
@RequestParam(value = "bundle-id", required = false) Long bundleId,
|
||||||
@RequestParam( value = "count", required = false, defaultValue = "100") Long count,
|
@RequestParam( value = "count", required = false, defaultValue = "100") Long count,
|
||||||
Model model
|
@RequestParam( value = "status", required = false) String status,
|
||||||
,RedirectAttributes redirect){
|
Model model, RedirectAttributes redirect){
|
||||||
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
LocalDate startDate1 = StringUtils.isNullOrEmpty(startDate) ? LocalDate.now().minusDays(30) : LocalDate.parse(startDate);
|
||||||
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
LocalDate endDate1 = StringUtils.isNullOrEmpty(endDate) ? LocalDate.now() : LocalDate.parse(endDate);
|
||||||
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, startDate, endDate, bundleId ,count );
|
List<StitchingOfflineItem> itemList = bundleService.getStitchedOfflineItems( id, itemId, sku, status, startDate, endDate, bundleId ,count );
|
||||||
model.addAttribute("items", itemList ) ;
|
model.addAttribute("items", itemList ) ;
|
||||||
model.addAttribute("startDate", startDate1);
|
model.addAttribute("startDate", startDate1);
|
||||||
model.addAttribute("endDate", endDate1);
|
model.addAttribute("endDate", endDate1);
|
||||||
|
@ -124,7 +122,7 @@ public class StitchingController {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
redirectAttributes.addFlashAttribute( "error", exception.getMessage() );
|
redirectAttributes.addFlashAttribute( "error", exception.getMessage() );
|
||||||
}
|
}
|
||||||
return "redirect:/stitching/stitching-offline-items";
|
return "redirect:/stitching/create-stitching-items";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping( "/generate-barcodes" )
|
@PostMapping( "/generate-barcodes" )
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.utopiaindustries.controller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.auth.StoreRole;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
|
import com.utopiaindustries.service.InventoryAccountService;
|
||||||
|
import com.utopiaindustries.service.LocationService;
|
||||||
|
import com.utopiaindustries.service.StoreService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@StoreRole
|
||||||
|
@RequestMapping( "/store" )
|
||||||
|
public class StoreController {
|
||||||
|
|
||||||
|
private final InventoryAccountService inventoryAccountService;
|
||||||
|
private final StoreService storeService;
|
||||||
|
private final LocationService locationService;
|
||||||
|
|
||||||
|
public StoreController(InventoryAccountService inventoryAccountService, StoreService storeService, LocationService locationService) {
|
||||||
|
this.inventoryAccountService = inventoryAccountService;
|
||||||
|
this.storeService = storeService;
|
||||||
|
this.locationService = locationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public String showHome(Model model ){
|
||||||
|
return "redirect:/store/receive-inventory";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/receive-inventory")
|
||||||
|
public String packagingItemReceive( Model model ){
|
||||||
|
model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts(9L));
|
||||||
|
model.addAttribute("wrapper", new FinishedItemWrapper() );
|
||||||
|
return "/store/receive-inventory-form";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping( "/store-items" )
|
||||||
|
public String packagingItems( @ModelAttribute FinishedItemWrapper wrapper,
|
||||||
|
RedirectAttributes redirectAttributes,
|
||||||
|
Model model ){
|
||||||
|
try {
|
||||||
|
storeService.createStoreItems( wrapper );
|
||||||
|
redirectAttributes.addFlashAttribute("success", "Items Successfully received !" );
|
||||||
|
} catch ( Exception e ){
|
||||||
|
redirectAttributes.addFlashAttribute("error", e.getMessage() );
|
||||||
|
}
|
||||||
|
return "redirect:/store/receive-inventory";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping( "/inventory-accounts" )
|
||||||
|
public String showInventoryAccounts(@RequestParam( value = "id", required = false ) String id,
|
||||||
|
@RequestParam( value = "title", required = false) String title,
|
||||||
|
@RequestParam( value = "active", required = false ) String active,
|
||||||
|
@RequestParam( value = "created-by", required = false ) String createdBy,
|
||||||
|
@RequestParam( value = "start-date", required = false ) String startDate,
|
||||||
|
@RequestParam( value = "end-date", required = false ) String endDate,
|
||||||
|
@RequestParam( value = "site-id", required = false ) String siteId,
|
||||||
|
@RequestParam( value = "count", required = false ) Long count,
|
||||||
|
Model model ){
|
||||||
|
if(StringUtils.isNullOrEmpty( active )){
|
||||||
|
return "redirect:/store/inventory-accounts?id=&title=&active=1&created-by=&start-date=&end-date=&site-id=&site-title=&count=100";
|
||||||
|
}
|
||||||
|
model.addAttribute("accounts", inventoryAccountService.findInventoryAccounts(9L));
|
||||||
|
model.addAttribute("locations", locationService.findAll() );
|
||||||
|
return "/store/inventory-accounts";
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package com.utopiaindustries.dao.ctp;
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
import com.utopiaindustries.model.ctp.FinishedItem;
|
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||||
import com.utopiaindustries.model.ctp.JobCard;
|
|
||||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import com.utopiaindustries.util.KeyHolderFunctions;
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
@ -22,18 +21,20 @@ public class FinishedItemDAO {
|
||||||
private final String TABLE_NAME = "cut_to_pack.finished_item";
|
private final String TABLE_NAME = "cut_to_pack.finished_item";
|
||||||
private final String SELECT_QUERY = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
|
private final String SELECT_QUERY = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
private final String SELECT_ALL_QUERY = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
|
private final String SELECT_ALL_QUERY = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
|
||||||
private final String SELECT_QUERY_BY_BARCODE_QA_STATUS = String.format( "SELECT case when EXISTS ( SELECT * FROM %s WHERE barcode = :barcode AND (qa_status = 'APPROVED' OR qa_status = 'WASHED') ) then true else false End as Result", TABLE_NAME );
|
private final String SELECT_QUERY_BY_BARCODE_QA_STATUS =String.format("SELECT CASE WHEN EXISTS (SELECT 1 FROM %s WHERE barcode = :barcode AND (is_store = TRUE OR is_packed = TRUE)) 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 SELECT_QUERY_BY_JOB_CARD = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
|
||||||
private final String DELETE_QUERY = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
|
private final String DELETE_QUERY = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, stitched_item_id, is_segregated, qa_status) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :stitched_item_id, :is_segregated, :qa_status) ON DUPLICATE KEY UPDATE item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), created_at = VALUES(created_at), created_by = VALUES(created_by), job_card_id = VALUES(job_card_id), is_qa = VALUES(is_qa), stitched_item_id = VALUES(stitched_item_id), is_segregated = VALUES(is_segregated), qa_status = VALUES(qa_status)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format("INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, stitched_item_id, is_segregated, qa_status, is_packed, operation_date, is_store) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :stitched_item_id, :is_segregated, :qa_status, :is_packed, :operation_date, :is_store) 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), is_packed = VALUES(is_packed), operation_date = VALUES(operation_date), is_store = VALUES(is_store)", TABLE_NAME);
|
||||||
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME);
|
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME);
|
||||||
private final String SELECT_BY_IDS = String.format("SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME);
|
private final String SELECT_BY_IDS = String.format("SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME);
|
||||||
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME);
|
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME);
|
||||||
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated ORDER BY ID DESC", TABLE_NAME );
|
private final String SELECT_BY_TERM = String.format("SELECT * FROM %s WHERE barcode LIKE :term AND is_qa = :is_qa AND is_packed = FALSE AND is_store = FALSE 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_TERM_FOR_PACKAGING = String.format("SELECT * FROM %s WHERE barcode LIKE :term AND is_segregated = :is_segregated AND qa_status = :qa_status AND is_packed = FALSE AND is_store = FALSE 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 AND is_packed = FALSE", TABLE_NAME);
|
||||||
private final String SELECT_BY_STITCHED_ITEM_IDS = String.format("SELECT * FROM %s WHERE stitched_item_id IN (:stitched_item_ids)", TABLE_NAME);
|
private final String SELECT_BY_STITCHED_ITEM_IDS = String.format("SELECT * FROM %s WHERE stitched_item_id IN (:stitched_item_ids)", TABLE_NAME);
|
||||||
private final String COUNT_TOTAL_FINISH_ITEM= String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_segregated IS TRUE ",TABLE_NAME);
|
private final String COUNT_TOTAL_FINISH_ITEM = String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_qa = TRUE AND (is_segregated IS TRUE OR is_store = TRUE) ", TABLE_NAME);
|
||||||
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME);
|
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME);
|
||||||
|
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR operation_date >= :start_date) AND operation_date <= :end_date AND qa_status = :qa_status AND id in (:ids) AND is_packed = FALSE AND is_qa = TRUE", TABLE_NAME );
|
||||||
|
|
||||||
public FinishedItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public FinishedItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
@ -52,7 +53,10 @@ public class FinishedItemDAO {
|
||||||
.addValue("is_qa", finishedItem.getIsQa())
|
.addValue("is_qa", finishedItem.getIsQa())
|
||||||
.addValue("stitched_item_id", finishedItem.getStitchedItemId())
|
.addValue("stitched_item_id", finishedItem.getStitchedItemId())
|
||||||
.addValue("is_segregated", finishedItem.getIsSegregated())
|
.addValue("is_segregated", finishedItem.getIsSegregated())
|
||||||
.addValue("qa_status", finishedItem.getQaStatus() );
|
.addValue("qa_status", finishedItem.getQaStatus())
|
||||||
|
.addValue("is_packed", finishedItem.isPackaging())
|
||||||
|
.addValue("is_store", finishedItem.isStore())
|
||||||
|
.addValue("operation_date", finishedItem.getOperationDate());
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,11 +117,19 @@ public class FinishedItemDAO {
|
||||||
return namedParameterJdbcTemplate.query(SELECT_BY_IDS, params, new FinishedItemRowMapper());
|
return namedParameterJdbcTemplate.query(SELECT_BY_IDS, params, new FinishedItemRowMapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FinishedItem> findByTerm( String term , boolean isSegregated ){
|
public List<FinishedItem> findByTerm(String term, boolean isQa) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("term", "%" + term + "%");
|
||||||
|
params.addValue("is_qa", isQa);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_TERM, params, new FinishedItemRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FinishedItem> findByTermForPackaging(String term, boolean isSegregated, String qaStatus) {
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("term", "%" + term + "%");
|
params.addValue("term", "%" + term + "%");
|
||||||
params.addValue("is_segregated", isSegregated);
|
params.addValue("is_segregated", isSegregated);
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_TERM , params, new FinishedItemRowMapper() );
|
params.addValue("qa_status", qaStatus);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_TERM_FOR_PACKAGING, params, new FinishedItemRowMapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
// find By job card Id
|
// find By job card Id
|
||||||
|
@ -186,4 +198,14 @@ public class FinishedItemDAO {
|
||||||
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_AND_DATE, params, new FinishedItemRowMapper());
|
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_AND_DATE, params, new FinishedItemRowMapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long findByOperationDateAndIdsAndQaStatus(String startDate, String endDate, String qaStatus, List<Long> ids){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "start_date", startDate );
|
||||||
|
params.addValue( "end_date", endDate );
|
||||||
|
params.addValue( "qa_status", qaStatus );
|
||||||
|
params.addValue( "ids", ids );
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_QA_STATUS, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -16,12 +16,17 @@ public class FinishedItemRowMapper implements RowMapper<FinishedItem> {
|
||||||
if ( rs.getTimestamp( "created_at" ) != null ) {
|
if ( rs.getTimestamp( "created_at" ) != null ) {
|
||||||
finishedItem.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
finishedItem.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
||||||
}
|
}
|
||||||
|
if ( rs.getTimestamp( "operation_date" ) != null ) {
|
||||||
|
finishedItem.setOperationDate( rs.getTimestamp( "operation_date" ).toLocalDateTime() );
|
||||||
|
}
|
||||||
finishedItem.setCreatedBy( rs.getString( "created_by" ) );
|
finishedItem.setCreatedBy( rs.getString( "created_by" ) );
|
||||||
finishedItem.setJobCardId( rs.getLong("job_card_id") );
|
finishedItem.setJobCardId( rs.getLong("job_card_id") );
|
||||||
finishedItem.setIsQa( rs.getBoolean("is_qa"));
|
finishedItem.setIsQa( rs.getBoolean("is_qa"));
|
||||||
finishedItem.setStitchedItemId( rs.getLong("stitched_item_id" ) );
|
finishedItem.setStitchedItemId( rs.getLong("stitched_item_id" ) );
|
||||||
finishedItem.setIsSegregated( rs.getBoolean( "is_segregated") );
|
finishedItem.setIsSegregated( rs.getBoolean( "is_segregated") );
|
||||||
finishedItem.setQaStatus( rs.getString("qa_status" ) );
|
finishedItem.setQaStatus( rs.getString("qa_status" ) );
|
||||||
|
finishedItem.setPackaging( rs.getBoolean("is_packed" ) );
|
||||||
|
finishedItem.setStore( rs.getBoolean("is_store" ) );
|
||||||
return finishedItem;
|
return finishedItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,7 +20,26 @@ public class InventoryAccountDAO {
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY title DESC", TABLE_NAME );
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY title DESC", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, title, parent_entity_type, parent_entity_id, active, created_by, created_at, location_site_id, notes, is_packaging) VALUES (:id, :title, :parent_entity_type, :parent_entity_id, :active, :created_by, :created_at, :location_site_id, :notes, :is_packaging) ON DUPLICATE KEY UPDATE title = VALUES(title), parent_entity_type = VALUES(parent_entity_type), parent_entity_id = VALUES(parent_entity_id), active = VALUES(active), created_by = VALUES(created_by), created_at = VALUES(created_at), location_site_id = VALUES(location_site_id), notes = VALUES(notes), is_packaging = VALUES(is_packaging)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format(
|
||||||
|
"INSERT INTO %s (id, title, parent_entity_type, parent_entity_id, active, created_by, created_at, location_site_id, notes, is_packaging, article_name, shift_minutes, total_machines, efficiency, sam) " +
|
||||||
|
"VALUES (:id, :title, :parent_entity_type, :parent_entity_id, :active, :created_by, :created_at, :location_site_id, :notes, :is_packaging, :article_name, :shift_minutes, :total_machines, :efficiency, :sam) " +
|
||||||
|
"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), " +
|
||||||
|
"article_name = VALUES(article_name), " +
|
||||||
|
"shift_minutes = VALUES(shift_minutes), " +
|
||||||
|
"efficiency = VALUES(efficiency), " +
|
||||||
|
"sam = VALUES(sam), " +
|
||||||
|
"total_machines = VALUES(total_machines)",
|
||||||
|
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 active = TRUE AND 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 active = TRUE AND 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 );
|
||||||
|
@ -45,6 +64,11 @@ public class InventoryAccountDAO {
|
||||||
.addValue( "created_at", inventoryAccount.getCreatedAt() )
|
.addValue( "created_at", inventoryAccount.getCreatedAt() )
|
||||||
.addValue( "location_site_id", inventoryAccount.getLocationSiteId() )
|
.addValue( "location_site_id", inventoryAccount.getLocationSiteId() )
|
||||||
.addValue( "notes", inventoryAccount.getNotes() )
|
.addValue( "notes", inventoryAccount.getNotes() )
|
||||||
|
.addValue( "article_name", inventoryAccount.getArticleName() )
|
||||||
|
.addValue( "total_machines", inventoryAccount.getTotalMachines() )
|
||||||
|
.addValue( "shift_minutes", inventoryAccount.getShiftMinutes() )
|
||||||
|
.addValue( "efficiency", inventoryAccount.getEfficiency() )
|
||||||
|
.addValue( "sam", inventoryAccount.getSam() )
|
||||||
.addValue("is_packaging", inventoryAccount.getIsPackaging() );
|
.addValue("is_packaging", inventoryAccount.getIsPackaging() );
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,11 @@ public class InventoryAccountRowMapper implements RowMapper<InventoryAccount> {
|
||||||
}
|
}
|
||||||
inventoryAccount.setLocationSiteId( rs.getInt( "location_site_id" ) );
|
inventoryAccount.setLocationSiteId( rs.getInt( "location_site_id" ) );
|
||||||
inventoryAccount.setNotes( rs.getString( "notes" ) );
|
inventoryAccount.setNotes( rs.getString( "notes" ) );
|
||||||
|
inventoryAccount.setArticleName( rs.getString( "article_name" ) );
|
||||||
|
inventoryAccount.setShiftMinutes( rs.getLong( "shift_minutes" ) );
|
||||||
|
inventoryAccount.setTotalMachines( rs.getLong( "total_machines" ) );
|
||||||
|
inventoryAccount.setEfficiency( rs.getBigDecimal( "efficiency" ) );
|
||||||
|
inventoryAccount.setSam( rs.getBigDecimal( "sam" ) );
|
||||||
inventoryAccount.setIsPackaging( rs.getBoolean("is_packaging" ) );
|
inventoryAccount.setIsPackaging( rs.getBoolean("is_packaging" ) );
|
||||||
return inventoryAccount;
|
return inventoryAccount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,9 @@ public class InventoryTransactionLegDAO {
|
||||||
private final String COUNT_TOTAL_SEGREGATE_ITEMS = String.format("SELECT COUNT(*) FROM %s WHERE parent_document_id IN (:parent_document_id) AND account_id = :account_id", TABLE_NAME);
|
private final String COUNT_TOTAL_SEGREGATE_ITEMS = String.format("SELECT COUNT(*) FROM %s WHERE parent_document_id IN (:parent_document_id) AND account_id = :account_id", TABLE_NAME);
|
||||||
private final String SELECT_FIRST_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type ORDER BY transaction_leg_datetime ASC LIMIT 1", TABLE_NAME);
|
private final String SELECT_FIRST_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type ORDER BY transaction_leg_datetime ASC LIMIT 1", TABLE_NAME);
|
||||||
private final String SELECT_GROUP_By_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type GROUP BY account_id", TABLE_NAME);
|
private final String SELECT_GROUP_By_TRANSACTION_PARENT_TYPE_PARENT_ID = String.format("SELECT * FROM %s WHERE parent_document_id IN (:parent_document_id) AND parent_document_type = :parent_document_type GROUP BY account_id", TABLE_NAME);
|
||||||
|
private final String SELECT_TRANSACTIONS_REMAINING = String.format("SELECT parent_document_id as parentIds FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'IN' AND parent_document_id NOT IN (SELECT parent_document_id FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'OUT')", TABLE_NAME, TABLE_NAME);
|
||||||
|
private final String SELECT_IN_PARENT_ID_BY_TYPE_GROUP = String.format("SELECT parent_document_id as parentIds FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'IN' GROUP BY parent_document_id", TABLE_NAME);
|
||||||
|
private final String SELECT_OUT_PARENT_ID_BY_TYPE_GROUP = String.format("SELECT parent_document_id as parentIds FROM %s WHERE account_id = :account_id AND parent_document_type = :parent_document_type AND type = 'OUT' GROUP BY parent_document_id", TABLE_NAME);
|
||||||
private final String SELECT_JOB_CARD_DATES = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type ", TABLE_NAME);
|
private final String SELECT_JOB_CARD_DATES = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type ", TABLE_NAME);
|
||||||
private final String SELECT_JOB_CARD_And_Date_Type_Account_Id = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type AND account_id IN (:account_ids)", TABLE_NAME);
|
private final String SELECT_JOB_CARD_And_Date_Type_Account_Id = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR transaction_leg_datetime BETWEEN :start_date AND :end_date) AND type = :type AND account_id IN (:account_ids)", TABLE_NAME);
|
||||||
|
|
||||||
|
@ -202,10 +205,6 @@ public class InventoryTransactionLegDAO {
|
||||||
params.addValue("start_date", startDate );
|
params.addValue("start_date", startDate );
|
||||||
params.addValue("end_date", endDate );
|
params.addValue("end_date", endDate );
|
||||||
params.addValue("type", type );
|
params.addValue("type", type );
|
||||||
System.out.println("Start Date: " + startDate);
|
|
||||||
System.out.println("End Date: " + endDate);
|
|
||||||
|
|
||||||
System.out.println("Params: " + params.getValues());
|
|
||||||
return namedParameterJdbcTemplate.query( SELECT_JOB_CARD_DATES , params, new InventoryTransactionLegRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_JOB_CARD_DATES , params, new InventoryTransactionLegRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,4 +217,24 @@ public class InventoryTransactionLegDAO {
|
||||||
params.addValue("account_ids", accountId );
|
params.addValue("account_ids", accountId );
|
||||||
return namedParameterJdbcTemplate.query( SELECT_JOB_CARD_And_Date_Type_Account_Id , params, new InventoryTransactionLegRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_JOB_CARD_And_Date_Type_Account_Id , params, new InventoryTransactionLegRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Long> findRemainingByParentTypeAndAccountID(String parentType, Integer accountId){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("account_id", accountId );
|
||||||
|
params.addValue("parent_document_type", parentType );
|
||||||
|
return namedParameterJdbcTemplate.queryForList( SELECT_TRANSACTIONS_REMAINING , params, Long.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Long> getInParentIdByDate(String parentType, Integer accountId){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("account_id", accountId );
|
||||||
|
params.addValue("parent_document_type", parentType );
|
||||||
|
return namedParameterJdbcTemplate.queryForList( SELECT_IN_PARENT_ID_BY_TYPE_GROUP , params, Long.class );
|
||||||
|
}
|
||||||
|
public List<Long> getOutParentIdByDate(String parentType, Integer accountId){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("account_id", accountId );
|
||||||
|
params.addValue("parent_document_type", parentType );
|
||||||
|
return namedParameterJdbcTemplate.queryForList( SELECT_OUT_PARENT_ID_BY_TYPE_GROUP , params, Long.class );
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -21,11 +21,12 @@ public class JobCardDAO {
|
||||||
private final String TABLE_NAME = "cut_to_pack.job_card";
|
private final String TABLE_NAME = "cut_to_pack.job_card";
|
||||||
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
private final String SELECT_ALL_QUERY_WITH_LIMIT = String.format( "SELECT * FROM %s ORDER BY id DESC limit :limit", TABLE_NAME );
|
private final String SELECT_ALL_BY_PO_ID = String.format( "SELECT * FROM %s WHERE purchase_order_id = :purchase_order_id", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, code, job_order_id, created_at, created_by, status, inventory_status, customer, lot_number, purchase_order_id, location_site_id, description, poQuantity, articleName) VALUES (:id, :code, :job_order_id, :created_at, :created_by, :status, :inventory_status, :customer, :lot_number, :purchase_order_id, :location_site_id, :description, :poQuantity, :articleName) 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), poQuantity = VALUES(poQuantity), articleName = VALUES(articleName) ", 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, poQuantity, articleName) VALUES (:id, :code, :job_order_id, :created_at, :created_by, :status, :inventory_status, :customer, :lot_number, :purchase_order_id, :location_site_id, :description, :poQuantity, :articleName) 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), poQuantity = VALUES(poQuantity), articleName = VALUES(articleName) ", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIKE_CODE_AND_INV_STATUS_AND_STATUS = String.format( "SELECT * FROM %s WHERE code like :code AND status = :status AND inventory_status = :inventory_status", TABLE_NAME );
|
private final String SELECT_BY_LIKE_CODE_AND_INV_STATUS_AND_STATUS = String.format( "SELECT * FROM %s WHERE code like :code AND status = :status AND inventory_status = :inventory_status", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIKE_CODE = String.format( "SELECT * FROM %s WHERE code like :code", TABLE_NAME );
|
private final String SELECT_BY_LIKE_CODE = String.format( "SELECT * FROM %s WHERE code like :code", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_LIKE_CODE_AND_PO_ID = String.format( "SELECT * FROM %s WHERE code like :code AND purchase_order_id = :purchase_order_id", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
|
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
|
||||||
|
|
||||||
// prepare query params
|
// prepare query params
|
||||||
|
@ -95,6 +96,13 @@ public class JobCardDAO {
|
||||||
return namedParameterJdbcTemplate.query(SELECT_BY_LIKE_CODE, params, new JobCardRowMapper());
|
return namedParameterJdbcTemplate.query(SELECT_BY_LIKE_CODE, params, new JobCardRowMapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<JobCard> findLikeCodeAndPoID( String code, long poID ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("code", "%" + code + "%");
|
||||||
|
params.addValue("purchase_order_id", poID);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_LIKE_CODE_AND_PO_ID, params, new JobCardRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
public List<JobCard> findLikeCode( String code , String inventoryStatus, String status ){
|
public List<JobCard> findLikeCode( String code , String inventoryStatus, String status ){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue( "code", "%" + code + "%" );
|
params.addValue( "code", "%" + code + "%" );
|
||||||
|
@ -114,9 +122,9 @@ public class JobCardDAO {
|
||||||
return namedParameterJdbcTemplate.query( query, new JobCardRowMapper() );
|
return namedParameterJdbcTemplate.query( query, new JobCardRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<JobCard> findByAllWithLimit(Long limit){
|
public List<JobCard> findByPoId(long poId){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("limit", limit.intValue());
|
params.addValue("purchase_order_id", poId);
|
||||||
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY_WITH_LIMIT, params, new JobCardRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_ALL_BY_PO_ID, params, new JobCardRowMapper() );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ import org.springframework.jdbc.support.KeyHolder;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@ -22,11 +23,16 @@ public class JobCardItemDAO {
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String SELECT_BY_CARD_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id", TABLE_NAME );
|
private final String SELECT_BY_CARD_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id", TABLE_NAME );
|
||||||
private final String SELECT_BY_CARD_ID_AND_ITEM_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id AND item_id = :item_id ", TABLE_NAME );
|
private final String SELECT_BY_CARD_ID_AND_ITEM_ID = String.format( "SELECT * FROM %s WHERE job_card_id = :card_id AND item_id = :item_id ", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_id, item_id, sku, expected_production, actual_production, total_production, account_id, length, width, gsm, wt_ply, ply, is_complete) VALUES (:id, :job_card_id, :item_id, :sku, :expected_production, :actual_production, :total_production, :account_id, :length, :width, :gsm, :wt_ply, :ply, :is_complete) ON DUPLICATE KEY UPDATE job_card_id = VALUES(job_card_id), item_id = VALUES(item_id), sku = VALUES(sku), expected_production = VALUES(expected_production), actual_production = VALUES(actual_production), total_production = VALUES(total_production), account_id = VALUES(account_id), length = VALUES(length), width = VALUES(width), gsm = VALUES(gsm), wt_ply = VALUES(wt_ply), ply = VALUES(ply), is_complete =VALUES(is_complete) ", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_id, item_id, sku, expected_production, actual_production, total_production, account_id, length, width, gsm, wt_ply, ply, is_complete, size, color) VALUES (:id, :job_card_id, :item_id, :sku, :expected_production, :actual_production, :total_production, :account_id, :length, :width, :gsm, :wt_ply, :ply, :is_complete, :size, :color) ON DUPLICATE KEY UPDATE job_card_id = VALUES(job_card_id), item_id = VALUES(item_id), sku = VALUES(sku), expected_production = VALUES(expected_production), actual_production = VALUES(actual_production), total_production = VALUES(total_production), account_id = VALUES(account_id), length = VALUES(length), width = VALUES(width), gsm = VALUES(gsm), wt_ply = VALUES(wt_ply), ply = VALUES(ply), is_complete = VALUES(is_complete), size =VALUES(size), color =VALUES(color) ", 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_JOB_CARD_AND_ACCOUNT_IDS = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND account_id IN (:account_ids) AND is_complete = FALSE ", TABLE_NAME );
|
private final String SELECT_BY_JOB_CARD_AND_ACCOUNT_IDS = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND account_id IN (:account_ids) AND is_complete = FALSE ", TABLE_NAME );
|
||||||
private final String SELECT_ALL_ACTIVE_ITEM = String.format("SELECT CASE WHEN MIN(is_complete) = TRUE THEN TRUE ELSE FALSE END FROM %s WHERE job_card_id = :job_card_id AND id IN (:id)", TABLE_NAME);
|
private final String SELECT_ALL_ACTIVE_ITEM = String.format("SELECT CASE WHEN MIN(is_complete) = TRUE THEN TRUE ELSE FALSE END FROM %s WHERE job_card_id = :job_card_id AND id IN (:id)", TABLE_NAME);
|
||||||
private final String SELECT_BY_JOB_CARD_IDS = String.format( "SELECT * FROM %s WHERE job_card_id IN (:job_card_id)", TABLE_NAME );
|
private final String SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE = String.format(
|
||||||
|
"SELECT * FROM %s WHERE job_card_id IN (:job_card_id) ",
|
||||||
|
TABLE_NAME
|
||||||
|
);
|
||||||
|
private final String SELECT_ALL_SIZE_GROUP_BY = String.format( "SELECT size FROM %s GROUP BY size", TABLE_NAME );
|
||||||
|
private final String SELECT_ALL_COLOR_GROUP_BY = String.format( "SELECT color FROM %s GROUP BY color", TABLE_NAME );
|
||||||
|
|
||||||
public JobCardItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public JobCardItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
@ -48,6 +54,8 @@ public class JobCardItemDAO {
|
||||||
.addValue("gsm", jobCardItem.getGsm() )
|
.addValue("gsm", jobCardItem.getGsm() )
|
||||||
.addValue("wt_ply", jobCardItem.getWtPly() )
|
.addValue("wt_ply", jobCardItem.getWtPly() )
|
||||||
.addValue("ply", jobCardItem.getPly() )
|
.addValue("ply", jobCardItem.getPly() )
|
||||||
|
.addValue("size", jobCardItem.getSize() )
|
||||||
|
.addValue("color", jobCardItem.getColor() )
|
||||||
.addValue("is_complete", jobCardItem.isComplete() );
|
.addValue("is_complete", jobCardItem.isComplete() );
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
|
@ -131,9 +139,29 @@ public class JobCardItemDAO {
|
||||||
return Boolean.TRUE.equals(allComplete);
|
return Boolean.TRUE.equals(allComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<JobCardItem> findByJobCardIds(List<Long> ids){
|
//find By jobCard ids, color and size
|
||||||
|
public List<JobCardItem> findByJobCardIdsAndSizeColor(List<Long> ids, String size, String color){
|
||||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
params.addValue("job_card_id", ids);
|
params.addValue("job_card_id", ids);
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_JOB_CARD_IDS, params, new JobCardItemRowMapper() );
|
StringBuilder sql = new StringBuilder(SELECT_BY_JOB_CARD_IDS_AND_COLOR_SIZE);
|
||||||
|
if (color != null && !color.isEmpty() && !"null".equalsIgnoreCase(color)) {
|
||||||
|
sql.append(" AND color = :color");
|
||||||
|
params.addValue("color", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size != null && !size.isEmpty() && !"null".equalsIgnoreCase(size)) {
|
||||||
|
sql.append(" AND size = :size");
|
||||||
|
params.addValue("size", size);
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.query( sql.toString(), params, new JobCardItemRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllSize() {
|
||||||
|
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_SIZE_GROUP_BY, new HashMap<>(), String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllColor() {
|
||||||
|
return namedParameterJdbcTemplate.queryForList(SELECT_ALL_COLOR_GROUP_BY, new HashMap<>(), String.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -22,6 +22,8 @@ public class JobCardItemRowMapper implements RowMapper<JobCardItem> {
|
||||||
jobCardItem.setGsm( rs.getString("gsm" ) );
|
jobCardItem.setGsm( rs.getString("gsm" ) );
|
||||||
jobCardItem.setWtPly( rs.getString("wt_ply" ) );
|
jobCardItem.setWtPly( rs.getString("wt_ply" ) );
|
||||||
jobCardItem.setPly( rs.getString("ply" ) );
|
jobCardItem.setPly( rs.getString("ply" ) );
|
||||||
|
jobCardItem.setColor( rs.getString("color" ) );
|
||||||
|
jobCardItem.setSize( rs.getString("size" ) );
|
||||||
jobCardItem.setComplete( rs.getBoolean("is_complete" ) );
|
jobCardItem.setComplete( rs.getBoolean("is_complete" ) );
|
||||||
return jobCardItem;
|
return jobCardItem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||||
|
import com.utopiaindustries.model.ctp.PackagingItems;
|
||||||
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
|
import org.springframework.jdbc.support.KeyHolder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class PackagingItemsDAO {
|
||||||
|
|
||||||
|
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
private static final String TABLE_NAME = "packaging_items";
|
||||||
|
|
||||||
|
private static final String SELECT_BY_ID = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_ALL = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
|
||||||
|
private static final String DELETE_BY_ID = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_BY_JOB_CARD_ID = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
|
||||||
|
|
||||||
|
private static final String INSERT_QUERY = String.format(
|
||||||
|
"INSERT INTO %s (" +
|
||||||
|
"id, item_id, sku, barcode, job_card_id, created_at, created_by, " +
|
||||||
|
"is_qa, finish_item_id, is_segregated, account_id, qa_status, bundle_id, account_title" +
|
||||||
|
") VALUES (" +
|
||||||
|
":id, :item_id, :sku, :barcode, :job_card_id, :created_at, :created_by, " +
|
||||||
|
":is_qa, :finish_item_id, :is_segregated, :account_id, :qa_status, :bundle_id, :account_title" +
|
||||||
|
") ON DUPLICATE KEY UPDATE " +
|
||||||
|
"item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), " +
|
||||||
|
"job_card_id = VALUES(job_card_id), created_at = VALUES(created_at), created_by = VALUES(created_by), " +
|
||||||
|
"is_qa = VALUES(is_qa), finish_item_id = VALUES(finish_item_id), " +
|
||||||
|
"is_segregated = VALUES(is_segregated), account_id = VALUES(account_id), " +
|
||||||
|
"qa_status = VALUES(qa_status), bundle_id = VALUES(bundle_id), account_title = VALUES(account_title)",
|
||||||
|
TABLE_NAME
|
||||||
|
);
|
||||||
|
private final String SELECT_BY_DATE_AND_IDs = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR created_at >=:start_date) AND created_at <= :end_date AND id IN (:ids)", TABLE_NAME );
|
||||||
|
|
||||||
|
public PackagingItemsDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MapSqlParameterSource prepareParams(PackagingItems item) {
|
||||||
|
return new MapSqlParameterSource()
|
||||||
|
.addValue("id", item.getId())
|
||||||
|
.addValue("item_id", item.getItemId())
|
||||||
|
.addValue("sku", item.getSku())
|
||||||
|
.addValue("barcode", item.getBarcode())
|
||||||
|
.addValue("job_card_id", item.getJobCardId())
|
||||||
|
.addValue("created_at", item.getCreatedAt())
|
||||||
|
.addValue("created_by", item.getCreatedBy())
|
||||||
|
.addValue("is_qa", item.getIsQa())
|
||||||
|
.addValue("finish_item_id", item.getFinishedItemId())
|
||||||
|
.addValue("is_segregated", item.getIsSegregated())
|
||||||
|
.addValue("account_id", item.getAccountId())
|
||||||
|
.addValue("qa_status", item.getQaStatus())
|
||||||
|
.addValue("bundle_id", item.getBundleId())
|
||||||
|
.addValue("account_title", item.getAccountTitle());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PackagingItems find(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_ID, params, new PackagingItemsRowMapper())
|
||||||
|
.stream().findFirst().orElse(new PackagingItems());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PackagingItems> findAll() {
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_ALL, new PackagingItemsRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long save(PackagingItems item) {
|
||||||
|
KeyHolder keyHolder = new GeneratedKeyHolder();
|
||||||
|
MapSqlParameterSource params = prepareParams(item);
|
||||||
|
namedParameterJdbcTemplate.update(INSERT_QUERY, params, keyHolder);
|
||||||
|
return KeyHolderFunctions.getKey(item.getId(), keyHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] saveAll(List<PackagingItems> items) {
|
||||||
|
List<MapSqlParameterSource> batchParams = new ArrayList<>();
|
||||||
|
for (PackagingItems item : items) {
|
||||||
|
batchParams.add(prepareParams(item));
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate(INSERT_QUERY, batchParams.toArray(new MapSqlParameterSource[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean delete(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.update(DELETE_BY_ID, params) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PackagingItems> findByJobCardId(long jobCardId) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("job_card_id", jobCardId);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_ID, params, new PackagingItemsRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long findByDateAndIds(String startDate, String endDate,List<Long> ids){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "start_date", startDate );
|
||||||
|
params.addValue( "end_date", endDate );
|
||||||
|
params.addValue( "ids", ids );
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_AND_IDs, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PackagingItems;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class PackagingItemsRowMapper implements RowMapper<PackagingItems> {
|
||||||
|
@Override
|
||||||
|
public PackagingItems mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
|
PackagingItems item = new PackagingItems();
|
||||||
|
item.setId(rs.getLong("id"));
|
||||||
|
item.setItemId(rs.getLong("item_id"));
|
||||||
|
item.setSku(rs.getString("sku"));
|
||||||
|
item.setBarcode(rs.getString("barcode"));
|
||||||
|
item.setJobCardId(rs.getLong("job_card_id"));
|
||||||
|
item.setCreatedAt(rs.getTimestamp("created_at") != null ? rs.getTimestamp("created_at").toLocalDateTime() : null);
|
||||||
|
item.setCreatedBy(rs.getString("created_by"));
|
||||||
|
item.setIsQa(rs.getBoolean("is_qa"));
|
||||||
|
item.setFinishedItemId(rs.getLong("finish_item_id"));
|
||||||
|
item.setIsSegregated(rs.getBoolean("is_segregated"));
|
||||||
|
item.setAccountId(rs.getLong("account_id"));
|
||||||
|
item.setQaStatus(rs.getString("qa_status"));
|
||||||
|
item.setBundleId(rs.getLong("bundle_id"));
|
||||||
|
item.setAccountTitle(rs.getString("account_title"));
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,139 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.uind.PurchaseOrderRowMapper;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCard;
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
|
import com.utopiaindustries.model.uind.PurchaseOrder;
|
||||||
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
|
import org.springframework.jdbc.support.KeyHolder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class PurchaseOrderCTPDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
private final String TABLE_NAME = "cut_to_pack.purchase_order";
|
||||||
|
private final String SELECT_QUERY = String.format( "SELECT * FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY created_at DESC LIMIT :limit ", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_PO_CODE = String.format("SELECT * FROM %s WHERE purchase_order_code = :purchase_order_code ORDER BY created_at DESC LIMIT :limit", TABLE_NAME);
|
||||||
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
|
private final String INSERT_QUERY = String.format(
|
||||||
|
"INSERT INTO %s (id, purchase_order_code, purchase_order_quantity, purchase_order_quantity_required, article_name, created_by, status, po_status) " +
|
||||||
|
"VALUES (:id, :purchase_order_code, :purchase_order_quantity, :purchase_order_quantity_required, :article_name, :created_by, :status, :po_status) " +
|
||||||
|
"ON DUPLICATE KEY UPDATE " +
|
||||||
|
"purchase_order_code = VALUES(purchase_order_code), " +
|
||||||
|
"purchase_order_quantity = VALUES(purchase_order_quantity), " +
|
||||||
|
"purchase_order_quantity_required = VALUES(purchase_order_quantity_required), " +
|
||||||
|
"article_name = VALUES(article_name), " +
|
||||||
|
"created_by = VALUES(created_by), " +
|
||||||
|
"status = VALUES(status)," +
|
||||||
|
"po_status = VALUES(po_status)",
|
||||||
|
TABLE_NAME);
|
||||||
|
|
||||||
|
private final String SELECT_BY_LIMIT = String.format( "SELECT * FROM %s WHERE created_by = :created_by ORDER BY id ASC limit :limit", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE purchase_order_code LIKE :term AND po_status = false limit 100 offset 0", TABLE_NAME );
|
||||||
|
|
||||||
|
|
||||||
|
// prepare query params
|
||||||
|
private MapSqlParameterSource prepareInsertQueryParams(PurchaseOrderCTP purchaseOrderCTP) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("id", purchaseOrderCTP.getId())
|
||||||
|
.addValue("purchase_order_code", purchaseOrderCTP.getPurchaseOrderCode())
|
||||||
|
.addValue("purchase_order_quantity", purchaseOrderCTP.getPurchaseOrderQuantity())
|
||||||
|
.addValue("purchase_order_quantity_required", purchaseOrderCTP.getPurchaseOrderQuantityRequired())
|
||||||
|
.addValue("article_name", purchaseOrderCTP.getArticleName())
|
||||||
|
.addValue("created_by", purchaseOrderCTP.getCreatedBy())
|
||||||
|
.addValue("status", purchaseOrderCTP.getStatus())
|
||||||
|
.addValue("po_status", purchaseOrderCTP.getPoStatus());
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// find
|
||||||
|
public PurchaseOrderCTP find(long id ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "id", id );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_QUERY, params, new PurchaseOrderCTPRowMapper() )
|
||||||
|
.stream()
|
||||||
|
.findFirst()
|
||||||
|
.orElse( new PurchaseOrderCTP() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// find all
|
||||||
|
public List<PurchaseOrderCTP> findAll(Long limit) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("limit", limit);
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_ALL_QUERY, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// save
|
||||||
|
public long save( PurchaseOrderCTP PurchaseOrderCTP) {
|
||||||
|
KeyHolder keyHolder = new GeneratedKeyHolder();
|
||||||
|
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
|
||||||
|
namedParameterJdbcTemplate.update( INSERT_QUERY, params, keyHolder );
|
||||||
|
return KeyHolderFunctions.getKey( PurchaseOrderCTP.getId(), keyHolder );
|
||||||
|
}
|
||||||
|
|
||||||
|
// save all
|
||||||
|
public int[] saveAll( List<PurchaseOrderCTP> purchaseOrderCTPS) {
|
||||||
|
List<MapSqlParameterSource> batchArgs = new ArrayList<>();
|
||||||
|
for ( PurchaseOrderCTP PurchaseOrderCTP : purchaseOrderCTPS) {
|
||||||
|
MapSqlParameterSource params = prepareInsertQueryParams(PurchaseOrderCTP);
|
||||||
|
batchArgs.add( params );
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate( INSERT_QUERY, batchArgs.toArray(new MapSqlParameterSource[purchaseOrderCTPS.size()]) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete
|
||||||
|
public boolean delete( long id ) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "id", id );
|
||||||
|
return namedParameterJdbcTemplate.update( DELETE_QUERY, params ) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* find by query
|
||||||
|
* */
|
||||||
|
public List<PurchaseOrderCTP> findByQuery(String query ){
|
||||||
|
return namedParameterJdbcTemplate.query( query, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* find by created by
|
||||||
|
* */
|
||||||
|
public List<PurchaseOrderCTP> findByUserAndLimit(String createdBy, Long limit ){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("limit", limit.intValue() );
|
||||||
|
params.addValue("created_by", createdBy );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_BY_LIMIT, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* find by po code
|
||||||
|
* */
|
||||||
|
public List<PurchaseOrderCTP> findByPoCode(String poCode, Long limit ){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("purchase_order_code", poCode);
|
||||||
|
params.addValue("limit", limit);
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_BY_PO_CODE, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* find by term
|
||||||
|
* */
|
||||||
|
public List<PurchaseOrderCTP> findByTerm(String term ){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("term", "%" + term + "%" );
|
||||||
|
return namedParameterJdbcTemplate.query( SELECT_BY_TERM, params, new PurchaseOrderCTPRowMapper() );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPRowMapper implements RowMapper<PurchaseOrderCTP> {
|
||||||
|
public PurchaseOrderCTP mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
|
PurchaseOrderCTP PurchaseOrderCTP = new PurchaseOrderCTP();
|
||||||
|
PurchaseOrderCTP.setId(rs.getLong("id"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderCode(rs.getString("purchase_order_code"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderQuantity(rs.getInt("purchase_order_quantity"));
|
||||||
|
PurchaseOrderCTP.setPurchaseOrderQuantityRequired(rs.getInt("purchase_order_quantity_required"));
|
||||||
|
PurchaseOrderCTP.setArticleName(rs.getString("article_name"));
|
||||||
|
if (rs.getTimestamp("created_at") != null) {
|
||||||
|
PurchaseOrderCTP.setCreatedAt(rs.getTimestamp("created_at").toLocalDateTime());
|
||||||
|
}
|
||||||
|
PurchaseOrderCTP.setCreatedBy(rs.getString("created_by"));
|
||||||
|
PurchaseOrderCTP.setStatus(rs.getString("status"));
|
||||||
|
PurchaseOrderCTP.setPoStatus(rs.getBoolean("po_status"));
|
||||||
|
return PurchaseOrderCTP;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.utopiaindustries.dao.ctp;
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItem;
|
||||||
import com.utopiaindustries.model.ctp.InventoryTransactionLeg;
|
import com.utopiaindustries.model.ctp.InventoryTransactionLeg;
|
||||||
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
import com.utopiaindustries.model.ctp.StitchingOfflineItem;
|
||||||
import com.utopiaindustries.util.KeyHolderFunctions;
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
@ -23,7 +24,7 @@ public class StitchingOfflineItemDAO {
|
||||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
private final String SELECT_QUERY_BY_JOB_CARD = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, item_id, sku, barcode, created_at, created_by, job_card_id, is_qa, qa_remarks, qa_status,bundle_id) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status, :bundle_id) 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), bundle_id = VALUES(bundle_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,bundle_id, qc_done_at) VALUES (:id, :item_id, :sku, :barcode, :created_at, :created_by, :job_card_id, :is_qa, :qa_remarks, :qa_status, :bundle_id, :qc_done_at) 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), bundle_id = VALUES(bundle_id), qc_done_at = VALUES(qc_done_at)", TABLE_NAME );
|
||||||
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
private final String SELECT_BY_LIMIT = String.format("SELECT * FROM %s ORDER BY id DESC LIMIT :limit", TABLE_NAME );
|
||||||
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME );
|
private final String FIND_TOTAL_COUNT = String.format("SELECT COUNT(*) FROM %s where job_card_id = :job_card_id And item_id = :item_id", TABLE_NAME );
|
||||||
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
private final String SELECT_BY_IDS = String.format( "SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME );
|
||||||
|
@ -32,6 +33,8 @@ public class StitchingOfflineItemDAO {
|
||||||
private final String COUNT_TOTAL_QA_ITEMS= String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_qa IS TRUE",TABLE_NAME);
|
private final String COUNT_TOTAL_QA_ITEMS= String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id AND is_qa IS TRUE",TABLE_NAME);
|
||||||
private final String SELECT_BY_TIME_AND_CARD_ID= String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id ORDER BY created_at DESC LIMIT 1;",TABLE_NAME);
|
private final String SELECT_BY_TIME_AND_CARD_ID= String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id ORDER BY created_at DESC LIMIT 1;",TABLE_NAME);
|
||||||
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME );
|
private final String SELECT_BY_JOB_CARD_AND_DATE = String.format( "SELECT * FROM %s WHERE job_card_id = :job_card_id AND (:start_date IS NULL OR :end_date IS NULL OR created_at BETWEEN :start_date AND :end_date)", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_DATE_QA_STATUS = String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND qc_done_at <= :end_date AND qa_status = :qa_status AND id IN (:ids)", TABLE_NAME );
|
||||||
|
private final String SELECT_BY_DATE_QA_STATUS_APPROVED= String.format( "SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR qc_done_at >= :start_date) AND qc_done_at <= :end_date AND qa_status = :qa_status", TABLE_NAME );
|
||||||
|
|
||||||
public StitchingOfflineItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public StitchingOfflineItemDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
@ -50,6 +53,7 @@ public class StitchingOfflineItemDAO {
|
||||||
.addValue("job_card_id", stitchingOfflineItem.getJobCardId() )
|
.addValue("job_card_id", stitchingOfflineItem.getJobCardId() )
|
||||||
.addValue("is_qa", stitchingOfflineItem.getIsQa() )
|
.addValue("is_qa", stitchingOfflineItem.getIsQa() )
|
||||||
.addValue("qa_remarks", stitchingOfflineItem.getQaRemarks() )
|
.addValue("qa_remarks", stitchingOfflineItem.getQaRemarks() )
|
||||||
|
.addValue("qc_done_at", stitchingOfflineItem.getQcDoneAt() )
|
||||||
.addValue("qa_status", stitchingOfflineItem.getQaStatus() );
|
.addValue("qa_status", stitchingOfflineItem.getQaStatus() );
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
@ -169,4 +173,22 @@ public class StitchingOfflineItemDAO {
|
||||||
params.addValue( "end_date", endDate );
|
params.addValue( "end_date", endDate );
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_JOB_CARD_AND_DATE , params, new StitchingOfflineItemRowMapper() );
|
return namedParameterJdbcTemplate.query( SELECT_BY_JOB_CARD_AND_DATE , params, new StitchingOfflineItemRowMapper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long findByQCOperationDateAndIds(String startDate, String endDate, String qaStatus, List<Long> ids){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "start_date", startDate );
|
||||||
|
params.addValue( "end_date", endDate );
|
||||||
|
params.addValue( "qa_status", qaStatus );
|
||||||
|
params.addValue( "ids", ids);
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_QA_STATUS, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
|
public Long findByQCOperationDateAndApproved(String startDate, String endDate, String qaStatus){
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue( "start_date", startDate );
|
||||||
|
params.addValue( "end_date", endDate );
|
||||||
|
params.addValue( "qa_status", qaStatus );
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_QA_STATUS_APPROVED, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ public class StitchingOfflineItemRowMapper implements RowMapper<StitchingOffline
|
||||||
if ( rs.getTimestamp( "created_at" ) != null ) {
|
if ( rs.getTimestamp( "created_at" ) != null ) {
|
||||||
stitchingOfflineItem.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
stitchingOfflineItem.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
||||||
}
|
}
|
||||||
|
if ( rs.getTimestamp( "qc_done_at" ) != null ) {
|
||||||
|
stitchingOfflineItem.setQcDoneAt( rs.getTimestamp( "qc_done_at" ).toLocalDateTime() );
|
||||||
|
}
|
||||||
stitchingOfflineItem.setCreatedBy( rs.getString( "created_by" ) );
|
stitchingOfflineItem.setCreatedBy( rs.getString( "created_by" ) );
|
||||||
stitchingOfflineItem.setJobCardId( rs.getLong("job_card_id") );
|
stitchingOfflineItem.setJobCardId( rs.getLong("job_card_id") );
|
||||||
stitchingOfflineItem.setIsQa( rs.getBoolean("is_qa"));
|
stitchingOfflineItem.setIsQa( rs.getBoolean("is_qa"));
|
||||||
|
|
|
@ -0,0 +1,131 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.StoreItem;
|
||||||
|
import com.utopiaindustries.util.KeyHolderFunctions;
|
||||||
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
|
import org.springframework.jdbc.support.KeyHolder;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class StoreItemDao {
|
||||||
|
|
||||||
|
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
private static final String TABLE_NAME = "store_items";
|
||||||
|
|
||||||
|
private static final String SELECT_BY_ID = String.format("SELECT * FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_ALL = String.format("SELECT * FROM %s ORDER BY id DESC", TABLE_NAME);
|
||||||
|
private static final String DELETE_BY_ID = String.format("DELETE FROM %s WHERE id = :id", TABLE_NAME);
|
||||||
|
private static final String SELECT_BY_JOB_CARD_ID = String.format("SELECT * FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
|
||||||
|
private final String COUNT_TOTAL_FINISH_ITEM = String.format("SELECT COUNT(*) FROM %s WHERE job_card_id = :job_card_id", TABLE_NAME);
|
||||||
|
|
||||||
|
private static final String INSERT_QUERY = String.format(
|
||||||
|
"INSERT INTO %s (" +
|
||||||
|
"id, item_id, sku, barcode, job_card_id, created_at, created_by, " +
|
||||||
|
"finish_item_id, account_id, bundle_id, reject_reason" +
|
||||||
|
") VALUES (" +
|
||||||
|
":id, :item_id, :sku, :barcode, :job_card_id, :created_at, :created_by, " +
|
||||||
|
":finish_item_id, :account_id, :bundle_id, :reject_reason" +
|
||||||
|
") ON DUPLICATE KEY UPDATE " +
|
||||||
|
"item_id = VALUES(item_id), sku = VALUES(sku), barcode = VALUES(barcode), " +
|
||||||
|
"job_card_id = VALUES(job_card_id), created_at = VALUES(created_at), created_by = VALUES(created_by), " +
|
||||||
|
"finish_item_id = VALUES(finish_item_id), account_id = VALUES(account_id), bundle_id = VALUES(bundle_id), reject_reason = VALUES(reject_reason)",
|
||||||
|
TABLE_NAME
|
||||||
|
);
|
||||||
|
String SELECT_BY_JOB_CARD_GROUP_REJECT_REASON = String.format("SELECT reject_reason, COUNT(*) AS total FROM %s WHERE job_card_id IN (:job_card_id) GROUP BY reject_reason", TABLE_NAME);
|
||||||
|
|
||||||
|
private static final String SELECT_BY_DATE_AND_IDs = String.format("SELECT COUNT(*) FROM %s WHERE (:start_date IS NULL OR created_at >= :start_date) AND created_at <= :end_date AND id IN (:ids)", TABLE_NAME);
|
||||||
|
|
||||||
|
public StoreItemDao(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MapSqlParameterSource prepareParams(StoreItem item) {
|
||||||
|
return new MapSqlParameterSource()
|
||||||
|
.addValue("id", item.getId())
|
||||||
|
.addValue("item_id", item.getItemId())
|
||||||
|
.addValue("sku", item.getSku())
|
||||||
|
.addValue("barcode", item.getBarcode())
|
||||||
|
.addValue("job_card_id", item.getJobCardId())
|
||||||
|
.addValue("created_at", item.getCreatedAt())
|
||||||
|
.addValue("created_by", item.getCreatedBy())
|
||||||
|
.addValue("finish_item_id", item.getFinishedItemId())
|
||||||
|
.addValue("account_id", item.getAccountId())
|
||||||
|
.addValue("bundle_id", item.getBundleId())
|
||||||
|
.addValue("reject_reason", item.getRejectedReason());
|
||||||
|
}
|
||||||
|
|
||||||
|
public StoreItem find(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_ID, params, new StoreItemRowMapper())
|
||||||
|
.stream().findFirst().orElse(new StoreItem());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreItem> findAll() {
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_ALL, new StoreItemRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long save(StoreItem item) {
|
||||||
|
KeyHolder keyHolder = new GeneratedKeyHolder();
|
||||||
|
MapSqlParameterSource params = prepareParams(item);
|
||||||
|
namedParameterJdbcTemplate.update(INSERT_QUERY, params, keyHolder);
|
||||||
|
return KeyHolderFunctions.getKey(item.getId(), keyHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] saveAll(List<StoreItem> items) {
|
||||||
|
List<MapSqlParameterSource> batchParams = new ArrayList<>();
|
||||||
|
for (StoreItem item : items) {
|
||||||
|
batchParams.add(prepareParams(item));
|
||||||
|
}
|
||||||
|
return namedParameterJdbcTemplate.batchUpdate(INSERT_QUERY, batchParams.toArray(new MapSqlParameterSource[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean delete(long id) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("id", id);
|
||||||
|
return namedParameterJdbcTemplate.update(DELETE_BY_ID, params) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreItem> findByJobCardId(long jobCardId) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource("job_card_id", jobCardId);
|
||||||
|
return namedParameterJdbcTemplate.query(SELECT_BY_JOB_CARD_ID, params, new StoreItemRowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long calculateTotalRejectItemByJobCardId(long jobCardId) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("job_card_id", jobCardId);
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(COUNT_TOTAL_FINISH_ITEM, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long findByDateAndIds(String startDate, String endDate, List<Long> ids) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("start_date", startDate);
|
||||||
|
params.addValue("end_date", endDate);
|
||||||
|
params.addValue("ids", ids);
|
||||||
|
Long count = namedParameterJdbcTemplate.queryForObject(SELECT_BY_DATE_AND_IDs, params, Long.class);
|
||||||
|
return count != null ? count : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> totalCountByJobCardIdsAndGroupByRejectReason(List<Long> jobCardIds) {
|
||||||
|
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||||
|
params.addValue("job_card_id", jobCardIds);
|
||||||
|
|
||||||
|
List<Map<String, Object>> rows = namedParameterJdbcTemplate.queryForList(SELECT_BY_JOB_CARD_GROUP_REJECT_REASON, params);
|
||||||
|
|
||||||
|
Map<String, Integer> result = new HashMap<>();
|
||||||
|
for (Map<String, Object> row : rows) {
|
||||||
|
String reason = (String) row.get("reject_reason");
|
||||||
|
Integer total = ((Number) row.get("total")).intValue();
|
||||||
|
result.put(reason, total);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.utopiaindustries.dao.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PackagingItems;
|
||||||
|
import com.utopiaindustries.model.ctp.StoreItem;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class StoreItemRowMapper implements RowMapper<StoreItem> {
|
||||||
|
@Override
|
||||||
|
public StoreItem mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
|
StoreItem item = new StoreItem();
|
||||||
|
item.setId(rs.getLong("id"));
|
||||||
|
item.setItemId(rs.getLong("item_id"));
|
||||||
|
item.setSku(rs.getString("sku"));
|
||||||
|
item.setBarcode(rs.getString("barcode"));
|
||||||
|
item.setJobCardId(rs.getLong("job_card_id"));
|
||||||
|
item.setCreatedAt(rs.getTimestamp("created_at") != null ? rs.getTimestamp("created_at").toLocalDateTime() : null);
|
||||||
|
item.setCreatedBy(rs.getString("created_by"));
|
||||||
|
item.setFinishedItemId(rs.getLong("finish_item_id"));
|
||||||
|
item.setAccountId(rs.getLong("account_id"));
|
||||||
|
item.setBundleId(rs.getLong("bundle_id"));
|
||||||
|
item.setRejectedReason(rs.getString("reject_reason"));
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,5 +9,8 @@ public enum Roles {
|
||||||
ROLE_QUALITY_CONTROL,
|
ROLE_QUALITY_CONTROL,
|
||||||
ROLE_FINISHING,
|
ROLE_FINISHING,
|
||||||
ROLE_PACKAGING,
|
ROLE_PACKAGING,
|
||||||
ROLE_REPORTING
|
ROLE_REPORTING,
|
||||||
|
ROLE_PURCHASE_ORDER,
|
||||||
|
ROLE_INVENTORY_ACCOUNT,
|
||||||
|
ROLE_STORE
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ public enum BarcodeStickerSize {
|
||||||
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
|
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
|
||||||
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
|
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
|
||||||
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
|
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
|
||||||
SIZE_1_X_2( 67.69f, 128.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
|
SIZE_1_X_2( 67.69f, 139.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
|
||||||
|
|
||||||
private final float width;
|
private final float width;
|
||||||
private final float height;
|
private final float height;
|
||||||
|
|
|
@ -4,7 +4,7 @@ public class CuttingJobCardItemWrapper {
|
||||||
private long jobCardId;
|
private long jobCardId;
|
||||||
private String poName;
|
private String poName;
|
||||||
private String sku;
|
private String sku;
|
||||||
private Long totalCutting;
|
private Long total;
|
||||||
private String width;
|
private String width;
|
||||||
private String length;
|
private String length;
|
||||||
private String gsm;
|
private String gsm;
|
||||||
|
@ -13,8 +13,8 @@ public class CuttingJobCardItemWrapper {
|
||||||
private String articleName;
|
private String articleName;
|
||||||
private boolean isComplete;
|
private boolean isComplete;
|
||||||
private String jobCardCode;
|
private String jobCardCode;
|
||||||
private String cuttingOperatorName;
|
private String operatorName;
|
||||||
private long cuttingAccountId;
|
private long accountId;
|
||||||
|
|
||||||
public long getJobCardId() {
|
public long getJobCardId() {
|
||||||
return jobCardId;
|
return jobCardId;
|
||||||
|
@ -40,14 +40,6 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.sku = sku;
|
this.sku = sku;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getTotalCutting() {
|
|
||||||
return totalCutting;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalCutting(Long totalCutting) {
|
|
||||||
this.totalCutting = totalCutting;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWidth() {
|
public String getWidth() {
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
@ -104,13 +96,6 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.jobCardCode = jobCardCode;
|
this.jobCardCode = jobCardCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getCuttingAccountId() {
|
|
||||||
return cuttingAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCuttingAccountId(long cuttingAccountId) {
|
|
||||||
this.cuttingAccountId = cuttingAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLength() {
|
public String getLength() {
|
||||||
return length;
|
return length;
|
||||||
|
@ -120,31 +105,47 @@ public class CuttingJobCardItemWrapper {
|
||||||
this.length = length;
|
this.length = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingOperatorName() {
|
public String getOperatorName() {
|
||||||
return cuttingOperatorName;
|
return operatorName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingOperatorName(String cuttingOperatorName) {
|
public void setOperatorName(String operatorName) {
|
||||||
this.cuttingOperatorName = cuttingOperatorName;
|
this.operatorName = operatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(Long total) {
|
||||||
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CuttingJobCardItemWrapper{" +
|
return "CuttingJobCardItemWrapper{" +
|
||||||
"cuttingAccountId=" + cuttingAccountId +
|
"jobCardId=" + jobCardId +
|
||||||
", cuttingOperatorName='" + cuttingOperatorName + '\'' +
|
|
||||||
", jobCardCode='" + jobCardCode + '\'' +
|
|
||||||
", isComplete=" + isComplete +
|
|
||||||
", articleName='" + articleName + '\'' +
|
|
||||||
", ply='" + ply + '\'' +
|
|
||||||
", wtPly='" + wtPly + '\'' +
|
|
||||||
", gsm='" + gsm + '\'' +
|
|
||||||
", length='" + length + '\'' +
|
|
||||||
", width='" + width + '\'' +
|
|
||||||
", totalCutting=" + totalCutting +
|
|
||||||
", sku='" + sku + '\'' +
|
|
||||||
", poName='" + poName + '\'' +
|
", poName='" + poName + '\'' +
|
||||||
", jobCardId=" + jobCardId +
|
", sku='" + sku + '\'' +
|
||||||
|
", total=" + total +
|
||||||
|
", width='" + width + '\'' +
|
||||||
|
", length='" + length + '\'' +
|
||||||
|
", gsm='" + gsm + '\'' +
|
||||||
|
", wtPly='" + wtPly + '\'' +
|
||||||
|
", ply='" + ply + '\'' +
|
||||||
|
", articleName='" + articleName + '\'' +
|
||||||
|
", isComplete=" + isComplete +
|
||||||
|
", jobCardCode='" + jobCardCode + '\'' +
|
||||||
|
", operatorName='" + operatorName + '\'' +
|
||||||
|
", accountId=" + accountId +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,11 @@ public class FinishedItem implements InventoryArtifact {
|
||||||
private JobCard jobCard;
|
private JobCard jobCard;
|
||||||
private long accountId;
|
private long accountId;
|
||||||
private String qaStatus;
|
private String qaStatus;
|
||||||
|
private boolean isPackaging;
|
||||||
|
private boolean isStore;
|
||||||
|
|
||||||
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
|
private LocalDateTime operationDate;
|
||||||
|
|
||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -154,6 +158,30 @@ public class FinishedItem implements InventoryArtifact {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPackaging() {
|
||||||
|
return isPackaging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackaging(boolean packaging) {
|
||||||
|
isPackaging = packaging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getOperationDate() {
|
||||||
|
return operationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperationDate(LocalDateTime operationDate) {
|
||||||
|
this.operationDate = operationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStore() {
|
||||||
|
return isStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStore(boolean store) {
|
||||||
|
isStore = store;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FinishedItem{" +
|
return "FinishedItem{" +
|
||||||
|
|
|
@ -4,6 +4,10 @@ import java.util.List;
|
||||||
|
|
||||||
public class FinishedItemWrapper {
|
public class FinishedItemWrapper {
|
||||||
|
|
||||||
|
private String qaStatus;
|
||||||
|
private Long accountId;
|
||||||
|
private String rejectReason;
|
||||||
|
|
||||||
private List<FinishedItem> items;
|
private List<FinishedItem> items;
|
||||||
|
|
||||||
public List<FinishedItem> getItems() {
|
public List<FinishedItem> getItems() {
|
||||||
|
@ -14,6 +18,30 @@ public class FinishedItemWrapper {
|
||||||
this.items = items;
|
this.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getQaStatus() {
|
||||||
|
return qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQaStatus(String qaStatus) {
|
||||||
|
this.qaStatus = qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(Long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRejectReason() {
|
||||||
|
return rejectReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRejectReason(String rejectReason) {
|
||||||
|
this.rejectReason = rejectReason;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "FinishedItemWrapper{" +
|
return "FinishedItemWrapper{" +
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.utopiaindustries.model.ctp;
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
public class InventoryAccount {
|
public class InventoryAccount {
|
||||||
|
@ -14,6 +15,12 @@ public class InventoryAccount {
|
||||||
private Integer locationSiteId;
|
private Integer locationSiteId;
|
||||||
private String notes;
|
private String notes;
|
||||||
private Boolean isPackaging;
|
private Boolean isPackaging;
|
||||||
|
private String articleName;
|
||||||
|
private long shiftMinutes;
|
||||||
|
private long totalMachines;
|
||||||
|
private BigDecimal efficiency;
|
||||||
|
private BigDecimal sam;
|
||||||
|
|
||||||
//wrapper
|
//wrapper
|
||||||
private String locationTitle;
|
private String locationTitle;
|
||||||
|
|
||||||
|
@ -105,6 +112,45 @@ public class InventoryAccount {
|
||||||
this.locationTitle = locationTitle;
|
this.locationTitle = locationTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getArticleName() {
|
||||||
|
return articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleName(String articleName) {
|
||||||
|
this.articleName = articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getShiftMinutes() {
|
||||||
|
return shiftMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShiftMinutes(long shiftMinutes) {
|
||||||
|
this.shiftMinutes = shiftMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalMachines() {
|
||||||
|
return totalMachines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalMachines(long totalMachines) {
|
||||||
|
this.totalMachines = totalMachines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getEfficiency() {
|
||||||
|
return efficiency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEfficiency(BigDecimal efficiency) {
|
||||||
|
this.efficiency = efficiency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSam() {
|
||||||
|
return sam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSam(BigDecimal sam) {
|
||||||
|
this.sam = sam;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -119,6 +165,10 @@ public class InventoryAccount {
|
||||||
", locationSiteId=" + locationSiteId +
|
", locationSiteId=" + locationSiteId +
|
||||||
", notes='" + notes + '\'' +
|
", notes='" + notes + '\'' +
|
||||||
", isPackaging=" + isPackaging +
|
", isPackaging=" + isPackaging +
|
||||||
|
", articleName='" + articleName + '\'' +
|
||||||
|
", shiftMinutes=" + shiftMinutes +
|
||||||
|
", totalMachines=" + totalMachines +
|
||||||
|
", efficiency=" + efficiency +
|
||||||
", locationTitle='" + locationTitle + '\'' +
|
", locationTitle='" + locationTitle + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ public enum InventoryArtifactType {
|
||||||
BUNDLE,
|
BUNDLE,
|
||||||
STITCHING_OFFLINE,
|
STITCHING_OFFLINE,
|
||||||
FINISHED_ITEM,
|
FINISHED_ITEM,
|
||||||
STITCH_BUNDLE
|
STITCH_BUNDLE,
|
||||||
|
PACKAGING,
|
||||||
|
STORED_ITEM,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ public class JobCardItem {
|
||||||
private String gsm;
|
private String gsm;
|
||||||
private String wtPly;
|
private String wtPly;
|
||||||
private String ply;
|
private String ply;
|
||||||
|
private String color;
|
||||||
|
private String size;
|
||||||
// wrapper
|
// wrapper
|
||||||
private List<CutPiece> cutPieces;
|
private List<CutPiece> cutPieces;
|
||||||
private String title;
|
private String title;
|
||||||
|
@ -176,6 +178,22 @@ public class JobCardItem {
|
||||||
isComplete = complete;
|
isComplete = complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(String color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(String size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
|
|
|
@ -1,20 +1,33 @@
|
||||||
package com.utopiaindustries.model.ctp;
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
public class POsDetails {
|
public class POsDetails {
|
||||||
|
//po detail
|
||||||
|
private long poId;
|
||||||
private String poNumber;
|
private String poNumber;
|
||||||
private String articleTitle;
|
private String articleTitle;
|
||||||
private long poQuantity;
|
private long poQuantity;
|
||||||
private long totalCutting;
|
private long poRequiredQuantity;
|
||||||
private long remainingCutting;
|
|
||||||
private long totalStitching;
|
// items detail
|
||||||
private long remainingStitching;
|
private long actualCutting;
|
||||||
private long totalEndLineQC;
|
private long balanceToCutting;
|
||||||
private long remainingEndLineQC;
|
private long cuttingReceived;
|
||||||
private long totalFinishing;
|
private long cuttingOki;
|
||||||
private long remainingFinishing;
|
private long cuttingReject;
|
||||||
private long totalAGradeItem;
|
private long stitchingIn;
|
||||||
private long totalBGradeItem;
|
private long stitchingWips;
|
||||||
private long totalCGradeItem;
|
private long stitchingOut;
|
||||||
|
private long finishIn;
|
||||||
|
private long finishRej;
|
||||||
|
private long finishQaApproved;
|
||||||
|
private long storeReceived;
|
||||||
|
private long storeWaiting;
|
||||||
|
private long packagingIn;
|
||||||
|
private long packagingOut;
|
||||||
|
private long packagingStock;
|
||||||
|
private long shippedScan;
|
||||||
|
private long shippedNet;
|
||||||
|
private boolean poStatus;
|
||||||
|
|
||||||
public long getPoQuantity() {
|
public long getPoQuantity() {
|
||||||
return poQuantity;
|
return poQuantity;
|
||||||
|
@ -40,108 +53,200 @@ public class POsDetails {
|
||||||
this.articleTitle = articleTitle;
|
this.articleTitle = articleTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalCutting() {
|
public long getPoId() {
|
||||||
return totalCutting;
|
return poId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalCutting(long totalCutting) {
|
public void setPoId(long poId) {
|
||||||
this.totalCutting = totalCutting;
|
this.poId = poId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRemainingCutting() {
|
public long getPoRequiredQuantity() {
|
||||||
return remainingCutting;
|
return poRequiredQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemainingCutting(long remainingCutting) {
|
public void setPoRequiredQuantity(long poRequiredQuantity) {
|
||||||
this.remainingCutting = remainingCutting;
|
this.poRequiredQuantity = poRequiredQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalStitching() {
|
public long getActualCutting() {
|
||||||
return totalStitching;
|
return actualCutting;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalStitching(long totalStitching) {
|
public void setActualCutting(long actualCutting) {
|
||||||
this.totalStitching = totalStitching;
|
this.actualCutting = actualCutting;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRemainingStitching() {
|
public long getBalanceToCutting() {
|
||||||
return remainingStitching;
|
return balanceToCutting;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemainingStitching(long remainingStitching) {
|
public void setBalanceToCutting(long balanceToCutting) {
|
||||||
this.remainingStitching = remainingStitching;
|
this.balanceToCutting = balanceToCutting;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalEndLineQC() {
|
public long getCuttingReceived() {
|
||||||
return totalEndLineQC;
|
return cuttingReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalEndLineQC(long totalEndLineQC) {
|
public void setCuttingReceived(long cuttingReceived) {
|
||||||
this.totalEndLineQC = totalEndLineQC;
|
this.cuttingReceived = cuttingReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRemainingEndLineQC() {
|
public long getCuttingOki() {
|
||||||
return remainingEndLineQC;
|
return cuttingOki;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemainingEndLineQC(long remainingEndLineQC) {
|
public void setCuttingOki(long cuttingOki) {
|
||||||
this.remainingEndLineQC = remainingEndLineQC;
|
this.cuttingOki = cuttingOki;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalFinishing() {
|
public long getCuttingReject() {
|
||||||
return totalFinishing;
|
return cuttingReject;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalFinishing(long totalFinishing) {
|
public void setCuttingReject(long cuttingReject) {
|
||||||
this.totalFinishing = totalFinishing;
|
this.cuttingReject = cuttingReject;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRemainingFinishing() {
|
public long getStitchingIn() {
|
||||||
return remainingFinishing;
|
return stitchingIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemainingFinishing(long remainingFinishing) {
|
public void setStitchingIn(long stitchingIn) {
|
||||||
this.remainingFinishing = remainingFinishing;
|
this.stitchingIn = stitchingIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalAGradeItem() {
|
public long getStitchingWips() {
|
||||||
return totalAGradeItem;
|
return stitchingWips;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalAGradeItem(long totalAGradeItem) {
|
public void setStitchingWips(long stitchingWips) {
|
||||||
this.totalAGradeItem = totalAGradeItem;
|
this.stitchingWips = stitchingWips;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalBGradeItem() {
|
public long getStitchingOut() {
|
||||||
return totalBGradeItem;
|
return stitchingOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalBGradeItem(long totalBGradeItem) {
|
public void setStitchingOut(long stitchingOut) {
|
||||||
this.totalBGradeItem = totalBGradeItem;
|
this.stitchingOut = stitchingOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalCGradeItem() {
|
public long getFinishIn() {
|
||||||
return totalCGradeItem;
|
return finishIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotalCGradeItem(long totalCGradeItem) {
|
public void setFinishIn(long finishIn) {
|
||||||
this.totalCGradeItem = totalCGradeItem;
|
this.finishIn = finishIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFinishRej() {
|
||||||
|
return finishRej;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishRej(long finishRej) {
|
||||||
|
this.finishRej = finishRej;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFinishQaApproved() {
|
||||||
|
return finishQaApproved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishQaApproved(long finishQaApproved) {
|
||||||
|
this.finishQaApproved = finishQaApproved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStoreReceived() {
|
||||||
|
return storeReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreReceived(long storeReceived) {
|
||||||
|
this.storeReceived = storeReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStoreWaiting() {
|
||||||
|
return storeWaiting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStoreWaiting(long storeWaiting) {
|
||||||
|
this.storeWaiting = storeWaiting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPackagingIn() {
|
||||||
|
return packagingIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackagingIn(long packagingIn) {
|
||||||
|
this.packagingIn = packagingIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPackagingOut() {
|
||||||
|
return packagingOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackagingOut(long packagingOut) {
|
||||||
|
this.packagingOut = packagingOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPackagingStock() {
|
||||||
|
return packagingStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackagingStock(long packagingStock) {
|
||||||
|
this.packagingStock = packagingStock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getShippedScan() {
|
||||||
|
return shippedScan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShippedScan(long shippedScan) {
|
||||||
|
this.shippedScan = shippedScan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getShippedNet() {
|
||||||
|
return shippedNet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShippedNet(long shippedNet) {
|
||||||
|
this.shippedNet = shippedNet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPoStatus() {
|
||||||
|
return poStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPoStatus(boolean poStatus) {
|
||||||
|
this.poStatus = poStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "POsDetails{" +
|
return "POsDetails{" +
|
||||||
"totalCutting=" + totalCutting +
|
"poId=" + poId +
|
||||||
", remainingCutting=" + remainingCutting +
|
", poNumber='" + poNumber + '\'' +
|
||||||
", totalStitching=" + totalStitching +
|
", articleTitle='" + articleTitle + '\'' +
|
||||||
", remainingStitching=" + remainingStitching +
|
", poQuantity=" + poQuantity +
|
||||||
", totalEndLineQC=" + totalEndLineQC +
|
", poRequiredQuantity=" + poRequiredQuantity +
|
||||||
", remainingEndLineQC=" + remainingEndLineQC +
|
", actualCutting=" + actualCutting +
|
||||||
", totalFinishing=" + totalFinishing +
|
", balanceToCutting=" + balanceToCutting +
|
||||||
", remainingFinishing=" + remainingFinishing +
|
", cuttingReceived=" + cuttingReceived +
|
||||||
", totalAGradeItem=" + totalAGradeItem +
|
", cuttingOki=" + cuttingOki +
|
||||||
", totalBGradeItem=" + totalBGradeItem +
|
", cuttingReject=" + cuttingReject +
|
||||||
", totalCGradeItem=" + totalCGradeItem +
|
", stitchingIn=" + stitchingIn +
|
||||||
|
", stitchingWips=" + stitchingWips +
|
||||||
|
", stitchingOut=" + stitchingOut +
|
||||||
|
", finishIn=" + finishIn +
|
||||||
|
", finishRej=" + finishRej +
|
||||||
|
", finishQaApproved=" + finishQaApproved +
|
||||||
|
", storeReceived=" + storeReceived +
|
||||||
|
", storeWaiting=" + storeWaiting +
|
||||||
|
", packagingIn=" + packagingIn +
|
||||||
|
", packagingOut=" + packagingOut +
|
||||||
|
", packagingStock=" + packagingStock +
|
||||||
|
", shippedScan=" + shippedScan +
|
||||||
|
", shippedNet=" + shippedNet +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class PackagingItems implements InventoryArtifact {
|
||||||
|
private long id;
|
||||||
|
private long itemId;
|
||||||
|
private String sku;
|
||||||
|
private String barcode;
|
||||||
|
private long jobCardId;
|
||||||
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String createdBy;
|
||||||
|
private boolean isQa;
|
||||||
|
private long finishedItemId;
|
||||||
|
private boolean isSegregated;
|
||||||
|
// wrapper
|
||||||
|
private JobCard jobCard;
|
||||||
|
private long accountId;
|
||||||
|
private String qaStatus;
|
||||||
|
private long bundleId;
|
||||||
|
private String accountTitle;
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(long itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getJobCardId() {
|
||||||
|
return jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobCardId(long jobCardId) {
|
||||||
|
this.jobCardId = jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsQa() {
|
||||||
|
return isQa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsQa(boolean qa) {
|
||||||
|
isQa = qa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFinishedItemId() {
|
||||||
|
return finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishedItemId(long finishedItemId) {
|
||||||
|
this.finishedItemId = finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JobCard getJobCard() {
|
||||||
|
return jobCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobCard(JobCard jobCard) {
|
||||||
|
this.jobCard = jobCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsSegregated() {
|
||||||
|
return isSegregated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsSegregated(boolean segregated) {
|
||||||
|
isSegregated = segregated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQaStatus() {
|
||||||
|
return qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQaStatus(String qaStatus) {
|
||||||
|
this.qaStatus = qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getWrapQuantity(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMasterBundleId(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getBundleId(){
|
||||||
|
return bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundleId(long bundleId) {
|
||||||
|
this.bundleId = bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccountTitle() {
|
||||||
|
return accountTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountTitle(String accountTitle) {
|
||||||
|
this.accountTitle = accountTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PackagingItems{" +
|
||||||
|
"id=" + id +
|
||||||
|
", itemId=" + itemId +
|
||||||
|
", sku='" + sku + '\'' +
|
||||||
|
", barcode='" + barcode + '\'' +
|
||||||
|
", jobCardId=" + jobCardId +
|
||||||
|
", createdAt=" + createdAt +
|
||||||
|
", createdBy='" + createdBy + '\'' +
|
||||||
|
", isQa=" + isQa +
|
||||||
|
", finishedItemId=" + finishedItemId +
|
||||||
|
", isSegregated=" + isSegregated +
|
||||||
|
", jobCard=" + jobCard +
|
||||||
|
", accountId=" + accountId +
|
||||||
|
", qaStatus='" + qaStatus + '\'' +
|
||||||
|
", bundleId=" + bundleId +
|
||||||
|
", accountTitle='" + accountTitle + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
public class PoItemsWrapper {
|
||||||
|
private int totalCutting;
|
||||||
|
private int totalStitching;
|
||||||
|
private int totalProduction;
|
||||||
|
private String size;
|
||||||
|
private String color;
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
public int getTotalCutting() {
|
||||||
|
return totalCutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCutting(int totalCutting) {
|
||||||
|
this.totalCutting = totalCutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalStitching() {
|
||||||
|
return totalStitching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalStitching(int totalStitching) {
|
||||||
|
this.totalStitching = totalStitching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalProduction() {
|
||||||
|
return totalProduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalProduction(int totalProduction) {
|
||||||
|
this.totalProduction = totalProduction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(String size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColor(String color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTP {
|
||||||
|
|
||||||
|
public enum Status{
|
||||||
|
DRAFT,
|
||||||
|
POSTED,
|
||||||
|
}
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private String purchaseOrderCode;
|
||||||
|
private long purchaseOrderQuantity;
|
||||||
|
private long purchaseOrderQuantityRequired;
|
||||||
|
private String articleName;
|
||||||
|
private boolean poStatus;
|
||||||
|
private String createdBy;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPurchaseOrderCode() {
|
||||||
|
return purchaseOrderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderCode(String purchaseOrderCode) {
|
||||||
|
this.purchaseOrderCode = purchaseOrderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPurchaseOrderQuantity() {
|
||||||
|
return purchaseOrderQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderQuantity(long purchaseOrderQuantity) {
|
||||||
|
this.purchaseOrderQuantity = purchaseOrderQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPurchaseOrderQuantityRequired() {
|
||||||
|
return purchaseOrderQuantityRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseOrderQuantityRequired(long purchaseOrderQuantityRequired) {
|
||||||
|
this.purchaseOrderQuantityRequired = purchaseOrderQuantityRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArticleName() {
|
||||||
|
return articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleName(String articleName) {
|
||||||
|
this.articleName = articleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getPoStatus() {
|
||||||
|
return poStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPoStatus(boolean poStatus) {
|
||||||
|
this.poStatus = poStatus;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,20 @@
|
||||||
package com.utopiaindustries.model.ctp;
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class StitchedItemWrapper {
|
public class StitchedItemWrapper {
|
||||||
|
|
||||||
|
private String qaStatus;
|
||||||
private List<StitchingOfflineItem> items;
|
private List<StitchingOfflineItem> items;
|
||||||
private Long finishedAccountId;
|
private Long finishedAccountId;
|
||||||
|
|
||||||
|
public String getQaStatus() {
|
||||||
|
return qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQaStatus(String qaStatus) {
|
||||||
|
this.qaStatus = qaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
public List<StitchingOfflineItem> getItems() {
|
public List<StitchingOfflineItem> getItems() {
|
||||||
return items;
|
return items;
|
||||||
|
|
|
@ -14,6 +14,10 @@ public class StitchingOfflineItem implements InventoryArtifact {
|
||||||
private long jobCardId;
|
private long jobCardId;
|
||||||
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
|
private LocalDateTime qcDoneAt;
|
||||||
|
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
private boolean isQa;
|
private boolean isQa;
|
||||||
private String qaRemarks;
|
private String qaRemarks;
|
||||||
|
@ -125,6 +129,14 @@ public class StitchingOfflineItem implements InventoryArtifact {
|
||||||
this.bundleId = bundleId;
|
this.bundleId = bundleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getQcDoneAt() {
|
||||||
|
return qcDoneAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQcDoneAt(LocalDateTime qcDoneAt) {
|
||||||
|
this.qcDoneAt = qcDoneAt;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "StitchingOfflineItem{" +
|
return "StitchingOfflineItem{" +
|
||||||
|
|
|
@ -0,0 +1,151 @@
|
||||||
|
package com.utopiaindustries.model.ctp;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class StoreItem implements InventoryArtifact {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private long itemId;
|
||||||
|
private String sku;
|
||||||
|
private String barcode;
|
||||||
|
private long jobCardId;
|
||||||
|
@DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" )
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String createdBy;
|
||||||
|
private long finishedItemId;
|
||||||
|
private long bundleId;
|
||||||
|
private long accountId;
|
||||||
|
private String rejectedReason;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(long itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSku() {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSku(String sku) {
|
||||||
|
this.sku = sku;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getJobCardId() {
|
||||||
|
return jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobCardId(long jobCardId) {
|
||||||
|
this.jobCardId = jobCardId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalDateTime getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal getWrapQuantity() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getMasterBundleId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFinishedItemId() {
|
||||||
|
return finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishedItemId(long finishedItemId) {
|
||||||
|
this.finishedItemId = finishedItemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getBundleId() {
|
||||||
|
return bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundleId(long bundleId) {
|
||||||
|
this.bundleId = bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAccountId() {
|
||||||
|
return accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccountId(long accountId) {
|
||||||
|
this.accountId = accountId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRejectedReason() {
|
||||||
|
return rejectedReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRejectedReason(String rejectedReason) {
|
||||||
|
this.rejectedReason = rejectedReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StoreItem{" +
|
||||||
|
"id=" + id +
|
||||||
|
", itemId=" + itemId +
|
||||||
|
", sku='" + sku + '\'' +
|
||||||
|
", barcode='" + barcode + '\'' +
|
||||||
|
", jobCardId=" + jobCardId +
|
||||||
|
", createdAt=" + createdAt +
|
||||||
|
", createdBy='" + createdBy + '\'' +
|
||||||
|
", finishedItemId=" + finishedItemId +
|
||||||
|
", bundleId=" + bundleId +
|
||||||
|
", accountId=" + accountId +
|
||||||
|
", rejectedReason='" + rejectedReason + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.utopiaindustries.querybuilder.ctp;
|
||||||
|
|
||||||
|
import com.utopiaindustries.querybuilder.QueryBuilder;
|
||||||
|
import com.utopiaindustries.util.CTPDateTimeFormat;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class PurchaseOrderCTPQueryBuilder {
|
||||||
|
public static String buildQuery(String purchaseOrderCode, String articleName, String createdBy, String startDate, String endDate, Long count ){
|
||||||
|
// format date
|
||||||
|
String formattedDate;
|
||||||
|
String formattedEndDate;
|
||||||
|
String startDate1 = "";
|
||||||
|
String endDate1 = "";
|
||||||
|
String purchaseOrderCode1 = purchaseOrderCode == null ? "" : purchaseOrderCode;
|
||||||
|
String articleName1 = articleName == null ? "" : articleName;
|
||||||
|
if ( ! StringUtils.isNullOrEmpty( startDate ) ) {
|
||||||
|
formattedDate = CTPDateTimeFormat.getMySQLFormattedDateString( startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
|
||||||
|
formattedEndDate = CTPDateTimeFormat.getMySQLFormattedDateString( endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT );
|
||||||
|
startDate1 = String.format( "'%s 00:00:01'", formattedDate );
|
||||||
|
if ( ! StringUtils.isNullOrEmpty( endDate ) ) {
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEndDate);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", LocalDate.now() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (new QueryBuilder())
|
||||||
|
.setTable("cut_to_pack.purchase_order")
|
||||||
|
.setColumns("*")
|
||||||
|
.where()
|
||||||
|
.columnEquals("created_by", createdBy)
|
||||||
|
.and()
|
||||||
|
.columnLike("purchase_order_code", "%" + purchaseOrderCode1 + "%")
|
||||||
|
.and()
|
||||||
|
.columnLike("article_name", articleName)
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrGreaterThan("created_at", startDate1)
|
||||||
|
.and()
|
||||||
|
.columnEqualToOrLessThan("created_at", endDate1)
|
||||||
|
.limit(count.intValue())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
public class StichedOfflineItemQueryBuilder {
|
public class StichedOfflineItemQueryBuilder {
|
||||||
|
|
||||||
public static String buildQuery(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count) {
|
public static String buildQuery(String id, String itemId, String sku, String QaStatus,String createdStartDate, String createdEndDate, Long bundleId, Long count) {
|
||||||
// format date
|
// format date
|
||||||
String formattedDate;
|
String formattedDate;
|
||||||
String formattedEndDate;
|
String formattedEndDate;
|
||||||
|
@ -24,8 +24,7 @@ public class StichedOfflineItemQueryBuilder {
|
||||||
endDate1 = String.format("'%s 23:59:59'", LocalDate.now());
|
endDate1 = String.format("'%s 23:59:59'", LocalDate.now());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QueryBuilder qb = (new QueryBuilder())
|
||||||
return ( new QueryBuilder() )
|
|
||||||
.setTable("cut_to_pack.stitching_offline_item")
|
.setTable("cut_to_pack.stitching_offline_item")
|
||||||
.setColumns("*")
|
.setColumns("*")
|
||||||
.where()
|
.where()
|
||||||
|
@ -39,11 +38,14 @@ public class StichedOfflineItemQueryBuilder {
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrGreaterThan("created_at", startDate1)
|
.columnEqualToOrGreaterThan("created_at", startDate1)
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrLessThan("created_at", endDate1 )
|
.columnEqualToOrLessThan("created_at", endDate1);
|
||||||
.orderBy("id","DESC")
|
if (!StringUtils.isNullOrEmpty(QaStatus)) {
|
||||||
.limit(count)
|
qb.and().columnEquals("qa_status", QaStatus);
|
||||||
.build();
|
}
|
||||||
|
qb.orderBy("id", "DESC")
|
||||||
|
.limit(count);
|
||||||
|
|
||||||
|
return qb.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,11 @@ public class SummaryInventoryReportQueryBuilder {
|
||||||
|
|
||||||
public static String cuttingQueryBuild(long jobCardId,
|
public static String cuttingQueryBuild(long jobCardId,
|
||||||
List<Long> account,
|
List<Long> account,
|
||||||
|
String sku,
|
||||||
String startDate,
|
String startDate,
|
||||||
String endDate,String type) {
|
String endDate,
|
||||||
|
String type,
|
||||||
|
String parentDocumentType, Long count) {
|
||||||
|
|
||||||
QueryBuilder qb = new QueryBuilder()
|
QueryBuilder qb = new QueryBuilder()
|
||||||
.setTable(TABLE_NAME)
|
.setTable(TABLE_NAME)
|
||||||
|
@ -84,11 +87,18 @@ public class SummaryInventoryReportQueryBuilder {
|
||||||
.and()
|
.and()
|
||||||
.columnEqualToOrLessThan("transaction_leg_datetime",endDate)
|
.columnEqualToOrLessThan("transaction_leg_datetime",endDate)
|
||||||
.and()
|
.and()
|
||||||
.columnEquals("type",type);
|
.columnEquals("type",type)
|
||||||
|
.and()
|
||||||
|
.columnEquals("parent_document_type",parentDocumentType);
|
||||||
if (jobCardId != 0){
|
if (jobCardId != 0){
|
||||||
qb.and()
|
qb.and()
|
||||||
.columnEquals("job_card_id", jobCardId );
|
.columnEquals("job_card_id", jobCardId );
|
||||||
}
|
}
|
||||||
|
if (!StringUtils.isNullOrEmpty(sku)){
|
||||||
|
qb.and()
|
||||||
|
.columnEquals("sku", sku );
|
||||||
|
}
|
||||||
|
qb.orderBy("transaction_leg_datetime", "DESC").limit(count);
|
||||||
return qb.build();
|
return qb.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,6 +22,18 @@ public class FinishedItemRestController {
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
public List<FinishedItem> searchFinishedItems(@RequestParam("term") String term,
|
public List<FinishedItem> searchFinishedItems(@RequestParam("term") String term,
|
||||||
@RequestParam("is-segregated") boolean isSegregated) {
|
@RequestParam("is-segregated") boolean isSegregated) {
|
||||||
return finishedItemDAO.findByTerm( term, isSegregated );
|
return finishedItemDAO.findByTerm(term, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/search-packaging")
|
||||||
|
public List<FinishedItem> searchFinishedItemsForPackaging(@RequestParam("term") String term,
|
||||||
|
@RequestParam("is-segregated") boolean isSegregated) {
|
||||||
|
return finishedItemDAO.findByTermForPackaging(term, isSegregated, "APPROVED");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/search-store")
|
||||||
|
public List<FinishedItem> searchFinishedItemsForStore(@RequestParam("term") String term,
|
||||||
|
@RequestParam("is-segregated") boolean isSegregated) {
|
||||||
|
return finishedItemDAO.findByTermForPackaging(term, isSegregated,"REJECT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,13 @@ public class JobCardRestController {
|
||||||
return jobCardService.searchJobCards( term , filter );
|
return jobCardService.searchJobCards( term , filter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//search job card for avs integration
|
||||||
|
@GetMapping( "/search-avs-jobcard" )
|
||||||
|
public List<JobCard> searchJobCardByTermAndPOId( @RequestParam(value = "term", required = false) String term,
|
||||||
|
@RequestParam(value = "poId") long poID){
|
||||||
|
return jobCardService.searchJobCardsByTermAndPoId( term , poID );
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping ( "/{id}/items" )
|
@GetMapping ( "/{id}/items" )
|
||||||
public List<JobCardItem> getJobCardItems( @PathVariable( "id" ) long jobCardId ){
|
public List<JobCardItem> getJobCardItems( @PathVariable( "id" ) long jobCardId ){
|
||||||
return jobCardService.getJobCardItems( jobCardId );
|
return jobCardService.getJobCardItems( jobCardId );
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.utopiaindustries.restcontroller;
|
package com.utopiaindustries.restcontroller;
|
||||||
|
|
||||||
|
import com.utopiaindustries.model.ctp.PurchaseOrderCTP;
|
||||||
import com.utopiaindustries.model.uind.PurchaseOrder;
|
import com.utopiaindustries.model.uind.PurchaseOrder;
|
||||||
|
import com.utopiaindustries.service.PurchaseOrderCTPService;
|
||||||
import com.utopiaindustries.service.PurchaseOrderService;
|
import com.utopiaindustries.service.PurchaseOrderService;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -14,9 +16,11 @@ import java.util.List;
|
||||||
public class PurchaseOrderRestController {
|
public class PurchaseOrderRestController {
|
||||||
|
|
||||||
private final PurchaseOrderService purchaseOrderService;
|
private final PurchaseOrderService purchaseOrderService;
|
||||||
|
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
||||||
|
|
||||||
public PurchaseOrderRestController(PurchaseOrderService purchaseOrderService) {
|
public PurchaseOrderRestController(PurchaseOrderService purchaseOrderService, PurchaseOrderCTPService purchaseOrderCTPService) {
|
||||||
this.purchaseOrderService = purchaseOrderService;
|
this.purchaseOrderService = purchaseOrderService;
|
||||||
|
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -26,4 +30,12 @@ public class PurchaseOrderRestController {
|
||||||
public List<PurchaseOrder> findByTerm(@RequestParam("term") String term ) {
|
public List<PurchaseOrder> findByTerm(@RequestParam("term") String term ) {
|
||||||
return purchaseOrderService.findByTerm( term );
|
return purchaseOrderService.findByTerm( term );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search by term in ctp purchase order table
|
||||||
|
* */
|
||||||
|
@GetMapping( "/ctp-po-search" )
|
||||||
|
public List<PurchaseOrderCTP> findByTermInCtpPurchaseOrderTable(@RequestParam("term") String term ) {
|
||||||
|
return purchaseOrderCTPService.findByTerm( term );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,7 @@ public class BarcodeService {
|
||||||
float qrY =stickerSize.getMarginLeft()+50 ;
|
float qrY =stickerSize.getMarginLeft()+50 ;
|
||||||
float qrX = stickerSize.getMarginTop();
|
float qrX = stickerSize.getMarginTop();
|
||||||
|
|
||||||
qrCodeImage.setFixedPosition(qrX - 16, qrY-40);
|
qrCodeImage.setFixedPosition(qrX - 16, qrY-35);
|
||||||
document.add(qrCodeImage);
|
document.add(qrCodeImage);
|
||||||
|
|
||||||
float textX = stickerSize.getMarginLeft() + 40;
|
float textX = stickerSize.getMarginLeft() + 40;
|
||||||
|
@ -323,18 +323,33 @@ public class BarcodeService {
|
||||||
String combinedText = sku + " \\ " + jobCardCode + " \\ " + artifact.getBundleId();
|
String combinedText = sku + " \\ " + jobCardCode + " \\ " + artifact.getBundleId();
|
||||||
combinedText = combinedText.replaceAll("\\s+", "");
|
combinedText = combinedText.replaceAll("\\s+", "");
|
||||||
|
|
||||||
int maxLength = 14;
|
int maxLength = 12;
|
||||||
|
int start = 0;
|
||||||
|
int lineCount = 0;
|
||||||
List<String> lines = new ArrayList<>();
|
List<String> lines = new ArrayList<>();
|
||||||
for (int i = 0; i < 5; i++) {
|
|
||||||
int start = i * maxLength;
|
while (start < combinedText.length() && lineCount < 5) {
|
||||||
if (start < combinedText.length()) {
|
int end = Math.min(start + maxLength, combinedText.length());
|
||||||
String part = combinedText.substring(start, Math.min(start + maxLength, combinedText.length())).replaceAll("\\s+", "");
|
String part = combinedText.substring(start, end);
|
||||||
lines.add(part);
|
|
||||||
|
if (part.matches(".*[^a-zA-Z0-9 ].*")) {
|
||||||
|
if(combinedText.length() - start<=17 && combinedText.length() - start>0){
|
||||||
|
end = Math.min(start + maxLength + 5, combinedText.length());
|
||||||
|
part = combinedText.substring(start, end);
|
||||||
|
}else {
|
||||||
|
end = Math.min(start + maxLength + 3, combinedText.length());
|
||||||
|
part = combinedText.substring(start, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part = part.replaceAll("\\s+", "");
|
||||||
|
lines.add(part);
|
||||||
|
start = end;
|
||||||
|
lineCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float labelWidth = 67.69f;
|
float labelWidth = 67.69f;
|
||||||
float textBoxWidth = 220;
|
float textBoxWidth = 120f;
|
||||||
float textY1 = textY-23;
|
float textY1 = textY-23;
|
||||||
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
|
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
|
||||||
|
|
||||||
|
@ -343,21 +358,26 @@ public class BarcodeService {
|
||||||
.setFontColor(ColorConstants.BLACK)
|
.setFontColor(ColorConstants.BLACK)
|
||||||
.setFontSize(stickerSize.getTextSize()+2)
|
.setFontSize(stickerSize.getTextSize()+2)
|
||||||
.setTextAlignment(TextAlignment.CENTER)
|
.setTextAlignment(TextAlignment.CENTER)
|
||||||
.setFixedPosition(textXCenter, textY1-18, textBoxWidth);
|
.setFixedPosition(textXCenter, textY1-13, textBoxWidth);
|
||||||
|
|
||||||
document.add(rotatedText);
|
document.add(rotatedText);
|
||||||
textY1 -= 6;
|
textY1 -= 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER_OBLIQUE);
|
PdfFont font = PdfFontFactory.createFont(StandardFonts.COURIER);
|
||||||
String id = String.valueOf(artifact.getId());
|
String id = String.valueOf(artifact.getId());
|
||||||
|
float textSize = stickerSize.getTextSize() + 6;
|
||||||
|
float charWidth = textSize * 0.6f;
|
||||||
|
float idWidth = id.length() * charWidth;
|
||||||
|
float xCentered = (labelWidth / 2f) - (idWidth / 2f);
|
||||||
|
|
||||||
document.add(new Paragraph(id)
|
document.add(new Paragraph(id)
|
||||||
.setFont(font)
|
.setFont(font)
|
||||||
.setBold()
|
.setBold()
|
||||||
.setFontColor(ColorConstants.BLACK)
|
.setFontColor(ColorConstants.BLACK)
|
||||||
.setFontSize(stickerSize.getTextSize() + 8)
|
.setFontSize(textSize)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setFixedPosition(xCentered, textY + 18, 100));
|
||||||
.setFixedPosition(textX - 25, textY + 13, 100));
|
|
||||||
|
|
||||||
float dottedLine = textY - 65;
|
float dottedLine = textY - 65;
|
||||||
for(int i= 0 ;i<16;i++){
|
for(int i= 0 ;i<16;i++){
|
||||||
|
@ -367,7 +387,7 @@ public class BarcodeService {
|
||||||
.setBold()
|
.setBold()
|
||||||
.setRotationAngle(-Math.PI / 2)
|
.setRotationAngle(-Math.PI / 2)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setTextAlignment(TextAlignment.LEFT)
|
||||||
.setFixedPosition(dottedLine,textX+45, 100));
|
.setFixedPosition(dottedLine,textX+55, 100));
|
||||||
|
|
||||||
dottedLine += 7;
|
dottedLine += 7;
|
||||||
}
|
}
|
||||||
|
@ -380,7 +400,7 @@ public class BarcodeService {
|
||||||
.setBold()
|
.setBold()
|
||||||
.setRotationAngle(-Math.PI / 2)
|
.setRotationAngle(-Math.PI / 2)
|
||||||
.setTextAlignment(TextAlignment.LEFT)
|
.setTextAlignment(TextAlignment.LEFT)
|
||||||
.setFixedPosition(dottedLine2,textX+80, 100));
|
.setFixedPosition(dottedLine2,textX+90, 100));
|
||||||
|
|
||||||
dottedLine2 += 7;
|
dottedLine2 += 7;
|
||||||
}
|
}
|
||||||
|
@ -389,9 +409,11 @@ public class BarcodeService {
|
||||||
document.add(new AreaBreak());
|
document.add(new AreaBreak());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdfDoc.getNumberOfPages() > artifacts.size()) {
|
if (pdfDoc.getNumberOfPages() > artifacts.size()) {
|
||||||
pdfDoc.removePage(pdfDoc.getNumberOfPages());
|
pdfDoc.removePage(pdfDoc.getNumberOfPages());
|
||||||
}
|
}
|
||||||
|
|
||||||
document.close();
|
document.close();
|
||||||
sendPdfToZebraPrinter(pdfPath.toFile());
|
sendPdfToZebraPrinter(pdfPath.toFile());
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,13 +125,13 @@ public class BundleService {
|
||||||
/*
|
/*
|
||||||
* find finished Items by params
|
* find finished Items by params
|
||||||
* */
|
* */
|
||||||
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
|
public List<StitchingOfflineItem> getStitchedOfflineItems(String id, String itemId, String sku,String status, String createdStartDate, String createdEndDate, Long bundleId, Long count ){
|
||||||
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
|
List<StitchingOfflineItem> stitchingOfflineItems = new ArrayList<>();
|
||||||
if( count == null ){
|
if( count == null ){
|
||||||
count = 100L;
|
count = 100L;
|
||||||
}
|
}
|
||||||
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){
|
if( StringUtils.isAnyNotNullOrEmpty(id, itemId, sku, createdStartDate, createdEndDate, String.valueOf(bundleId) ) ){
|
||||||
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, createdStartDate, createdEndDate, bundleId , count );
|
String query = StichedOfflineItemQueryBuilder.buildQuery( id, itemId, sku, status,createdStartDate, createdEndDate, bundleId , count );
|
||||||
System.out.println( query );
|
System.out.println( query );
|
||||||
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
stitchingOfflineItems = stitchingOfflineItemDAO.findByQuery( query );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -0,0 +1,185 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.*;
|
||||||
|
import com.utopiaindustries.model.ctp.*;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DashboardService {
|
||||||
|
|
||||||
|
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
|
||||||
|
private final JobCardDAO jobCardDAO;
|
||||||
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
|
private final InventoryAccountDAO inventoryAccountDAO;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
|
|
||||||
|
public DashboardService(InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PackagingItemsDAO packagingItemsDAO) {
|
||||||
|
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
|
||||||
|
this.jobCardDAO = jobCardDAO;
|
||||||
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
|
this.inventoryAccountDAO = inventoryAccountDAO;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Float> getPhasesProgressDayWise(String lineNo) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
HashMap<String, Float> progress = new HashMap<>();
|
||||||
|
|
||||||
|
String cuttingAccount = "CUTTING ACCOUNT " + lineNo;
|
||||||
|
String stitchingAccount = "STITCHING ACCOUNT " + lineNo;
|
||||||
|
String finishingAccount = "FINISHING ACCOUNT " + lineNo;
|
||||||
|
String packagingAccount = "A GRADE ACCOUNT " + lineNo;
|
||||||
|
|
||||||
|
LocalDateTime today = LocalDateTime.now().withHour(0).withMinute(0).withSecond(1);
|
||||||
|
String startDate1 = today.format(formatter);
|
||||||
|
String endDate1 = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).format(formatter);
|
||||||
|
String forPreviousDate = LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).format(formatter);
|
||||||
|
|
||||||
|
//set inventory accounts
|
||||||
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findAll();
|
||||||
|
InventoryAccount inventoryAccount = inventoryAccounts.stream()
|
||||||
|
.filter(e -> stitchingAccount.equals(e.getTitle())).findFirst().orElse(new InventoryAccount());
|
||||||
|
Map<String, Integer> inventoryAccountMap = inventoryAccounts.stream()
|
||||||
|
.filter(e -> cuttingAccount.equals(e.getTitle()) ||
|
||||||
|
stitchingAccount.equals(e.getTitle()) ||
|
||||||
|
finishingAccount.equals(e.getTitle()) ||
|
||||||
|
packagingAccount.equals(e.getTitle()))
|
||||||
|
.collect(Collectors.toMap(InventoryAccount::getTitle, e -> (int) e.getId()));
|
||||||
|
|
||||||
|
//get all in remaining transaction stitching
|
||||||
|
List<Long> stitchingItemIds = inventoryTransactionLegDAO.findRemainingByParentTypeAndAccountID("STITCHING_OFFLINE", inventoryAccountMap.get(stitchingAccount));
|
||||||
|
|
||||||
|
//get all out transaction stitching
|
||||||
|
List<Long> stitchingOutIds = inventoryTransactionLegDAO.getOutParentIdByDate("STITCHING_OFFLINE", inventoryAccountMap.get(stitchingAccount));
|
||||||
|
|
||||||
|
|
||||||
|
//get all in transaction finished
|
||||||
|
List<Long> finishing = inventoryTransactionLegDAO.getInParentIdByDate("FINISHED_ITEM", inventoryAccountMap.get(finishingAccount));
|
||||||
|
|
||||||
|
//get all in remaining transaction packaging
|
||||||
|
List<Long> packagingItemIDs = inventoryTransactionLegDAO.findRemainingByParentTypeAndAccountID("PACKAGING", inventoryAccountMap.get(packagingAccount));
|
||||||
|
|
||||||
|
//set stitching related details
|
||||||
|
Long approvedStitchingOfflineItems = 0L;
|
||||||
|
Long remaininfQcAlterPieces = 0L;
|
||||||
|
Long approvedStitchingOfflineItemsThenReject = 0L;
|
||||||
|
long qcReject = 0L;
|
||||||
|
if (stitchingItemIds != null && !stitchingItemIds.isEmpty()) {
|
||||||
|
approvedStitchingOfflineItems = stitchingOfflineItemDAO.findByQCOperationDateAndApproved(startDate1, endDate1, "APPROVED");
|
||||||
|
qcReject = stitchingOfflineItemDAO.findByQCOperationDateAndIds(startDate1, endDate1, "REJECT", stitchingItemIds);
|
||||||
|
remaininfQcAlterPieces = stitchingOfflineItemDAO.findByQCOperationDateAndIds(null, forPreviousDate, "REJECT", stitchingItemIds);
|
||||||
|
}
|
||||||
|
if(stitchingOutIds != null && !stitchingOutIds.isEmpty()) {
|
||||||
|
approvedStitchingOfflineItemsThenReject = stitchingOfflineItemDAO.findByQCOperationDateAndIds(startDate1, endDate1, "REJECT", stitchingOutIds);
|
||||||
|
}
|
||||||
|
//set finishing related details
|
||||||
|
Long alterationPieceFinish = 0L;
|
||||||
|
Long rejectFinishedItem = 0L;
|
||||||
|
Long washFinishedItem = 0L;
|
||||||
|
Long approved = 0L;
|
||||||
|
Long operationNotPerformed = 0L;
|
||||||
|
Long remainingAlterationPieceFinish = 0L;
|
||||||
|
if (finishing != null && !finishing.isEmpty()) {
|
||||||
|
approved = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(startDate1, endDate1, "APPROVED", finishing);
|
||||||
|
operationNotPerformed = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(startDate1, endDate1, "-", finishing);
|
||||||
|
rejectFinishedItem = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(startDate1, endDate1, "REJECT", finishing);
|
||||||
|
washFinishedItem = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(startDate1, endDate1, "WASHED", finishing);
|
||||||
|
alterationPieceFinish = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(startDate1, endDate1, "ALTER", finishing);
|
||||||
|
remainingAlterationPieceFinish = finishedItemDAO.findByOperationDateAndIdsAndQaStatus(null, forPreviousDate, "ALTER", finishing);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set packaging details
|
||||||
|
Long packagingItems = 0L;
|
||||||
|
if (packagingItemIDs != null && !packagingItemIDs.isEmpty()) {
|
||||||
|
packagingItems = packagingItemsDAO.findByDateAndIds(startDate1, endDate1, packagingItemIDs);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set shift wise details and time
|
||||||
|
LocalDateTime statTime = LocalDateTime.now().withHour(9).withMinute(0).withSecond(0).withNano(0);
|
||||||
|
LocalDateTime endTime = statTime.plusMinutes(inventoryAccount.getShiftMinutes());
|
||||||
|
long minutesPassed = 0;
|
||||||
|
if (statTime.isBefore(LocalDateTime.now()) && LocalDateTime.now().isBefore(endTime)) {
|
||||||
|
minutesPassed = Duration.between(statTime, LocalDateTime.now()).toMinutes();
|
||||||
|
}
|
||||||
|
|
||||||
|
//set efficiency
|
||||||
|
long shiftTargetMinutesWise = getTargetShiftWiseOrHourlyWise(Math.max(0, minutesPassed), inventoryAccount);
|
||||||
|
float efficiency;
|
||||||
|
if (shiftTargetMinutesWise == 0) {
|
||||||
|
efficiency = 0f;
|
||||||
|
} else {
|
||||||
|
efficiency = (float) approvedStitchingOfflineItems / shiftTargetMinutesWise;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress.put("Stitching", (float) approvedStitchingOfflineItems + qcReject);
|
||||||
|
progress.put("totalWips", (float) stitchingItemIds.size() - qcReject);
|
||||||
|
progress.put("Alteration", (float) qcReject + approvedStitchingOfflineItemsThenReject);
|
||||||
|
|
||||||
|
progress.put("finishing", (float) approved );
|
||||||
|
progress.put("ALTER", (float) alterationPieceFinish);
|
||||||
|
progress.put("Reject", (float) rejectFinishedItem);
|
||||||
|
progress.put("wash", (float) washFinishedItem);
|
||||||
|
progress.put("finishingValueForBarChart", (float) approved + alterationPieceFinish + rejectFinishedItem + washFinishedItem + packagingItems);
|
||||||
|
|
||||||
|
progress.put("packaging", (float) packagingItems);
|
||||||
|
progress.put("totalPackaging", (float) packagingItemIDs.size());
|
||||||
|
progress.put("remainingFinishAlter", (float) remainingAlterationPieceFinish);
|
||||||
|
progress.put("remainingQCAlter", (float) remaininfQcAlterPieces);
|
||||||
|
|
||||||
|
progress.put("Efficiency", efficiency);
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getLineDetails(String lineNo) {
|
||||||
|
String stitchingAccount = "STITCHING ACCOUNT " + lineNo;
|
||||||
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findAll();
|
||||||
|
|
||||||
|
InventoryAccount inventoryAccount = inventoryAccounts.stream()
|
||||||
|
.filter(e -> stitchingAccount.equals(e.getTitle())).findFirst().orElse(new InventoryAccount());
|
||||||
|
|
||||||
|
int shiftTarget = getTargetShiftWiseOrHourlyWise(inventoryAccount.getShiftMinutes(), inventoryAccount);
|
||||||
|
int shiftHourlyTarget = getTargetShiftWiseOrHourlyWise(60, inventoryAccount);
|
||||||
|
|
||||||
|
HashMap<String, String> details = new HashMap<>();
|
||||||
|
details.put("Shift Target", shiftTarget + " Pcs");
|
||||||
|
details.put("articleName", inventoryAccount.getArticleName());
|
||||||
|
details.put("Hourly Target", shiftHourlyTarget + " Pcs");
|
||||||
|
details.put("Total Machine", String.valueOf(inventoryAccount.getTotalMachines()));
|
||||||
|
details.put("Total Worker", String.valueOf(30));
|
||||||
|
details.put("line", "Line " + lineNo);
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
//formula for calculating targets --> machine * shiftTime * Efficiency / SAM
|
||||||
|
private int getTargetShiftWiseOrHourlyWise(long minutes, InventoryAccount inventoryAccount) {
|
||||||
|
if (inventoryAccount == null ||
|
||||||
|
inventoryAccount.getTotalMachines() == 0 ||
|
||||||
|
inventoryAccount.getEfficiency() == null ||
|
||||||
|
inventoryAccount.getSam() == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
BigDecimal totalMachines = BigDecimal.valueOf(inventoryAccount.getTotalMachines());
|
||||||
|
BigDecimal efficiency = inventoryAccount.getEfficiency();
|
||||||
|
BigDecimal sam = inventoryAccount.getSam();
|
||||||
|
BigDecimal totalShiftProductiveTime = totalMachines
|
||||||
|
.multiply(BigDecimal.valueOf(minutes))
|
||||||
|
.multiply(efficiency);
|
||||||
|
if (sam.longValue() != 0) {
|
||||||
|
return totalShiftProductiveTime.divide(sam, 0, RoundingMode.HALF_UP).intValueExact();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -71,11 +71,7 @@ public class InventoryAccountService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InventoryAccount> findInventoryAccounts(){
|
public List<InventoryAccount> findInventoryAccounts(){
|
||||||
List<InventoryAccount> accounts = inventoryAccountDAO.findAll();
|
return inventoryAccountDAO.findAll();
|
||||||
for( InventoryAccount account : accounts ){
|
|
||||||
account.setLocationTitle( locationSiteDAO.find( account.getLocationSiteId() ).getTitle() );
|
|
||||||
}
|
|
||||||
return accounts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InventoryAccount> findInventoryAccountsByFilter(String id, String title, String active, String createdBy, String startDate, String endDate,
|
public List<InventoryAccount> findInventoryAccountsByFilter(String id, String title, String active, String createdBy, String startDate, String endDate,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
||||||
public class InventoryService {
|
public class InventoryService {
|
||||||
|
|
||||||
private final JobCardItemDAO jobCardItemDAO;
|
private final JobCardItemDAO jobCardItemDAO;
|
||||||
private final CutPieceDAO cutPieceDAO;
|
private final StoreItemDao storeItemDao;
|
||||||
private final BundleDAO bundleDAO;
|
private final BundleDAO bundleDAO;
|
||||||
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
|
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
|
||||||
private final InventoryTransactionDAO inventoryTransactionDAO;
|
private final InventoryTransactionDAO inventoryTransactionDAO;
|
||||||
|
@ -28,10 +28,11 @@ public class InventoryService {
|
||||||
private final MasterBundleDAO masterBundleDAO;
|
private final MasterBundleDAO masterBundleDAO;
|
||||||
private final FinishedItemDAO finishedItemDAO;
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
public InventoryService( JobCardItemDAO jobCardItemDAO, CutPieceDAO cutPieceDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO) {
|
public InventoryService(JobCardItemDAO jobCardItemDAO, StoreItemDao storeItemDao, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, PackagingItemsDAO packagingItemsDAO) {
|
||||||
this.jobCardItemDAO = jobCardItemDAO;
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
this.cutPieceDAO = cutPieceDAO;
|
this.storeItemDao = storeItemDao;
|
||||||
this.bundleDAO = bundleDAO;
|
this.bundleDAO = bundleDAO;
|
||||||
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
|
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
|
||||||
this.inventoryTransactionDAO = inventoryTransactionDAO;
|
this.inventoryTransactionDAO = inventoryTransactionDAO;
|
||||||
|
@ -40,6 +41,7 @@ public class InventoryService {
|
||||||
this.masterBundleDAO = masterBundleDAO;
|
this.masterBundleDAO = masterBundleDAO;
|
||||||
this.finishedItemDAO = finishedItemDAO;
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateJobCardInventoryStatus(JobCard card) {
|
private void updateJobCardInventoryStatus(JobCard card) {
|
||||||
|
@ -81,14 +83,14 @@ public class InventoryService {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// save updated cut pieces
|
// save updated cut pieces
|
||||||
List<CutPiece> cutPieces = jobCardItemWrappers.stream( )
|
// List<CutPiece> cutPieces = jobCardItemWrappers.stream()
|
||||||
.flatMap( wrapper -> wrapper.getPieces( ).stream( ) )
|
// .flatMap(wrapper -> wrapper.getPieces().stream())
|
||||||
.collect( Collectors.toList( ) );
|
// .collect(Collectors.toList());
|
||||||
cutPieceDAO.saveAll( cutPieces );
|
// cutPieceDAO.saveAll(cutPieces);
|
||||||
|
|
||||||
Map<Long, List<CutPiece>> piecesMap = cutPieceDAO.findByJobCardItemIds( jobCardItemIds)
|
// Map<Long, List<CutPiece>> piecesMap = cutPieceDAO.findByJobCardItemIds(jobCardItemIds)
|
||||||
.stream( )
|
// .stream()
|
||||||
.collect( Collectors.groupingBy( CutPiece::getJobCardItemId));
|
// .collect(Collectors.groupingBy(CutPiece::getJobCardItemId));
|
||||||
|
|
||||||
for (JobCardItem jobCardItem : items) {
|
for (JobCardItem jobCardItem : items) {
|
||||||
|
|
||||||
|
@ -462,13 +464,14 @@ public class InventoryService {
|
||||||
* generate finished items against stitched items
|
* generate finished items against stitched items
|
||||||
* */
|
* */
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createFinishedItemsAgainstStitchedItems( StitchedItemWrapper wrapper ) {
|
public void createFinishedItemsAgainstStitchedItems(StitchedItemWrapper wrapper, String qaStatus) {
|
||||||
if (wrapper.getItems() != null && wrapper.getFinishedAccountId() != 0) {
|
if (wrapper.getItems() != null && wrapper.getFinishedAccountId() != 0) {
|
||||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
|
||||||
List<StitchingOfflineItem> stitchingOfflineItems = wrapper.getItems();
|
List<StitchingOfflineItem> stitchingOfflineItems = wrapper.getItems();
|
||||||
List<StitchingOfflineItem> updatedStitchedItems = new ArrayList<>();
|
List<StitchingOfflineItem> updatedStitchedItems = new ArrayList<>();
|
||||||
List<FinishedItem> finishedItems = new ArrayList<>();
|
List<FinishedItem> finishedItems = new ArrayList<>();
|
||||||
|
List<FinishedItem> finishedItemsForUlter = new ArrayList<>();
|
||||||
|
|
||||||
List<Long> stitchedItemIds = stitchingOfflineItems.stream()
|
List<Long> stitchedItemIds = stitchingOfflineItems.stream()
|
||||||
.map(StitchingOfflineItem::getId)
|
.map(StitchingOfflineItem::getId)
|
||||||
|
@ -493,7 +496,7 @@ public class InventoryService {
|
||||||
|
|
||||||
// generate FI for SI
|
// generate FI for SI
|
||||||
for (StitchingOfflineItem stitchingOfflineItem : stitchingOfflineItems) {
|
for (StitchingOfflineItem stitchingOfflineItem : stitchingOfflineItems) {
|
||||||
if ( stitchingOfflineItem.getQaStatus( ).equalsIgnoreCase( "APPROVED" )) {
|
if (qaStatus.equalsIgnoreCase("APPROVED")) {
|
||||||
// check finished item is already created
|
// check finished item is already created
|
||||||
FinishedItem preCreatedItem = finishedItemDAO.findByStitchedItem(stitchingOfflineItem.getId());
|
FinishedItem preCreatedItem = finishedItemDAO.findByStitchedItem(stitchingOfflineItem.getId());
|
||||||
if (preCreatedItem == null) {
|
if (preCreatedItem == null) {
|
||||||
|
@ -503,9 +506,11 @@ public class InventoryService {
|
||||||
finishedItem.setBarcode(stitchingOfflineItem.getBarcode());
|
finishedItem.setBarcode(stitchingOfflineItem.getBarcode());
|
||||||
finishedItem.setCreatedBy(authentication.getName());
|
finishedItem.setCreatedBy(authentication.getName());
|
||||||
finishedItem.setCreatedAt(LocalDateTime.now());
|
finishedItem.setCreatedAt(LocalDateTime.now());
|
||||||
|
finishedItem.setOperationDate(LocalDateTime.now());
|
||||||
|
finishedItem.setQaStatus("-");
|
||||||
finishedItem.setStitchedItemId(stitchingOfflineItem.getId());
|
finishedItem.setStitchedItemId(stitchingOfflineItem.getId());
|
||||||
finishedItem.setJobCardId(stitchingOfflineItem.getJobCardId());
|
finishedItem.setJobCardId(stitchingOfflineItem.getJobCardId());
|
||||||
finishedItem.setIsQa( false);
|
finishedItem.setIsQa(true);
|
||||||
finishedItem.setId(finishedItemDAO.save(finishedItem));
|
finishedItem.setId(finishedItemDAO.save(finishedItem));
|
||||||
finishedItems.add(finishedItem);
|
finishedItems.add(finishedItem);
|
||||||
InventoryTransactionLeg lastInvTransaction = lastStitchedIdInTransactionMap.getOrDefault(stitchingOfflineItem.getId(), null);
|
InventoryTransactionLeg lastInvTransaction = lastStitchedIdInTransactionMap.getOrDefault(stitchingOfflineItem.getId(), null);
|
||||||
|
@ -516,6 +521,8 @@ public class InventoryService {
|
||||||
}
|
}
|
||||||
// update stitched item
|
// update stitched item
|
||||||
stitchingOfflineItem.setIsQa(true);
|
stitchingOfflineItem.setIsQa(true);
|
||||||
|
stitchingOfflineItem.setQaStatus(qaStatus);
|
||||||
|
updatedStitchedItems.add(stitchingOfflineItem);
|
||||||
// if FI is already created
|
// if FI is already created
|
||||||
} else {
|
} else {
|
||||||
// create OUT from stitching account Finished Item
|
// create OUT from stitching account Finished Item
|
||||||
|
@ -523,19 +530,33 @@ public class InventoryService {
|
||||||
if (lastInvTransaction != null) {
|
if (lastInvTransaction != null) {
|
||||||
// OUT
|
// OUT
|
||||||
long fromAccount = lastInvTransaction.getAccountId();
|
long fromAccount = lastInvTransaction.getAccountId();
|
||||||
createInventoryTransactionLeg( transaction, stitchingOfflineItem, fromAccount, InventoryTransactionLeg.Type.OUT.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
createInventoryTransactionLeg(transaction, preCreatedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
||||||
}
|
}
|
||||||
|
stitchingOfflineItem.setIsQa(true);
|
||||||
|
preCreatedItem.setIsQa(true);
|
||||||
|
finishedItemsForUlter.add(preCreatedItem);
|
||||||
// create IN in finishing Account Finished Item
|
// create IN in finishing Account Finished Item
|
||||||
finishedItems.add(preCreatedItem);
|
finishedItems.add(preCreatedItem);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
FinishedItem preCreatedItem = finishedItemDAO.findByStitchedItem(stitchingOfflineItem.getId());
|
||||||
|
if (preCreatedItem != null) {
|
||||||
|
preCreatedItem.setIsQa(false);
|
||||||
|
finishedItemsForUlter.add(preCreatedItem);
|
||||||
}
|
}
|
||||||
|
stitchingOfflineItem.setIsQa(false);
|
||||||
|
}
|
||||||
|
stitchingOfflineItem.setQaStatus(qaStatus);
|
||||||
|
stitchingOfflineItem.setQcDoneAt(LocalDateTime.now());
|
||||||
|
updatedStitchedItems.add(stitchingOfflineItem);
|
||||||
}
|
}
|
||||||
for (FinishedItem finishedItem : finishedItems) {
|
for (FinishedItem finishedItem : finishedItems) {
|
||||||
// IN
|
// IN
|
||||||
createInventoryTransactionLeg(transaction, finishedItem, wrapper.getFinishedAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
createInventoryTransactionLeg(transaction, finishedItem, wrapper.getFinishedAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
||||||
}
|
}
|
||||||
// save updated stitched items
|
// save updated stitched items
|
||||||
stitchingOfflineItemDAO.saveAll( wrapper.getItems( ));
|
finishedItemDAO.saveAll(finishedItemsForUlter);
|
||||||
|
stitchingOfflineItemDAO.saveAll(updatedStitchedItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +565,7 @@ public class InventoryService {
|
||||||
* segregate finish items
|
* segregate finish items
|
||||||
* */
|
* */
|
||||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
|
||||||
public void segregateFinishedItems( FinishedItemWrapper wrapper) {
|
public void segregateFinishedItems(FinishedItemWrapper wrapper, String status) {
|
||||||
if (wrapper != null && wrapper.getItems() != null) {
|
if (wrapper != null && wrapper.getItems() != null) {
|
||||||
|
|
||||||
List<FinishedItem> items = wrapper.getItems();
|
List<FinishedItem> items = wrapper.getItems();
|
||||||
|
@ -571,19 +592,16 @@ public class InventoryService {
|
||||||
// create transaction
|
// create transaction
|
||||||
InventoryTransaction transaction = createInventoryTransaction("Against Segregation of Finished Items");
|
InventoryTransaction transaction = createInventoryTransaction("Against Segregation of Finished Items");
|
||||||
|
|
||||||
|
|
||||||
// create IN and OUT for all approved items
|
// create IN and OUT for all approved items
|
||||||
for (FinishedItem finishedItem : items) {
|
for (FinishedItem finishedItem : items) {
|
||||||
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault(finishedItem.getId(), null);
|
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault(finishedItem.getId(), null);
|
||||||
finishedItem.setIsQa(true);
|
finishedItem.setIsQa(true);
|
||||||
/*
|
finishedItem.setOperationDate(LocalDateTime.now());
|
||||||
* item is not approved and washed is selected then item remain in Finishing account
|
|
||||||
* */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* item is approved and alter is selected then finished item will to stitching account
|
* item is approved and alter is selected then finished item will to stitching account
|
||||||
* */
|
* */
|
||||||
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "ALTER")) {
|
if (status.equalsIgnoreCase("ALTER")) {
|
||||||
// create OUT and IN transactions for FI
|
// create OUT and IN transactions for FI
|
||||||
if (lastInvTransaction != null) {
|
if (lastInvTransaction != null) {
|
||||||
// OUT
|
// OUT
|
||||||
|
@ -594,27 +612,154 @@ public class InventoryService {
|
||||||
long stitchedItemId = finishedItem.getStitchedItemId();
|
long stitchedItemId = finishedItem.getStitchedItemId();
|
||||||
InventoryTransactionLeg lastOutTransaction = lastStitchedItemOutTransactionMap.getOrDefault(stitchedItemId, null);
|
InventoryTransactionLeg lastOutTransaction = lastStitchedItemOutTransactionMap.getOrDefault(stitchedItemId, null);
|
||||||
createInventoryTransactionLeg(transaction, finishedItem, lastOutTransaction.getAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
createInventoryTransactionLeg(transaction, finishedItem, lastOutTransaction.getAccountId(), InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
||||||
|
finishedItem.setQaStatus("ALTER");
|
||||||
|
finishedItem.setIsSegregated(false);
|
||||||
|
finishedItem.setIsQa(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* item is not approved and washed is selected then item remain in Finishing account
|
||||||
|
* */
|
||||||
|
if (status.equalsIgnoreCase("WASHED")) {
|
||||||
|
finishedItem.setIsSegregated(false);
|
||||||
|
finishedItem.setQaStatus("WASHED");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* item is not approved and B grade is selected then item remain in Finishing account because after
|
||||||
|
* alteration item will be moved to A grade account for segregation
|
||||||
|
* */
|
||||||
|
if (status.equalsIgnoreCase("B GRADE")) {
|
||||||
|
finishedItem.setIsSegregated(false);
|
||||||
|
finishedItem.setQaStatus("B GRADE");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* item is not approved and C grade is selected then item remain in Finishing account because after
|
||||||
|
* alteration item will be moved to A grade account for segregation
|
||||||
|
* */
|
||||||
|
if (status.equalsIgnoreCase("REJECT")) {
|
||||||
|
finishedItem.setIsSegregated(false);
|
||||||
|
finishedItem.setQaStatus("REJECT");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* item is approved and grade is selected then fI is move to grade account
|
* item is approved and grade is selected then fI is move to grade account
|
||||||
*/
|
*/
|
||||||
if ( finishedItem.getQaStatus( ).equalsIgnoreCase( "APPROVED") && finishedItem.getAccountId( ) != 0) {
|
if (status.equalsIgnoreCase("APPROVED")) {
|
||||||
// create OUT and IN transactions for FI
|
finishedItem.setQaStatus("APPROVED");
|
||||||
if ( lastInvTransaction != null) {
|
|
||||||
// OUT
|
|
||||||
long fromAccount = lastInvTransaction.getAccountId( );
|
|
||||||
createInventoryTransactionLeg( transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
|
||||||
// IN
|
|
||||||
createInventoryTransactionLeg( transaction, finishedItem, finishedItem.getAccountId( ), InventoryTransactionLeg.Type.IN.name( ), InventoryArtifactType.FINISHED_ITEM.name( ));
|
|
||||||
}
|
|
||||||
finishedItem.setIsSegregated(true);
|
finishedItem.setIsSegregated(true);
|
||||||
}
|
}
|
||||||
updatedItems.add(finishedItem);
|
updatedItems.add(finishedItem);
|
||||||
}
|
}
|
||||||
finishedItemDAO.saveAll( updatedItems);
|
|
||||||
// save finish items
|
// save finish items
|
||||||
|
finishedItemDAO.saveAll(updatedItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Packaging items
|
||||||
|
* */
|
||||||
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
|
||||||
|
public void createPackagingItemAndTransaction(FinishedItemWrapper wrapper, long accountId) {
|
||||||
|
if (wrapper != null && wrapper.getItems() != null) {
|
||||||
|
|
||||||
|
List<FinishedItem> items = wrapper.getItems();
|
||||||
|
List<FinishedItem> updatedItems = new ArrayList<>();
|
||||||
|
List<PackagingItems> packagingItems = new ArrayList<>();
|
||||||
|
// finished ids
|
||||||
|
List<Long> finishedItemIds = items.stream().map(FinishedItem::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// find parent doc type last IN transaction map
|
||||||
|
Map<Long, InventoryTransactionLeg> lastFinishedItemIdInTransactionMap = inventoryTransactionLegDAO
|
||||||
|
.findLastTransactionByParentIdAndParentType(InventoryTransactionLeg.Type.IN.name(), finishedItemIds, InventoryArtifactType.FINISHED_ITEM.name())
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(InventoryTransactionLeg::getParentDocumentId, Function.identity()));
|
||||||
|
|
||||||
|
// create transaction
|
||||||
|
InventoryTransaction transaction = createInventoryTransaction("Against Segregation of Finished Items");
|
||||||
|
|
||||||
|
|
||||||
|
// create IN and OUT for all approved items
|
||||||
|
for (FinishedItem finishedItem : items) {
|
||||||
|
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault(finishedItem.getId(), null);
|
||||||
|
finishedItem.setIsQa(true);
|
||||||
|
|
||||||
|
if (finishedItem.getQaStatus().equalsIgnoreCase("APPROVED") && finishedItem.getIsSegregated()) {
|
||||||
|
// create OUT and IN transactions for FI
|
||||||
|
PackagingItems packagingItems1 = (createPackagingItem(finishedItem));
|
||||||
|
packagingItems1.setId(packagingItemsDAO.save(packagingItems1));
|
||||||
|
if (lastInvTransaction != null) {
|
||||||
|
// OUT
|
||||||
|
long fromAccount = lastInvTransaction.getAccountId();
|
||||||
|
packagingItems1.setAccountId(fromAccount);
|
||||||
|
createInventoryTransactionLeg(transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
||||||
|
// IN
|
||||||
|
createInventoryTransactionLeg(transaction, packagingItems1, accountId, InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.PACKAGING.name());
|
||||||
|
}
|
||||||
|
finishedItem.setIsSegregated(true);
|
||||||
|
finishedItem.setPackaging(true);
|
||||||
|
packagingItems.add(packagingItems1);
|
||||||
|
}
|
||||||
|
updatedItems.add(finishedItem);
|
||||||
|
}
|
||||||
|
// save finish items
|
||||||
|
finishedItemDAO.saveAll(updatedItems);
|
||||||
|
packagingItemsDAO.saveAll(packagingItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* store items
|
||||||
|
* */
|
||||||
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.NESTED)
|
||||||
|
public void createStoreItemAndTransaction(FinishedItemWrapper wrapper, long toAccount) {
|
||||||
|
if (wrapper != null && wrapper.getItems() != null) {
|
||||||
|
|
||||||
|
List<FinishedItem> items = wrapper.getItems();
|
||||||
|
List<FinishedItem> updatedItems = new ArrayList<>();
|
||||||
|
List<StoreItem> storeItems = new ArrayList<>();
|
||||||
|
// finished ids
|
||||||
|
List<Long> finishedItemIds = items.stream().map(FinishedItem::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// find parent doc type last IN transaction map
|
||||||
|
Map<Long, InventoryTransactionLeg> lastFinishedItemIdInTransactionMap = inventoryTransactionLegDAO
|
||||||
|
.findLastTransactionByParentIdAndParentType(InventoryTransactionLeg.Type.IN.name(), finishedItemIds, InventoryArtifactType.FINISHED_ITEM.name())
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(InventoryTransactionLeg::getParentDocumentId, Function.identity()));
|
||||||
|
|
||||||
|
// create transaction
|
||||||
|
InventoryTransaction transaction = createInventoryTransaction("Against Segregation of Finished Items");
|
||||||
|
|
||||||
|
// create IN and OUT for all approved items
|
||||||
|
for (FinishedItem finishedItem : items) {
|
||||||
|
InventoryTransactionLeg lastInvTransaction = lastFinishedItemIdInTransactionMap.getOrDefault(finishedItem.getId(), null);
|
||||||
|
finishedItem.setIsQa(true);
|
||||||
|
|
||||||
|
if (finishedItem.getQaStatus().equalsIgnoreCase("REJECT")) {
|
||||||
|
// create OUT and IN transactions for FI
|
||||||
|
StoreItem storeItem = (createStoreItems(finishedItem, wrapper.getRejectReason()));
|
||||||
|
storeItem.setId(storeItemDao.save(storeItem));
|
||||||
|
if (lastInvTransaction != null) {
|
||||||
|
// OUT
|
||||||
|
long fromAccount = lastInvTransaction.getAccountId();
|
||||||
|
storeItem.setAccountId(fromAccount);
|
||||||
|
createInventoryTransactionLeg(transaction, finishedItem, fromAccount, InventoryTransactionLeg.Type.OUT.name(), InventoryArtifactType.FINISHED_ITEM.name());
|
||||||
|
// IN
|
||||||
|
createInventoryTransactionLeg(transaction, storeItem, toAccount, InventoryTransactionLeg.Type.IN.name(), InventoryArtifactType.STORED_ITEM.name());
|
||||||
|
}
|
||||||
|
finishedItem.setIsSegregated(true);
|
||||||
|
finishedItem.setStore(true);
|
||||||
|
storeItems.add(storeItem);
|
||||||
|
}
|
||||||
|
updatedItems.add(finishedItem);
|
||||||
|
}
|
||||||
|
// save finish items
|
||||||
|
finishedItemDAO.saveAll(updatedItems);
|
||||||
|
storeItemDao.saveAll(storeItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,4 +769,37 @@ public class InventoryService {
|
||||||
public List<InventorySummary> findItemSummaryByAccountId(long accountId) {
|
public List<InventorySummary> findItemSummaryByAccountId(long accountId) {
|
||||||
return inventoryTransactionLegDAO.findSummaryByAccountId(accountId);
|
return inventoryTransactionLegDAO.findSummaryByAccountId(accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PackagingItems createPackagingItem(FinishedItem finishedItem) {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
PackagingItems packagingItems = new PackagingItems();
|
||||||
|
packagingItems.setItemId(finishedItem.getItemId());
|
||||||
|
packagingItems.setAccountId(finishedItem.getAccountId());
|
||||||
|
packagingItems.setFinishedItemId(finishedItem.getId());
|
||||||
|
packagingItems.setJobCardId(finishedItem.getJobCardId());
|
||||||
|
packagingItems.setJobCard(finishedItem.getJobCard());
|
||||||
|
packagingItems.setSku(finishedItem.getSku());
|
||||||
|
packagingItems.setBarcode(finishedItem.getBarcode());
|
||||||
|
packagingItems.setCreatedAt(LocalDateTime.now());
|
||||||
|
packagingItems.setCreatedBy(authentication.getName());
|
||||||
|
packagingItems.setIsQa(finishedItem.getIsQa());
|
||||||
|
packagingItems.setIsSegregated(finishedItem.getIsSegregated());
|
||||||
|
packagingItems.setQaStatus(finishedItem.getQaStatus());
|
||||||
|
return packagingItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StoreItem createStoreItems(FinishedItem finishedItem, String reason) {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
StoreItem storeItem = new StoreItem();
|
||||||
|
storeItem.setItemId(finishedItem.getItemId());
|
||||||
|
storeItem.setAccountId(finishedItem.getAccountId());
|
||||||
|
storeItem.setFinishedItemId(finishedItem.getId());
|
||||||
|
storeItem.setJobCardId(finishedItem.getJobCardId());
|
||||||
|
storeItem.setSku(finishedItem.getSku());
|
||||||
|
storeItem.setBarcode(finishedItem.getBarcode());
|
||||||
|
storeItem.setCreatedAt(LocalDateTime.now());
|
||||||
|
storeItem.setCreatedBy(authentication.getName());
|
||||||
|
storeItem.setRejectedReason(reason);
|
||||||
|
return storeItem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.JobCardItemDAO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JobCardItemService {
|
||||||
|
|
||||||
|
private final JobCardItemDAO jobCardItemDAO;
|
||||||
|
|
||||||
|
public JobCardItemService(JobCardItemDAO jobCardItemDAO) {
|
||||||
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllSizesOFItems() {
|
||||||
|
return jobCardItemDAO.getAllSize();
|
||||||
|
}
|
||||||
|
public List<String> getAllColorOFItems() {
|
||||||
|
return jobCardItemDAO.getAllColor();
|
||||||
|
}
|
||||||
|
}
|
|
@ -78,6 +78,13 @@ public class JobCardService {
|
||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search by code and po id
|
||||||
|
* */
|
||||||
|
public List<JobCard> searchJobCardsByTermAndPoId( String term, long id ){
|
||||||
|
return jobCardDAO.findLikeCodeAndPoID( term, id );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get cards
|
* get cards
|
||||||
|
@ -149,20 +156,7 @@ public class JobCardService {
|
||||||
for (JobCardItem item : jobCard.getItems()) {
|
for (JobCardItem item : jobCard.getItems()) {
|
||||||
item.setJobCardId(jobCardId);
|
item.setJobCardId(jobCardId);
|
||||||
long itemId = jobCardItemDAO.save(item);
|
long itemId = jobCardItemDAO.save(item);
|
||||||
for (CutPiece cutPiece : item.getCutPieces()) {
|
|
||||||
cutPiece.setJobCardItemId(itemId);
|
|
||||||
if (!skuCutPiecesDAO.doesExist(cutPiece.getType(), item.getSku())){
|
|
||||||
SkuCutPieces skuCutPieces = new SkuCutPieces();
|
|
||||||
skuCutPieces.setType(cutPiece.getType());
|
|
||||||
skuCutPieces.setSku(item.getSku());
|
|
||||||
//save cut-piece for sku next time fetch
|
|
||||||
skuCutPiecesDAO.save(skuCutPieces);
|
|
||||||
}
|
}
|
||||||
cutPieces.add(cutPiece);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// save all pieces
|
|
||||||
cutPieceDAO.saveAll(cutPieces);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.PackagingItemsDAO;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PackagingService {
|
||||||
|
|
||||||
|
private final InventoryService inventoryService;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
|
public PackagingService(InventoryService inventoryService, PackagingItemsDAO packagingItemsDAO) {
|
||||||
|
this.inventoryService = inventoryService;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createPackagingItem(FinishedItemWrapper wrapper){
|
||||||
|
inventoryService.createPackagingItemAndTransaction(wrapper, wrapper.getAccountId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.JobCardDAO;
|
||||||
|
import com.utopiaindustries.dao.ctp.PurchaseOrderCTPDao;
|
||||||
|
import com.utopiaindustries.dao.ctp.StoreItemDao;
|
||||||
|
import com.utopiaindustries.model.ctp.*;
|
||||||
|
import com.utopiaindustries.model.uind.PurchaseOrder;
|
||||||
|
import com.utopiaindustries.querybuilder.ctp.JobCardQueryBuilder;
|
||||||
|
import com.utopiaindustries.querybuilder.ctp.PurchaseOrderCTPQueryBuilder;
|
||||||
|
import com.utopiaindustries.util.StringUtils;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PurchaseOrderCTPService {
|
||||||
|
|
||||||
|
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
|
||||||
|
private final JobCardDAO jobCardDAO;
|
||||||
|
private final StoreItemDao storeItemDao;
|
||||||
|
|
||||||
|
public PurchaseOrderCTPService(PurchaseOrderCTPDao purchaseOrderCTPDao, JobCardDAO jobCardDAO, StoreItemDao storeItemDao) {
|
||||||
|
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
|
||||||
|
this.jobCardDAO = jobCardDAO;
|
||||||
|
this.storeItemDao = storeItemDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search by id
|
||||||
|
* */
|
||||||
|
public PurchaseOrderCTP searchPurchaseOrderById(long id){
|
||||||
|
return purchaseOrderCTPDao.find(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* create new purchase
|
||||||
|
* */
|
||||||
|
public PurchaseOrderCTP createNewPurchaseOrderCTP() {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
PurchaseOrderCTP purchaseOrderCTP = new PurchaseOrderCTP();
|
||||||
|
purchaseOrderCTP.setCreatedBy( authentication.getName() );
|
||||||
|
purchaseOrderCTP.setCreatedAt( LocalDateTime.now() );
|
||||||
|
return purchaseOrderCTP;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* save purchase order for ctp
|
||||||
|
* */
|
||||||
|
@Transactional( rollbackFor = Exception.class )
|
||||||
|
public void save(PurchaseOrderCTP purchaseOrderCTP) {
|
||||||
|
purchaseOrderCTPDao.save(purchaseOrderCTP);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> getAllPurchaseOrderCtp(String purchaseOrderCode, String articleName, String startDate, String endDate, Long limit) {
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
List<PurchaseOrderCTP> list = new ArrayList<>();
|
||||||
|
String createdBy = authentication.getName();
|
||||||
|
if( limit == null ){
|
||||||
|
limit = 100L;
|
||||||
|
}
|
||||||
|
if(StringUtils.isAnyNotNullOrEmpty(purchaseOrderCode, articleName,startDate,endDate) ){
|
||||||
|
for (GrantedAuthority role : authentication.getAuthorities()){
|
||||||
|
if (role.toString().equals("ROLE_ADMIN")){
|
||||||
|
createdBy = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String query = PurchaseOrderCTPQueryBuilder.buildQuery(purchaseOrderCode, articleName, createdBy, startDate, endDate, limit );
|
||||||
|
System.out.println( query );
|
||||||
|
list = purchaseOrderCTPDao.findByQuery( query );
|
||||||
|
}else {
|
||||||
|
list = purchaseOrderCTPDao.findByUserAndLimit( authentication.getName(), limit );
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PurchaseOrderCTP> findByTerm(String term ){
|
||||||
|
return purchaseOrderCTPDao.findByTerm( term );
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,Integer> getStoreItemsByPoId(Long poId){
|
||||||
|
Map<String,Integer> totalItems = new HashMap<>();
|
||||||
|
List<JobCard> jobCards = jobCardDAO.findByPoId(poId);
|
||||||
|
List<Long> jobCardIds = jobCards.stream()
|
||||||
|
.map(JobCard::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if(!jobCardIds.isEmpty()){
|
||||||
|
return storeItemDao.totalCountByJobCardIdsAndGroupByRejectReason(jobCardIds);
|
||||||
|
}else {
|
||||||
|
return totalItems;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,21 +1,69 @@
|
||||||
package com.utopiaindustries.service;
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.StoreItemDao;
|
||||||
import com.utopiaindustries.dao.uind.PurchaseOrderDAO;
|
import com.utopiaindustries.dao.uind.PurchaseOrderDAO;
|
||||||
|
import com.utopiaindustries.model.ctp.JobCardItem;
|
||||||
|
import com.utopiaindustries.model.ctp.POsDetails;
|
||||||
import com.utopiaindustries.model.uind.PurchaseOrder;
|
import com.utopiaindustries.model.uind.PurchaseOrder;
|
||||||
|
import com.utopiaindustries.util.HTMLBuilder;
|
||||||
|
import com.utopiaindustries.util.PDFResponseEntityInputStreamResource;
|
||||||
|
import com.utopiaindustries.util.URLUtils;
|
||||||
|
import org.springframework.core.io.InputStreamResource;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PurchaseOrderService {
|
public class PurchaseOrderService {
|
||||||
|
|
||||||
private final PurchaseOrderDAO purchaseOrderDAO;
|
private final PurchaseOrderDAO purchaseOrderDAO;
|
||||||
|
private final PurchaseOrderCTPService purchaseOrderCTPService;
|
||||||
|
private final HTMLBuilder htmlBuilder;
|
||||||
|
private final PDFResponseEntityInputStreamResource pdfGenerator;
|
||||||
|
private final ReportingService reportingService;
|
||||||
|
|
||||||
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO) {
|
public PurchaseOrderService(PurchaseOrderDAO purchaseOrderDAO, PurchaseOrderCTPService purchaseOrderCTPService, HTMLBuilder htmlBuilder, PDFResponseEntityInputStreamResource pdfGenerator, ReportingService reportingService) {
|
||||||
this.purchaseOrderDAO = purchaseOrderDAO;
|
this.purchaseOrderDAO = purchaseOrderDAO;
|
||||||
|
this.purchaseOrderCTPService = purchaseOrderCTPService;
|
||||||
|
this.htmlBuilder = htmlBuilder;
|
||||||
|
this.pdfGenerator = pdfGenerator;
|
||||||
|
this.reportingService = reportingService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PurchaseOrder> findByTerm( String term ){
|
public List<PurchaseOrder> findByTerm( String term ){
|
||||||
return purchaseOrderDAO.findByTerm( term );
|
return purchaseOrderDAO.findByTerm( term );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print po pdf *
|
||||||
|
* **/
|
||||||
|
public ResponseEntity<InputStreamResource> generatePOPdf(POsDetails pOsDetails, Model model, boolean includeItemsDetail, boolean storeDetail, String size, String color ) throws Exception {
|
||||||
|
Map<String,Integer> storeItems = purchaseOrderCTPService.getStoreItemsByPoId(pOsDetails.getPoId());
|
||||||
|
model.addAttribute("poDetail", pOsDetails);
|
||||||
|
model.addAttribute( "baseUrl", URLUtils.getCurrentBaseUrl() );
|
||||||
|
|
||||||
|
model.addAttribute("date", LocalDateTime.now());
|
||||||
|
if (includeItemsDetail){
|
||||||
|
model.addAttribute("showItems", true);
|
||||||
|
model.addAttribute("poItems", reportingService.getPoItemsSizeOrColor(pOsDetails.getPoId(), size, color));
|
||||||
|
}else {
|
||||||
|
model.addAttribute("showItems", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (storeDetail && !storeItems.isEmpty()){
|
||||||
|
model.addAttribute("showStore", true);
|
||||||
|
model.addAttribute("store", storeItems);
|
||||||
|
}else {
|
||||||
|
model.addAttribute("showStore", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
String htmlStr = htmlBuilder.buildHTML( "po-status-pdf", model );
|
||||||
|
return pdfGenerator.generatePdf( htmlStr, "Po-status", "inline" );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,29 +22,27 @@ import java.util.stream.Collectors;
|
||||||
public class ReportingService {
|
public class ReportingService {
|
||||||
|
|
||||||
private final JobCardItemDAO jobCardItemDAO;
|
private final JobCardItemDAO jobCardItemDAO;
|
||||||
private final ProcessDAO processDAO;
|
|
||||||
private final BundleDAO bundleDAO;
|
private final BundleDAO bundleDAO;
|
||||||
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
|
private final InventoryTransactionLegDAO inventoryTransactionLegDAO;
|
||||||
private final InventoryTransactionDAO inventoryTransactionDAO;
|
|
||||||
private final JobCardDAO jobCardDAO;
|
private final JobCardDAO jobCardDAO;
|
||||||
private final CryptographyService cryptographyService;
|
|
||||||
private final MasterBundleDAO masterBundleDAO;
|
|
||||||
private final FinishedItemDAO finishedItemDAO;
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
private final StitchingOfflineItemDAO stitchingOfflineItemDAO;
|
||||||
private final InventoryAccountDAO inventoryAccountDAO;
|
private final InventoryAccountDAO inventoryAccountDAO;
|
||||||
|
private final PurchaseOrderCTPDao purchaseOrderCTPDao;
|
||||||
|
private final StoreItemDao storeItemDao;
|
||||||
|
private final PackagingItemsDAO packagingItemsDAO;
|
||||||
|
|
||||||
public ReportingService( JobCardItemDAO jobCardItemDAO, ProcessDAO processDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, InventoryTransactionDAO inventoryTransactionDAO, JobCardDAO jobCardDAO, CryptographyService cryptographyService, MasterBundleDAO masterBundleDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO) {
|
public ReportingService(JobCardItemDAO jobCardItemDAO, BundleDAO bundleDAO, InventoryTransactionLegDAO inventoryTransactionLegDAO, JobCardDAO jobCardDAO, FinishedItemDAO finishedItemDAO, StitchingOfflineItemDAO stitchingOfflineItemDAO, InventoryAccountDAO inventoryAccountDAO, PurchaseOrderCTPDao purchaseOrderCTPDao, StoreItemDao storeItemDao, PackagingItemsDAO packagingItemsDAO) {
|
||||||
this.jobCardItemDAO = jobCardItemDAO;
|
this.jobCardItemDAO = jobCardItemDAO;
|
||||||
this.processDAO = processDAO;
|
|
||||||
this.bundleDAO = bundleDAO;
|
this.bundleDAO = bundleDAO;
|
||||||
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
|
this.inventoryTransactionLegDAO = inventoryTransactionLegDAO;
|
||||||
this.inventoryTransactionDAO = inventoryTransactionDAO;
|
|
||||||
this.jobCardDAO = jobCardDAO;
|
this.jobCardDAO = jobCardDAO;
|
||||||
this.cryptographyService = cryptographyService;
|
|
||||||
this.masterBundleDAO = masterBundleDAO;
|
|
||||||
this.finishedItemDAO = finishedItemDAO;
|
this.finishedItemDAO = finishedItemDAO;
|
||||||
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
this.stitchingOfflineItemDAO = stitchingOfflineItemDAO;
|
||||||
this.inventoryAccountDAO = inventoryAccountDAO;
|
this.inventoryAccountDAO = inventoryAccountDAO;
|
||||||
|
this.purchaseOrderCTPDao = purchaseOrderCTPDao;
|
||||||
|
this.storeItemDao = storeItemDao;
|
||||||
|
this.packagingItemsDAO = packagingItemsDAO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Integer> getJobCardProgress(String jobCardID) {
|
public Map<String, Integer> getJobCardProgress(String jobCardID) {
|
||||||
|
@ -211,20 +209,27 @@ public class ReportingService {
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}else {
|
}else {
|
||||||
HashMap<String,Integer> gradingItems = new HashMap<>();
|
HashMap<String,Integer> gradingItems = new HashMap<>();
|
||||||
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
|
|
||||||
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
|
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(Long.parseLong(jobCardID));
|
||||||
List<Long> finishItemsIds = finishedItems.stream()
|
|
||||||
.map(FinishedItem::getId).collect(Collectors.toList());
|
List<FinishedItem> bGradeFinishItemsIds= finishedItems.stream()
|
||||||
if (finishItemsIds.isEmpty()){
|
.filter(item -> "REJECT".equals(item.getQaStatus())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<FinishedItem> cGradeFinishItemsIds= finishedItems.stream()
|
||||||
|
.filter(item -> "C GRADE".equals(item.getQaStatus())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<FinishedItem> aGradeFinishItemsIds= finishedItems.stream()
|
||||||
|
.filter(item -> "APPROVED".equals(item.getQaStatus())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
if (finishedItems.isEmpty()){
|
||||||
gradingItems.put("A GRADE",0);
|
gradingItems.put("A GRADE",0);
|
||||||
gradingItems.put("B GRADE",0);
|
gradingItems.put("B GRADE",0);
|
||||||
gradingItems.put("C GRADE",0);
|
gradingItems.put("C GRADE",0);
|
||||||
return gradingItems;
|
return gradingItems;
|
||||||
}else {
|
}else {
|
||||||
for (InventoryAccount inventoryAccount : inventoryAccounts){
|
gradingItems.put("B GRADE",bGradeFinishItemsIds.size());
|
||||||
long totalGradingItems = inventoryTransactionLegDAO.CalculateTotalGradingItems(finishItemsIds,(int) inventoryAccount.getId());
|
gradingItems.put("C GRADE",cGradeFinishItemsIds.size());
|
||||||
gradingItems.put(inventoryAccount.getTitle(), (int) totalGradingItems);
|
gradingItems.put("A GRADE",aGradeFinishItemsIds.size());
|
||||||
}
|
|
||||||
return gradingItems;
|
return gradingItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,9 +277,6 @@ public class ReportingService {
|
||||||
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
BigDecimal expectedProduction = jobCardItems.stream()
|
|
||||||
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
if(actualProduction.compareTo(totalProduction) == 0) {
|
if(actualProduction.compareTo(totalProduction) == 0) {
|
||||||
phasePending.put("Stitching Total Time", null);
|
phasePending.put("Stitching Total Time", null);
|
||||||
}else {
|
}else {
|
||||||
|
@ -371,10 +373,7 @@ public class ReportingService {
|
||||||
if (jobCardID == null) {
|
if (jobCardID == null) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(Long.parseLong(jobCardID));
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS",6L);
|
||||||
BigDecimal actualProduction = jobCardItems.stream()
|
|
||||||
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
|
|
||||||
LocalDateTime startDate = jobCardDAO.find(Long.parseLong(jobCardID)).getCreatedAt();
|
LocalDateTime startDate = jobCardDAO.find(Long.parseLong(jobCardID)).getCreatedAt();
|
||||||
HashMap<String, List<?>> barChartData = new HashMap<>();
|
HashMap<String, List<?>> barChartData = new HashMap<>();
|
||||||
|
@ -422,14 +421,9 @@ public class ReportingService {
|
||||||
stitchingList.set(index, stitchingList.get(index) + leg.getQuantity().intValue());
|
stitchingList.set(index, stitchingList.get(index) + leg.getQuantity().intValue());
|
||||||
}
|
}
|
||||||
else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(7) || leg.getAccountId().equals(12))) {
|
else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(7) || leg.getAccountId().equals(12))) {
|
||||||
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
|
|
||||||
qualityList.set(index, 0);
|
|
||||||
}
|
|
||||||
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
|
qualityList.set(index, qualityList.get(index) + leg.getQuantity().intValue());
|
||||||
}else if ("FINISHED_ITEM".equals(leg.getParentDocumentType()) && (leg.getAccountId().equals(8) || leg.getAccountId().equals(9) || leg.getAccountId().equals(10))) {
|
|
||||||
if (index == 0 || !dateIndexMap.containsKey(dateKey)) {
|
|
||||||
finishItems.set(index, 0);
|
|
||||||
}
|
}
|
||||||
|
else if ("PACKAGING".equals(leg.getParentDocumentType()) && inventoryAccounts.stream().anyMatch(e -> e.getId() == leg.getAccountId().longValue())) {
|
||||||
finishItems.set(index, finishItems.get(index) + leg.getQuantity().intValue());
|
finishItems.set(index, finishItems.get(index) + leg.getQuantity().intValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -443,95 +437,118 @@ public class ReportingService {
|
||||||
return barChartData;
|
return barChartData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<POsDetails> getAllPOs(String poName) {
|
/*
|
||||||
|
* find all po for po-online-status
|
||||||
|
* */
|
||||||
|
public List<POsDetails> getAllPOs(String poCode, String size, String color, Long count) {
|
||||||
|
|
||||||
List<POsDetails> pOsDetailsList = new ArrayList<>();
|
List<POsDetails> pOsDetailsList = new ArrayList<>();
|
||||||
List<JobCard> jobCards = jobCardDAO.findAll() ;
|
List<PurchaseOrderCTP> purchaseOrderCTPList;
|
||||||
HashMap<String, List<JobCard>> filterJobCardsByPos;
|
|
||||||
if(poName != null && !poName.isEmpty()) {
|
if (poCode != null && !poCode.isEmpty()) {
|
||||||
filterJobCardsByPos = jobCards.stream()
|
purchaseOrderCTPList = purchaseOrderCTPDao.findByPoCode(poCode, count);
|
||||||
.filter(jobCard -> jobCard.getPurchaseOrderId().equals(poName))
|
|
||||||
.collect(Collectors.groupingBy(
|
|
||||||
JobCard::getPurchaseOrderId,
|
|
||||||
HashMap::new,
|
|
||||||
Collectors.toList()
|
|
||||||
));
|
|
||||||
}else {
|
}else {
|
||||||
filterJobCardsByPos = jobCards.stream()
|
purchaseOrderCTPList = purchaseOrderCTPDao.findAll(count);
|
||||||
.collect(Collectors.groupingBy(
|
|
||||||
JobCard::getPurchaseOrderId,
|
|
||||||
HashMap::new,
|
|
||||||
Collectors.toList()
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,Integer> jobCardCompleteItems = new HashMap<>();
|
|
||||||
for (String pos : filterJobCardsByPos.keySet()) {
|
for (PurchaseOrderCTP pos : purchaseOrderCTPList) {
|
||||||
|
List<JobCard> jobCards = jobCardDAO.findByPoId(pos.getId());
|
||||||
BigDecimal totalProduction = BigDecimal.ZERO;
|
BigDecimal totalProduction = BigDecimal.ZERO;
|
||||||
|
BigDecimal expectedProduction = BigDecimal.ZERO;
|
||||||
BigDecimal actualProduction = BigDecimal.ZERO;
|
BigDecimal actualProduction = BigDecimal.ZERO;
|
||||||
int poQuantity = 0;
|
long stitchingIn = 0L;
|
||||||
String articleName = "";
|
long stitchingOut = 0L;
|
||||||
Long qaProgressItems = 0L;
|
long finishApprovedItem = 0L;
|
||||||
Long totalFinishItem = 0L;
|
long finishRejectItem = 0L;
|
||||||
|
long storeItems = 0L;
|
||||||
|
long packagingItems = 0L;
|
||||||
POsDetails pOsDetails = new POsDetails();
|
POsDetails pOsDetails = new POsDetails();
|
||||||
for (JobCard jobCard : filterJobCardsByPos.get(pos)) {
|
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCard.getId());
|
List<Long> jobCardIds = jobCards.stream()
|
||||||
totalProduction = totalProduction.add(jobCardItems.stream()
|
.map(JobCard::getId)
|
||||||
.map(item -> Optional.ofNullable(item.getTotalProduction()).orElse(BigDecimal.ZERO))
|
.collect(Collectors.toList());
|
||||||
|
List<JobCardItem> jobCardItems = new ArrayList<>();
|
||||||
|
if (!jobCardIds.isEmpty()) {
|
||||||
|
jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds,size, color);
|
||||||
|
}else {
|
||||||
|
jobCardItems = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
expectedProduction = expectedProduction.add(jobCardItems.stream()
|
||||||
|
.map(item -> Optional.ofNullable(item.getExpectedProduction()).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
|
||||||
actualProduction = actualProduction.add(jobCardItems.stream()
|
actualProduction = actualProduction.add(jobCardItems.stream()
|
||||||
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
.map(item -> Optional.ofNullable(item.getActualProduction()).orElse(BigDecimal.ZERO))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
poQuantity = jobCard.getPoQuantity();
|
if(!jobCardItems.isEmpty() || (StringUtils.isNullOrEmpty(size) || StringUtils.isNullOrEmpty(color))) {
|
||||||
articleName = jobCard.getArticleName();
|
for (JobCardItem jobCardItem : jobCardItems) {
|
||||||
qaProgressItems += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCard.getId())).orElse(0L);
|
|
||||||
totalFinishItem += Optional.ofNullable(finishedItemDAO.calculateTotalFinishItem(jobCard.getId())).orElse(0L);
|
//stitching detail
|
||||||
|
stitchingIn += Optional.of(stitchingOfflineItemDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
|
||||||
|
stitchingOut += Optional.ofNullable(stitchingOfflineItemDAO.CalculateTotalQA(jobCardItem.getJobCardId())).orElse(0L);
|
||||||
|
|
||||||
|
//finishItems detail
|
||||||
|
List<FinishedItem> finishedItems = finishedItemDAO.findByJobCardId(jobCardItem.getJobCardId());
|
||||||
|
finishApprovedItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("APPROVED")).count();
|
||||||
|
finishRejectItem += finishedItems.stream().filter(e -> e.getQaStatus().equals("REJECT")).count();
|
||||||
|
|
||||||
|
//reject store details
|
||||||
|
storeItems += Optional.ofNullable(storeItemDao.calculateTotalRejectItemByJobCardId(jobCardItem.getJobCardId())).orElse(0L);
|
||||||
|
|
||||||
|
//reject packaging details
|
||||||
|
packagingItems += Optional.of(packagingItemsDAO.findByJobCardId(jobCardItem.getJobCardId()).size()).orElse(0);
|
||||||
|
|
||||||
jobCardCompleteItems = getSegregateItems(String.valueOf(jobCard.getId()));
|
|
||||||
if (jobCardCompleteItems == null) {
|
|
||||||
jobCardCompleteItems = new HashMap<>();
|
|
||||||
}
|
}
|
||||||
}
|
pOsDetails.setPoId(pos.getId());
|
||||||
|
pOsDetails.setPoNumber(pos.getPurchaseOrderCode());
|
||||||
pOsDetails.setPoNumber(pos);
|
pOsDetails.setArticleTitle(pos.getArticleName());
|
||||||
pOsDetails.setArticleTitle(articleName);
|
pOsDetails.setPoQuantity(pos.getPurchaseOrderQuantity());
|
||||||
pOsDetails.setPoQuantity(poQuantity);
|
pOsDetails.setPoRequiredQuantity(pos.getPurchaseOrderQuantityRequired());
|
||||||
pOsDetails.setTotalCutting(actualProduction.intValue());
|
pOsDetails.setActualCutting(expectedProduction.longValue());
|
||||||
pOsDetails.setTotalStitching(totalProduction.intValue());
|
pOsDetails.setBalanceToCutting(pos.getPurchaseOrderQuantityRequired() - expectedProduction.longValue());
|
||||||
pOsDetails.setTotalEndLineQC(qaProgressItems.intValue());
|
pOsDetails.setCuttingReceived(expectedProduction.longValue());
|
||||||
pOsDetails.setTotalFinishing(totalFinishItem);
|
pOsDetails.setCuttingOki(expectedProduction.intValue());
|
||||||
|
pOsDetails.setCuttingReject(expectedProduction.subtract(expectedProduction).intValue());
|
||||||
pOsDetails.setRemainingCutting(poQuantity - actualProduction.intValue());
|
pOsDetails.setStitchingIn(stitchingIn);
|
||||||
pOsDetails.setRemainingStitching(poQuantity - totalProduction.intValue());
|
pOsDetails.setStitchingOut(stitchingOut);
|
||||||
pOsDetails.setRemainingEndLineQC(poQuantity - qaProgressItems);
|
pOsDetails.setStitchingWips(stitchingIn - stitchingOut);
|
||||||
pOsDetails.setRemainingFinishing(poQuantity - totalFinishItem);
|
pOsDetails.setFinishIn(stitchingOut);
|
||||||
|
pOsDetails.setFinishRej(finishRejectItem);
|
||||||
pOsDetails.setTotalAGradeItem(jobCardCompleteItems.getOrDefault("A GRADE", 0));
|
pOsDetails.setFinishQaApproved(finishApprovedItem);
|
||||||
pOsDetails.setTotalBGradeItem(jobCardCompleteItems.getOrDefault("B GRADE", 0));
|
pOsDetails.setStoreReceived(storeItems);
|
||||||
pOsDetails.setTotalCGradeItem(jobCardCompleteItems.getOrDefault("C GRADE", 0));
|
pOsDetails.setStoreWaiting(finishRejectItem - storeItems);
|
||||||
|
pOsDetails.setFinishQaApproved(finishApprovedItem);
|
||||||
|
pOsDetails.setPackagingIn(packagingItems);
|
||||||
|
pOsDetails.setPackagingOut(packagingItems);
|
||||||
|
pOsDetails.setPackagingStock(0);
|
||||||
|
pOsDetails.setShippedScan(packagingItems);
|
||||||
|
pOsDetails.setShippedNet(packagingItems);
|
||||||
|
pOsDetails.setPackagingStock(0);
|
||||||
|
pOsDetails.setPoStatus(pos.getPoStatus());
|
||||||
pOsDetailsList.add(pOsDetails);
|
pOsDetailsList.add(pOsDetails);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return pOsDetailsList;
|
return pOsDetailsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Map<String, Integer>> getAllPoJobCards(String PONumber, String selectDate) {
|
/*
|
||||||
|
* find all job cards of specific po
|
||||||
|
* */
|
||||||
|
public HashMap<String, Map<String, Integer>> getAllPoJobCards(long poId, String selectDate) {
|
||||||
String startDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 00:00:01": null;
|
String startDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 00:00:01": null;
|
||||||
String endDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 23:59:59": null;
|
String endDate = selectDate != null && !selectDate.isEmpty() ? selectDate + " 23:59:59": null;
|
||||||
|
|
||||||
HashMap<String, Map<String, Integer>> poJobCardItemsProgress = new HashMap<>();
|
HashMap<String, Map<String, Integer>> poJobCardItemsProgress = new HashMap<>();
|
||||||
List<JobCard> jobCards = jobCardDAO.findAll();
|
|
||||||
// Filter JobCards by Purchase Order ID
|
// Filter JobCards by Purchase Order ID
|
||||||
List<JobCard> filterJobCardsByPos = jobCards.stream()
|
List<JobCard> filterJobCardsByPos = jobCardDAO.findByPoId(poId);
|
||||||
.filter(e -> e.getPurchaseOrderId().equals(PONumber))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.getPackagingAccounts();
|
||||||
List<Integer> gradingAccounts = inventoryAccounts.stream().map(e-> (int)(e.getId())).collect(Collectors.toList());
|
List<Integer> gradingAccounts = inventoryAccounts.stream().map(e-> (int)(e.getId())).collect(Collectors.toList());
|
||||||
for (JobCard jobCard : filterJobCardsByPos) {
|
for (JobCard jobCard : filterJobCardsByPos) {
|
||||||
List<Bundle> bundles = bundleDAO.findByCardIdAndDATE(jobCard.getId(),startDate,endDate);
|
List<Bundle> bundles = bundleDAO.findByCardIdAndDATE(jobCard.getId(),startDate,endDate);
|
||||||
List<StitchingOfflineItem> stitchingOfflineItems = stitchingOfflineItemDAO.findByJobCardIdAndDate(jobCard.getId(),startDate,endDate);
|
List<StitchingOfflineItem> stitchingOfflineItems = stitchingOfflineItemDAO.findByJobCardIdAndDate(jobCard.getId(),startDate,endDate);
|
||||||
List<FinishedItem> finishedItems = finishedItemDAO.calculateTotalFinishItem(jobCard.getId(),startDate,endDate);
|
List<FinishedItem> finishedItems = finishedItemDAO.calculateTotalFinishItem(jobCard.getId(),startDate,endDate);
|
||||||
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.getTransactionByJobCardAndDatesAndTypeAndAccountID(jobCard.getId(),startDate,endDate,"IN", gradingAccounts);
|
|
||||||
|
|
||||||
//cutting days wise
|
//cutting days wise
|
||||||
BigDecimal cutting = bundles.stream()
|
BigDecimal cutting = bundles.stream()
|
||||||
|
@ -543,26 +560,21 @@ public class ReportingService {
|
||||||
|
|
||||||
//total qa
|
//total qa
|
||||||
Integer qa = finishedItems.size();
|
Integer qa = finishedItems.size();
|
||||||
Map<String, Integer> segregateItems = inventoryTransactionLegs.stream()
|
Map<String, Integer> segregateItems = finishedItems.stream()
|
||||||
.filter(leg -> inventoryAccounts.stream()
|
.collect(Collectors.groupingBy(
|
||||||
.anyMatch(account -> (int) account.getId() == (leg.getAccountId())))
|
FinishedItem::getQaStatus,
|
||||||
.collect(Collectors.toMap(
|
Collectors.collectingAndThen(
|
||||||
leg -> inventoryAccounts.stream()
|
Collectors.counting(),
|
||||||
.filter(account -> (int) account.getId() == (leg.getAccountId()))
|
Long::intValue
|
||||||
.findFirst()
|
)
|
||||||
.map(InventoryAccount::getTitle)
|
|
||||||
.orElse("Unknown"),
|
|
||||||
leg -> leg.getQuantity().intValue(),
|
|
||||||
Integer::sum,
|
|
||||||
HashMap::new
|
|
||||||
));
|
));
|
||||||
|
|
||||||
Map<String, Integer> items = getCompleteProduction(String.valueOf(jobCard.getId()));
|
Map<String, Integer> items = getCompleteProduction(String.valueOf(jobCard.getId()));
|
||||||
items.put("Cutting Progress",cutting.intValue());
|
items.put("Cutting Progress",cutting.intValue());
|
||||||
items.put("Stitching Progress",stitching);
|
items.put("Stitching Progress",stitching);
|
||||||
items.put("QA Progress",qa);
|
items.put("QA Progress",qa);
|
||||||
items.put("A Grade",segregateItems.get("A GRADE") != null ? segregateItems.get("A GRADE") : 0);
|
items.put("A Grade",segregateItems.get("APPROVED") != null ? segregateItems.get("APPROVED") : 0);
|
||||||
items.put("B Grade",segregateItems.get("B GRADE") != null ? segregateItems.get("B GRADE") : 0);
|
items.put("B Grade / Reject",segregateItems.get("REJECT") != null ? segregateItems.get("REJECT") : 0);
|
||||||
items.put("C Grade",segregateItems.get("C GRADE") != null ? segregateItems.get("C GRADE") : 0);
|
|
||||||
|
|
||||||
// Define sorting order
|
// Define sorting order
|
||||||
Map<String, Integer> indexMap = new HashMap<>();
|
Map<String, Integer> indexMap = new HashMap<>();
|
||||||
|
@ -571,9 +583,8 @@ public class ReportingService {
|
||||||
indexMap.put("Stitching Progress", 3);
|
indexMap.put("Stitching Progress", 3);
|
||||||
indexMap.put("QA Progress", 4);
|
indexMap.put("QA Progress", 4);
|
||||||
indexMap.put("Finishing Progress", 5);
|
indexMap.put("Finishing Progress", 5);
|
||||||
indexMap.put("A GRADE", 6);
|
indexMap.put("APPROVED", 6);
|
||||||
indexMap.put("B GRADE", 7);
|
indexMap.put("REJECT", 7);
|
||||||
indexMap.put("C GRADE", 8);
|
|
||||||
|
|
||||||
// Sort items based on indexMap order
|
// Sort items based on indexMap order
|
||||||
Map<String, Integer> sortedItems = items.entrySet()
|
Map<String, Integer> sortedItems = items.entrySet()
|
||||||
|
@ -593,7 +604,37 @@ public class ReportingService {
|
||||||
return poJobCardItemsProgress;
|
return poJobCardItemsProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate) {
|
//get po related items size, poId or color
|
||||||
|
public HashMap<String, PoItemsWrapper> getPoItemsSizeOrColor(long poId, String size, String color) {
|
||||||
|
List<JobCard> jobCards = jobCardDAO.findByPoId(poId);
|
||||||
|
List<Long> jobCardIds = jobCards.stream()
|
||||||
|
.map(JobCard::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
HashMap<String, PoItemsWrapper> poItemsWrapperHashMap = new HashMap<>();
|
||||||
|
|
||||||
|
if(!jobCardIds.isEmpty()){
|
||||||
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, size, color);
|
||||||
|
jobCardItems.forEach(e -> {
|
||||||
|
String sku = e.getSku();
|
||||||
|
PoItemsWrapper poItemsWrapper = poItemsWrapperHashMap.getOrDefault(sku, new PoItemsWrapper());
|
||||||
|
poItemsWrapper.setColor(e.getColor());
|
||||||
|
poItemsWrapper.setSize(e.getSize());
|
||||||
|
poItemsWrapper.setSku(e.getSku());
|
||||||
|
poItemsWrapper.setTotalCutting(
|
||||||
|
poItemsWrapper.getTotalCutting() + (e.getActualProduction() != null ? e.getActualProduction().intValue() : 0)
|
||||||
|
);
|
||||||
|
poItemsWrapper.setTotalProduction(
|
||||||
|
poItemsWrapper.getTotalProduction() + (e.getExpectedProduction() != null ? e.getExpectedProduction().intValue() : 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
poItemsWrapperHashMap.put(sku, poItemsWrapper);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return poItemsWrapperHashMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getCuttingTableDetails(String jobCardId, String cuttingTableId, String startDate, String endDate, Long count) {
|
||||||
Map<String, Object> cuttingDetails = new HashMap<>();
|
Map<String, Object> cuttingDetails = new HashMap<>();
|
||||||
long jobCardIdTemp = 0L;
|
long jobCardIdTemp = 0L;
|
||||||
String startDate1 = null;
|
String startDate1 = null;
|
||||||
|
@ -618,7 +659,7 @@ public class ReportingService {
|
||||||
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
|
inventoryAccountIds = List.of(Long.parseLong(cuttingTableId));
|
||||||
}
|
}
|
||||||
|
|
||||||
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, startDate1, endDate1, "IN");
|
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds, null, startDate1, endDate1, "IN","BUNDLE", count);
|
||||||
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
||||||
|
|
||||||
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
||||||
|
@ -634,7 +675,7 @@ public class ReportingService {
|
||||||
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
||||||
List<Long> jobCardIds = entry.getValue();
|
List<Long> jobCardIds = entry.getValue();
|
||||||
if (!jobCardIds.isEmpty()) {
|
if (!jobCardIds.isEmpty()) {
|
||||||
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIds(jobCardIds);
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByJobCardIdsAndSizeColor(jobCardIds, null, null);
|
||||||
int totalProduction = jobCardItems.stream()
|
int totalProduction = jobCardItems.stream()
|
||||||
.filter(item -> item.getActualProduction() != null)
|
.filter(item -> item.getActualProduction() != null)
|
||||||
.mapToInt(item -> item.getActualProduction().intValue())
|
.mapToInt(item -> item.getActualProduction().intValue())
|
||||||
|
@ -670,15 +711,15 @@ public class ReportingService {
|
||||||
wrapper.setGsm(item.getGsm());
|
wrapper.setGsm(item.getGsm());
|
||||||
wrapper.setPly(item.getPly());
|
wrapper.setPly(item.getPly());
|
||||||
wrapper.setSku(item.getSku());
|
wrapper.setSku(item.getSku());
|
||||||
wrapper.setTotalCutting(item.getActualProduction().longValue());
|
wrapper.setTotal(item.getActualProduction().longValue());
|
||||||
wrapper.setWidth(item.getWidth());
|
wrapper.setWidth(item.getWidth());
|
||||||
wrapper.setWtPly(item.getWtPly());
|
wrapper.setWtPly(item.getWtPly());
|
||||||
wrapper.setComplete(item.isComplete());
|
wrapper.setComplete(item.isComplete());
|
||||||
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
||||||
wrapper.setCuttingOperatorName(bundle.getCreatedBy());
|
wrapper.setOperatorName(bundle.getCreatedBy());
|
||||||
wrapper.setJobCardId(item.getJobCardId());
|
wrapper.setJobCardId(item.getJobCardId());
|
||||||
wrapper.setLength(item.getLength());
|
wrapper.setLength(item.getLength());
|
||||||
wrapper.setCuttingAccountId(accountId);
|
wrapper.setAccountId(accountId);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
@ -691,6 +732,129 @@ public class ReportingService {
|
||||||
return cuttingDetails;
|
return cuttingDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getStitchingDetails(String jobCardId, String stitchingLine, String startDate, String endDate, Long count) {
|
||||||
|
Map<String, Object> stitchingDetails = new HashMap<>();
|
||||||
|
long jobCardIdTemp = 0L;
|
||||||
|
String startDate1 = null;
|
||||||
|
String endDate1 = null;
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(startDate)) {
|
||||||
|
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
|
||||||
|
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
|
||||||
|
: LocalDate.now().toString();
|
||||||
|
|
||||||
|
startDate1 = String.format("'%s 00:00:01'", formattedStart);
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<InventoryAccount> inventoryAccounts = inventoryAccountDAO.findByParentEntityTypeAndParentId("PROCESS", 2L);
|
||||||
|
List<Long> inventoryAccountIds = inventoryAccounts.stream().map(InventoryAccount::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(jobCardId)) {
|
||||||
|
jobCardIdTemp = Long.parseLong(jobCardId);
|
||||||
|
} else if (!StringUtils.isNullOrEmpty(stitchingLine)) {
|
||||||
|
inventoryAccountIds = List.of(Long.parseLong(stitchingLine));
|
||||||
|
}
|
||||||
|
|
||||||
|
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(jobCardIdTemp, inventoryAccountIds,null, startDate1, endDate1, "IN","STITCHING_OFFLINE", count);
|
||||||
|
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
||||||
|
|
||||||
|
Map<String, Integer> dateWiseProduction = new TreeMap<>();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
|
||||||
|
|
||||||
|
Map<LocalDate, List<Long>> dateWiseJobCardIds = inventoryTransactionLegs.stream()
|
||||||
|
.filter(e -> e.getTransactionLegDateTime() != null && e.getJobCardId() != 0)
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
e -> e.getTransactionLegDateTime().toLocalDate(),
|
||||||
|
Collectors.mapping(InventoryTransactionLeg::getJobCardId, Collectors.toList())
|
||||||
|
));
|
||||||
|
|
||||||
|
for (Map.Entry<LocalDate, List<Long>> entry : dateWiseJobCardIds.entrySet()) {
|
||||||
|
LocalDate date = entry.getKey();
|
||||||
|
List<Long> jobCardIds = entry.getValue();
|
||||||
|
|
||||||
|
if (!jobCardIds.isEmpty()) {
|
||||||
|
int totalProduction = inventoryTransactionLegs.stream()
|
||||||
|
.filter(item -> jobCardIds.contains(item.getJobCardId()) &&
|
||||||
|
"STITCHING_OFFLINE".equals(item.getParentDocumentType()) && item.getTransactionLegDateTime().toLocalDate().equals(date))
|
||||||
|
.mapToInt(item -> item.getQuantity().intValue())
|
||||||
|
.sum();
|
||||||
|
|
||||||
|
dateWiseProduction.put(date.format(formatter), totalProduction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> distinctJobCardIds = inventoryTransactionLegs.stream()
|
||||||
|
.map(InventoryTransactionLeg::getJobCardId)
|
||||||
|
.filter(id -> id != 0)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<Long, List<CuttingJobCardItemWrapper>> jobCardItemsStitchingDetailsMap = new HashMap<>();
|
||||||
|
Map<String, Integer> totalStitchingBasedOnAccountID = new HashMap<>();
|
||||||
|
|
||||||
|
for (long jobCardIdEntry : distinctJobCardIds) {
|
||||||
|
Long accountId = inventoryTransactionLegs.stream()
|
||||||
|
.filter(e -> e.getJobCardId() == jobCardIdEntry)
|
||||||
|
.map(e -> e.getAccountId().longValue())
|
||||||
|
.findFirst()
|
||||||
|
.orElse(0L);
|
||||||
|
|
||||||
|
JobCard jobCard = jobCardDAO.find(jobCardIdEntry);
|
||||||
|
List<StitchingOfflineItem> stitchingOfflineItem = stitchingOfflineItemDAO.findByJobCardId(jobCardIdEntry);
|
||||||
|
|
||||||
|
List<JobCardItem> jobCardItems = jobCardItemDAO.findByCardId(jobCardIdEntry);
|
||||||
|
|
||||||
|
List<CuttingJobCardItemWrapper> wrappers = jobCardItems.stream().map(item -> {
|
||||||
|
CuttingJobCardItemWrapper wrapper = new CuttingJobCardItemWrapper();
|
||||||
|
wrapper.setArticleName(jobCard.getArticleName());
|
||||||
|
wrapper.setJobCardId(jobCard.getId());
|
||||||
|
wrapper.setJobCardCode(jobCard.getCode());
|
||||||
|
wrapper.setSku(item.getSku());
|
||||||
|
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
||||||
|
wrapper.setJobCardId(item.getJobCardId());
|
||||||
|
wrapper.setOperatorName(stitchingOfflineItem.get(0).getCreatedBy());
|
||||||
|
wrapper.setAccountId(accountId);
|
||||||
|
return wrapper;
|
||||||
|
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
totalStitchingBasedOnAccountID.put(jobCard.getId()+stitchingOfflineItem.get(0).getSku(), stitchingOfflineItem.size());
|
||||||
|
jobCardItemsStitchingDetailsMap.computeIfAbsent(accountId, k -> new ArrayList<>()).addAll(wrappers);
|
||||||
|
}
|
||||||
|
|
||||||
|
stitchingDetails.put("totalStitchingBasedOnAccountID", totalStitchingBasedOnAccountID);
|
||||||
|
stitchingDetails.put("jobCardItemsStitchingDetailsMap", jobCardItemsStitchingDetailsMap);
|
||||||
|
stitchingDetails.put("Date Wise Stitching", dateWiseProduction);
|
||||||
|
|
||||||
|
stitchingDetails.put("stitchingAccount", inventoryAccounts);
|
||||||
|
return stitchingDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StitchingOfflineItem> stitchingItemsTransactions(String jobCardId, String accountId, String sku, String startDate, String endDate, Long count) {
|
||||||
|
List<Long> accountID = new ArrayList<>();
|
||||||
|
String startDate1 = null;
|
||||||
|
String endDate1 = null;
|
||||||
|
|
||||||
|
if (!StringUtils.isNullOrEmpty(startDate) && !StringUtils.isNullOrEmpty(accountId) && !StringUtils.isNullOrEmpty(jobCardId)) {
|
||||||
|
String formattedStart = CTPDateTimeFormat.getMySQLFormattedDateString(startDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT);
|
||||||
|
String formattedEnd = !StringUtils.isNullOrEmpty(endDate)
|
||||||
|
? CTPDateTimeFormat.getMySQLFormattedDateString(endDate, CTPDateTimeFormat.HTML5_DATE_INPUT_FORMAT)
|
||||||
|
: LocalDate.now().toString();
|
||||||
|
|
||||||
|
startDate1 = String.format("'%s 00:00:01'", formattedStart);
|
||||||
|
endDate1 = String.format("'%s 23:59:59'", formattedEnd);
|
||||||
|
accountID.add(Long.parseLong(accountId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String query = SummaryInventoryReportQueryBuilder.cuttingQueryBuild(Long.parseLong(jobCardId), accountID, sku, startDate1, endDate1,"IN","STITCHING_OFFLINE", count);
|
||||||
|
List<InventoryTransactionLeg> inventoryTransactionLegs = inventoryTransactionLegDAO.findByQuery(query);
|
||||||
|
List<Long> stitchingItemsList = inventoryTransactionLegs.stream()
|
||||||
|
.map(InventoryTransactionLeg::getParentDocumentId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return stitchingOfflineItemDAO.findByIds(stitchingItemsList);
|
||||||
|
}
|
||||||
|
|
||||||
private StringBuilder generateTime(LocalDateTime startDate, LocalDateTime endDate){
|
private StringBuilder generateTime(LocalDateTime startDate, LocalDateTime endDate){
|
||||||
StringBuilder totalTime = new StringBuilder();
|
StringBuilder totalTime = new StringBuilder();
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.utopiaindustries.service;
|
||||||
|
|
||||||
|
import com.utopiaindustries.dao.ctp.PackagingItemsDAO;
|
||||||
|
import com.utopiaindustries.model.ctp.FinishedItemWrapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StoreService {
|
||||||
|
|
||||||
|
private final InventoryService inventoryService;
|
||||||
|
|
||||||
|
public StoreService(InventoryService inventoryService, PackagingItemsDAO packagingItemsDAO) {
|
||||||
|
this.inventoryService = inventoryService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createStoreItems(FinishedItemWrapper wrapper ) {
|
||||||
|
inventoryService.createStoreItemAndTransaction(wrapper, wrapper.getAccountId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
spring:
|
spring:
|
||||||
uinddatasource:
|
uinddatasource:
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.147:3306
|
jdbcUrl: jdbc:mysql://utopia-industries-rr.c5qech8o9lgg.us-east-1.rds.amazonaws.com:3306/inventory
|
||||||
username: utopia
|
username: cut-to-pack
|
||||||
password: Utopia01
|
password: mAzFAivImnTqKJx4KNJ0
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
logbackUrl: jdbc:mysql://192.168.90.147:3306/uind_logs?serverTimezone=Asia/Karachi
|
logbackUrl: jdbc:mysql://192.168.90.147:3306/uind_logs?serverTimezone=Asia/Karachi
|
||||||
hikari:
|
hikari:
|
||||||
|
@ -19,7 +19,7 @@ spring:
|
||||||
pool-name: UINDCosmosPool
|
pool-name: UINDCosmosPool
|
||||||
leak-detection-threshold: 2000
|
leak-detection-threshold: 2000
|
||||||
localdatasource:
|
localdatasource:
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.147:3306/cut_to_pack
|
jdbcUrl: jdbc:mysql://localhost:3306/cut_to_pack
|
||||||
username: utopia
|
username: utopia
|
||||||
password: Utopia01
|
password: Utopia01
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
|
|
@ -9,7 +9,7 @@ spring:
|
||||||
minimum-idle: 5
|
minimum-idle: 5
|
||||||
idle-timeout: 30000 # 30 seconds
|
idle-timeout: 30000 # 30 seconds
|
||||||
max-lifetime: 1800000 # 30 minutes
|
max-lifetime: 1800000 # 30 minutes
|
||||||
connection-timeout: 30000 # 30 seconds
|
connection-timeout: 60000 # 30 seconds
|
||||||
leak-detection-threshold: 10000
|
leak-detection-threshold: 10000
|
||||||
cosmosdatasource:
|
cosmosdatasource:
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.147:3307
|
jdbcUrl: jdbc:mysql://192.168.90.147:3307
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -69,6 +69,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBarChart(divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, dates, fontSize, maxValue) {
|
function createBarChart(divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, dates, fontSize, maxValue) {
|
||||||
if (!document.getElementById(divId)) {
|
if (!document.getElementById(divId)) {
|
||||||
return;
|
return;
|
||||||
|
@ -137,6 +138,90 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dashboardChart(
|
||||||
|
divId, height, width, title,
|
||||||
|
aHeading, aData, bHeading, bData, cHeading, cData,
|
||||||
|
dates, fontSize, fontSizeText, maxValue
|
||||||
|
) {
|
||||||
|
if (!document.getElementById(divId)) return;
|
||||||
|
|
||||||
|
Highcharts.chart(divId, {
|
||||||
|
chart: {
|
||||||
|
type: 'bar',
|
||||||
|
height: height,
|
||||||
|
width: width
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
text: title,
|
||||||
|
style: {
|
||||||
|
fontSize: fontSize
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
categories: dates,
|
||||||
|
labels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
text: null
|
||||||
|
},
|
||||||
|
lineWidth: 2
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
max: maxValue,
|
||||||
|
min: 0,
|
||||||
|
title: {
|
||||||
|
text: null,
|
||||||
|
align: 'high',
|
||||||
|
style: {
|
||||||
|
fontSize: fontSizeText
|
||||||
|
}
|
||||||
|
},
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
fontSize: fontSizeText
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gridLineWidth: 0
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
itemStyle: {
|
||||||
|
fontSize: fontSizeText
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
borderRadius: '50%',
|
||||||
|
dataLabels: {
|
||||||
|
enabled: true,
|
||||||
|
style: {
|
||||||
|
fontSize: fontSizeText
|
||||||
|
}
|
||||||
|
},
|
||||||
|
groupPadding: 0.1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
credits: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: aHeading,
|
||||||
|
data: aData
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: bHeading,
|
||||||
|
data: bData
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: cHeading,
|
||||||
|
data: cData
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function createSingleBarChart(divId, height, width, title, Heading, Data, dates, fontSize, maxValue) {
|
function createSingleBarChart(divId, height, width, title, Heading, Data, dates, fontSize, maxValue) {
|
||||||
if (!document.getElementById(divId)) {
|
if (!document.getElementById(divId)) {
|
||||||
return;
|
return;
|
||||||
|
@ -185,7 +270,12 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
format: '{value}%'
|
format: '{value}%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
legend: {
|
||||||
|
itemStyle: {
|
||||||
|
fontSize: 10 - fontSize,
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
},
|
||||||
scrollbar: {
|
scrollbar: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
|
@ -196,8 +286,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initializeGauges();
|
initializeGauges();
|
||||||
|
|
||||||
function initializeGauges() {
|
function initializeGauges() {
|
||||||
|
|
||||||
const gaugeDivs2 = document.querySelectorAll('.gauge-chart2');
|
const gaugeDivs2 = document.querySelectorAll('.gauge-chart2');
|
||||||
|
@ -256,7 +346,53 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
createBarChart(divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, datesArray, fontSize, maxValue);
|
createBarChart(divId, height, width, title, aHeading, aData, bHeading, bData, cHeading, cData, dHeading, dData, datesArray, fontSize, maxValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
const cuttingBarChart = document.querySelectorAll('.cuttingBarChart');
|
const dashboardBarChart = document.querySelectorAll('.dashboardBarChart'); // fixed name
|
||||||
|
dashboardBarChart.forEach(function (div) {
|
||||||
|
const title = div.getAttribute('data-title');
|
||||||
|
const height = div.getAttribute('data-height');
|
||||||
|
const width = div.getAttribute('data-width');
|
||||||
|
const fontSize = div.getAttribute('data-fontSize');
|
||||||
|
|
||||||
|
const rawValue = div.getAttribute('data-totalProduction') || "0";
|
||||||
|
const cleanValue = rawValue.replace(/[^0-9.-]+/g, '');
|
||||||
|
const maxValue = Number(cleanValue);
|
||||||
|
|
||||||
|
const aHeading = 'Stitching';
|
||||||
|
const aDataString = div.getAttribute('data-stitching');
|
||||||
|
const cleanValueStitch = aDataString.replace(/[^0-9.-]+/g, '');
|
||||||
|
const aData = [Number(cleanValueStitch)];
|
||||||
|
|
||||||
|
const bHeading = 'Finishing';
|
||||||
|
const bDataString = div.getAttribute('data-finishing');
|
||||||
|
const packaging = bDataString.replace(/[^0-9.-]+/g, '');
|
||||||
|
const bData = [Number(packaging)];
|
||||||
|
|
||||||
|
const cHeading = 'Packaging';
|
||||||
|
const cDataString = div.getAttribute('data-packaging');
|
||||||
|
const cleanValueAchieved = cDataString.replace(/[^0-9.-]+/g, '');
|
||||||
|
const cData = [Number(cleanValueAchieved)];
|
||||||
|
|
||||||
|
const dates = [div.getAttribute('data-dates')];
|
||||||
|
const divId = div.id;
|
||||||
|
dashboardChart(
|
||||||
|
divId,
|
||||||
|
height,
|
||||||
|
width,
|
||||||
|
title,
|
||||||
|
aHeading,
|
||||||
|
aData,
|
||||||
|
bHeading,
|
||||||
|
bData,
|
||||||
|
cHeading,
|
||||||
|
cData,
|
||||||
|
dates,
|
||||||
|
fontSize,
|
||||||
|
'20',
|
||||||
|
maxValue
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const cuttingBarChart = document.querySelectorAll('.singleBarChart');
|
||||||
cuttingBarChart.forEach(function (div) {
|
cuttingBarChart.forEach(function (div) {
|
||||||
const title = div.getAttribute('data-title');
|
const title = div.getAttribute('data-title');
|
||||||
const height = div.getAttribute('data-height');
|
const height = div.getAttribute('data-height');
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
(async function () {
|
(async function () {
|
||||||
|
|
||||||
Vue.prototype.$accounts = window.ctp.accounts;
|
Vue.prototype.$accounts = window.ctp.accounts;
|
||||||
|
|
||||||
Vue.component('finished-item-table', {
|
Vue.component('finished-item-table', {
|
||||||
|
@ -27,23 +26,22 @@
|
||||||
<th>Job Card ID</th>
|
<th>Job Card ID</th>
|
||||||
<th>Barcode</th>
|
<th>Barcode</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Account</th>
|
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item,index) in items">
|
<tr v-for="(item,index) in items">
|
||||||
<td>
|
<td>
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
|
<input type="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
|
<input type="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
|
<input type="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
|
<input type="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
|
<input type="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
|
<input type="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode" >
|
<input type="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
|
<input type="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
|
<input type="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
|
||||||
<input hidden="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
|
<input type="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
|
||||||
<span> {{item.id}} </span>
|
<span> {{item.id}} </span>
|
||||||
</td>
|
</td>
|
||||||
<td> {{item.itemId}} </td>
|
<td> {{item.itemId}} </td>
|
||||||
|
@ -53,44 +51,30 @@
|
||||||
<td> {{item.jobCardId}} </td>
|
<td> {{item.jobCardId}} </td>
|
||||||
<td> {{item.barcode}} </td>
|
<td> {{item.barcode}} </td>
|
||||||
<td>
|
<td>
|
||||||
<select class="w-100" required v-bind:name="'items[' + index + '].qaStatus'" v-model="item.qaStatus">
|
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
|
||||||
<option value="WASHED">WASHED</option>
|
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
|
||||||
<option value="ALTER">ALTER</option>
|
<span v-else-if="item.qaStatus === 'ALTER' || item.qaStatus === 'B GRADE' || item.qaStatus === 'C GRADE' " class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
|
||||||
<option value="APPROVED">APPROVED</option>
|
<span v-else-if="item.qaStatus === 'WASHED'" class="font-lg badge badge-APPROVED">{{ item.qaStatus }}</span>
|
||||||
</select><br>
|
<span v-else-if="item.qaStatus === 'REJECT'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
|
||||||
<!-- <textarea class="w-100 mt-1" rows="2" v-model="item.qaRemarks" -->
|
|
||||||
<!-- v-if="item.accountId === '0'" -->
|
|
||||||
<!-- v-bind:name="'items[' + index + '].qaRemarks'"></textarea> -->
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<select class="w-100" required v-bind:name="'items[' + index + '].accountId'"
|
<button type="button" class="btn btn-light" v-on:click="removeItem(index)">
|
||||||
v-model="item.accountId"
|
|
||||||
v-bind:disabled="item.qaStatus !== 'APPROVED'"
|
|
||||||
v-bind:required="item.qaStatus === 'APPROVED'">
|
|
||||||
<option v-for="(option,index) in $accounts"
|
|
||||||
v-bind:value="option.id">{{option.title}}</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
|
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
`,
|
`
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|
||||||
let app = new Vue({
|
let app = new Vue({
|
||||||
el: '#finishedApp',
|
el: '#finishedApp',
|
||||||
data: {
|
data: {
|
||||||
items : []
|
items: [],
|
||||||
|
QaStatus: 'APPROVED'
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onItemSelect: function (id, item) {
|
onItemSelect: function (id, item) {
|
||||||
console.log("wdwawdwwadwwdwda",item.id)
|
|
||||||
this.items.push(item);
|
this.items.push(item);
|
||||||
},
|
},
|
||||||
removeItem: function (index) {
|
removeItem: function (index) {
|
||||||
|
@ -101,10 +85,15 @@
|
||||||
const uniqueIds = new Set(ids);
|
const uniqueIds = new Set(ids);
|
||||||
return ids.length !== uniqueIds.size;
|
return ids.length !== uniqueIds.size;
|
||||||
},
|
},
|
||||||
|
submitWithQaStatus: function (status) {
|
||||||
|
this.QaStatus = status;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
document.getElementById('finishedApp').submit();
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
console.log( this.$accounts )
|
console.log(this.$accounts);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
})(jQuery);
|
||||||
})(jQuery)
|
|
||||||
|
|
|
@ -123,28 +123,36 @@
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Sku</label>
|
<label>Sku</label>
|
||||||
<span class="form-control" readonly >{{item.sku}}</span>
|
<span class="form-control" readonly >{{item.sku}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 form-group">
|
||||||
|
<label>Size</label>
|
||||||
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].size'" v-model="item.size" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 form-group">
|
||||||
|
<label>Color</label>
|
||||||
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].color'" v-model="item.color" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>Expected Quantity</label>
|
<label>Expected Quantity</label>
|
||||||
<input type="number" class="form-control" v-bind:name="'items[' + index + '].expectedProduction'" v-model="item.expectedProduction" required>
|
<input type="number" class="form-control" v-bind:name="'items[' + index + '].expectedProduction'" v-model="item.expectedProduction" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>Length</label>
|
<label>Length</label>
|
||||||
<input type="text" class="form-control" v-bind:name="'items[' + index + '].length'" v-model="item.length" required>
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].length'" v-model="item.length" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>Width</label>
|
<label>Width</label>
|
||||||
<input type="text" class="form-control" v-bind:name="'items[' + index + '].width'" v-model="item.width" required>
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].width'" v-model="item.width" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>GSM</label>
|
<label>GSM</label>
|
||||||
<input type="text" class="form-control" v-bind:name="'items[' + index + '].gsm'" v-model="item.gsm" required>
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].gsm'" v-model="item.gsm" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>WT./Ply</label>
|
<label>WT./Ply</label>
|
||||||
<input type="text" class="form-control" v-bind:name="'items[' + index + '].wtPly'" v-model="item.wtPly" required>
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].wtPly'" v-model="item.wtPly" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-2 form-group">
|
||||||
<label>Number of Ply</label>
|
<label>Number of Ply</label>
|
||||||
<input type="text" class="form-control" v-bind:name="'items[' + index + '].ply'" v-model="item.ply" required>
|
<input type="text" class="form-control" v-bind:name="'items[' + index + '].ply'" v-model="item.ply" required>
|
||||||
</div>
|
</div>
|
||||||
|
@ -219,6 +227,10 @@
|
||||||
data: {
|
data: {
|
||||||
jobCard: {},
|
jobCard: {},
|
||||||
items: [],
|
items: [],
|
||||||
|
purchaseOrderID:0,
|
||||||
|
articleName: '',
|
||||||
|
purchaseOrderQuantityRequired: 0,
|
||||||
|
purchaseOrderCode: '',
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addItem: function (e) {
|
addItem: function (e) {
|
||||||
|
@ -259,10 +271,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
}, onPoSelect(id,purchaseOrder) {
|
||||||
|
this.purchaseOrderID = id,
|
||||||
|
this.articleName = purchaseOrder.articleName,
|
||||||
|
this.purchaseOrderQuantityRequired = purchaseOrder.purchaseOrderQuantityRequired,
|
||||||
|
this.purchaseOrderCode = purchaseOrder.purchaseOrderCode
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.jobCard = window.ctp.jobCard;
|
this.jobCard = window.ctp.jobCard;
|
||||||
|
this.purchaseOrderID = this.jobCard.purchaseOrderId,
|
||||||
|
this.articleName = this.jobCard.articleName,
|
||||||
|
this.purchaseOrderQuantityRequired = this.jobCard.poQuantity,
|
||||||
|
this.purchaseOrderCode = this.jobCard.purchaseOrderTitle
|
||||||
this.items = this.jobCard.items;
|
this.items = this.jobCard.items;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
( async function(){
|
||||||
|
|
||||||
|
Vue.prototype.$accounts = window.ctp.accounts;
|
||||||
|
|
||||||
|
Vue.component('finish-item-table',{
|
||||||
|
props : [ 'items' ],
|
||||||
|
methods: {
|
||||||
|
getFormattedDateTime: function (dateTime) {
|
||||||
|
if (!!dateTime) {
|
||||||
|
return dateTime.split('T')[0] + ' ' + dateTime.split('T')[1];
|
||||||
|
}
|
||||||
|
return luxon.DateTime.now().toFormat('yyyy-MM-dd HH:mm:ss');
|
||||||
|
},
|
||||||
|
removeItem: function (index) {
|
||||||
|
this.$emit('remove-item', index)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template : `
|
||||||
|
<table class="table table-bordered bg-white col-sm-12">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>Sku</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Job Card ID</th>
|
||||||
|
<th>Barcode</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(item,index) in items">
|
||||||
|
<td>
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].id'" v-bind:value="item.id">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].itemId'" v-bind:value="item.itemId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].sku'" v-bind:value="item.sku">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].createdBy'" v-bind:value="item.createdBy">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].createdAt'" v-bind:value="getFormattedDateTime(item.createdAt)">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].jobCardId'" v-bind:value="item.jobCardId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].barcode'" v-bind:value="item.barcode" >
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].isQa'" v-bind:value="item.isQa">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].stitchedItemId'" v-bind:value="item.stitchedItemId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].isSegregated'" v-bind:value="item.isSegregated">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].qaStatus'" v-bind:value="item.qaStatus">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].accountId'" v-bind:value="item.accountId">
|
||||||
|
<input hidden="hidden" v-bind:name="'items[' + index + '].operationDate'" v-bind:value="getFormattedDateTime(item.operationDate)">
|
||||||
|
<span> {{item.id}} </span>
|
||||||
|
</td>
|
||||||
|
<td> {{item.itemId}} </td>
|
||||||
|
<td> {{item.sku}} </td>
|
||||||
|
<td> {{item.createdBy}} </td>
|
||||||
|
<td> {{ getFormattedDateTime( item.createdAt) }} </td>
|
||||||
|
<td> {{item.jobCardId}}</td>
|
||||||
|
<td> {{item.barcode}} </td>
|
||||||
|
<td >
|
||||||
|
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
|
||||||
|
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
|
||||||
|
<span v-else-if="item.qaStatus === 'ALTER' || item.qaStatus === 'B GRADE'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
|
||||||
|
<span v-else-if="item.qaStatus === 'WASHED'" class="font-lg badge badge-APPROVED">{{ item.qaStatus }}</span>
|
||||||
|
<span v-else-if="item.qaStatus === 'REJECT'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
|
||||||
|
<i class="bi bi-trash"></i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
`,
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
let app = new Vue({
|
||||||
|
el : '#packagingApp',
|
||||||
|
data : {
|
||||||
|
items : [],
|
||||||
|
reason: '',
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
onItemSelect: function (id, item) {
|
||||||
|
this.items.push(item);
|
||||||
|
},
|
||||||
|
removeItem: function (index) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
},
|
||||||
|
hasDuplicates: function () {
|
||||||
|
const ids = this.items.map(item => item.id);
|
||||||
|
const uniqueIds = new Set(ids);
|
||||||
|
return ids.length !== uniqueIds.size;
|
||||||
|
},
|
||||||
|
submitWithRejectReason: function (reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const form = document.getElementById('packagingApp');
|
||||||
|
if (form.checkValidity()) {
|
||||||
|
form.submit();
|
||||||
|
} else {
|
||||||
|
form.reportValidity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted : function () {
|
||||||
|
console.log( this.$accounts )
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})(jQuery)
|
|
@ -50,11 +50,9 @@
|
||||||
<td> {{item.jobCardId}}</td>
|
<td> {{item.jobCardId}}</td>
|
||||||
<td> {{item.barcode}} </td>
|
<td> {{item.barcode}} </td>
|
||||||
<td>
|
<td>
|
||||||
<select class="w-100" required v-bind:name="'items[' + index + '].qaStatus'" v-model="item.qaStatus">
|
<span v-if="!item.qaStatus" class="badge badge-danger">NOT PERFORMED</span>
|
||||||
<option value="APPROVED">APPROVED</option>
|
<span v-else-if="item.qaStatus === 'APPROVED'" class="font-lg badge badge-success">{{ item.qaStatus }}</span>
|
||||||
<option value="REJECT">REJECT</option>
|
<span v-else-if="item.qaStatus === 'REJECT'" class="font-lg badge badge-danger">{{ item.qaStatus }}</span>
|
||||||
</select><br>
|
|
||||||
<textarea class="w-100 mt-1" rows="2" v-model="item.remarks" v-if="item.qaStatus === 'REJECT'" v-bind:name="'items[' + index + '].qaRemarks'"></textarea>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
|
<button type="button" title="Remove" class="btn btn-light text-left" v-on:click="removeItem(index)">
|
||||||
|
@ -72,6 +70,7 @@
|
||||||
el: '#qcForm',
|
el: '#qcForm',
|
||||||
data: {
|
data: {
|
||||||
items: [],
|
items: [],
|
||||||
|
QaStatus: 'APPROVED'
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onItemSelect: function (id, item) {
|
onItemSelect: function (id, item) {
|
||||||
|
@ -86,6 +85,17 @@
|
||||||
const uniqueIds = new Set(ids);
|
const uniqueIds = new Set(ids);
|
||||||
return ids.length !== uniqueIds.size;
|
return ids.length !== uniqueIds.size;
|
||||||
},
|
},
|
||||||
|
submitWithQaStatus: function (status) {
|
||||||
|
this.QaStatus = status;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const form = document.getElementById('qcForm');
|
||||||
|
if (form.checkValidity()) {
|
||||||
|
form.submit();
|
||||||
|
} else {
|
||||||
|
form.reportValidity();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
|
||||||
|
|
|
@ -3592,6 +3592,48 @@ if ( typeof Vue !== 'undefined' ) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search po
|
||||||
|
* */
|
||||||
|
Vue.component('search-ctp-po',{
|
||||||
|
mixins: [searchComponentMixin],
|
||||||
|
data: {
|
||||||
|
purchaseOrderCode: '',
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
getSearchUrl : function () {
|
||||||
|
return `/ctp/rest/purchase-orders/ctp-po-search?term=${encodeURIComponent( this.list.term )}`
|
||||||
|
},
|
||||||
|
getEmittedEventName: function() {
|
||||||
|
return 'select-po';
|
||||||
|
},
|
||||||
|
getTitle: function( po ) {
|
||||||
|
this.purchaseOrderCode = po.purchaseOrderCode;
|
||||||
|
return this.purchaseOrderCode;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
labelText: {
|
||||||
|
default: 'Search PO '
|
||||||
|
},
|
||||||
|
titleFieldName: {
|
||||||
|
default: 'poCode'
|
||||||
|
},
|
||||||
|
idFieldName: {
|
||||||
|
default: 'poId'
|
||||||
|
},
|
||||||
|
codeFieldName : {
|
||||||
|
default : 'poCode'
|
||||||
|
},
|
||||||
|
received : {
|
||||||
|
default : false
|
||||||
|
},
|
||||||
|
inputMode: {
|
||||||
|
default : 'none'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
Vue.component('search-item', {
|
Vue.component('search-item', {
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<head th:fragment="head (title)">
|
<head th:fragment="head (title)">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
<meta http-equiv="refresh" content="60" th:if="${refresh == true}">
|
||||||
<link rel="shortcut icon" href="../static/img/favicon.ico" th:href="@{/img/favicon.ico}">
|
<link rel="shortcut icon" href="../static/img/favicon.ico" th:href="@{/img/favicon.ico}">
|
||||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
<script th:src="@{/js/vendor/jquery-3.4.1.min.js}"></script>
|
<script th:src="@{/js/vendor/jquery-3.4.1.min.js}"></script>
|
||||||
|
@ -20,6 +21,17 @@
|
||||||
<script src="https://code.highcharts.com/highcharts-more.js"></script>
|
<script src="https://code.highcharts.com/highcharts-more.js"></script>
|
||||||
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
|
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
|
||||||
<title th:text="${#strings.concat(title, ' - CTP')}"></title>
|
<title th:text="${#strings.concat(title, ' - CTP')}"></title>
|
||||||
|
<style>
|
||||||
|
@keyframes blinker {
|
||||||
|
50% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.blink {
|
||||||
|
animation: blinker 1s linear infinite;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -31,9 +43,15 @@
|
||||||
<img th:src="@{/img/utopia-industries-white.svg}" class="page-header__logo" alt="Utopia Industries">
|
<img th:src="@{/img/utopia-industries-white.svg}" class="page-header__logo" alt="Utopia Industries">
|
||||||
</a>
|
</a>
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_PURCHASE_ORDER', 'ROLE_ADMIN')">
|
||||||
|
<a th:href="@{/purchase-order/}" class="nav-link"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">Purchase
|
||||||
|
Order</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_JOB_CARD', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_JOB_CARD', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/job-cards/}" class="nav-link"
|
<a th:href="@{/job-cards/}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards') ? 'active' : ''}">Job Cards</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards') ? 'active' : ''}">Job
|
||||||
|
Cards</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_CUTTING', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_CUTTING', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/cutting/}" class="nav-link"
|
<a th:href="@{/cutting/}" class="nav-link"
|
||||||
|
@ -45,7 +63,8 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_QUALITY_CONTROL', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_QUALITY_CONTROL', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/quality-control/}" class="nav-link"
|
<a th:href="@{/quality-control/}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/quality-control') ? 'active' : ''}">Quality Control</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/quality-control') ? 'active' : ''}">Quality
|
||||||
|
Control</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_FINISHING', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_FINISHING', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/finishing/}" class="nav-link"
|
<a th:href="@{/finishing/}" class="nav-link"
|
||||||
|
@ -55,13 +74,19 @@
|
||||||
<a th:href="@{/packaging/}" class="nav-link"
|
<a th:href="@{/packaging/}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging') ? 'active' : ''}">Packaging</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging') ? 'active' : ''}">Packaging</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_STORE', 'ROLE_ADMIN')">
|
||||||
|
<a th:href="@{/store/}" class="nav-link"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/store') ? 'active' : ''}">Store</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_PURCHASE_ORDER', 'ROLE_ADMIN')">
|
||||||
|
<a th:href="@{/po-status/}" class="nav-link"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/po-status') ? 'active' : ''}">Online PO Status</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_REPORTING', 'ROLE_ADMIN')">
|
<li class="nav-item" sec:authorize="hasAnyRole('ROLE_REPORTING', 'ROLE_ADMIN')">
|
||||||
<a th:href="@{/reporting/summary}" class="nav-link"
|
<a th:href="@{/reporting/}" class="nav-link"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting') ? 'active' : ''}">Reporting</a>
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting') ? 'active' : ''}">Reporting</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ADMIN')">
|
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ADMIN')">
|
||||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Admin</a>
|
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Admin</a>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
|
@ -78,6 +103,15 @@
|
||||||
class="dropdown-item">User And Roles</a>
|
class="dropdown-item">User And Roles</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_INVENTORY_ACCOUNT')">
|
||||||
|
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Inventory Accounts</a>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<!-- Add Inventory Accounts-->
|
||||||
|
<a th:href="@{/inventory-accounts}"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/inventory-accounts') ? 'active' : ''}"
|
||||||
|
class="dropdown-item">Inventory Accounts</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="dropdown page-header__user-menu">
|
<div class="dropdown page-header__user-menu">
|
||||||
<a href="#" class="dropdown-toggle btn btn-sm btn-outline-light" data-toggle="dropdown">
|
<a href="#" class="dropdown-toggle btn btn-sm btn-outline-light" data-toggle="dropdown">
|
||||||
|
@ -91,6 +125,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<!-- second level purchase Order-->
|
||||||
|
<!-- <nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"-->
|
||||||
|
<!-- th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order')}">-->
|
||||||
|
<!-- <ul class="navbar-nav">-->
|
||||||
|
<!-- <li class="nav-item"-->
|
||||||
|
<!-- th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">-->
|
||||||
|
<!-- <a th:href="@{/purchase-order/}" class="nav-link">Cards</a>-->
|
||||||
|
<!-- </li>-->
|
||||||
|
<!-- </ul>-->
|
||||||
|
<!-- </nav>-->
|
||||||
<!-- second level job cards-->
|
<!-- second level job cards-->
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/job-cards')}">
|
||||||
|
@ -101,6 +145,17 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- second level purchase order-->
|
||||||
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order')}">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/purchase-order') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/purchase-order/}" class="nav-link">PO's</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
<!-- second level cutting -->
|
<!-- second level cutting -->
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/cutting')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/cutting')}">
|
||||||
|
@ -132,10 +187,6 @@
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting')}">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item"
|
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/po-report') ? 'active' : ''}">
|
|
||||||
<a th:href="@{/reporting/po-report}" class="nav-link">PO Report</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item"
|
<li class="nav-item"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/job-card-report') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/job-card-report') ? 'active' : ''}">
|
||||||
<a th:href="@{/reporting/job-card-report}" class="nav-link">Job Card Report</a>
|
<a th:href="@{/reporting/job-card-report}" class="nav-link">Job Card Report</a>
|
||||||
|
@ -144,12 +195,27 @@
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/cutting-report') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/cutting-report') ? 'active' : ''}">
|
||||||
<a th:href="@{/reporting/cutting-report}" class="nav-link">Cutting Tables Report</a>
|
<a th:href="@{/reporting/cutting-report}" class="nav-link">Cutting Tables Report</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/stitching-report') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/reporting/stitching-report}" class="nav-link">Stitching Line Report</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item"
|
<li class="nav-item"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/summary') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/reporting/summary') ? 'active' : ''}">
|
||||||
<a th:href="@{/reporting/summary}" class="nav-link">Summary</a>
|
<a th:href="@{/reporting/summary}" class="nav-link">Summary</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!--Second level of po-status-->
|
||||||
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/po-status')}">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/po-status/all-pos') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/po-status/all-pos}" class="nav-link">All PO's</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
<!-- second level stitching -->
|
<!-- second level stitching -->
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/stitching')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/stitching')}">
|
||||||
|
@ -204,12 +270,31 @@
|
||||||
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging')}">
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging')}">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/receive-inventory') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/packaging/receive-inventory}" class="nav-link">Receive Inventory</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item"
|
<li class="nav-item"
|
||||||
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/inventory-accounts') ? 'active' : ''}">
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/packaging/inventory-accounts') ? 'active' : ''}">
|
||||||
<a th:href="@{/packaging/inventory-accounts}" class="nav-link">Inventory Accounts</a>
|
<a th:href="@{/packaging/inventory-accounts}" class="nav-link">Inventory Accounts</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<!-- second level store -->
|
||||||
|
<nav class="navbar navbar-light bg-light navbar-expand-lg justify-content-between"
|
||||||
|
th:if="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/store')}">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/store/receive-inventory') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/store/receive-inventory}" class="nav-link">Receive Inventory</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item"
|
||||||
|
th:classappend="${#strings.startsWith(#httpServletRequest.getRequestURI(), '/ctp/store/inventory-accounts') ? 'active' : ''}">
|
||||||
|
<a th:href="@{/store/inventory-accounts}" class="nav-link">Inventory Accounts</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<!-- table loading skeleton -->
|
<!-- table loading skeleton -->
|
||||||
|
|
|
@ -19,6 +19,27 @@
|
||||||
<label>Title</label>
|
<label>Title</label>
|
||||||
<input class="form-control" th:field="*{title}" required>
|
<input class="form-control" th:field="*{title}" required>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Article Name</label>
|
||||||
|
<input class="form-control" th:field="*{articleName}">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Shift Minutes</label>
|
||||||
|
<input type="number" class="form-control" th:field="*{shiftMinutes}">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Efficiency</label>
|
||||||
|
<input type="number" class="form-control" th:field="*{efficiency}" step="0.01"
|
||||||
|
inputmode="decimal" min="0">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>SAM</label>
|
||||||
|
<input type="number" class="form-control no-spinner" th:field="*{sam}" step="0.01"
|
||||||
|
inputmode="decimal" min="0"></div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Total Machine</label>
|
||||||
|
<input type="number" class="form-control" th:field="*{totalMachines}">
|
||||||
|
</div>
|
||||||
<div class="col-sm-6 form-group">
|
<div class="col-sm-6 form-group">
|
||||||
<label>Notes</label>
|
<label>Notes</label>
|
||||||
<input class="form-control" th:field="*{notes}" required>
|
<input class="form-control" th:field="*{notes}" required>
|
||||||
|
@ -45,7 +66,8 @@
|
||||||
></option>
|
></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 form-group" data-vue-app th:with="id=*{locationSiteId},title=*{locationTitle}">
|
<div class="col-sm-3 form-group" data-vue-app
|
||||||
|
th:with="id=*{locationSiteId},title=*{locationTitle}">
|
||||||
<location-site-search th:attr="id=${id},title=${title}"
|
<location-site-search th:attr="id=${id},title=${title}"
|
||||||
v-bind:label-text="'Location Site'"
|
v-bind:label-text="'Location Site'"
|
||||||
v-bind:id-field-name="'locationSiteId'"
|
v-bind:id-field-name="'locationSiteId'"
|
||||||
|
@ -71,7 +93,8 @@
|
||||||
<div class="col-sm-1 form-group">
|
<div class="col-sm-1 form-group">
|
||||||
<label for="is-grading">Is Grading Account</label>
|
<label for="is-grading">Is Grading Account</label>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="custom-control-label:" type="checkbox" id="is-grading" th:field="*{isPackaging}" />
|
<input class="custom-control-label:" type="checkbox" id="is-grading"
|
||||||
|
th:field="*{isPackaging}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,13 +114,16 @@
|
||||||
border-color: #007bff;
|
border-color: #007bff;
|
||||||
background-color: #007bff;
|
background-color: #007bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-checkbox .custom-control-input ~ .custom-control-label::before {
|
.custom-checkbox .custom-control-input ~ .custom-control-label::before {
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
|
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-checkbox .custom-control-input {
|
.custom-checkbox .custom-control-input {
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
<head th:replace="_fragments :: head('Home Page')"></head>
|
<head th:replace="_fragments :: head('Home Page')"></head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
@ -17,6 +18,13 @@
|
||||||
<input hidden="hidden" th:field="*{createdBy}">
|
<input hidden="hidden" th:field="*{createdBy}">
|
||||||
<input hidden="hidden" th:field="*{status}">
|
<input hidden="hidden" th:field="*{status}">
|
||||||
<input hidden="hidden" th:field="*{inventoryStatus}">
|
<input hidden="hidden" th:field="*{inventoryStatus}">
|
||||||
|
|
||||||
|
<!-- Hidden Inputs for Dynamic Values -->
|
||||||
|
<input type="hidden" name="articleName" :value="articleName">
|
||||||
|
<input type="hidden" name="poQuantity" :value="purchaseOrderQuantityRequired">
|
||||||
|
<input type="hidden" name="purchaseOrderTitle" :value="purchaseOrderCode">
|
||||||
|
<input type="hidden" name="purchaseOrderId" :value="purchaseOrderID">
|
||||||
|
|
||||||
<div class="bg-light p-3 mb-3">
|
<div class="bg-light p-3 mb-3">
|
||||||
<h6 class="mb-3">Info</h6>
|
<h6 class="mb-3">Info</h6>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
@ -34,28 +42,35 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Article Name</label>
|
<label>Article Name</label>
|
||||||
<input class="form-control" th:field="*{articleName}" required>
|
<!-- Dynamically show articleName -->
|
||||||
|
<span class="form-control">{{ articleName || jobCard.articleName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col-sm-3 form-group">
|
<search-ctp-po
|
||||||
<label>Purchase Order</label>
|
v-bind:id-field-name="'poID'"
|
||||||
<input type="text" class="form-control" th:field="*{purchaseOrderId}" required>
|
v-on:select-po="onPoSelect"
|
||||||
</div>
|
v-bind:required="false"
|
||||||
|
v-bind:selected="purchaseOrderCode">
|
||||||
|
</search-ctp-po>
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>PO Quantity</label>
|
<label>PO Quantity</label>
|
||||||
<input type="number" class="form-control" th:field="*{poQuantity}" required>
|
<!-- Dynamically show PO quantity -->
|
||||||
|
<span class="form-control">{{ purchaseOrderQuantityRequired || jobCard.poQuantity }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-3 form-group" th:with="title=*{locationTitle},id=*{locationSiteId}">
|
<div class="col-sm-3 form-group" th:with="title=*{locationTitle},id=*{locationSiteId}">
|
||||||
<location-site-search th:attr="id=${id},title=${title}"
|
<location-site-search th:attr="id=${id},title=${title}" v-bind:id-field-name="'locationSiteId'">
|
||||||
v-bind:id-field-name="'locationSiteId'">
|
|
||||||
</location-site-search>
|
</location-site-search>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Generated Date</label>
|
<label>Generated Date</label>
|
||||||
<span class="form-control" ctp:formatdatetime="*{createdAt}" readonly>
|
<!-- Use Thymeleaf to format datetime -->
|
||||||
|
<span class="form-control" ctp:formatdatetime="*{createdAt}" readonly></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col-sm-6 form-group">
|
<div class="col-sm-6 form-group">
|
||||||
<label>Description*</label>
|
<label>Description*</label>
|
||||||
|
@ -85,8 +100,8 @@
|
||||||
</form>
|
</form>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
window.ctp.jobCard = [[${jobCard}]];
|
window.ctp.jobCard = [[${jobCard}]];
|
||||||
window.ctp.types = [[${cutPieceTypes}]]
|
window.ctp.types = [[${cutPieceTypes}]];
|
||||||
window.ctp.accounts = [[${accounts}]]
|
window.ctp.accounts = [[${accounts}]];
|
||||||
</script>
|
</script>
|
||||||
<script th:src="@{/js/vendor/compressor.min.js}"></script>
|
<script th:src="@{/js/vendor/compressor.min.js}"></script>
|
||||||
<script th:src="@{/js/job-card-form.js}"></script>
|
<script th:src="@{/js/job-card-form.js}"></script>
|
||||||
|
|
|
@ -40,10 +40,12 @@
|
||||||
<input type="text" class="form-control" name="lot-number" maxlength="100" th:value="${param['lot-number']}">
|
<input type="text" class="form-control" name="lot-number" maxlength="100" th:value="${param['lot-number']}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" data-vue-app th:with="id=${param['purchase-order-id']},title=${param['purchase-order-id']}">
|
<div class="form-group" data-vue-app th:with="id=${param['purchase-order-id']},title=${param['purchase-order-id']}">
|
||||||
<purchase-order-search th:attr="id=${id},title=${title}"
|
<search-ctp-po
|
||||||
v-bind:id-field-name="'purchase-order-id'"
|
v-bind:id-field-name="'purchase-order-id'"
|
||||||
v-bind:code-field-name="'purchase-order-code'"
|
v-on:select-po="onPoSelect"
|
||||||
></purchase-order-search>
|
v-bind:required="false"
|
||||||
|
v-bind:selected="purchaseOrderCode">
|
||||||
|
</search-ctp-po>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}">
|
<div class="form-group" data-vue-app th:with="id=${param['site-id']},title=${param['site-title']}">
|
||||||
<location-site-search th:attr="id=${id},title=${title}"
|
<location-site-search th:attr="id=${id},title=${title}"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<th>Created By</th>
|
<th>Created By</th>
|
||||||
<th>
|
<th>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Barcode</button>
|
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Bundle Barcode</button>
|
||||||
</div>
|
</div>
|
||||||
<div><input type="checkbox" data-checkbox-all></div>
|
<div><input type="checkbox" data-checkbox-all></div>
|
||||||
</th>
|
</th>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<form th:action="@{/cutting/generate-master-barcodes}" method="post">
|
<form th:action="@{/cutting/generate-master-barcodes}" method="post">
|
||||||
<input hidden="hidden" name="artifactType" value="MasterBundle">
|
<input hidden="hidden" name="artifactType" value="MasterBundle">
|
||||||
<table class="table table-striped table-bordered" data-bundle-table
|
<table class="table table-striped table-bordered" data-bundle-table
|
||||||
data-order="[[ 0, "desc" ]]">
|
data-order="[[ 6, "desc" ]]">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<th>Received</th>
|
<th>Received</th>
|
||||||
<th>
|
<th>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button class="btn btn-sm btn-outline-primary" type="submit">Generate
|
<button class="btn btn-sm btn-outline-primary" type="submit">Generate Master
|
||||||
Barcode
|
Barcode
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div th:replace="_notices :: page-notices"></div>
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
<h3 class="pb-2">Receive Inventory</h3>
|
<h3 class="pb-2">Receive Inventory Against Job Card</h3>
|
||||||
<form th:action="@{/cutting/receive-inventory}"
|
<form th:action="@{/cutting/receive-inventory}"
|
||||||
method="POST"
|
method="POST"
|
||||||
id="receiveInvApp"
|
id="receiveInvApp"
|
||||||
|
|
|
@ -0,0 +1,206 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<head th:replace="_fragments :: head('Production Dashboard')">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="m-0 p-2">
|
||||||
|
<div class="container-fluid px-0">
|
||||||
|
<header class="header shadow py-2 bg-black text-white" style="background-color: black !important;">
|
||||||
|
<div class="container-fluid d-flex flex-wrap align-items-center justify-content-between">
|
||||||
|
<img width="200" class="logo img-fluid" th:src="@{/img/utopia-industries-white.png}"
|
||||||
|
alt="Utopia Industries">
|
||||||
|
<div class="d-flex flex-wrap justify-content-end">
|
||||||
|
<h1 class="px-2 fw-bold text-uppercase m-0" th:text="${{day}}"></h1>
|
||||||
|
<h1 class="px-2 fw-bold text-uppercase m-0" th:text="${{date}}"></h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main id="main1" class="container-fluid main-content">
|
||||||
|
<div class="row page-main g-4 p-3">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<!-- Title Row -->
|
||||||
|
<div class="mb-4 d-flex justify-content-between align-items-center">
|
||||||
|
<h1 class="fw-bold text-uppercase m-0" th:text="${detail.get('line')}"></h1>
|
||||||
|
<div class="text-end">
|
||||||
|
<h3 class="fw-bold m-0 text-end "
|
||||||
|
th:text=" 'Total Machines: '+ ${detail.get('Total Machine')} ">0</h3>
|
||||||
|
<h3 class="fw-bold m-0 text-end" th:text="'Article: ' + ${detail.get('articleName')}">
|
||||||
|
0</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-lg-6 border border-black-50 p-4 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #516ec4; height: 100%; ">
|
||||||
|
<h1 class="fw-bold pt-5 pb-2" style="font-size: 6rem;" th:text="${detail.get('Shift Target')}">
|
||||||
|
%</h1>
|
||||||
|
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Shift Target</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-6 border border-black-50 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #72788a;">
|
||||||
|
<h1 class="fw-bold pt-5 pb-2" style="font-size: 6rem;"
|
||||||
|
th:text="${phases.get('packaging')?.intValue() ?: 0}"></h1>
|
||||||
|
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Achieved</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Card 1: Stitching -->
|
||||||
|
<div class="col-lg-6 d-flex">
|
||||||
|
<div class="card w-100 h-100">
|
||||||
|
<div class="container-fluid d-flex p-3 align-items-center">
|
||||||
|
<img style="width:337px" th:src="@{/img/stitchingImage.jpg}" class="card-img-top"
|
||||||
|
alt="Stitching">
|
||||||
|
<div class="ps-4 text-center">
|
||||||
|
<h1 class="fw-bold m-0" style="font-size: 4rem;"
|
||||||
|
th:text="${(phases.get('Stitching') != null ? phases.get('Stitching').intValue() : 0) + ' Pcs'}"></h1>
|
||||||
|
<h4 class="pt-2 fw-bold text-uppercase m-0" style="font-size: 2rem;">Stitching Offline</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body text-center d-flex justify-content-center">
|
||||||
|
<div class="px-4 border-right" style="height: 150px">
|
||||||
|
<h1 class="card-text" style="font-size: 4rem;"
|
||||||
|
th:text="${(phases.get('totalWips') != null ? phases.get('totalWips').intValue() : 0) + ' Pcs'}"></h1>
|
||||||
|
<h2 class="card-title" style="font-size: 3rem;">WIP QTY</h2>
|
||||||
|
</div>
|
||||||
|
<div class="px-4" style="height: 150px">
|
||||||
|
<h1 class="card-text text-danger fw-bold blink" style="font-size: 4rem;"
|
||||||
|
th:text="${(phases.get('Alteration') != null ? phases.get('Alteration').intValue() : 0) + ' Pcs'}"></h1>
|
||||||
|
<h2 class="card-title text-danger fw-bold text-uppercase blink" style="font-size: 3rem;">
|
||||||
|
ALTERATION</h2>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Second Row -->
|
||||||
|
<div class="row g-4 p-3">
|
||||||
|
<!-- Chart -->
|
||||||
|
<div class="col-lg-6 d-flex flex-column" style="height: 100%;">
|
||||||
|
<div class="row g-3 flex-grow-2" style="height: 100%;">
|
||||||
|
<div class="col-lg-6 border border-black-50 p-5 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #516ec4; height: 100%; ">
|
||||||
|
<h1 class="fw-bold pl-3 pr-3 pt-5 pb-2" style="font-size: 6rem;"
|
||||||
|
th:text="${#numbers.formatDecimal(phases.get('Efficiency'), 1, 2) + ' %'}">0%</h1>
|
||||||
|
<h1 class="fw-bold m-0 text-start pl-3 pr-3 pb-5 pt-2" style="font-size: 5rem;">Efficiency</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-6 border border-black-50 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #72788a;">
|
||||||
|
<h1 class="fw-bold pl-3 pr-3 pt-5 pb-2" style="font-size: 6rem;"
|
||||||
|
th:text="${detail.get('Hourly Target') }"></h1>
|
||||||
|
<h1 class="fw-bold m-0 text-start pb-5 pt-2" style="font-size: 4rem;">Hourly Target</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Card 3: Finishing -->
|
||||||
|
<div class="col-lg-3 d-flex">
|
||||||
|
<div class="card w-100 h-100">
|
||||||
|
<div class="container-fluid d-flex p-3 align-items-center">
|
||||||
|
<img style="width:200px" th:src="@{/img/finishing.jfif}" class="card-img-top" alt="Finishing">
|
||||||
|
<div class="ps-2 text-center">
|
||||||
|
<h1 class="fw-bold m-0"
|
||||||
|
th:text="${phases.get('finishing')?.intValue() ?: 0} + ' Pcs'"></h1>
|
||||||
|
<h4 class="pt-2 fw-bold text-uppercase m-0">Finishing</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body p-0 text-center d-flex justify-content-center">
|
||||||
|
<div class="pr-2 border-right">
|
||||||
|
<h1 class="card-text" th:text="${phases.get('Reject')?.intValue() ?: 0} + ' Pcs'"></h1>
|
||||||
|
<h2 class="card-title">REJECTION</h2>
|
||||||
|
</div>
|
||||||
|
<div class="pl-2">
|
||||||
|
<h1 class="card-text blink text-danger fw-bold "
|
||||||
|
th:text="${phases.get('ALTER')?.intValue() ?: 0} + ' Pcs'"></h1>
|
||||||
|
<h2 class="card-title blink text-danger fw-bold ">ALTERATION</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body p-0 text-center d-flex justify-content-center">
|
||||||
|
<div class="px-2 ">
|
||||||
|
<h1 class="card-text" th:text="${phases.get('wash')?.intValue() ?: 0} + ' Pcs'"></h1>
|
||||||
|
<h2 class="card-title">WASH/STAIN</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Card 4: Packaging -->
|
||||||
|
<div class="col-lg-3 d-flex">
|
||||||
|
<div class="card w-100 h-100">
|
||||||
|
<div class="container-fluid d-flex p-3 align-items-center">
|
||||||
|
<img style="width:200px" th:src="@{/img/packaging.jfif}" class="card-img-top" alt="Packaging">
|
||||||
|
<div class="ps-4 text-center">
|
||||||
|
<h1 class="fw-bold text-uppercase m-0"
|
||||||
|
th:text="${phases.get('packaging')?.intValue() ?: 0}"></h1>
|
||||||
|
<h4 class="pt-2 fw-bold text-uppercase m-0">Packaging</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body text-center d-flex justify-content-center p-4">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<main id="main2" class="container-fluid main-content" style="display: none;">
|
||||||
|
<div class="row page-main g-4 p-3">
|
||||||
|
<div class="col-lg-12 d-flex border border-black-50">
|
||||||
|
<div id="dashboardBarChart" class="dashboardBarChart w-100"
|
||||||
|
style="min-height: 476px;"
|
||||||
|
th:data-title="${detail.get('articleName')} + ' (' + ${date} + ')'"
|
||||||
|
th:data-dates="${date}"
|
||||||
|
th:data-stitching="${phases.get('Stitching')?.intValue() ?: 0}"
|
||||||
|
th:data-finishing="${phases.get('finishingValueForBarChart')?.intValue() ?: 0}"
|
||||||
|
th:data-packaging="${phases.get('packaging')?.intValue() ?: 0}"
|
||||||
|
th:data-totalProduction="${detail.get('Shift Target')}"
|
||||||
|
th:data-fontSize="35">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row page-main g-4 p-3">
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="h-100 border border-black-50 p-3 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #516ec4;">
|
||||||
|
<h1 class="fw-bold pt-5 pb-2" style="font-size: 6rem;"
|
||||||
|
th:text="${phases.get('remainingQCAlter')?.intValue()}">0%</h1>
|
||||||
|
<h4 class="fw-bold m-0 pt-2 pb-5" style="font-size: 4rem;">Remaining QC Alter Pcs</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="h-100 border border-black-50 p-3 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #72788a;">
|
||||||
|
<h1 class="fw-bold pt-5 pb-2" style="font-size: 6rem;"
|
||||||
|
th:text="${phases.get('remainingFinishAlter')?.intValue()}">0</h1>
|
||||||
|
<h1 class="fw-bold m-0 pt-2 pb-5" style="font-size: 4rem;">Remaining Finish Alter Pcs </h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="h-100 border border-black-50 p-5 d-flex flex-column align-items-center justify-content-center text-center text-white rounded"
|
||||||
|
style="background-color: #4bb85f;">
|
||||||
|
<h1 class="fw-bold pt-5 pb-2" style="font-size: 7rem;"
|
||||||
|
th:text="${phases.get('totalPackaging')?.intValue()}">0</h1>
|
||||||
|
<h1 class="fw-bold m-0 pt-2 pb-5" style="font-size: 4rem;">OverAll Packing</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
setTimeout(function () {
|
||||||
|
document.getElementById("main1").style.display = "none";
|
||||||
|
document.getElementById("main2").style.display = "block";
|
||||||
|
}, 30000);
|
||||||
|
</script>
|
||||||
|
<script th:src="@{/js/charts.js}"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -28,7 +28,9 @@
|
||||||
<!-- th:text="${account.title}"></option>-->
|
<!-- th:text="${account.title}"></option>-->
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" name="qaStatus" v-model="QaStatus">
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-light p-3 mb-3">
|
<div class="bg-light p-3 mb-3">
|
||||||
<h6 class="mb-3">Finished Items</h6>
|
<h6 class="mb-3">Finished Items</h6>
|
||||||
|
@ -38,7 +40,21 @@
|
||||||
></finished-item-table>
|
></finished-item-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
|
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
|
||||||
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
|
<button class="btn btn-primary mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('APPROVED')">APPROVED
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('ALTER')">ALTER
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('B GRADE')">B GRADE
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('REJECT')">REJECT
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-success mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('WASHED')">WASHED
|
||||||
|
</button>
|
||||||
<a th:href="@{/finishing/finished-items}" class="btn btn-light">Cancel</a>
|
<a th:href="@{/finishing/finished-items}" class="btn btn-light">Cancel</a>
|
||||||
</form>
|
</form>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:v-bind="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Packaging Receive Inventory')"></head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<div class="col-sm">
|
||||||
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
|
<h3>Receive Packing Items</h3>
|
||||||
|
</div>
|
||||||
|
<form th:action="'/ctp/packaging/packaging-items'" method="post" id="packagingApp" th:object="${wrapper}">
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<search-item
|
||||||
|
:is-segregated="true"
|
||||||
|
url="/ctp/rest/finished-items/search-packaging"
|
||||||
|
v-on:finished-item-select="onItemSelect">
|
||||||
|
</search-item>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Packaging Account</label>
|
||||||
|
<select class="form-control" name="account-id" th:field="*{accountId}" required>
|
||||||
|
<option value="">PLease select</option>
|
||||||
|
<option th:each="account : ${accounts}"
|
||||||
|
th:value="${account.id}"
|
||||||
|
th:text="${account.title}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<h6 class="mb-3">Search Finished Items</h6>
|
||||||
|
<finish-item-table
|
||||||
|
v-bind:items="items"
|
||||||
|
v-on:remove-item="removeItem"
|
||||||
|
></finish-item-table>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-danger" v-if="hasDuplicates()" >Duplicate Item Selected</div>
|
||||||
|
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
|
||||||
|
<a th:href="@{/packaging/receive-inventory}" class="btn btn-light">Cancel</a>
|
||||||
|
</form>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
window.ctp.accounts = [[${accounts}]];
|
||||||
|
</script>
|
||||||
|
<script th:src="@{/js/vendor/compressor.min.js}"></script>
|
||||||
|
<script th:src="@{/js/packaging/packaging-item-form.js}"></script>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,188 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html
|
||||||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml"
|
||||||
|
xml:lang="en"
|
||||||
|
lang="en"
|
||||||
|
xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<title>Job Card</title>
|
||||||
|
<link rel="stylesheet" type="text/css" th:href="@{|${baseUrl}/css/print.css|}">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:400,400i" rel="stylesheet">
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
@page {
|
||||||
|
size: landscape;
|
||||||
|
margin: 10mm;
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
body {
|
||||||
|
transform: rotate(0deg); /* Not needed for @page landscape */
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.td-value{
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td width="50%">
|
||||||
|
<img width="200" th:src="@{|${baseUrl}/img/utopia-industries.png|}" alt="Utopia Industries">
|
||||||
|
</td>
|
||||||
|
<td width="50%">
|
||||||
|
<table class="bordered">
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td colspan="2" style="text-align: center" th:text="'PO Online Status'"></td>
|
||||||
|
</tr>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 40%;"><i>PO Code</i></td>
|
||||||
|
<td style="width: 60%;">
|
||||||
|
<a class="text-reset" target="_blank" th:text="${poDetail.getPoNumber()}"></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 40%;"><i>Article Name</i></td>
|
||||||
|
<td style="width: 60%;">
|
||||||
|
<a class="text-reset" target="_blank" th:text="${poDetail.getArticleTitle()}"></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>PO Quantity</i></td>
|
||||||
|
<td><span th:text="${poDetail.getPoQuantity()}"></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="align-middle"><i>PO Status</i></td>
|
||||||
|
<td>
|
||||||
|
<span th:if="*{poDetail.isPoStatus}" th:text="'CLOSE'"></span>
|
||||||
|
<span th:if="*{!poDetail.isPoStatus}" th:text="'OPEN'"></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table style="margin-top: 10px;">
|
||||||
|
|
||||||
|
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;">PO Details</h5>
|
||||||
|
<h5 class="no-margin-top no-margin-bottom" style="margin-top: 10px;" ctp:formatdatetime="${date}"></h5>
|
||||||
|
<thead>
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td style="width: 90px; text-align: center"></td>
|
||||||
|
<td style="width: 60px; text-align: center">Cutting Insp.</td>
|
||||||
|
<td style="width: 140px; text-align: center">Stitching</td>
|
||||||
|
<td style="width: 65px; text-align: center">Finished</td>
|
||||||
|
<td style="width: 90px; text-align: center; padding-left: 40px">Rej. Store</td>
|
||||||
|
<td style="width: 100px; text-align: center">Packaging</td>
|
||||||
|
<td style="width: 80px; text-align: center">Shipped</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table >
|
||||||
|
<thead>
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td style="width: 50px; text-align: center" >Req.+ Excess</td>
|
||||||
|
<td style="width: 50px; text-align: center" >Actual Cut</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Bal.To Cut</td>
|
||||||
|
<td style="width: 50px; text-align: center;">Rcvd.</td>
|
||||||
|
<td style="width: 50px; text-align: center">Ok</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Rej.</td>
|
||||||
|
<td style="width: 50px; text-align: center">In</td>
|
||||||
|
<td style="width: 50px; text-align: center">WIP</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Out</td>
|
||||||
|
<td style="width: 50px; text-align: center">In</td>
|
||||||
|
<td style="width: 50px; text-align: center">Rej</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">QA Approv.</td>
|
||||||
|
<td style="width: 50px; text-align: center">Rcvd.</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">waiting</td>
|
||||||
|
<td style="width: 50px; text-align: center">In</td>
|
||||||
|
<td style="width: 50px; text-align: center">Out</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Stock</td>
|
||||||
|
<td style="width: 50px; text-align: center">Scan</td>
|
||||||
|
<td style="width: 50px; text-align: center; border-right: 1px solid white;">Net</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr >
|
||||||
|
<td th:text="${poDetail.getPoRequiredQuantity()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getActualCutting()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getBalanceToCutting()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getCuttingReceived()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getCuttingOki()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getCuttingReject()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getStitchingIn()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getStitchingWips()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getStitchingOut()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getFinishIn()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getFinishRej()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getFinishQaApproved()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getStoreReceived()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getStoreWaiting()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getPackagingIn()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getPackagingOut()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getPackagingStock()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getShippedScan()}" class="td-value"></td>
|
||||||
|
<td th:text="${poDetail.getShippedNet()}" class="td-value"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 50%; margin-top: 20px;" th:if="${showStore}">
|
||||||
|
<table class="bordered" style="margin-top: 10px;">
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td colspan="2" style="text-align: center" th:text="'Reject Items In Store'"></td>
|
||||||
|
</tr>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="heading : ${store.keySet()}"
|
||||||
|
th:if="${store != null and not store.isEmpty()}">
|
||||||
|
<td style="width: 40%;"><i th:text="${heading}"></i></td>
|
||||||
|
<td style="width: 60%;">
|
||||||
|
<a class="text-reset" target="_blank" th:text="${store.get(heading)}"></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td style="width: 50%; margin-top: 20px;" th:if="${showItems && poItems.values() != null and not poItems.values().isEmpty() }">
|
||||||
|
<table class="bordered" style="margin-top: 10px;">
|
||||||
|
<thead>
|
||||||
|
<tr class="tr-header">
|
||||||
|
<td>Sku</td>
|
||||||
|
<td>Color</td>
|
||||||
|
<td>Size</td>
|
||||||
|
<td>Expected Production</td>
|
||||||
|
<td>Total Cutting</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="items : ${poItems.values()}" th:object="${items}">
|
||||||
|
<td th:text="*{sku}"></td>
|
||||||
|
<td th:text="*{color}"></td>
|
||||||
|
<td th:text="*{size}"></td>
|
||||||
|
<td th:text="*{totalProduction}"></td>
|
||||||
|
<td th:text="*{totalCutting}"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,63 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Home Page')"></head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<div class="col-sm" th:fragment="cardFragment">
|
||||||
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
|
<form th:action="${purchaseOrder.id} != null ? @{/purchase-order/edit/(id=${purchaseOrder.id})} : @{/purchase-order/edit}"
|
||||||
|
method="POST"
|
||||||
|
id="jobCardApp">
|
||||||
|
<div class="bg-light p-3 mb-3">
|
||||||
|
<h6 class="mb-3">Info</h6>
|
||||||
|
<input hidden="hidden" th:field="${purchaseOrder.id}">
|
||||||
|
<input hidden="hidden" th:field="${purchaseOrder.createdAt}">
|
||||||
|
<input hidden="hidden" th:field="${purchaseOrder.createdBy}">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Purchase Order Code</label>
|
||||||
|
<input class="form-control" th:field="${purchaseOrder.purchaseOrderCode}" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Purchase Order Quantity</label>
|
||||||
|
<input class="form-control" th:field="${purchaseOrder.purchaseOrderQuantity}" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Required Quantity</label>
|
||||||
|
<input class="form-control" th:field="${purchaseOrder.purchaseOrderQuantityRequired}" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 form-group">
|
||||||
|
<label>Article Name</label>
|
||||||
|
<input type="text" class="form-control" th:field="${purchaseOrder.articleName}" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 form-group">
|
||||||
|
<label for="active">Status OPEN/CLOSE</label>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="custom-control-label:" type="checkbox" id="active" th:field="*{purchaseOrder.poStatus}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button class="btn btn-secondary" type="submit" name="user" value="draft"
|
||||||
|
v-bind:disabled="hasEmptyItems()">
|
||||||
|
Save Draft
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary" type="submit" name="user" value="post"
|
||||||
|
v-bind:disabled="hasEmptyItems()">
|
||||||
|
Post
|
||||||
|
</button>
|
||||||
|
<a th:href="@{/purchase-order}" class="btn btn-light">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,71 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:uind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Purchase Order')"></head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
<main class="row page-main">
|
||||||
|
<!-- sidebar starts -->
|
||||||
|
<aside class="col-sm-2" th:replace="/purchaseOrder/purchase-order-sidebar :: sidebar"></aside>
|
||||||
|
<!-- sidebar ends -->
|
||||||
|
<!--header starts-->
|
||||||
|
<div class="col-sm">
|
||||||
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
|
<h3>All PO's</h3>
|
||||||
|
<a th:href="@{/purchase-order/new}" class="btn btn-primary">Add New</a>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
||||||
|
<!-- Show table if purchaseOrder is not null and not empty -->
|
||||||
|
<table th:if="${purchaseOrder != null and !purchaseOrder.isEmpty()}" class="table table-striped font-sm" >
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>PO Code</th>
|
||||||
|
<th>PO Quantity</th>
|
||||||
|
<th>Required Quantity</th>
|
||||||
|
<th>Article Name</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>PO Status</th>
|
||||||
|
<th>Action</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="order : ${purchaseOrder}" th:object="${purchaseOrder}">
|
||||||
|
<td th:text="${order.purchaseOrderCode}"></td>
|
||||||
|
<td th:text="${order.purchaseOrderQuantity}"></td>
|
||||||
|
<td th:text="${order.purchaseOrderQuantityRequired}"></td>
|
||||||
|
<td th:text="${order.articleName}"></td>
|
||||||
|
<td ctp:formatdatetime="${order.createdAt}"></td>
|
||||||
|
<td th:text="${order.createdBy}"></td>
|
||||||
|
<td>
|
||||||
|
<span class="badge font-sm" th:classappend="'badge-' + ${order.status}" th:if="${order.status}" th:text="${order.status}"></span>
|
||||||
|
<span th:unless="${order.status}">-</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span th:if="${!order.poStatus}" class="badge badge-APPROVED">OPEN</span>
|
||||||
|
<div th:if="${order.poStatus}">
|
||||||
|
<span class="badge badge-danger" >CLOSE</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<th:block >
|
||||||
|
<a th:href="@{'/purchase-order/edit/' + ${order.id}}" class="btn btn-sm btn-secondary" title="Edit">
|
||||||
|
<i class="bi bi-pencil"></i>
|
||||||
|
</a>
|
||||||
|
</th:block>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!-- Show message if purchaseOrder is null or empty -->
|
||||||
|
<h4 th:if="${purchaseOrder == null or purchaseOrder.isEmpty()}">No POs found.</h4>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,43 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
|
||||||
|
<head th:replace="_fragments :: head('Home Page')"></head>
|
||||||
|
<body>
|
||||||
|
<!-- sidebar starts -->
|
||||||
|
<aside class="col-sm-2" th:fragment="sidebar">
|
||||||
|
<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>PO Code</label>
|
||||||
|
<input type="text" class="form-control" name="purchaseOrderCode" maxlength="100" th:value="${param['purchaseOrderCode']}">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Article Name</label>
|
||||||
|
<input type="text" class="form-control" name="articleName" maxlength="100" th:value="${param['articleName']}">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>From Date</label>
|
||||||
|
<input type="date" class="form-control" name="created-start-date" th:value="${param['created-start-date'] ?: startDate }" >
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>To Date</label>
|
||||||
|
<input type="date" class="form-control" name="created-end-date" th:value="${param['created-end-date'] ?: endDate}" >
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Count</label>
|
||||||
|
<input type="number" class="form-control" name="limit"
|
||||||
|
th:value="${param['limits'] ?: 100}">
|
||||||
|
</div>
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<!-- sidebar ends -->
|
||||||
|
<div th:fragment="page-footer-scripts">
|
||||||
|
<script th:src="@{/js/vendor/lazyload-db.js}"></script>
|
||||||
|
<script th:src="@{/js/main.js}"></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -21,6 +21,7 @@
|
||||||
v-on:finished-item-select="onItemSelect">
|
v-on:finished-item-select="onItemSelect">
|
||||||
</search-item>
|
</search-item>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" name="qaStatus" v-model="QaStatus">
|
||||||
<div class="col-sm-3 form-group">
|
<div class="col-sm-3 form-group">
|
||||||
<label>Finishing Account</label>
|
<label>Finishing Account</label>
|
||||||
<select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>
|
<select class="form-control" name="account-id" th:field="*{finishedAccountId}" required>
|
||||||
|
@ -40,7 +41,12 @@
|
||||||
</stitched-item-table>
|
</stitched-item-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
|
<div class="alert alert-danger" v-if="hasDuplicates()">Duplicate Item Selected</div>
|
||||||
<button class="btn btn-primary" type="submit" v-bind:disabled="hasDuplicates()">Submit</button>
|
<button class="btn btn-primary mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('APPROVED')">APPROVED
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-danger mr-2" type="button" :disabled="hasDuplicates() || items.length === 0"
|
||||||
|
@click="submitWithQaStatus('REJECT')">REJECT
|
||||||
|
</button>
|
||||||
<a th:href="@{/quality-control/qc-finished-items}" class="btn btn-light">Cancel</a>
|
<a th:href="@{/quality-control/qc-finished-items}" class="btn btn-light">Cancel</a>
|
||||||
</form>
|
</form>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:uind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
|
xmlns:uind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
<head th:replace="_fragments :: head('Finished Item')"></head>
|
<head th:replace="_fragments :: head('Qc Finished Item')"></head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div th:replace="_notices :: page-notices"></div>
|
<div th:replace="_notices :: page-notices"></div>
|
||||||
<div class="mb-4 d-flex justify-content-between">
|
<div class="mb-4 d-flex justify-content-between">
|
||||||
<h3>Finished Items</h3>
|
<h3>QC Items</h3>
|
||||||
<a th:href="@{/quality-control/qc-finished-item}" class="btn btn-primary">Add Items For QC</a>
|
<a th:href="@{/quality-control/qc-finished-item}" class="btn btn-primary">Add Items For QC</a>
|
||||||
</div>
|
</div>
|
||||||
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
<div th:replace="_fragments :: table-loading-skeleton"></div>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,113 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<style>
|
||||||
|
/* Custom CSS for full height and center alignment of span */
|
||||||
|
.vertical-divider {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center; /* Center horizontally */
|
||||||
|
align-items: center; /* Center vertically */
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-divider span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 1px;
|
||||||
|
background-color: #dee2e6;
|
||||||
|
height: 100%; /* Take full height of the parent div */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm mb-4" data-account-tables>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Item ID</th>
|
||||||
|
<th>SKU</th>
|
||||||
|
<th>QR Code</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Created At</th>
|
||||||
|
<th>Bundle Id</th>
|
||||||
|
<th>QA Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="transaction : ${transactions}" th:object="${transaction}">
|
||||||
|
<td th:text="*{id}"></td>
|
||||||
|
<td th:text="*{itemId}"></td>
|
||||||
|
<td th:text="*{sku}"></td>
|
||||||
|
<td th:text="*{barcode}"></td>
|
||||||
|
<td th:text="*{createdBy}"></td>
|
||||||
|
<td th:text="*{createdAt}"></td>
|
||||||
|
<td th:text="*{bundleId}"></td>
|
||||||
|
<td>
|
||||||
|
<span th:if="*{ not isQa}" class="badge badge-danger">NOT PERFORMED</span>
|
||||||
|
<div th:if="*{isQa}">
|
||||||
|
<span class="badge badge-APPROVED">PERFORMED</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- More rows as needed -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h5 th:if="${#lists.size(transactions) == 0}" class="mt-2">No Inventory Transactions found.</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
|
||||||
|
// Initialize DataTables for each individual table
|
||||||
|
$('table[data-account-tables]').each(function () {
|
||||||
|
const $table = $(this);
|
||||||
|
|
||||||
|
// Prevent reinitializing if already done
|
||||||
|
if (!$.fn.DataTable.isDataTable($table)) {
|
||||||
|
$table.DataTable({
|
||||||
|
pageLength: 5,
|
||||||
|
searching: true,
|
||||||
|
lengthChange: false,
|
||||||
|
processing: false,
|
||||||
|
dom: `
|
||||||
|
<'row'<'col-sm-5'B><'col-sm-7'f>>
|
||||||
|
<'row'<'col-sm-12't>>
|
||||||
|
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
|
||||||
|
buttons: [{
|
||||||
|
extend: 'excel',
|
||||||
|
text: '',
|
||||||
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none' // Keep it hidden
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
(async function () {
|
||||||
|
const $selectAllCheckBox = $('[data-checkbox-all]');
|
||||||
|
|
||||||
|
$selectAllCheckBox.change(function () {
|
||||||
|
if ($selectAllCheckBox.prop('checked')) {
|
||||||
|
// When parent checkbox is checked, check all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', true);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// When parent checkbox is unchecked, uncheck all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(jQuery)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -22,7 +22,7 @@
|
||||||
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
<input type="date" class="form-control" name="end-date" th:value="${param['end-date'] ?: endDate}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Cutting Account</label>
|
<label>Select Account</label>
|
||||||
<select class="form-control" name="accountId">
|
<select class="form-control" name="accountId">
|
||||||
<option value="">Please Select</option>
|
<option value="">Please Select</option>
|
||||||
<option th:each="account : ${accounts}"
|
<option th:each="account : ${accounts}"
|
||||||
|
@ -32,6 +32,10 @@
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Count</label>
|
||||||
|
<input type="number" class="form-control" name="count" maxlength="100" min="0" th:value="${param['count'] ?: 100}">
|
||||||
|
</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>
|
||||||
|
|
|
@ -3,19 +3,27 @@
|
||||||
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
<head th:replace="_fragments :: head('Cutting Report')"></head>
|
<head th:replace="_fragments :: head('Cutting Report')"></head>
|
||||||
|
<style>
|
||||||
|
div.dataTables_wrapper div.dataTables_filter {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
div.dataTables_wrapper .dt-buttons {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
div.dataTables_wrapper div.dataTables_info {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
|
<aside class="col-sm-2" th:replace="/reporting/cutting-report-sidebar :: sidebar"></aside>
|
||||||
<div class="col-sm">
|
<div class="col-lg-10">
|
||||||
<table class="table table-striped" data-account-table data-order="[[ 0, "asc" ]]">
|
<div th:if="${cutting.get('Date Wise Cutting') != null}" class="d-flex justify-content-center">
|
||||||
<tbody>
|
<div class="border rounded-3 pt-2 mx-auto overflow-auto" style="height: 560px; width: 80%;">
|
||||||
<tr>
|
<div id="singleBarChart" class="singleBarChart" style="height: 500px; width: 1600px;"
|
||||||
<td th:if="${cutting.get('Date Wise Cutting') != null}" style="padding-left: 150px;">
|
|
||||||
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
|
|
||||||
<div id="cuttingBarChart" class="cuttingBarChart" style="height: 500px; width: 1600px;"
|
|
||||||
th:data-width="1600"
|
th:data-width="1600"
|
||||||
th:data-height="500"
|
th:data-height="500"
|
||||||
th:data-title="'Days Wise Progress'"
|
th:data-title="'Days Wise Progress'"
|
||||||
|
@ -29,13 +37,15 @@
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
<div class="mt-3" th:if="${cutting.get('cuttingAccount') != null}"
|
||||||
<tr th:if="${cutting.get('cuttingAccount') != null}" th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
|
th:each="cuttingAccount, index : ${cutting.get('cuttingAccount')}">
|
||||||
<td th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}" class="p-0 text-center">
|
<div th:if="${cutting.get('accountWiseCutting').containsKey(cuttingAccount.id)}"
|
||||||
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center" th:text="${cuttingAccount.title}"></div>
|
class="p-0 text-center">
|
||||||
<table class="table table-bordered mt-2">
|
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center"
|
||||||
<thead class="">
|
th:text="${cuttingAccount.title}"></div>
|
||||||
|
<table class="table table-bordered mt-2 datatable">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Job Card</th>
|
<th>Job Card</th>
|
||||||
<th>PO Number</th>
|
<th>PO Number</th>
|
||||||
|
@ -57,8 +67,8 @@
|
||||||
<td th:text="${wrap.poName}"></td>
|
<td th:text="${wrap.poName}"></td>
|
||||||
<td th:text="${wrap.sku}"></td>
|
<td th:text="${wrap.sku}"></td>
|
||||||
<td th:text="${wrap.articleName}"></td>
|
<td th:text="${wrap.articleName}"></td>
|
||||||
<td th:text="${wrap.totalCutting}"></td>
|
<td th:text="${wrap.total}"></td>
|
||||||
<td th:text="${wrap.cuttingOperatorName}"></td>
|
<td th:text="${wrap.operatorName}"></td>
|
||||||
<td th:text="${wrap.width}"></td>
|
<td th:text="${wrap.width}"></td>
|
||||||
<td th:text="${wrap.length}"></td>
|
<td th:text="${wrap.length}"></td>
|
||||||
<td th:text="${wrap.gsm}"></td>
|
<td th:text="${wrap.gsm}"></td>
|
||||||
|
@ -73,15 +83,42 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Load chart logic -->
|
||||||
<!-- Load JavaScript file -->
|
|
||||||
<script th:src="@{/js/charts.js}"></script>
|
<script th:src="@{/js/charts.js}"></script>
|
||||||
|
|
||||||
|
<!-- DataTables Initialization -->
|
||||||
|
<script>
|
||||||
|
const dataTableConfig = {
|
||||||
|
pageLength: 5,
|
||||||
|
searching: true,
|
||||||
|
lengthChange: false,
|
||||||
|
processing: false,
|
||||||
|
info: true,
|
||||||
|
paging: true,
|
||||||
|
dom: `
|
||||||
|
<'row mb-2 mt-2'<'col-sm-6'f><'col-sm-6'B>>
|
||||||
|
<'row'<'col-sm-12'tr>>
|
||||||
|
<'row mt-2'<'col-sm-6'i><'col-sm-6 text-end'p>>`
|
||||||
|
,
|
||||||
|
buttons: []
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('table.datatable').each(function () {
|
||||||
|
const $table = $(this);
|
||||||
|
if (!$.fn.DataTable.isDataTable($table)) {
|
||||||
|
$table.DataTable(dataTableConfig);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -10,25 +10,37 @@
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<aside class="col-sm-2" th:replace="/reporting/inventory-summary-sidebar :: sidebar"></aside>
|
<aside class="col-sm-2" th:replace="/reporting/inventory-summary-sidebar :: sidebar"></aside>
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-lg-10">
|
||||||
<h3>Summary</h3>
|
<h3>Summary</h3>
|
||||||
|
|
||||||
<table th:if="${tableData != null}" class=" table table-striped table-bordered table-hover font-sm " data-table data-order="[[ 0, "asc" ]]">
|
<!-- Scrollable wrapper to prevent overflow -->
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table th:if="${tableData != null}"
|
||||||
|
class="table table-striped table-bordered table-hover font-sm"
|
||||||
|
data-table
|
||||||
|
data-order="[[ 0, "asc" ]]"
|
||||||
|
style="min-width: 1000px;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="1">SKU / Date</th>
|
<th colspan="1">SKU / Date</th>
|
||||||
<th class="text-center text-center" th:each="date: ${dateLimits}" >
|
<th class="text-center" th:each="date: ${dateLimits}">
|
||||||
<span class="d-block " style="width: 100px !important; padding-left: 70px; " th:text="${#temporals.format(date, 'E')}"></span>
|
<span class="d-block" style="width: 100px !important; padding-left: 70px;"
|
||||||
<span class="d-block pl-4 " style="width: 150px !important; " ctp:formatdate="${date}" ></span>
|
th:text="${#temporals.format(date, 'E')}"></span>
|
||||||
|
<span class="d-block pl-4" style="width: 150px !important;"
|
||||||
|
ctp:formatdate="${date}"></span>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="sku : ${tableData.keySet()}">
|
<tr th:each="sku : ${tableData.keySet()}">
|
||||||
<!-- SKU Column (first td) -->
|
<!-- SKU Column -->
|
||||||
<td th:rowspan="${#lists.size(sku)}" th:text="${sku}" class="align-middle" rowspan="3" ></td>
|
<td th:rowspan="${#lists.size(sku)}"
|
||||||
|
th:text="${sku}"
|
||||||
|
class="align-middle"
|
||||||
|
rowspan="3"></td>
|
||||||
<td th:each="dates: ${dateLimits}" class="p-0">
|
<td th:each="dates: ${dateLimits}" class="p-0">
|
||||||
<table th:each="data : ${tableData.get(sku)}" class="table table-striped table-bordered table-hover font-sm m-0 " >
|
<table th:each="data : ${tableData.get(sku)}"
|
||||||
|
class="table table-striped table-bordered table-hover font-sm m-0">
|
||||||
<thead th:if="${data.getKey() == dates.toString()}">
|
<thead th:if="${data.getKey() == dates.toString()}">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
@ -58,8 +70,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h4 th:if="${tableData == null}"> No data found </h4>
|
<h4 th:if="${tableData == null}"> No data found </h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,38 +9,35 @@
|
||||||
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
<header class="row page-header" th:replace="_fragments :: page-header"></header>
|
||||||
<main class="row page-main">
|
<main class="row page-main">
|
||||||
<aside class="col-sm-2" th:replace="/reporting/job-card-report-sidebar :: sidebar"></aside>
|
<aside class="col-sm-2" th:replace="/reporting/job-card-report-sidebar :: sidebar"></aside>
|
||||||
<div class="col-sm">
|
<div class="col-lg-10">
|
||||||
<table class="table " >
|
<div th:if="${jobCardProgress == null}" class="text-center my-5">
|
||||||
<thead>
|
<h2 class="fs-1">Please Select Job Card</h2>
|
||||||
<tr th:if="${jobCardProgress == null}">
|
</div>
|
||||||
<th colspan="5" style="font-size:26px; text-align: center;">Please Select Job card</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<div th:if="${jobCardProgress != null}">
|
||||||
<tr th:if="${jobCardProgress != null }">
|
<div class="border rounded-3 pt-4 ">
|
||||||
<td style="padding:0px;">
|
<h1 class="text-center mb-5">Job Card Report</h1>
|
||||||
<div style="border: 2px solid #d5d8dc; padding: 10px; border-radius: 10px; height: 370px;">
|
|
||||||
<h1 style="text-align: center;">Job Card Report</h1>
|
<div class="row justify-content-center align-items-start">
|
||||||
<div style="display: flex; align-items: center;">
|
<div class="text-center">
|
||||||
<div style="text-align: center;margin-top: -45px">
|
<div class="gauge-chart2"
|
||||||
<div style="width: 300px; height: 330px;"
|
|
||||||
th:id="'gauge-chart2'"
|
th:id="'gauge-chart2'"
|
||||||
class="gauge-chart2"
|
|
||||||
th:data-progress="${jobCardProgress.get('Job Card Progress')}"
|
th:data-progress="${jobCardProgress.get('Job Card Progress')}"
|
||||||
th:data-title="${'Job Card Progress'}"
|
th:data-title="'Job Card Progress'"
|
||||||
th:data-width="350"
|
th:data-width="350"
|
||||||
th:data-height="350"
|
th:data-height="350"
|
||||||
th:data-totalProduction="${totalProduction}"
|
th:data-totalProduction="${totalProduction}"
|
||||||
th:data-actualProduction="${completeProduction.get('Job Card Progress')}"
|
th:data-actualProduction="${completeProduction.get('Job Card Progress')}"
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30"
|
||||||
th:data-fontColor="'#17202a'"
|
th:data-fontColor="'#17202a'"
|
||||||
th:data-color="'#566573'"></div>
|
th:data-color="'#566573'">
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; ">
|
</div>
|
||||||
<div th:each="title, index : ${jobCardProgress.keySet()}" style="text-align: center; margin-top: 40px;">
|
<div class="d-flex flex-wrap justify-content-center gap-2 " style="margin-top: 70px;">
|
||||||
<div th:if ="${ title != 'Job Card Progress' }"
|
<div th:each="title, index : ${jobCardProgress.keySet()}"
|
||||||
th:id="'gauge-chart-' + ${index}" class="gauge-chart" style="width: 200px; height: 230px;"
|
th:if="${title != 'Job Card Progress'}" class="text-center">
|
||||||
|
<div class="gauge-chart"
|
||||||
|
th:id="'gauge-chart-' + ${index}"
|
||||||
th:data-progress="${jobCardProgress.get(title)}"
|
th:data-progress="${jobCardProgress.get(title)}"
|
||||||
th:data-totalProduction="${totalProduction}"
|
th:data-totalProduction="${totalProduction}"
|
||||||
th:data-actualProduction="${completeProduction.get(title)}"
|
th:data-actualProduction="${completeProduction.get(title)}"
|
||||||
|
@ -58,37 +55,38 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
<div th:if="${phasesTimes != null}" class="d-flex flex-column align-items-center my-2">
|
||||||
<tr th:if="${phasesTimes != null }">
|
<div class="d-flex flex-wrap gap-3">
|
||||||
<td style="display: flex; flex-direction: column; align-items: center; border: none !important; outline: none;">
|
<div th:each="phase, index : ${phasesTimes.keySet()}"
|
||||||
<div style="display: flex; gap: 10px;">
|
class="border rounded-3 text-center p-3 mr-3">
|
||||||
<div th:each="phase, index : ${phasesTimes.keySet()}" style="border: 2px solid #d5d8dc; border-radius: 10px; text-align: center; padding:20px;">
|
<h6 th:text="${phase}"></h6>
|
||||||
<H6 th:text="${phase}"></H6>
|
<h6 th:text="${phasesTimes.get(phase)}"></h6>
|
||||||
<H6 th:text="${phasesTimes.get(phase)}"></H6>
|
<h6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></h6>
|
||||||
<H6 th:if="${pendingStatus.get(phase) != null}" th:text="${pendingStatus.get(phase)}"></H6>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
|
||||||
<tr>
|
<div class="my-5">
|
||||||
<!-- Cutting Details Column -->
|
<div class="row g-4">
|
||||||
<td th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
|
<div class="col-md-6"
|
||||||
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
|
th:if="${cuttingDetails != null && cuttingDetails.get('accounts') != null}">
|
||||||
|
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
|
||||||
Cutting Detail
|
Cutting Detail
|
||||||
</div>
|
</div>
|
||||||
<table class="table" style="width: 100%; border-collapse: collapse;">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table class="table table-bordered align-middle">
|
||||||
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Cutting</th>
|
<th>Cutting</th>
|
||||||
<th>Cutting Date</th>
|
<th>Cutting Date</th>
|
||||||
<th>Cutting Table Descriptions</th>
|
<th>Descriptions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:if="${cuttingDetails != null}" th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
|
<tr th:each="detail, index : ${cuttingDetails.get('accounts').keySet()}">
|
||||||
<td th:text="${cuttingDetails.get('accounts').get(detail).id}"></td>
|
<td th:text="${cuttingDetails.get('accounts').get(detail).id}"></td>
|
||||||
<td th:text="${cuttingDetails.get('accounts').get(detail).title}"></td>
|
<td th:text="${cuttingDetails.get('accounts').get(detail).title}"></td>
|
||||||
<td th:text="${cuttingDetails.get('personName').get(detail)}"></td>
|
<td th:text="${cuttingDetails.get('personName').get(detail)}"></td>
|
||||||
|
@ -100,43 +98,47 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Stitching Details Column -->
|
<div class="col-md-6"
|
||||||
<td th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}" style="padding: 0px; text-align: center;">
|
th:if="${stitchingDetails != null && stitchingDetails.get('accounts') != null}">
|
||||||
<div style="background-color: black; color: white; padding: 10px; font-size: 18px; font-weight: bold; text-align: center;">
|
<div class="bg-dark text-white text-center py-2 rounded-3 mb-3">
|
||||||
Stitching Detail
|
Stitching Detail
|
||||||
</div>
|
</div>
|
||||||
<table class="table" style="width: 100%; border-collapse: collapse;">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table class="table table-bordered align-middle">
|
||||||
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Stitching</th>
|
<th>Stitching</th>
|
||||||
<th>Stitching Day</th>
|
<th>Stitching Day</th>
|
||||||
<th>Stitching Table Descriptions</th>
|
<th>Descriptions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody th:if="${stitchingDetails != null and stitchingDetails.get('accounts') != null}">
|
<tbody>
|
||||||
<tr th:each="detail : ${stitchingDetails.get('accounts').keySet()}">
|
<tr th:each="detail : ${stitchingDetails.get('accounts').keySet()}">
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).id}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).id}"></td>
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).title}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).title}"></td>
|
||||||
<td th:text="${stitchingDetails.get('personName') != null ? stitchingDetails.get('personName').get(detail) : ''}"></td>
|
<td th:text="${stitchingDetails.get('personName') != null ? stitchingDetails.get('personName').get(detail) : ''}"></td>
|
||||||
<td>
|
<td>
|
||||||
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
|
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
|
||||||
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}" ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
|
th:text="${#temporals.format(stitchingDetails.get('date').get(detail), 'E')}"></span>
|
||||||
|
<span th:if="${stitchingDetails.get('date') != null and stitchingDetails.get('date').get(detail) != null}"
|
||||||
|
ctp:formatdate="${stitchingDetails.get('date').get(detail)}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td th:text="${stitchingDetails.get('accounts').get(detail).notes}"></td>
|
<td th:text="${stitchingDetails.get('accounts').get(detail).notes}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div th:if="${dailyProgress != null}" class="d-flex justify-content-center my-5">
|
||||||
<tr th:if="${dailyProgress != null}">
|
<div class="border rounded-3 p-3 w-75 overflow-auto" style="height: 560px;">
|
||||||
<td colspan="5" style="padding-left: 150px;">
|
|
||||||
<div style="border: 2px solid #d5d8dc; padding-top: 10px; border-radius: 10px; height: 560px; width: 80%; overflow-x: auto;">
|
|
||||||
<div id="barChart" class="barChart" style="height: 500px; width: 1600px;"
|
<div id="barChart" class="barChart" style="height: 500px; width: 1600px;"
|
||||||
th:data-width="1600"
|
th:data-width="1600"
|
||||||
th:data-height="500"
|
th:data-height="500"
|
||||||
|
@ -147,13 +149,11 @@
|
||||||
th:data-quality="${dailyProgress.get('quality')}"
|
th:data-quality="${dailyProgress.get('quality')}"
|
||||||
th:data-finishing="${dailyProgress.get('finishing')}"
|
th:data-finishing="${dailyProgress.get('finishing')}"
|
||||||
th:data-totalProduction="${completeProduction.get('Cutting Progress')}"
|
th:data-totalProduction="${completeProduction.get('Cutting Progress')}"
|
||||||
th:data-fontSize="30"
|
th:data-fontSize="30">
|
||||||
></div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue