Remove obsolete controllers and repositories.
This commit deletes unused controllers like PremiseController and repos such as NodeRepository. It also introduces new DTOs, services, and updates existing ones for improved modularity and functionality. These changes streamline the codebase and enhance maintainability.
This commit is contained in:
parent
dd830e0097
commit
8608fe349b
80 changed files with 1508 additions and 327 deletions
|
|
@ -2,6 +2,8 @@ package de.avatic.lcc.controller.bulk;
|
|||
|
||||
|
||||
import de.avatic.lcc.dto.bulk.BulkFileType;
|
||||
import de.avatic.lcc.dto.bulk.BulkProcessingType;
|
||||
import de.avatic.lcc.dto.bulk.BulkStatus;
|
||||
import de.avatic.lcc.service.bulk.BulkExportService;
|
||||
import de.avatic.lcc.service.bulk.BulkFileProcessingService;
|
||||
import de.avatic.lcc.service.bulk.TemplateGenerationService;
|
||||
|
|
@ -12,6 +14,11 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* REST controller for handling bulk operations, including file uploads, template generation,
|
||||
* and export downloads. It provides a comprehensive set of endpoints to manage processing
|
||||
* operations for supported file types based on defined business requirements.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/bulk")
|
||||
public class BulkOperationController {
|
||||
|
|
@ -26,37 +33,89 @@ public class BulkOperationController {
|
|||
this.bulkExportService = bulkExportService;
|
||||
}
|
||||
|
||||
@GetMapping("/status/{id}")
|
||||
public ResponseEntity<Void> getUploadStatus(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok().build();
|
||||
/**
|
||||
* Retrieves the current status of a specific bulk processing operation.
|
||||
*
|
||||
* @param id The unique identifier of the operation (processing_id) to check its status.
|
||||
* @return A ResponseEntity with the bulk processing status payload.
|
||||
*/
|
||||
@GetMapping("/status/{processing_id}")
|
||||
public ResponseEntity<BulkStatus> getUploadStatus(@PathVariable("processing_id") Integer id) {
|
||||
return ResponseEntity.ok(bulkProcessingService.getStatus(id));
|
||||
}
|
||||
|
||||
@PostMapping("/upload/{type}")
|
||||
public ResponseEntity<Void> uploadFile(@PathVariable String type, @RequestParam("file") MultipartFile file) {
|
||||
return ResponseEntity.ok().build();
|
||||
/**
|
||||
* Handles the upload of a file for a specific processing type and file type.
|
||||
*
|
||||
* @param processingType The processing type ("full" or "append") associated with the upload.
|
||||
* @param type The file type being uploaded, as defined in {@link BulkFileType}.
|
||||
* @param file The file to be uploaded, provided as a multipart file.
|
||||
* @return A ResponseEntity indicating whether the upload was processed successfully.
|
||||
*/
|
||||
@PostMapping("/upload/{type}/{processing_type}")
|
||||
public ResponseEntity<Integer> uploadFile(@PathVariable("processing_type") BulkProcessingType processingType, @PathVariable BulkFileType type, @RequestParam("file") MultipartFile file) {
|
||||
return ResponseEntity.ok(bulkProcessingService.processFile(type, processingType, file));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates and downloads a template file for the specified file type.
|
||||
*
|
||||
* @param type The type of file template to generate, based on the {@link BulkFileType} enumeration.
|
||||
* @return A ResponseEntity with the generated template as an InputStreamResource.
|
||||
* The response includes the appropriate Excel MIME type and a Content-Disposition header
|
||||
* specifying it as a downloadable file.
|
||||
* @throws IllegalArgumentException if the file type is invalid.
|
||||
*/
|
||||
@GetMapping("/templates/{type}")
|
||||
public ResponseEntity<InputStreamResource> generateTemplate(@PathVariable String type) {
|
||||
public ResponseEntity<InputStreamResource> generateTemplate(@PathVariable BulkFileType type) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Content-Disposition", "attachment; filename=lcc_template_"+type.toLowerCase()+".xlsx");
|
||||
headers.add("Content-Disposition", "attachment; filename=lcc_template_" + type.name().toLowerCase() + ".xlsx");
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentType(MediaType.parseMediaType("application/vnd.ms-excel"))
|
||||
.body(new InputStreamResource(templateGenerationService.generateTemplate(BulkFileType.valueOf(type.toUpperCase()))));
|
||||
.body(new InputStreamResource(templateGenerationService.generateTemplate(BulkFileType.valueOf(type.name().toUpperCase()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads an export file for the specified file type.
|
||||
*
|
||||
* @param type The type of file to export, as defined in {@link BulkFileType}.
|
||||
* @return A ResponseEntity with the exported file as an InputStreamResource.
|
||||
* The file is served as an Excel document, with proper headers for download.
|
||||
* @throws IllegalArgumentException if the provided file type is not supported.
|
||||
*/
|
||||
@GetMapping("/download/{type}")
|
||||
public ResponseEntity<InputStreamResource> downloadFile(@PathVariable String type) {
|
||||
public ResponseEntity<InputStreamResource> downloadFile(@PathVariable BulkFileType type) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Content-Disposition", "attachment; filename=lcc_export_"+type.toLowerCase()+".xlsx");
|
||||
headers.add("Content-Disposition", "attachment; filename=lcc_export_" + type.name().toLowerCase() + ".xlsx");
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentType(MediaType.parseMediaType("application/vnd.ms-excel"))
|
||||
.body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.toUpperCase()))));
|
||||
.body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.name().toUpperCase()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads an export file for the specified file type, filtered by a validity period.
|
||||
*
|
||||
* @param type The type of file to export, according to {@link BulkFileType}.
|
||||
* @param validityPeriodId The ID of the validity period to apply filtering for the export.
|
||||
* @return A ResponseEntity containing the exported file as an InputStreamResource.
|
||||
* The file is served as an Excel document, with appropriate headers for download.
|
||||
* @throws IllegalArgumentException if the file type or validity period ID is invalid.
|
||||
*/
|
||||
@GetMapping("/download/{type}/{validity_period_id}")
|
||||
public ResponseEntity<InputStreamResource> downloadFile(@PathVariable BulkFileType type, @PathVariable("validity_period_id") Integer validityPeriodId) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Content-Disposition", "attachment; filename=lcc_export_" + type.name().toLowerCase() + ".xlsx");
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentType(MediaType.parseMediaType("application/vnd.ms-excel"))
|
||||
.body(new InputStreamResource(bulkExportService.generateExport(BulkFileType.valueOf(type.name().toUpperCase()), validityPeriodId)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package de.avatic.lcc.controller.calculation;
|
||||
|
||||
|
||||
import de.avatic.lcc.dto.calculation.edit.SetSupplierDTO;
|
||||
import de.avatic.lcc.dto.calculation.create.PremiseSearchResultDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.*;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateType;
|
||||
import de.avatic.lcc.dto.calculation.view.PremiseViewDTO;
|
||||
import de.avatic.lcc.service.calculation.PremiseSearchStringAnalyzerService;
|
||||
import de.avatic.lcc.service.calculation.PremiseCreationService;
|
||||
import de.avatic.lcc.service.calculation.PremisesService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/calculation")
|
||||
public class CalculationController {
|
||||
|
||||
private final PremiseSearchStringAnalyzerService premiseSearchStringAnalyzerService;
|
||||
private final PremisesService premisesServices;
|
||||
private final PremiseCreationService premiseCreationService;
|
||||
|
||||
public CalculationController(PremiseSearchStringAnalyzerService premiseSearchStringAnalyzerService, PremisesService premisesServices, PremiseCreationService premiseCreationService) {
|
||||
this.premiseSearchStringAnalyzerService = premiseSearchStringAnalyzerService;
|
||||
this.premisesServices = premisesServices;
|
||||
this.premiseCreationService = premiseCreationService;
|
||||
}
|
||||
|
||||
@GetMapping("/view")
|
||||
public ResponseEntity<List<PremiseViewDTO>> listPremises(@RequestParam String filter, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer limit, @RequestParam(name = "user", required = false) Integer userId, @RequestParam(required = false) Boolean deleted, @RequestParam(required = false) Boolean archived, @RequestParam(required = false) Boolean done) {
|
||||
return ResponseEntity.ok(premisesServices.listPremises(filter, page, limit, userId, deleted, archived, done));
|
||||
}
|
||||
|
||||
@GetMapping("/search")
|
||||
public ResponseEntity<PremiseSearchResultDTO> findMaterialsAndSuppliers(@RequestParam String search) {
|
||||
return ResponseEntity.ok(premiseSearchStringAnalyzerService.findMaterialAndSuppliers(search));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<List<PremiseDetailDTO>> createPremises(@RequestParam("material") List<Integer> materialIds, @RequestParam("supplier") List<Integer> supplierIds, @RequestParam("user_supplier") List<Integer> userSupplierIds, @RequestParam("from_scratch") boolean createEmpty) {
|
||||
return ResponseEntity.ok(premiseCreationService.createPremises(materialIds, supplierIds, userSupplierIds, createEmpty));
|
||||
}
|
||||
|
||||
@GetMapping("/edit")
|
||||
public ResponseEntity<List<PremiseDetailDTO>> getPremises(@RequestParam("premiss_ids") List<Integer> premissIds) {
|
||||
return ResponseEntity.ok(premisesServices.getPremises(premissIds));
|
||||
}
|
||||
|
||||
// triggers a calculation
|
||||
@PutMapping("/done")
|
||||
public ResponseEntity<Integer> completePremises(@RequestBody List<Integer> premiseIds) {
|
||||
return ResponseEntity.ok(premisesServices.startCalculation(premiseIds));
|
||||
}
|
||||
|
||||
@PutMapping("/{type}")
|
||||
public ResponseEntity<HashMap<String, String>> updateMasterData(@PathVariable MasterDataUpdateType type, MasterDataUpdateDTO masterDataDTO) {
|
||||
return ResponseEntity.ok(premisesServices.updateMasterData(type, masterDataDTO));
|
||||
}
|
||||
|
||||
@PostMapping("/destination")
|
||||
public ResponseEntity<HashMap<Integer, DestinationDTO>> createDestination(CreateDestinationDTO createDestinationDTO) {
|
||||
return ResponseEntity.ok(premisesServices.createDestination(createDestinationDTO));
|
||||
}
|
||||
|
||||
@GetMapping("/destination({id}")
|
||||
public ResponseEntity<DestinationDTO> getDestination(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(premisesServices.getDestination(id));
|
||||
}
|
||||
|
||||
@PutMapping("/destination({id}")
|
||||
public ResponseEntity<Void> updateDestination(@PathVariable Integer id) {
|
||||
premisesServices.updateDestination(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@DeleteMapping("/destination({id}")
|
||||
public ResponseEntity<Void> deleteDestination(@PathVariable Integer id) {
|
||||
premisesServices.deleteDestination(id);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/supplier")
|
||||
public ResponseEntity<List<PremiseDetailDTO>> setSupplier(SetSupplierDTO setSupplierDTO) {
|
||||
return ResponseEntity.ok(premisesServices.setSupplier(setSupplierDTO));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package de.avatic.lcc.controller.calculation;
|
||||
|
||||
|
||||
import de.avatic.lcc.dto.calculation.PremiseDTO;
|
||||
import de.avatic.lcc.dto.calculation.SearchDTO;
|
||||
import de.avatic.lcc.dto.calculation.view.PremiseViewDTO;
|
||||
import de.avatic.lcc.service.calculation.CalclationSearchStringAnalyzerService;
|
||||
import de.avatic.lcc.service.calculation.CalculationCreationService;
|
||||
import de.avatic.lcc.service.calculation.PremisesService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/calculation")
|
||||
public class PremiseController {
|
||||
|
||||
private final CalclationSearchStringAnalyzerService calclationSearchStringAnalyzerService;
|
||||
private final PremisesService premisesServices;
|
||||
private final CalculationCreationService calculationCreationService;
|
||||
|
||||
public PremiseController(CalclationSearchStringAnalyzerService calclationSearchStringAnalyzerService, PremisesService premisesServices, CalculationCreationService calculationCreationService) {
|
||||
this.calclationSearchStringAnalyzerService = calclationSearchStringAnalyzerService;
|
||||
this.premisesServices = premisesServices;
|
||||
this.calculationCreationService = calculationCreationService;
|
||||
}
|
||||
|
||||
@GetMapping("/view")
|
||||
public ResponseEntity<List<PremiseDTO>> listPremises(@RequestParam String filter, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer limit, @RequestParam(name = "user", required = false) Integer userId, @RequestParam(required = false) Boolean deleted, @RequestParam(required = false) Boolean archived, @RequestParam(required = false) Boolean done) {
|
||||
return ResponseEntity.ok(premisesServices.listCalculation(filter, page, limit, userId, deleted, archived, done));
|
||||
}
|
||||
|
||||
@GetMapping("/search")
|
||||
public ResponseEntity<SearchDTO> findMaterialsAndSuppliers(@RequestParam String search) {
|
||||
return ResponseEntity.ok(calclationSearchStringAnalyzerService.findMaterialAndSuppliers(search));
|
||||
}
|
||||
|
||||
@GetMapping("/create")
|
||||
public ResponseEntity<List<PremiseViewDTO>> createCalculation(@RequestParam("material") List<Integer> materialIds, @RequestParam("supplier") List<Integer> supplierIds, @RequestParam("user_supplier") List<Integer> userSupplierIds, @RequestParam("from_scratch") boolean createEmpty ) {
|
||||
return ResponseEntity.ok(calculationCreationService.createCalculations(materialIds, supplierIds, userSupplierIds, createEmpty));
|
||||
}
|
||||
|
||||
@GetMapping("/edit")
|
||||
public ResponseEntity<List<PremiseViewDTO>> getPremises(@RequestParam("premiss_ids") List<Integer> premissIds) {
|
||||
return ResponseEntity.ok(premisesServices.getPremises(premissIds));
|
||||
}
|
||||
|
||||
@PutMapping("/edit")
|
||||
public ResponseEntity<Void> savePremises(@RequestBody List<PremiseViewDTO> premises ) {
|
||||
premisesServices.savePremises(premises);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package de.avatic.lcc.controller.configuration;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/rates/container")
|
||||
public class ContainerRateController {
|
||||
|
||||
@GetMapping("/")
|
||||
public ResponseEntity<ContainerRateDTO> getRates() {
|
||||
return "Container rates";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package de.avatic.lcc.controller.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.update.CountryUpdateDTO;
|
||||
import de.avatic.lcc.dto.generic.CountryDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
|
|
@ -36,7 +36,7 @@ public class CountryController {
|
|||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<CountryViewDTO> getCountryDetails(@PathVariable Integer id) {
|
||||
public ResponseEntity<CountryDetailDTO> getCountryDetails(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(countryService.getCountry(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
package de.avatic.lcc.controller.configuration;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/rates/matrix")
|
||||
public class MatrixRateController {
|
||||
|
||||
@GetMapping("/")
|
||||
public String getRates() {
|
||||
return "Matrix rates";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package de.avatic.lcc.controller.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.update.NodeUpdateDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
import de.avatic.lcc.service.configuration.NodeService;
|
||||
|
|
@ -36,7 +36,7 @@ public class NodeController {
|
|||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<NodeViewDTO> getNode(@PathVariable Integer id) {
|
||||
public ResponseEntity<NodeDetailDTO> getNode(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(nodeService.getNode(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,10 @@ import java.util.List;
|
|||
@RequestMapping("/api/packaging")
|
||||
public class PackagingController {
|
||||
|
||||
private final PackagingRepository packagingRepository;
|
||||
private final PackagingService packagingService;
|
||||
private final PackagingService packagingService;
|
||||
|
||||
@Autowired
|
||||
public PackagingController(PackagingRepository packagingRepository, PackagingService packagingService) {
|
||||
this.packagingRepository = packagingRepository;
|
||||
public PackagingController(PackagingService packagingService) {
|
||||
this.packagingService = packagingService;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
package de.avatic.lcc.controller.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.configuration.matrixrates.MatrixRateDTO;
|
||||
import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
import de.avatic.lcc.service.configuration.ContainerRateService;
|
||||
import de.avatic.lcc.service.configuration.MatrixRateService;
|
||||
import de.avatic.lcc.service.configuration.StagedChangesService;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/rates")
|
||||
public class RateController {
|
||||
|
||||
private final MatrixRateService matrixRateService;
|
||||
private final ContainerRateService containerRateService;
|
||||
private final StagedChangesService stagedChangesService;
|
||||
|
||||
public RateController(MatrixRateService matrixRateService, ContainerRateService containerRateService, StagedChangesService stagedChangesService) {
|
||||
this.matrixRateService = matrixRateService;
|
||||
this.containerRateService = containerRateService;
|
||||
this.stagedChangesService = stagedChangesService;
|
||||
}
|
||||
|
||||
@GetMapping("/container")
|
||||
public ResponseEntity<List<ContainerRateDTO>> listContainerRates(
|
||||
@RequestParam(defaultValue = "20") int limit,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(required = false) Integer valid,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime validAt) {
|
||||
|
||||
SearchQueryResult<ContainerRateDTO> containerRates = null;
|
||||
|
||||
if(validAt != null) {
|
||||
containerRates = containerRateService.listContainerRates(limit, page, validAt);
|
||||
}
|
||||
else if(valid != null) {
|
||||
containerRates = containerRateService.listContainerRates(limit, page, valid);
|
||||
}
|
||||
else {
|
||||
containerRates = containerRateService.listContainerRates(limit, page);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header("X-Total-Count", String.valueOf(containerRates.getTotalElements()))
|
||||
.header("X-Page-Count", String.valueOf(containerRates.getTotalPages()))
|
||||
.header("X-Current-Page", String.valueOf(page))
|
||||
.body(containerRates.toList());
|
||||
}
|
||||
|
||||
@GetMapping("/container/{id}")
|
||||
public ResponseEntity<ContainerRateDTO> getContainerRate(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(containerRateService.getContainerRate(id));
|
||||
}
|
||||
|
||||
@GetMapping("/matrix")
|
||||
public ResponseEntity<List<MatrixRateDTO>> listMatrixRates(
|
||||
@RequestParam(defaultValue = "20") int limit,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(required = false) Integer valid,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime validAt) {
|
||||
|
||||
SearchQueryResult<MatrixRateDTO> rates = null;
|
||||
|
||||
if(validAt != null) {
|
||||
rates = matrixRateService.listRates(limit, page, validAt);
|
||||
}
|
||||
else if(valid != null) {
|
||||
rates = matrixRateService.listRates(limit, page, valid);
|
||||
}
|
||||
else {
|
||||
rates = matrixRateService.listRates(limit, page);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header("X-Total-Count", String.valueOf(rates.getTotalElements()))
|
||||
.header("X-Page-Count", String.valueOf(rates.getTotalPages()))
|
||||
.header("X-Current-Page", String.valueOf(page))
|
||||
.body(rates.toList());
|
||||
}
|
||||
@GetMapping("/matrix/{id}")
|
||||
public ResponseEntity<MatrixRateDTO> getMatrixRate(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(matrixRateService.getRate(id));
|
||||
}
|
||||
|
||||
@GetMapping("/staged_changes")
|
||||
public ResponseEntity<Boolean> checkRateDrafts() {
|
||||
return ResponseEntity.ok(stagedChangesService.hasRateDrafts());
|
||||
}
|
||||
|
||||
@PutMapping("/staged_changes")
|
||||
public ResponseEntity<Void> approveRateDrafts() {
|
||||
stagedChangesService.approveRateDrafts();
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Rest Controller for managing reports functionality, including viewing, downloading,
|
||||
* and searching for suppliers related to reporting based on specific materials.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/reports")
|
||||
public class ReportingController {
|
||||
|
|
@ -21,22 +25,49 @@ public class ReportingController {
|
|||
private final ExcelReportingService excelReportingService;
|
||||
private final ReportFinderService reportFinderService;
|
||||
|
||||
/**
|
||||
* Constructor for ReportingController.
|
||||
*
|
||||
* @param reportingService Service used for generating reports.
|
||||
* @param excelReportingService Service used for generating Excel files for reports.
|
||||
* @param reportFinderService Service used for finding suppliers for reporting.
|
||||
*/
|
||||
public ReportingController(ReportingService reportingService, ExcelReportingService excelReportingService, ReportFinderService reportFinderService) {
|
||||
this.reportingService = reportingService;
|
||||
this.excelReportingService = excelReportingService;
|
||||
this.reportFinderService = reportFinderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a list of suppliers for reporting purposes, based on material ID.
|
||||
*
|
||||
* @param materialId The ID of the material for which suppliers need to be found.
|
||||
* @return A list of suppliers grouped by categories.
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public ResponseEntity<List<List<NodeDTO>>> findSupplierForReporting(@RequestParam(value = "material") Integer materialId) {
|
||||
return ResponseEntity.ok(reportFinderService.findSupplierForReporting(materialId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the report for the given material and source nodes.
|
||||
*
|
||||
* @param materialId The ID of the material for which the report will be generated.
|
||||
* @param nodeIds A list of node IDs (sources) to include in the report.
|
||||
* @return The generated report details.
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseEntity<ReportDTO> getReport(@RequestParam(value = "material") Integer materialId, @RequestParam(value = "sources") List<Integer> nodeIds) {
|
||||
return ResponseEntity.ok(reportingService.getReport(materialId, nodeIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads an Excel report for the given material and source nodes.
|
||||
*
|
||||
* @param materialId The ID of the material for which the report will be downloaded.
|
||||
* @param nodeIds A list of node IDs (sources) to include in the downloaded report.
|
||||
* @return The Excel file as an attachment in the response.
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public ResponseEntity<InputStreamResource> downloadReport(@RequestParam(value = "material") Integer materialId, @RequestParam(value = "sources") List<Integer> nodeIds) {
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* REST controller for handling group-related operations.
|
||||
* Provides endpoints for retrieving and updating group information.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/groups")
|
||||
public class GroupController {
|
||||
|
|
@ -18,6 +22,14 @@ public class GroupController {
|
|||
this.groupService = groupService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a paginated list of groups based on the provided limit and page parameters.
|
||||
* Also includes pagination metadata in response headers.
|
||||
*
|
||||
* @param limit The maximum number of groups to fetch per page. Defaults to 20.
|
||||
* @param page The index of the page to retrieve. Defaults to 0 (first page).
|
||||
* @return A ResponseEntity containing the list of groups and pagination headers.
|
||||
*/
|
||||
@GetMapping("/")
|
||||
public ResponseEntity<List<GroupDTO>> listGroups(@RequestParam(defaultValue = "20") int limit,
|
||||
@RequestParam(defaultValue = "0") int page) {
|
||||
|
|
@ -31,9 +43,16 @@ public class GroupController {
|
|||
.body(groups.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the details of an existing group.
|
||||
*
|
||||
* @param group The DTO containing the updated group information.
|
||||
* @return A ResponseEntity indicating the operation status.
|
||||
*/
|
||||
@PutMapping("/")
|
||||
public void updateGroup(GroupDTO group) {
|
||||
return groupService.updateGroup(group);
|
||||
public ResponseEntity<Void> updateGroup(GroupDTO group) {
|
||||
groupService.updateGroup(group);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package de.avatic.lcc.controller.users;
|
||||
|
||||
|
||||
import de.avatic.lcc.dto.generic.MaterialDTO;
|
||||
import de.avatic.lcc.dto.users.UserDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
import de.avatic.lcc.service.users.UserService;
|
||||
|
|
@ -10,6 +9,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* REST Controller for managing user-related operations.
|
||||
* This controller provides endpoints for listing users and updating user details.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/users")
|
||||
public class UserController {
|
||||
|
|
@ -21,22 +24,36 @@ public class UserController {
|
|||
this.userService = userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a paginated list of users.
|
||||
*
|
||||
* @param limit The maximum number of users to return, with a default value of 20.
|
||||
* @param page The page number of the users to retrieve, with a default value of 0.
|
||||
* @return A ResponseEntity containing the list of users, along with pagination headers.
|
||||
*/
|
||||
@GetMapping("/")
|
||||
public ResponseEntity<List<UserDTO>> listUsers(
|
||||
@RequestParam(defaultValue = "20") int limit,
|
||||
@RequestParam(defaultValue = "0") int page) {
|
||||
@RequestParam(defaultValue = "20") int limit,
|
||||
@RequestParam(defaultValue = "0") int page) {
|
||||
|
||||
SearchQueryResult<UserDTO> users = userService.listUsers(page, limit);
|
||||
SearchQueryResult<UserDTO> users = userService.listUsers(page, limit);
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header("X-Total-Count", String.valueOf(users.getTotalElements()))
|
||||
.header("X-Page-Count", String.valueOf(users.getTotalPages()))
|
||||
.header("X-Current-Page", String.valueOf(page))
|
||||
.body(users.toList());
|
||||
return ResponseEntity.ok()
|
||||
.header("X-Total-Count", String.valueOf(users.getTotalElements()))
|
||||
.header("X-Page-Count", String.valueOf(users.getTotalPages()))
|
||||
.header("X-Current-Page", String.valueOf(page))
|
||||
.body(users.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the details of an existing user.
|
||||
*
|
||||
* @param user A UserDTO object containing the updated user details.
|
||||
* @return A ResponseEntity indicating the operation was successful.
|
||||
*/
|
||||
@PutMapping("/")
|
||||
public void udateUser(UserDTO user) {
|
||||
public ResponseEntity<Void> updateUser(UserDTO user) {
|
||||
userService.updateUser(user);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
package de.avatic.lcc.dto.bulk;
|
||||
|
||||
public enum BulkProcessingType {
|
||||
FULL, APPEND
|
||||
}
|
||||
4
src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java
Normal file
4
src/main/java/de/avatic/lcc/dto/bulk/BulkStatus.java
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
package de.avatic.lcc.dto.bulk;
|
||||
|
||||
public class BulkStatus {
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package de.avatic.lcc.dto.calculation;
|
||||
|
||||
public class PremiseDTO {
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package de.avatic.lcc.dto.calculation;
|
||||
|
||||
public enum PremiseState {
|
||||
DRAFT, COMPLETED, ARCHIVED, DELETED
|
||||
}
|
||||
27
src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java
Normal file
27
src/main/java/de/avatic/lcc/dto/calculation/RouteDTO.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package de.avatic.lcc.dto.calculation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
import de.avatic.lcc.dto.generic.RouteType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RouteDTO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private RouteType type;
|
||||
|
||||
@JsonProperty("is_selected")
|
||||
private Boolean isSelected;
|
||||
|
||||
@JsonProperty("is_cheapest")
|
||||
private Boolean isCheapest;
|
||||
|
||||
@JsonProperty("is_fastest")
|
||||
private Boolean isFastest;
|
||||
|
||||
@JsonProperty("transit_nodes")
|
||||
private List<NodeDTO> transitNodes;
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,18 @@
|
|||
package de.avatic.lcc.dto.calculation;
|
||||
package de.avatic.lcc.dto.calculation.create;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.generic.MaterialDTO;
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearchDTO {
|
||||
public class PremiseSearchResultDTO {
|
||||
|
||||
private List<MaterialDTO> materials;
|
||||
private List<NodeDTO> supplier;
|
||||
|
||||
@JsonProperty("user_supplier")
|
||||
private List<NodeDTO> userSupplier;
|
||||
|
||||
public List<MaterialDTO> getMaterials() {
|
||||
return materials;
|
||||
|
|
@ -27,14 +30,11 @@ public class SearchDTO {
|
|||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public List<NodeDTO> getUser_supplier() {
|
||||
return user_supplier;
|
||||
public List<NodeDTO> getUserSupplier() {
|
||||
return userSupplier;
|
||||
}
|
||||
|
||||
public void setUser_supplier(List<NodeDTO> user_supplier) {
|
||||
this.user_supplier = user_supplier;
|
||||
public void setUserSupplier(List<NodeDTO> userSupplier) {
|
||||
this.userSupplier = userSupplier;
|
||||
}
|
||||
|
||||
private List<NodeDTO> user_supplier;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package de.avatic.lcc.dto.calculation.edit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CreateDestinationDTO {
|
||||
|
||||
@JsonProperty("premise_id")
|
||||
List<Integer> premiseId;
|
||||
|
||||
@JsonProperty("destination_node_id")
|
||||
Integer destinationNodeId;
|
||||
|
||||
public List<Integer> getPremiseId() {
|
||||
return premiseId;
|
||||
}
|
||||
|
||||
public void setPremiseId(List<Integer> premiseId) {
|
||||
this.premiseId = premiseId;
|
||||
}
|
||||
|
||||
public Integer getDestinationNodeId() {
|
||||
return destinationNodeId;
|
||||
}
|
||||
|
||||
public void setDestinationNodeId(Integer destinationNodeId) {
|
||||
this.destinationNodeId = destinationNodeId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package de.avatic.lcc.dto.calculation.edit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
import de.avatic.lcc.dto.calculation.RouteDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DestinationDTO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
@JsonProperty("repackaging_costs")
|
||||
private Number repackingCosts;
|
||||
|
||||
@JsonProperty("handling_costs")
|
||||
private Number handlingCosts;
|
||||
|
||||
@JsonProperty("disposal_costs")
|
||||
private Number disposalCosts;
|
||||
|
||||
@JsonProperty("destination_node")
|
||||
private NodeDTO destinationNode;
|
||||
|
||||
private List<RouteDTO> routes;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package de.avatic.lcc.dto.calculation.edit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.generic.DimensionDTO;
|
||||
import de.avatic.lcc.dto.generic.MaterialDTO;
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PremiseDetailDTO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private MaterialDTO material;
|
||||
|
||||
private NodeDTO supplier;
|
||||
|
||||
@JsonProperty("handling_unit")
|
||||
private DimensionDTO dimension;
|
||||
|
||||
@JsonProperty("is_mixable")
|
||||
private Boolean isMixable;
|
||||
|
||||
@JsonProperty("is_stackable")
|
||||
private Boolean isStackable;
|
||||
|
||||
private List<DestinationDTO> destinations;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public MaterialDTO getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
public void setMaterial(MaterialDTO material) {
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public NodeDTO getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(NodeDTO supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public DimensionDTO getDimension() {
|
||||
return dimension;
|
||||
}
|
||||
|
||||
public void setDimension(DimensionDTO dimension) {
|
||||
this.dimension = dimension;
|
||||
}
|
||||
|
||||
public Boolean getMixable() {
|
||||
return isMixable;
|
||||
}
|
||||
|
||||
public void setMixable(Boolean mixable) {
|
||||
isMixable = mixable;
|
||||
}
|
||||
|
||||
public Boolean getStackable() {
|
||||
return isStackable;
|
||||
}
|
||||
|
||||
public void setStackable(Boolean stackable) {
|
||||
isStackable = stackable;
|
||||
}
|
||||
|
||||
public List<DestinationDTO> getDestinations() {
|
||||
return destinations;
|
||||
}
|
||||
|
||||
public void setDestinations(List<DestinationDTO> destinations) {
|
||||
this.destinations = destinations;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package de.avatic.lcc.dto.calculation.edit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SetSupplierDTO {
|
||||
|
||||
@JsonProperty("premise_id")
|
||||
List<Integer> premiseId;
|
||||
|
||||
@JsonProperty("update_master_data")
|
||||
boolean updateMasterData;
|
||||
|
||||
@JsonProperty("supplier_node_id")
|
||||
Integer supplierNodeId;
|
||||
|
||||
public List<Integer> getPremiseId() {
|
||||
return premiseId;
|
||||
}
|
||||
|
||||
public void setPremiseId(List<Integer> premiseId) {
|
||||
this.premiseId = premiseId;
|
||||
}
|
||||
|
||||
public boolean isUpdateMasterData() {
|
||||
return updateMasterData;
|
||||
}
|
||||
|
||||
public void setUpdateMasterData(boolean updateMasterData) {
|
||||
this.updateMasterData = updateMasterData;
|
||||
}
|
||||
|
||||
public Integer getSupplierNodeId() {
|
||||
return supplierNodeId;
|
||||
}
|
||||
|
||||
public void setSupplierNodeId(Integer supplierNodeId) {
|
||||
this.supplierNodeId = supplierNodeId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update;
|
||||
|
||||
public interface MasterData {
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.data.AllUpdateDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.data.MaterialUpdateDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.data.PackagingUpdateDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.data.PriceUpdateDTO;
|
||||
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = MaterialUpdateDTO.class, name = "MATERIAL"),
|
||||
@JsonSubTypes.Type(value = PackagingUpdateDTO.class, name = "PACKAGING"),
|
||||
@JsonSubTypes.Type(value = PriceUpdateDTO.class, name = "PRICE"),
|
||||
@JsonSubTypes.Type(value = AllUpdateDTO.class, name = "ALL"),
|
||||
})
|
||||
public class MasterDataUpdateDTO {
|
||||
|
||||
private MasterDataUpdateType type;
|
||||
|
||||
private MasterData data;
|
||||
|
||||
public MasterDataUpdateType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(MasterDataUpdateType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MasterData getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(MasterData data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update;
|
||||
|
||||
public enum MasterDataUpdateType {
|
||||
MATERIAL, PRICE, PACKAGING, ALL
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterData;
|
||||
import de.avatic.lcc.dto.generic.DimensionDTO;
|
||||
|
||||
public class AllUpdateDTO implements MasterData {
|
||||
|
||||
private Number price;
|
||||
|
||||
@JsonProperty("oversea_share")
|
||||
private Number overseaShare;
|
||||
|
||||
@JsonProperty("fca_fee_included")
|
||||
private Boolean includeFcaFee;
|
||||
|
||||
@JsonProperty("handling_unit")
|
||||
private DimensionDTO dimensions;
|
||||
|
||||
@JsonProperty("is_mixable")
|
||||
private Boolean isMixable;
|
||||
|
||||
@JsonProperty("is_stackable")
|
||||
private Boolean isStackable;
|
||||
|
||||
@JsonProperty("part_number")
|
||||
private String partNumber;
|
||||
|
||||
@JsonProperty("hs_code")
|
||||
private String hsCode;
|
||||
|
||||
@JsonProperty("tariff_rate")
|
||||
private Number tariffRate ;
|
||||
|
||||
public Number getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Number price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Number getOverseaShare() {
|
||||
return overseaShare;
|
||||
}
|
||||
|
||||
public void setOverseaShare(Number overseaShare) {
|
||||
this.overseaShare = overseaShare;
|
||||
}
|
||||
|
||||
public Boolean getIncludeFcaFee() {
|
||||
return includeFcaFee;
|
||||
}
|
||||
|
||||
public void setIncludeFcaFee(Boolean includeFcaFee) {
|
||||
this.includeFcaFee = includeFcaFee;
|
||||
}
|
||||
|
||||
public DimensionDTO getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public void setDimensions(DimensionDTO dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
}
|
||||
|
||||
public Boolean getMixable() {
|
||||
return isMixable;
|
||||
}
|
||||
|
||||
public void setMixable(Boolean mixable) {
|
||||
isMixable = mixable;
|
||||
}
|
||||
|
||||
public Boolean getStackable() {
|
||||
return isStackable;
|
||||
}
|
||||
|
||||
public void setStackable(Boolean stackable) {
|
||||
isStackable = stackable;
|
||||
}
|
||||
|
||||
public String getPartNumber() {
|
||||
return partNumber;
|
||||
}
|
||||
|
||||
public void setPartNumber(String partNumber) {
|
||||
this.partNumber = partNumber;
|
||||
}
|
||||
|
||||
public String getHsCode() {
|
||||
return hsCode;
|
||||
}
|
||||
|
||||
public void setHsCode(String hsCode) {
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public Number getTariffRate() {
|
||||
return tariffRate;
|
||||
}
|
||||
|
||||
public void setTariffRate(Number tariffRate) {
|
||||
this.tariffRate = tariffRate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterData;
|
||||
|
||||
public class MaterialUpdateDTO implements MasterData {
|
||||
|
||||
@JsonProperty("part_number")
|
||||
private String partNumber;
|
||||
|
||||
@JsonProperty("hs_code")
|
||||
private String hsCode;
|
||||
|
||||
@JsonProperty("tariff_rate")
|
||||
private Number tariffRate ;
|
||||
|
||||
public String getPartNumber() {
|
||||
return partNumber;
|
||||
}
|
||||
|
||||
public void setPartNumber(String partNumber) {
|
||||
this.partNumber = partNumber;
|
||||
}
|
||||
|
||||
public String getHsCode() {
|
||||
return hsCode;
|
||||
}
|
||||
|
||||
public void setHsCode(String hsCode) {
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public Number getTariffRate() {
|
||||
return tariffRate;
|
||||
}
|
||||
|
||||
public void setTariffRate(Number tariffRate) {
|
||||
this.tariffRate = tariffRate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterData;
|
||||
import de.avatic.lcc.dto.generic.DimensionDTO;
|
||||
|
||||
public class PackagingUpdateDTO implements MasterData {
|
||||
|
||||
@JsonProperty("handling_unit")
|
||||
private DimensionDTO dimensions;
|
||||
|
||||
@JsonProperty("is_mixable")
|
||||
private Boolean isMixable;
|
||||
|
||||
@JsonProperty("is_stackable")
|
||||
private Boolean isStackable;
|
||||
|
||||
|
||||
public DimensionDTO getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public void setDimensions(DimensionDTO dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
}
|
||||
|
||||
public Boolean getMixable() {
|
||||
return isMixable;
|
||||
}
|
||||
|
||||
public void setMixable(Boolean mixable) {
|
||||
isMixable = mixable;
|
||||
}
|
||||
|
||||
public Boolean getStackable() {
|
||||
return isStackable;
|
||||
}
|
||||
|
||||
public void setStackable(Boolean stackable) {
|
||||
isStackable = stackable;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package de.avatic.lcc.dto.calculation.edit.update.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterData;
|
||||
|
||||
public class PriceUpdateDTO implements MasterData {
|
||||
|
||||
private Number price;
|
||||
|
||||
@JsonProperty("oversea_share")
|
||||
private Number overseaShare;
|
||||
|
||||
@JsonProperty("fca_fee_included")
|
||||
private Boolean includeFcaFee;
|
||||
|
||||
public Number getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Number price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Number getOverseaShare() {
|
||||
return overseaShare;
|
||||
}
|
||||
|
||||
public void setOverseaShare(Number overseaShare) {
|
||||
this.overseaShare = overseaShare;
|
||||
}
|
||||
|
||||
public Boolean getIncludeFcaFee() {
|
||||
return includeFcaFee;
|
||||
}
|
||||
|
||||
public void setIncludeFcaFee(Boolean includeFcaFee) {
|
||||
this.includeFcaFee = includeFcaFee;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,49 @@
|
|||
package de.avatic.lcc.dto.calculation.view;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.PremiseState;
|
||||
import de.avatic.lcc.dto.generic.MaterialDTO;
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
|
||||
public class PremiseViewDTO {
|
||||
|
||||
private int id;
|
||||
|
||||
private MaterialDTO material;
|
||||
|
||||
private NodeDTO supplier;
|
||||
|
||||
private PremiseState state;
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public MaterialDTO getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
public void setMaterial(MaterialDTO material) {
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public NodeDTO getSupplier() {
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setSupplier(NodeDTO supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public PremiseState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(PremiseState state) {
|
||||
this.state = state;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
|
||||
import java.util.Collection;
|
||||
|
||||
public class CountryViewDTO {
|
||||
public class CountryDetailDTO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package de.avatic.lcc.dto.configuration.matrixrates;
|
||||
|
||||
public class MatrixRateDTO {
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ import de.avatic.lcc.dto.generic.NodeTypeDTO;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class NodeViewDTO {
|
||||
public class NodeDetailDTO {
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package de.avatic.lcc.dto.configuration.rates;
|
||||
|
||||
public class ContainerRateDTO {
|
||||
}
|
||||
|
|
@ -2,8 +2,6 @@ package de.avatic.lcc.dto.generic;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Represents the various types of nodes that can exist in the system.
|
||||
* A node can be categorized as SINK, SOURCE, or INTERMEDIATE, depending
|
||||
|
|
@ -13,7 +11,7 @@ public enum NodeTypeDTO {
|
|||
/**
|
||||
* Represents a node that consumes resources or products (end-point of flow).
|
||||
*/
|
||||
SINK("sink"),
|
||||
DESTINATION("destination"),
|
||||
|
||||
/**
|
||||
* Represents a node that originates or provides resources or products for a process.
|
||||
|
|
|
|||
5
src/main/java/de/avatic/lcc/dto/generic/RouteType.java
Normal file
5
src/main/java/de/avatic/lcc/dto/generic/RouteType.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package de.avatic.lcc.dto.generic;
|
||||
|
||||
public enum RouteType {
|
||||
RAIL, SEA, D2D, ROAD
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
public enum ContainerType {
|
||||
FEU, TEU, HQ
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ReportContainerDTO {
|
||||
|
||||
private ContainerType type;
|
||||
|
||||
private Number rate;
|
||||
|
||||
@JsonProperty("unit_count")
|
||||
private Number unitCount;
|
||||
|
||||
@JsonProperty("weight_exceeded")
|
||||
private Boolean weightExceeded;
|
||||
|
||||
private Number utilization;
|
||||
|
||||
private Boolean mixed;
|
||||
|
||||
public ContainerType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(ContainerType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Number getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public void setRate(Number rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public Number getUnitCount() {
|
||||
return unitCount;
|
||||
}
|
||||
|
||||
public void setUnitCount(Number unitCount) {
|
||||
this.unitCount = unitCount;
|
||||
}
|
||||
|
||||
public Boolean getWeightExceeded() {
|
||||
return weightExceeded;
|
||||
}
|
||||
|
||||
public void setWeightExceeded(Boolean weightExceeded) {
|
||||
this.weightExceeded = weightExceeded;
|
||||
}
|
||||
|
||||
public Number getUtilization() {
|
||||
return utilization;
|
||||
}
|
||||
|
||||
public void setUtilization(Number utilization) {
|
||||
this.utilization = utilization;
|
||||
}
|
||||
|
||||
public Boolean getMixed() {
|
||||
return mixed;
|
||||
}
|
||||
|
||||
public void setMixed(Boolean mixed) {
|
||||
this.mixed = mixed;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,42 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ReportDTO {
|
||||
|
||||
@JsonProperty("costs")
|
||||
public HashMap<String, ReportEntryDTO> cost;
|
||||
|
||||
@JsonProperty("risk")
|
||||
public HashMap<String, ReportEntryDTO> risk;
|
||||
|
||||
@JsonProperty("premises")
|
||||
public ReportPremisesDTO premises;
|
||||
|
||||
|
||||
public HashMap<String, ReportEntryDTO> getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void setCost(HashMap<String, ReportEntryDTO> cost) {
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public HashMap<String, ReportEntryDTO> getRisk() {
|
||||
return risk;
|
||||
}
|
||||
|
||||
public void setRisk(HashMap<String, ReportEntryDTO> risk) {
|
||||
this.risk = risk;
|
||||
}
|
||||
|
||||
public ReportPremisesDTO getPremises() {
|
||||
return premises;
|
||||
}
|
||||
|
||||
public void setPremises(ReportPremisesDTO premises) {
|
||||
this.premises = premises;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
22
src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java
Normal file
22
src/main/java/de/avatic/lcc/dto/report/ReportEntryDTO.java
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
public class ReportEntryDTO {
|
||||
public Number total;
|
||||
public Number percentage;
|
||||
|
||||
public Number getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Number total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Number getPercentage() {
|
||||
return percentage;
|
||||
}
|
||||
|
||||
public void setPercentage(Number percentage) {
|
||||
this.percentage = percentage;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.avatic.lcc.model.utils.DimensionUnit;
|
||||
import de.avatic.lcc.model.utils.WeightUnit;
|
||||
|
||||
public class ReportPackagingDTO {
|
||||
|
||||
private Double width;
|
||||
|
||||
private Double height;
|
||||
|
||||
private Double length;
|
||||
|
||||
private Double weight;
|
||||
|
||||
@JsonProperty("dimension_unit")
|
||||
private DimensionUnit dimensionUnit;
|
||||
|
||||
@JsonProperty("weight_unit")
|
||||
private WeightUnit weightUnit;
|
||||
|
||||
@JsonProperty("unit_count")
|
||||
private Integer unitCount;
|
||||
|
||||
private Integer layer;
|
||||
|
||||
public Double getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(Double width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public Double getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(Double height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Double getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setLength(Double length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public DimensionUnit getDimensionUnit() {
|
||||
return dimensionUnit;
|
||||
}
|
||||
|
||||
public void setDimensionUnit(DimensionUnit dimensionUnit) {
|
||||
this.dimensionUnit = dimensionUnit;
|
||||
}
|
||||
|
||||
public WeightUnit getWeightUnit() {
|
||||
return weightUnit;
|
||||
}
|
||||
|
||||
public void setWeightUnit(WeightUnit weightUnit) {
|
||||
this.weightUnit = weightUnit;
|
||||
}
|
||||
|
||||
public Integer getUnitCount() {
|
||||
return unitCount;
|
||||
}
|
||||
|
||||
public void setUnitCount(Integer unitCount) {
|
||||
this.unitCount = unitCount;
|
||||
}
|
||||
|
||||
public Integer getLayer() {
|
||||
return layer;
|
||||
}
|
||||
|
||||
public void setLayer(Integer layer) {
|
||||
this.layer = layer;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReportPremisesDTO {
|
||||
List<ReportQuantityDTO> quantities;
|
||||
|
||||
@JsonProperty("hs_code")
|
||||
private String hsCode;
|
||||
|
||||
@JsonProperty("tariff_rate")
|
||||
private Number tariffRate;
|
||||
|
||||
private ReportContainerDTO container;
|
||||
|
||||
private ReportPackagingDTO packaging;
|
||||
|
||||
@JsonProperty("quota_share")
|
||||
private ReportQuotaShareDTO quotaShare;
|
||||
|
||||
public List<ReportQuantityDTO> getQuantities() {
|
||||
return quantities;
|
||||
}
|
||||
|
||||
public void setQuantities(List<ReportQuantityDTO> quantities) {
|
||||
this.quantities = quantities;
|
||||
}
|
||||
|
||||
public String getHsCode() {
|
||||
return hsCode;
|
||||
}
|
||||
|
||||
public void setHsCode(String hsCode) {
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public Number getTariffRate() {
|
||||
return tariffRate;
|
||||
}
|
||||
|
||||
public void setTariffRate(Number tariffRate) {
|
||||
this.tariffRate = tariffRate;
|
||||
}
|
||||
|
||||
public ReportContainerDTO getContainer() {
|
||||
return container;
|
||||
}
|
||||
|
||||
public void setContainer(ReportContainerDTO container) {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
public ReportPackagingDTO getPackaging() {
|
||||
return packaging;
|
||||
}
|
||||
|
||||
public void setPackaging(ReportPackagingDTO packaging) {
|
||||
this.packaging = packaging;
|
||||
}
|
||||
|
||||
public ReportQuotaShareDTO getQuotaShare() {
|
||||
return quotaShare;
|
||||
}
|
||||
|
||||
public void setQuotaShare(ReportQuotaShareDTO quotaShare) {
|
||||
this.quotaShare = quotaShare;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReportQuantityDTO {
|
||||
|
||||
private String destination;
|
||||
private Number quantity;
|
||||
|
||||
private List<ReportRouteEntryDTO> route;
|
||||
|
||||
public String getDestination() {
|
||||
return destination;
|
||||
}
|
||||
|
||||
public void setDestination(String destination) {
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
public Number getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Number quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public List<ReportRouteEntryDTO> getRoute() {
|
||||
return route;
|
||||
}
|
||||
|
||||
public void setRoute(List<ReportRouteEntryDTO> route) {
|
||||
this.route = route;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ReportQuotaShareDTO {
|
||||
|
||||
@JsonProperty("oversea_share")
|
||||
private Double overseaShare;
|
||||
|
||||
@JsonProperty("air_freight_share")
|
||||
private Double airFreightShare;
|
||||
|
||||
@JsonProperty("transport_time")
|
||||
private Double transportTime;
|
||||
|
||||
@JsonProperty("safety_stock")
|
||||
private Double safetyStock;
|
||||
|
||||
|
||||
public Double getOverseaShare() {
|
||||
return overseaShare;
|
||||
}
|
||||
|
||||
public void setOverseaShare(Double overseaShare) {
|
||||
this.overseaShare = overseaShare;
|
||||
}
|
||||
|
||||
public Double getAirFreightShare() {
|
||||
return airFreightShare;
|
||||
}
|
||||
|
||||
public void setAirFreightShare(Double airFreightShare) {
|
||||
this.airFreightShare = airFreightShare;
|
||||
}
|
||||
|
||||
public Double getTransportTime() {
|
||||
return transportTime;
|
||||
}
|
||||
|
||||
public void setTransportTime(Double transportTime) {
|
||||
this.transportTime = transportTime;
|
||||
}
|
||||
|
||||
public Double getSafetyStock() {
|
||||
return safetyStock;
|
||||
}
|
||||
|
||||
public void setSafetyStock(Double safetyStock) {
|
||||
this.safetyStock = safetyStock;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package de.avatic.lcc.dto.report;
|
||||
|
||||
import de.avatic.lcc.dto.generic.RouteType;
|
||||
|
||||
public class ReportRouteEntryDTO {
|
||||
|
||||
private String name;
|
||||
private RouteType type;
|
||||
|
||||
private ReportEntryDTO cost;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public RouteType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(RouteType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ReportEntryDTO getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void setCost(ReportEntryDTO cost) {
|
||||
this.cost = cost;
|
||||
}
|
||||
}
|
||||
4
src/main/java/de/avatic/lcc/model/users/Group.java
Normal file
4
src/main/java/de/avatic/lcc/model/users/Group.java
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
package de.avatic.lcc.model.users;
|
||||
|
||||
public class Group {
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.calculations.CalculationJob;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface CalculationJobRepository extends CrudRepository<CalculationJob, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.properties.CountryPropertyType;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface CountryPropertyTypeRepository extends CrudRepository<CountryPropertyType, Integer> {
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.country.Country;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface CountryRepository extends CrudRepository<Country, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.nodes.DistanceMatrix;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface DistanceMatrixRepository extends CrudRepository<DistanceMatrix, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.materials.Material;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface MaterialRepository extends CrudRepository<Material, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.nodes.Node;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface NodeRepository extends CrudRepository<Node, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.packaging.PackagingPropertyType;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface PackagingPropertyTypeRepository extends CrudRepository<PackagingPropertyType, Integer> {
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.packaging.Packaging;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface PackagingRepository extends CrudRepository<Packaging, Integer> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.premisses.Premiss;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface PremissRepository extends CrudRepository<Premiss, Integer> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.properties.PropertySet;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface PropertySetRepository extends CrudRepository<PropertySet, Integer> {
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.user.SysGroup;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface SysGroupRepository extends CrudRepository<SysGroup, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.user.SysUserNode;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface SysUserNodeRepository extends CrudRepository<SysUserNode, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.user.SysUser;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface SysUserRepository extends CrudRepository<SysUser, Integer> {
|
||||
|
||||
boolean existsByWorkdayIdIgnoreCase(String workdayId);
|
||||
|
||||
boolean existsByEmailIgnoreCase(String email);
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.properties.SystemPropertyType;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface SystemPropertyTypeRepository extends CrudRepository<SystemPropertyType, Integer> {
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package de.avatic.lcc.repos;
|
||||
|
||||
import de.avatic.lcc.model.rates.ValidityPeriod;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
|
||||
public interface ValidityPeriodRepository extends CrudRepository<ValidityPeriod, Integer> {
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
package de.avatic.lcc.repositories.users;
|
||||
|
||||
import de.avatic.lcc.model.users.Group;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class GroupRepository {
|
||||
public listGroups() {
|
||||
public List<Group> listGroups() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,8 @@ public class BulkExportService {
|
|||
public InputStreamSource generateExport(BulkFileType bulkFileType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public InputStreamSource generateExport(BulkFileType bulkFileType, Integer validityPeriodId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,27 @@
|
|||
package de.avatic.lcc.service.bulk;
|
||||
|
||||
import de.avatic.lcc.dto.bulk.BulkFileType;
|
||||
import org.springframework.core.io.InputStreamSource;
|
||||
import de.avatic.lcc.dto.bulk.BulkProcessingType;
|
||||
import de.avatic.lcc.dto.bulk.BulkStatus;
|
||||
import de.avatic.lcc.util.exception.clienterror.FileFormatNotSupportedException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Service
|
||||
public class BulkFileProcessingService {
|
||||
|
||||
public InputStreamSource generateExport(BulkFileType type) {
|
||||
public Integer processFile(BulkFileType type, BulkProcessingType processingType, MultipartFile file) {
|
||||
|
||||
String contentType = file.getContentType();
|
||||
if (!"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".equals(contentType) &&
|
||||
!"application/vnd.ms-excel".equals(contentType)) {
|
||||
throw new FileFormatNotSupportedException(contentType);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public BulkStatus getStatus(Integer id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package de.avatic.lcc.service.calculation;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.SearchDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class CalclationSearchStringAnalyzerService {
|
||||
|
||||
public SearchDTO findMaterialAndSuppliers(String search) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package de.avatic.lcc.service.calculation;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.view.PremiseViewDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CalculationCreationService {
|
||||
public List<PremiseViewDTO> createCalculations(List<Integer> materialIds, List<Integer> supplierIds, List<Integer> userSupplierIds, boolean createEmpty) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package de.avatic.lcc.service.calculation;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.edit.PremiseDetailDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PremiseCreationService {
|
||||
public List<PremiseDetailDTO> createPremises(List<Integer> materialIds, List<Integer> supplierIds, List<Integer> userSupplierIds, boolean createEmpty) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package de.avatic.lcc.service.calculation;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.create.PremiseSearchResultDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PremiseSearchStringAnalyzerService {
|
||||
|
||||
public PremiseSearchResultDTO findMaterialAndSuppliers(String search) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +1,47 @@
|
|||
package de.avatic.lcc.service.calculation;
|
||||
|
||||
import de.avatic.lcc.dto.calculation.PremiseDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.*;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateDTO;
|
||||
import de.avatic.lcc.dto.calculation.edit.update.MasterDataUpdateType;
|
||||
import de.avatic.lcc.dto.calculation.view.PremiseViewDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PremisesService {
|
||||
|
||||
public List<PremiseDTO> listCalculation(String filter, Integer page, Integer limit, Integer userId, Boolean deleted, Boolean archived, Boolean done) {
|
||||
public List<PremiseViewDTO> listPremises(String filter, Integer page, Integer limit, Integer userId, Boolean deleted, Boolean archived, Boolean done) {
|
||||
return null;
|
||||
};
|
||||
|
||||
public List<PremiseViewDTO> getPremises(List<Integer> premissIds) {
|
||||
public List<PremiseDetailDTO> getPremises(List<Integer> premissIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void savePremises(List<PremiseViewDTO> premises) {
|
||||
public Integer startCalculation(List<Integer> premises) {
|
||||
|
||||
}
|
||||
|
||||
public HashMap<String, String> updateMasterData(MasterDataUpdateType type, MasterDataUpdateDTO dto) {
|
||||
}
|
||||
|
||||
public HashMap<Integer, DestinationDTO> createDestination(CreateDestinationDTO createDestinationDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public DestinationDTO getDestination(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void updateDestination(Integer id) {
|
||||
}
|
||||
|
||||
public void deleteDestination(Integer id) {
|
||||
}
|
||||
|
||||
public List<PremiseDetailDTO> setSupplier(SetSupplierDTO setSupplierDTO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package de.avatic.lcc.service.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Service
|
||||
public class ContainerRateService {
|
||||
|
||||
|
||||
public SearchQueryResult<ContainerRateDTO> listContainerRates(int limit, int page, LocalDateTime validAt) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SearchQueryResult<ContainerRateDTO> listContainerRates(int limit, int page, Integer valid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SearchQueryResult<ContainerRateDTO> listContainerRates(int limit, int page) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ContainerRateDTO getContainerRate(Integer id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package de.avatic.lcc.service.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.update.CountryUpdateDTO;
|
||||
import de.avatic.lcc.dto.generic.CountryDTO;
|
||||
import de.avatic.lcc.model.properties.CountryProperty;
|
||||
|
|
@ -40,7 +40,7 @@ public class CountryService {
|
|||
}
|
||||
|
||||
@Transactional
|
||||
public CountryViewDTO getCountry(Integer id) {
|
||||
public CountryDetailDTO getCountry(Integer id) {
|
||||
List<CountryProperty> properties = countryPropertiesRepository.listByCountryId(id);
|
||||
return countryTransformerService.convertToCountryGetDTO(countryRepository.getById(id), properties).orElseThrow();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package de.avatic.lcc.service.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.configuration.matrixrates.MatrixRateDTO;
|
||||
import de.avatic.lcc.dto.configuration.rates.ContainerRateDTO;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Service
|
||||
public class MatrixRateService {
|
||||
public SearchQueryResult<MatrixRateDTO> listRates(int limit, int page, LocalDateTime validAt) {
|
||||
}
|
||||
|
||||
public SearchQueryResult<MatrixRateDTO> listRates(int limit, int page, Integer valid) {
|
||||
}
|
||||
|
||||
public SearchQueryResult<MatrixRateDTO> listRates(int limit, int page) {
|
||||
}
|
||||
|
||||
public MatrixRateDTO getRate(Integer id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package de.avatic.lcc.service.configuration;
|
||||
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.update.NodeUpdateDTO;
|
||||
import de.avatic.lcc.repositories.NodeRepository;
|
||||
import de.avatic.lcc.repositories.pagination.SearchQueryPagination;
|
||||
|
|
@ -31,11 +31,11 @@ public class NodeService {
|
|||
return SearchQueryResult.map(nodeRepository.listNodes(filter, true, new SearchQueryPagination(page, limit)), nodeDTOTransformer::toNodeDTO);
|
||||
}
|
||||
|
||||
public SearchQueryResult<NodeViewDTO> listNodesView(String filter, int page, int limit) {
|
||||
public SearchQueryResult<NodeDetailDTO> listNodesView(String filter, int page, int limit) {
|
||||
return SearchQueryResult.map(nodeRepository.listNodes(filter, true, new SearchQueryPagination(page, limit)), nodeViewDTOTransformer::toNodeViewDTO);
|
||||
}
|
||||
|
||||
public NodeViewDTO getNode(Integer id) {
|
||||
public NodeDetailDTO getNode(Integer id) {
|
||||
return nodeViewDTOTransformer.toNodeViewDTO(nodeRepository.getById(id).orElseThrow(() -> new NodeNotFoundException(id)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package de.avatic.lcc.service.configuration;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class StagedChangesService {
|
||||
public Boolean hasRateDrafts() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void approveRateDrafts() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package de.avatic.lcc.service.transformer.country;
|
||||
|
||||
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryDetailDTO;
|
||||
import de.avatic.lcc.dto.configuration.countries.view.CountryViewPropertyDTO;
|
||||
import de.avatic.lcc.model.country.Country;
|
||||
import de.avatic.lcc.model.properties.CountryProperty;
|
||||
|
|
@ -15,11 +15,11 @@ import java.util.Optional;
|
|||
public class CountryTransformerService {
|
||||
|
||||
|
||||
public Optional<CountryViewDTO> convertToCountryGetDTO(Optional<Country> country, List<CountryProperty> properties) {
|
||||
public Optional<CountryDetailDTO> convertToCountryGetDTO(Optional<Country> country, List<CountryProperty> properties) {
|
||||
|
||||
if (country.isEmpty()) return Optional.empty();
|
||||
|
||||
CountryViewDTO dto = new CountryViewDTO();
|
||||
CountryDetailDTO dto = new CountryDetailDTO();
|
||||
Country entity = country.get();
|
||||
|
||||
dto.setIsoCode(entity.getIsoCode().getCode());
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class NodeDTOTransformer {
|
|||
NodeDTO dto = new NodeDTO();
|
||||
|
||||
ArrayList<NodeTypeDTO> types = new ArrayList<>();
|
||||
if (entity.getSink()) types.add(NodeTypeDTO.SINK);
|
||||
if (entity.getSink()) types.add(NodeTypeDTO.DESTINATION);
|
||||
if (entity.getSource()) types.add(NodeTypeDTO.SOURCE);
|
||||
if (entity.getIntermediate()) types.add(NodeTypeDTO.INTERMEDIATE);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package de.avatic.lcc.service.transformer.nodes;
|
|||
|
||||
import de.avatic.lcc.dto.generic.NodeDTO;
|
||||
import de.avatic.lcc.dto.generic.NodeTypeDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeViewDTO;
|
||||
import de.avatic.lcc.dto.configuration.nodes.view.NodeDetailDTO;
|
||||
import de.avatic.lcc.model.nodes.Node;
|
||||
import de.avatic.lcc.repositories.CountryRepository;
|
||||
import de.avatic.lcc.repositories.NodeRepository;
|
||||
|
|
@ -32,8 +32,8 @@ public class NodeViewDTOTransformer {
|
|||
this.nodeRepository = nodeRepository;
|
||||
}
|
||||
|
||||
public NodeViewDTO toNodeViewDTO(Node node) {
|
||||
NodeViewDTO dto = new NodeViewDTO();
|
||||
public NodeDetailDTO toNodeViewDTO(Node node) {
|
||||
NodeDetailDTO dto = new NodeDetailDTO();
|
||||
|
||||
Map<Integer, NodeDTO> predecessors = new HashMap<>();
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ public class NodeViewDTOTransformer {
|
|||
|
||||
private ArrayList<NodeTypeDTO> toNodeTypeArrayList(Node entity) {
|
||||
ArrayList<NodeTypeDTO> types = new ArrayList<>();
|
||||
if (entity.getSink()) types.add(NodeTypeDTO.SINK);
|
||||
if (entity.getSink()) types.add(NodeTypeDTO.DESTINATION);
|
||||
if (entity.getSource()) types.add(NodeTypeDTO.SOURCE);
|
||||
if (entity.getIntermediate()) types.add(NodeTypeDTO.INTERMEDIATE);
|
||||
return types;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ public class GroupService {
|
|||
}
|
||||
|
||||
public SearchQueryResult<GroupDTO> listGroups(int page, int limit) {
|
||||
groupRepository.listGroups()
|
||||
|
||||
groupRepository.listGroups();
|
||||
//todo translate
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package de.avatic.lcc.util.exception.clienterror;
|
||||
|
||||
public class FileFormatNotSupportedException extends InvalidArgumentException{
|
||||
public FileFormatNotSupportedException(String fileType) {
|
||||
super("Unsupported file type", fileType);
|
||||
}
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ CREATE TABLE IF NOT EXISTS premiss
|
|||
is_fca_enabled BOOLEAN DEFAULT FALSE,
|
||||
oversea_share DECIMAL(7, 4),
|
||||
hs_code CHAR(8),
|
||||
custom_rate DECIMAL(7, 4),
|
||||
tariff_rate DECIMAL(7, 4),
|
||||
state CHAR(10) DEFAULT 'DRAFT',
|
||||
individual_hu_length INT UNSIGNED COMMENT 'user entered dimensions in mm (if system-wide packaging is used, packaging dimensions are copied here after creation)',
|
||||
individual_hu_height INT UNSIGNED COMMENT 'user entered dimensions in mm (if system-wide packaging is used, packaging dimensions are copied here after creation)',
|
||||
|
|
@ -516,7 +516,7 @@ CREATE TABLE IF NOT EXISTS calculation_job_custom
|
|||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
custom_value DECIMAL(15, 2) NOT NULL,-- Zollwert,
|
||||
custom_duties DECIMAL(15, 2) NOT NULL,-- Zollabgaben,
|
||||
custom_rate DECIMAL(7, 4) NOT NULL,-- Zollsatz,
|
||||
tariff_rate DECIMAL(7, 4) NOT NULL,-- Zollsatz,
|
||||
annual_cost DECIMAL(15, 2) NOT NULL-- Zollabgaben inkl. Einmalkosten,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue