public class BatchService extends SgqService
config, daoHelper| Constructor and Description |
|---|
BatchService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnalyzeFile(Batch batch,
BatchAnalyze analyze,
String fileName,
File file)
Ajoute un fichier d'analyse à un lot.
|
InputStream |
exportInventory()
Export de l'inventaire.
|
List<AnalyzeFile> |
findAllAnalyzeFilesByAnalyze(BatchAnalyze analyze) |
List<AnalyzeFile> |
findAllAnalyzeFilesByBatch(Batch batch) |
List<BatchAnalyze> |
findAllAnalyzesByBatch(Batch batch) |
Map<Place,List<PresentationModel>> |
findAllBatchPerPlacesAndProductName(Place place,
String productName)
Retourne toutes les presentations des lots non expirés par emplacements.
|
List<Batch> |
findAllBetweenNumbers(int startNumber,
int endNumber) |
List<PresentationModel> |
findAllPresentationsByBatch(Batch batch)
Find all presentation for batch.
|
protected org.apache.commons.collections.map.MultiKeyMap |
findAllPresentationsPerPlaceAndProduct()
Retourne toutes les presentations des lots non expirés par emplacement
et produit (ne sert que pour l'export inventaire).
|
File |
generateControlFile(Batch batch)
Génere le pdf de controle d'indentification ou botanique suivant
le produit du lot.
|
List<BatchAnalyze> |
getAnalysisToReceive(AnalyzeFilter analyzeFilter) |
List<AnalyzeModel> |
getAnalysisToSend(AnalyzeFilter analyzeFilter) |
BatchAnalyze |
getAnalyzeById(String analyzeId) |
InputStream |
getAnalyzeDataStream(AnalyzeFile analyzeFile)
Retourne un flux de lecture des données d'un fichier d'analyse.
|
AnalyzeFile |
getAnalyzeFileById(String analyzeFileId) |
Batch |
getBatchById(String batchId)
Get batch instance with batch id.
|
protected Batch |
getBatchByNumber(int batchNumer)
Find batch by number.
|
long |
getBatchCount()
Get total batch count.
|
BatchModel |
getBatchModelById(String batchId)
Get batch instance with batch id.
|
String |
getControlFilename(Batch batch)
Retourne le nom du fichier généré lors du télechargement.
|
protected String |
getControlHtmlContent(Batch batch)
Extraction de la génération seule du contenu html pour être plus
facilement testé.
|
int |
getNextBioBatchNumber() |
int |
getNextNonBioBatchNumber() |
Presentation |
getPresentationById(String presentationId)
Get presentation by id.
|
List<ImportLog<Batch>> |
importBatchFile(File batchFile)
Import du fichier dbf des numéros de lots.
|
List<ImportLog<Batch>> |
importInventory(File file)
Import inventaire.
|
void |
prepareAnalyze(Batch batch,
AnalyzeType analyzeType) |
void |
receiveAnalyzeFromSupplier(BatchAnalyze analyze,
Supplier supplier) |
void |
recoverBatchFile(File file)
Reprise du fichier numero lots.
|
void |
saveAnalyze(BatchAnalyze analyze) |
void |
saveBatch(Batch batch)
Save batch.
|
org.apache.commons.lang3.tuple.Pair<List<BatchModel>,Long> |
searchBatch(SearchModel search,
int offset,
int count)
Return
count result and total result count in a Pair
elements. |
InputStream |
searchBatchASCsv(SearchModel search)
Export la recherche en csv.
|
void |
sendAnalyzeToSupplier(BatchAnalyze analyze,
Date sentDate,
Date receiveLimitDate,
Supplier supplier)
Sauvegarde une analyze a envoyer.
|
void |
updatePresentation(Presentation presentation)
Update presentation.
|
setConfig, setServiceDAOHelperpublic long getBatchCount()
public org.apache.commons.lang3.tuple.Pair<List<BatchModel>,Long> searchBatch(SearchModel search, int offset, int count)
count result and total result count in a Pair
elements.search - search modeloffset - offsetcount - countpublic InputStream searchBatchASCsv(SearchModel search)
public Batch getBatchById(String batchId)
batchId - batch topia idpublic BatchModel getBatchModelById(String batchId)
batchId - batch topia idprotected Batch getBatchByNumber(int batchNumer)
batchNumer - batch numberpublic void saveBatch(Batch batch)
batch - batch to savepublic List<PresentationModel> findAllPresentationsByBatch(Batch batch)
batch - batch (can be null, search for all non expired valid batch)public Presentation getPresentationById(String presentationId)
presentationId - presentation topia idpublic void updatePresentation(Presentation presentation)
presentation - presentationpublic List<BatchAnalyze> findAllAnalyzesByBatch(Batch batch)
public List<AnalyzeFile> findAllAnalyzeFilesByBatch(Batch batch)
public List<AnalyzeFile> findAllAnalyzeFilesByAnalyze(BatchAnalyze analyze)
public int getNextBioBatchNumber()
public int getNextNonBioBatchNumber()
public BatchAnalyze getAnalyzeById(String analyzeId)
public void saveAnalyze(BatchAnalyze analyze)
public InputStream getAnalyzeDataStream(AnalyzeFile analyzeFile)
analyzeFile - analyze filepublic List<AnalyzeModel> getAnalysisToSend(AnalyzeFilter analyzeFilter)
public List<BatchAnalyze> getAnalysisToReceive(AnalyzeFilter analyzeFilter)
public List<ImportLog<Batch>> importBatchFile(File batchFile)
batchFile - dbf filepublic void prepareAnalyze(Batch batch, AnalyzeType analyzeType)
public void sendAnalyzeToSupplier(BatchAnalyze analyze, Date sentDate, Date receiveLimitDate, Supplier supplier)
sentDate et receiveDate peuvent rester
à null pour savegarder l'analyse sans pour autant l'envoyer.analyze - analyzesentDate - date d'envoireceiveLimitDate - date de reception limite prévuesupplier - fournisseurpublic void receiveAnalyzeFromSupplier(BatchAnalyze analyze, Supplier supplier)
public void addAnalyzeFile(Batch batch, BatchAnalyze analyze, String fileName, File file)
batch - batch (can't be null if analyze is not)analyze - analyze (can't be null if batch is not)fileName - file namefile - filefor blobpublic AnalyzeFile getAnalyzeFileById(String analyzeFileId)
public File generateControlFile(Batch batch)
protected String getControlHtmlContent(Batch batch)
public String getControlFilename(Batch batch)
batch - batchpublic void recoverBatchFile(File file)
file - file to importpublic Map<Place,List<PresentationModel>> findAllBatchPerPlacesAndProductName(Place place, String productName)
place - placeproductName - product name (can be null or empty)public InputStream exportInventory()
public List<ImportLog<Batch>> importInventory(File file)
file - protected org.apache.commons.collections.map.MultiKeyMap findAllPresentationsPerPlaceAndProduct()
place - placeproductName - product name (can be null or empty)Copyright © 2012 Herboristerie Cailleau. All Rights Reserved.