public class DomainServiceImpl extends AbstractAgrosystService implements DomainService
context__PARANAMER_DATA, NEW_EQUIPMENT| Constructor and Description |
|---|
DomainServiceImpl() |
easyBind, easyBind, easyBindNoDelete, finalize, getConfig, getContext, getPersistenceContext, getSecurityContext, getSecurityContextAsUser, getTransaction, newInstance, setContextpublic static final int BUFFER_SIZE
protected static final com.google.common.base.Predicate<CroppingPlanSpeciesDto> IS_CROPPING_SPECIES_EMPTY
protected static final com.google.common.base.Function<CroppingPlanSpeciesDto,String> GET_SPECIES_TOPIA_ID
protected static final com.google.common.base.Predicate<? super CroppingPlanEntryDto> IS_CROPPING_PLAN_ENTRY_EMPTY
public static final com.google.common.base.Function<CroppingPlanEntry,String> GET_CROPPING_PLAN_ENTRY_CODE
protected static final com.google.common.base.Function<CroppingPlanSpecies,String> GET_SPECIES_CODE
protected GrowingPlanService growingPlanService
protected PlotService plotService
protected BusinessAuthorizationService authorizationService
protected PricesService pricesService
protected AnonymizeService anonymizeService
protected EntityUsageService entityUsageService
protected ReferentialService referentialService
protected DomainTopiaDao domainDao
protected GrowingPlanTopiaDao growingPlanDao
protected GeoPointTopiaDao geoPointDao
protected CroppingPlanEntryTopiaDao croppingPlanEntryDao
protected CroppingPlanSpeciesTopiaDao croppingPlanSpeciesDao
protected EquipmentTopiaDao equipmentDao
protected GroundTopiaDao groundDao
protected ToolsCouplingTopiaDao toolsCouplingDao
protected WeatherStationTopiaDao weatherStationDao
protected PlotTopiaDao plotDao
protected RefLegalStatusTopiaDao refLegalStatusDao
protected RefLocationTopiaDao locationDao
protected RefOTEXTopiaDao refOTEXDao
protected RefEspeceTopiaDao refEspeceDao
protected RefVarieteTopiaDao refVarieteDao
protected RefStationMeteoTopiaDao refStationMeteoDao
protected RefSolArvalisTopiaDao refSolArvalisDao
protected RefMaterielTopiaDao refMaterielTopiaDao
protected RefInterventionAgrosystTravailEDITopiaDao refInterventionAgrosystTravailEDITopiaDao
protected AbstractActionTopiaDao abstractActionDao
protected PracticedInterventionTopiaDao practicedInterventionDao
protected EffectiveInterventionTopiaDao effectiveInterventionDao
public void setGrowingPlanService(GrowingPlanService growingPlanService)
public void setPlotService(PlotService plotService)
public void setAuthorizationService(BusinessAuthorizationService authorizationService)
public void setPricesService(PricesService pricesService)
public void setAnonymizeService(AnonymizeService anonymizeService)
public void setEntityUsageService(EntityUsageService entityUsageService)
public void setReferentialService(ReferentialService referentialService)
public void setGrowingPlanDao(GrowingPlanTopiaDao growingPlanDao)
public void setDomainDao(DomainTopiaDao domainDao)
public void setRefLegalStatusDao(RefLegalStatusTopiaDao refLegalStatusDao)
public void setLocationDao(RefLocationTopiaDao locationDao)
public void setRefOTEXDao(RefOTEXTopiaDao refOTEXDao)
public void setRefEspeceDao(RefEspeceTopiaDao refEspeceDao)
public void setRefVarieteDao(RefVarieteTopiaDao refVarieteDao)
public void setCroppingPlanEntryDao(CroppingPlanEntryTopiaDao croppingPlanEntryDao)
public void setCroppingPlanSpeciesDao(CroppingPlanSpeciesTopiaDao croppingPlanSpeciesDao)
public void setEquipmentDao(EquipmentTopiaDao equipmentDao)
public void setToolsCouplingDao(ToolsCouplingTopiaDao toolsCouplingDao)
public void setWeatherStationDao(WeatherStationTopiaDao weatherStationDao)
public void setRefStationMeteoDao(RefStationMeteoTopiaDao refStationMeteoDao)
public void setAbstractActionDao(AbstractActionTopiaDao abstractActionDao)
public void setPracticedInterventionDao(PracticedInterventionTopiaDao practicedInterventionDao)
public void setEffectiveInterventionDao(EffectiveInterventionTopiaDao effectiveInterventionDao)
public void setPlotDao(PlotTopiaDao plotDao)
public void setGeoPointDao(GeoPointTopiaDao geoPointDao)
public void setGroundDao(GroundTopiaDao groundDao)
public void setRefSolArvalisDao(RefSolArvalisTopiaDao refSolArvalisDao)
public void setRefMaterielTopiaDao(RefMaterielTopiaDao refMaterielTopiaDao)
public void setRefInterventionAgrosystTravailEDITopiaDao(RefInterventionAgrosystTravailEDITopiaDao refInterventionAgrosystTravailEDITopiaDao)
public List<Domain> getAllDomains()
getAllDomains in interface DomainServicepublic Domain getDomain(String domainId)
getDomain in interface DomainServicepublic Domain newDomain()
newDomain in interface DomainServicepublic GeoPoint newGpsData()
newGpsData in interface DomainServicepublic WeatherStation newWeatherStation()
newWeatherStation in interface DomainServicepublic DomainDto getDomainByCode(String domainCode)
getDomainByCode in interface DomainServicepublic Domain createOrUpdateDomain(Domain domain, String locationId, String legalStatusId, List<GeoPoint> geoPoints, List<CroppingPlanEntryDto> croppingPlan, Integer otex18code, Integer otex70code, List<Ground> grounds, List<Equipment> equipments, List<ToolsCoupling> toolsCouplings, List<Price> prices)
createOrUpdateDomain in interface DomainServiceprotected Domain createOrUpdateDomainWithoutCommit(Domain domain, String locationId, String legalStatusId, List<GeoPoint> geoPoints, Collection<CroppingPlanEntryDto> croppingPlanDtos, Integer otex18code, Integer otex70code, List<Ground> grounds, List<Equipment> equipments, List<ToolsCoupling> toolsCouplings, List<Price> prices)
protected void setCropCode(CroppingPlanEntryDto dtoEntry, CroppingPlanEntry entityEntry)
protected List<CroppingPlanSpecies> removeUnusedCroppingPlanSpecies(CroppingPlanEntry entityEntry, Collection<CroppingPlanSpeciesDto> dtoSpeciesList)
protected void manageEquipmentAndToolsCoupling(Domain persistedDomain, List<Equipment> equipments, List<ToolsCoupling> toolsCouplings, String domainId)
protected void deleteNotUsedToolsCouplings(List<ToolsCoupling> toolsCouplingsToDelete)
protected List<ToolsCoupling> bindDomainToToolsCouplings(Domain persistedDomain, List<ToolsCoupling> toolsCouplings, Map<String,Equipment> equipmentsCache, List<ToolsCoupling> existingToolsCouplings)
protected List<Equipment> bindDomainToEquipments(Domain persistedDomain, List<Equipment> equipments, Map<String,Equipment> equipmentsCache, List<Equipment> existingEquipments)
protected void bindDomainToGeoPoint(List<GeoPoint> geoPoints, Domain persistedDomain, String domainId)
protected void bindDomainToGrounds(List<Ground> grounds, Domain persistedDomain, String domainId)
protected void addDomainLegalStatus(String legalStatusId, Domain persistedDomain)
protected void validPreconditions(Domain domain, String locationId, List<GeoPoint> geoPoints, List<ToolsCoupling> toolsCouplings, Collection<CroppingPlanEntryDto> croppingPlanEntryDtos)
public ResultList<Domain> getFilteredDomains(DomainFilter filter)
getFilteredDomains in interface DomainServicepublic List<Domain> getDomainWithName(String name)
getDomainWithName in interface DomainServiceprotected ResultList<Domain> getFilteredDomains0(DomainFilter filter)
public ResultList<DomainDto> getFilteredDomainsDto(DomainFilter filter)
getFilteredDomainsDto in interface DomainServicepublic List<DomainDto> getDomains(Collection<String> domainIds)
getDomains in interface DomainServicepublic void unactivateDomains(List<String> domainIds, boolean activate)
unactivateDomains in interface DomainServicepublic List<RefLegalStatus> getAllRefLegalStatus()
getAllRefLegalStatus in interface DomainServicepublic RefStationMeteo findRefStationMeteoByTopiaId(String topiaId)
findRefStationMeteoByTopiaId in interface DomainServicepublic Equipment newMateriel()
newMateriel in interface DomainServicepublic Ground newSol()
newSol in interface DomainServicepublic Domain extendDomain(String domainTopiaId, int extendCampaign) throws DomainExtendException
extendDomain in interface DomainServiceDomainExtendExceptionpublic LinkedHashMap<Integer,String> getRelatedDomains(String domainCode)
getRelatedDomains in interface DomainServicepublic ToolsCoupling newToolsCoupling()
newToolsCoupling in interface DomainServiceprotected List<CroppingPlanEntry> getCroppingPlan0(String domainId)
protected List<CroppingPlanSpecies> getCroppingPlanSpecies(String domainId)
public InputStream exportDomainAsXlsStream(List<String> domainIds)
exportDomainAsXlsStream in interface DomainServicepublic void importDomainForXlsStream(InputStream is)
importDomainForXlsStream in interface DomainServicepublic boolean checkDomainExistence(String domainName)
checkDomainExistence in interface DomainServicepublic long getDomainsCount(Boolean active)
getDomainsCount in interface DomainServicepublic List<Price> getDomainPrices(String domainTopiaId)
getDomainPrices in interface DomainServicepublic void deleteToolsCouplings(Collection<ToolsCoupling> toolsCouplings)
deleteToolsCouplings in interface DomainServicepublic void deleteUnusedMainAction(String toolsCouplingCode, Collection<RefInterventionAgrosystTravailEDI> originalMainsActions, Collection<RefInterventionAgrosystTravailEDI> actualMainsActions)
deleteUnusedMainAction in interface DomainServicepublic Domain validateAndCommit(String domainId)
validateAndCommit in interface DomainServicepublic List<GeoPoint> getGeoPoints(String domainId)
getGeoPoints in interface DomainServicepublic List<Equipment> getEquipments(String domainId)
getEquipments in interface DomainServicepublic List<Ground> getGrounds(String domainId)
getGrounds in interface DomainServicepublic List<ToolsCoupling> getToolsCouplings(String domainId)
getToolsCouplings in interface DomainServicepublic UsageList<ToolsCoupling> getToolsCouplingAndUsage(String domainId)
getToolsCouplingAndUsage in interface DomainServicepublic List<String> getCroppingPlanCodeForDomainsAndCampaigns(String code, Set<Integer> campaigns)
getCroppingPlanCodeForDomainsAndCampaigns in interface DomainServicepublic List<String> getCroppingPlanSpeciesCodeForCropCodeAndCampaigns(String cropCode, Set<Integer> campaigns)
getCroppingPlanSpeciesCodeForCropCodeAndCampaigns in interface DomainServicepublic List<String> getToolsCouplingCodeForDomainsAndCampaigns(String code, Set<Integer> campaigns)
getToolsCouplingCodeForDomainsAndCampaigns in interface DomainServicepublic List<ToolsCoupling> getToolsCouplingsForDomainCodeAndCampaigns(String code, Set<Integer> campaigns)
getToolsCouplingsForDomainCodeAndCampaigns in interface DomainServicepublic List<CroppingPlanEntryDto> getCroppingPlanDtos(String domainId)
getCroppingPlanDtos in interface DomainServicepublic UsageList<CroppingPlanEntryDto> getCroppingPlanEntryDtoAndUsage(String domainId)
getCroppingPlanEntryDtoAndUsage in interface DomainServicepublic Map<String,Boolean> getCroppingPlanSpeciesUsage(String domainId)
getCroppingPlanSpeciesUsage in interface DomainServicepublic org.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>> getEntryAndSpeciesFromCode(String croppingPlanEntryCode, Set<Integer> campaignsSet)
getEntryAndSpeciesFromCode in interface DomainServicepublic Map<String,org.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>>> findSpeciesCodeByCropCodeForCampaigns(List<String> croppingPlanEntryCodes, Set<Integer> campaignsSet)
findSpeciesCodeByCropCodeForCampaigns in interface DomainServicepublic String getDomainCodeForGrowingSystem(String growingSystemId)
getDomainCodeForGrowingSystem in interface DomainServicepublic List<Domain> getActiveWritableDomainsForDecisionRuleCreation()
getActiveWritableDomainsForDecisionRuleCreation in interface DomainServicepublic List<String> findDomainIdsForCodeAndCampaigns(String code, Set<Integer> campaigns, boolean includeCropsFromInactiveDomains)
findDomainIdsForCodeAndCampaigns in interface DomainServiceprotected Boolean validateToolsCoupling(List<ToolsCoupling> toolsCouplings)
public List<String> copyTools(String fromDomain, List<String> toDomainIds, Boolean includeToolCouplings, List<Equipment> equipmentsToCopy, List<ToolsCoupling> toolsCouplingsToCopy)
copyTools in interface DomainServiceprotected void copyRelatedEntitiesToToolsCoupling(Map<String,Equipment> copiedEquipments, List<ToolsCoupling> copiedToolsCouplings, ToolsCoupling copiedToolsCoupling, ToolsCoupling toolsCoupling, Domain toDomain)
copiedEquipments - map of original equipment topiaId to copied equipmentcopiedToolsCouplings - target domain's tools couplingcopiedToolsCoupling - new copied tools couplingtoolsCoupling - original tools couplingtoDomain - targeted domainpublic double getDomainSAUArea(String domainId)
getDomainSAUArea in interface DomainServicepublic void importPZ0Domains(Map<Class,ImportResults> allResults)
importPZ0Domains in interface DomainServiceCopyright © 2013–2015 Inra. All rights reserved.