public class BatchService extends SgqService
| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationService |
configurationService |
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.
|
protected List<BatchModel> |
addBatchAnalyzeToModel(SearchModel search,
List<BatchModel> elements)
Perform new query to add batch analyze to model if query request for
SearchColumn.ANALYZE_CONFORMITY. |
void |
deleteAnalyze(BatchAnalyze analyze)
Supprimer un fichier d'analyze.
|
void |
deleteAnalyzeFile(AnalyzeFile analyzeFile)
Supprimer un fichier d'analyze.
|
InputStream |
exportInventory()
Export de l'inventaire.
|
List<AnalyzeFile> |
findAllAnalyzeFilesByAnalyze(BatchAnalyze analyze) |
List<AnalyzeFile> |
findAllAnalyzeFilesByBatch(Batch batch) |
org.apache.commons.collections.map.MultiKeyMap |
findAllAnalyzesBetweenBatchNumbers(int startNumber,
int endNumber)
Retourne toutes les analyzes enregistées sur des lots portants sur
des numeros entre ceux demandés.
|
List<BatchAnalyze> |
findAllAnalyzesByBatch(Batch batch) |
Map<Place,List<PresentationModel>> |
findAllBatchPerPlacesAndProduct(Zone zone,
Place place,
String product)
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) |
long |
getAnalyzeCount()
Get total analyze count.
|
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.
|
Date |
getBatchMaxEntryDate()
Retourne la date de la derniere date d'entrée produit (plus récent).
|
BatchModel |
getBatchModelById(String batchId)
Get batch instance with batch id.
|
List<Batch> |
getBatchWithBulletinToAsk()
Retourne les lots dont un bulletin doit être demandé au forunisseur.
|
List<Batch> |
getBatchWithInputAndPendingAnalysis()
Deprecated.
since 20130530 unused
|
List<Batch> |
getBatchWithMoreSellThanStock() |
List<Batch> |
getBatchWithNoStock() |
List<Batch> |
getBatchWithOutputAndPendingAnalysis() |
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é.
|
List<Batch> |
getDedicatedClientExpiredBatch() |
int |
getLastBiologicalBatch()
Get max batch number < 70000
|
int |
getLastConventionalBatch()
Get max batch number < 70000
|
long |
getOperatingBatchCount()
Get operating batch count.
|
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 |
recoverAnalyzeFile(File analyzeFile)
Import unique du fichier des analyses à la reprise des données.
|
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 |
setConfig(SgqBusinessConfig config) |
void |
setServiceDAOHelper(ServiceDAOHelper daoHelper)
Inject dao helper containing transaction to use.
|
void |
updatePresentation(Presentation presentation)
Update presentation.
|
protected ConfigurationService configurationService
public void setConfig(SgqBusinessConfig config)
setConfig in class SgqServicepublic void setServiceDAOHelper(ServiceDAOHelper daoHelper)
SgqServicesetServiceDAOHelper in class SgqServicedaoHelper - dao helperpublic long getBatchCount()
public long getOperatingBatchCount()
public int getLastConventionalBatch()
public int getLastBiologicalBatch()
public long getAnalyzeCount()
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 - countprotected List<BatchModel> addBatchAnalyzeToModel(SearchModel search, List<BatchModel> elements)
SearchColumn.ANALYZE_CONFORMITY. Otherwise, do nothing.search - search queryelements - results modelelementspublic InputStream searchBatchASCsv(SearchModel search)
public org.apache.commons.collections.map.MultiKeyMap findAllAnalyzesBetweenBatchNumbers(int startNumber,
int endNumber)
startNumber - batch number range startendNumber - batch number range endpublic 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<Batch> getBatchWithBulletinToAsk()
public 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 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)
@Deprecated public List<Batch> getBatchWithInputAndPendingAnalysis()
public List<ImportLog<Batch>> importBatchFile(File batchFile)
batchFile - dbf filenonBioStart - non bio batch number range startbioStart - bio batch number range startpublic 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 void recoverAnalyzeFile(File analyzeFile)
analyzeFile - analyze file to importpublic Map<Place,List<PresentationModel>> findAllBatchPerPlacesAndProduct(Zone zone, Place place, String product)
zone - zoneplace - placeproduct - product name or code (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)public void deleteAnalyzeFile(AnalyzeFile analyzeFile)
analyzeFile - analyze file to deletepublic void deleteAnalyze(BatchAnalyze analyze)
analyzeFile - analyze file to deletepublic Date getBatchMaxEntryDate()
Copyright © 2012-2013 Herboristerie Cailleau. All Rights Reserved.