public class EffectiveCropCycleServiceImpl extends AbstractAgrosystService implements EffectiveCropCycleService
context__PARANAMER_DATA, GET_TOOLS_COUPLING_BY_CODE| Constructor and Description |
|---|
EffectiveCropCycleServiceImpl() |
easyBind, easyBind, easyBindNoDelete, finalize, getConfig, getContext, getPersistenceContext, getSecurityContext, getSecurityContextAsUser, getTransaction, newInstance, setContextpublic static final String NEW_NODE_PREFIX
protected BusinessAuthorizationService authorizationService
protected ActionService actionService
protected InputService inputService
protected PricesService pricesService
protected DomainService domainService
protected AnonymizeService anonymizeService
protected ReferentialService referentialService
protected ZoneTopiaDao zoneDao
protected CroppingPlanEntryTopiaDao croppingPlanEntryDao
protected CroppingPlanSpeciesTopiaDao croppingPlanSpeciesDao
protected ToolsCouplingTopiaDao toolsCouplingDao
protected EffectivePerennialCropCycleTopiaDao effectivePerennialCropCycleDao
protected EffectiveSeasonalCropCycleTopiaDao effectiveSeasonalCropCycleDao
protected EffectiveCropCycleConnectionTopiaDao effectiveCropCycleConnectionDao
protected EffectiveCropCyclePhaseTopiaDao effectiveCropCyclePhaseDao
protected EffectiveCropCycleSpeciesTopiaDao effectiveCropCycleSpeciesDao
protected EffectiveCropCycleNodeTopiaDao effectiveCropCycleNodeDao
protected EffectiveInterventionTopiaDao effectiveInterventionDao
protected EffectiveSpeciesStadeTopiaDao effectiveSpeciesStadeDao
protected AbstractActionTopiaDao abstractActionDao
protected AbstractInputTopiaDao abstractInputTopiaDao
protected RefClonePlantGrapeTopiaDao refClonePlantGrapeDao
protected RefVarieteTopiaDao refVarieteDao
protected RefStadeEDITopiaDao refStadeEDIDao
protected RefOrientationEDITopiaDao refOrientationEDIDao
protected static final com.google.common.base.Function<EffectiveSeasonalCropCycle,Collection<EffectiveCropCycleNode>> EFFECTIVE_SEASONAL_CROP_CYCLE_TO_NODE_FUNCTION
protected static final com.google.common.base.Function<EffectiveCropCycleConnection,String> EFFECTIVE_CONNECTION_BY_TARGET_ID
protected final com.google.common.base.Function<EffectivePerennialCropCycle,CopyPasteZoneDto> EFFECTIVE_PERENNIAL_TO_CROP_CYCLE_CROP_TARGET_FUNCTION
protected final com.google.common.base.Function<EffectiveCropCycleNode,CopyPasteZoneDto> EFFECTIVE_CROP_CYCLE_NODE_TO_CROP_TARGET_FUNCTION
public static final com.google.common.base.Function<CroppingPlanSpecies,String> GET_CROPPING_PLAN_SPECIES_CODE
protected static final com.google.common.base.Function<SpeciesStadeDto,String> GET_SPECIES_STADE_BY_SPECIES_CODE
public static final com.google.common.base.Function<Pz0EffectiveSeasonalCropCycle,EffectiveSeasonalCropCycleDto> EFFECTIVE_PZ0_SEASONAL_CROP_CYCLE_TO_EFFECTIVE_PZ0_SEASONAL_CROP_CYCLE
public void setReferentialService(ReferentialService referentialService)
public void setAnonymizeService(AnonymizeService anonymizeService)
public void setAuthorizationService(BusinessAuthorizationService authorizationService)
public void setActionService(ActionService actionService)
public void setInputService(InputService inputService)
public void setDomainService(DomainService domainService)
public void setAbstractInputTopiaDao(AbstractInputTopiaDao abstractInputTopiaDao)
public void setPricesService(PricesService pricesService)
public void setZoneDao(ZoneTopiaDao zoneDao)
public void setCroppingPlanEntryDao(CroppingPlanEntryTopiaDao croppingPlanEntryDao)
public void setCroppingPlanSpeciesDao(CroppingPlanSpeciesTopiaDao croppingPlanSpeciesDao)
public void setToolsCouplingDao(ToolsCouplingTopiaDao toolsCouplingDao)
public void setEffectivePerennialCropCycleDao(EffectivePerennialCropCycleTopiaDao effectivePerennialCropCycleDao)
public void setEffectiveSeasonalCropCycleDao(EffectiveSeasonalCropCycleTopiaDao effectiveSeasonalCropCycleDao)
public void setEffectiveCropCycleConnectionDao(EffectiveCropCycleConnectionTopiaDao effectiveCropCycleConnectionDao)
public void setEffectiveCropCyclePhaseDao(EffectiveCropCyclePhaseTopiaDao effectiveCropCyclePhaseDao)
public void setEffectiveCropCycleSpeciesDao(EffectiveCropCycleSpeciesTopiaDao effectiveCropCycleSpeciesDao)
public void setEffectiveCropCycleNodeDao(EffectiveCropCycleNodeTopiaDao effectiveCropCycleNodeDao)
public void setRefClonePlantGrapeDao(RefClonePlantGrapeTopiaDao refClonePlantGrapeDao)
public void setRefVarieteDao(RefVarieteTopiaDao refVarieteDao)
public void setEffectiveInterventionDao(EffectiveInterventionTopiaDao effectiveInterventionDao)
public void setRefStadeEDIDao(RefStadeEDITopiaDao refStadeEDIDao)
public void setEffectiveSpeciesStadeDao(EffectiveSpeciesStadeTopiaDao effectiveSpeciesStadeDao)
public void setAbstractActionDao(AbstractActionTopiaDao abstractActionDao)
public void setRefOrientationEDIDao(RefOrientationEDITopiaDao refOrientationEDIDao)
public Zone getZone(String zoneTopiaId)
getZone in interface EffectiveCropCycleServicepublic ResultList<Zone> getFilteredZones(EffectiveZoneFilter filter)
getFilteredZones in interface EffectiveCropCycleServicepublic ResultList<ZoneDto> getFilteredZonesDto(EffectiveZoneFilter filter)
getFilteredZonesDto in interface EffectiveCropCycleServiceprotected String getEffectivePerennialCropCycleInfo(String zoneTopiaId)
protected String getEffectiveCropCycleNodesInfo(Collection<EffectiveCropCycleNode> allEffectiveCropCycleNodes)
protected String getEffectiveSeasonalCropCyclesInfo(String zoneTopiaId)
public ResultList<ZoneDto> getFilteredZonesAndCroppingPlanInfosDto(EffectiveZoneFilter filter)
getFilteredZonesAndCroppingPlanInfosDto in interface EffectiveCropCycleServicepublic List<CroppingPlanEntry> getZoneCroppingPlanEntries(Zone zone)
getZoneCroppingPlanEntries in interface EffectiveCropCycleServicepublic List<CroppingPlanEntry> getZoneCroppingPlanEntriesWithoutDomain(Zone zone)
getZoneCroppingPlanEntriesWithoutDomain in interface EffectiveCropCycleServicepublic CroppingPlanEntry getPreviousCampaignCroppingPlanEntry(String zoneTopiaId)
getPreviousCampaignCroppingPlanEntry in interface EffectiveCropCycleServicepublic List<EffectivePerennialCropCycleDto> getAllEffectivePerennialCropCyclesDtos(String zoneTopiaId)
getAllEffectivePerennialCropCyclesDtos in interface EffectiveCropCycleServiceprotected List<EffectivePerennialCropCycle> getAllEffectivePerennialCropCycles(String zoneTopiaId)
protected List<EffectivePerennialCropCycleDto> convertPerennialCropCyclesToDto(List<EffectivePerennialCropCycle> cycles, Zone zone)
protected List<EffectiveCropCycleSpeciesDto> getCropCyclePerennialSpecies(String croppingPlanEntryCode, EffectivePerennialCropCycle cycle, Integer campaign)
croppingPlanEntryCode - l'identifiant de la culture à traitercycle - le cycle pérennecampaign - la campagne concernée (issue de la zone)public List<EffectiveSeasonalCropCycleDto> getAllEffectiveSeasonalCropCyclesDtos(String zoneTopiaId)
getAllEffectiveSeasonalCropCyclesDtos in interface EffectiveCropCycleServiceprotected List<EffectiveSeasonalCropCycle> getAllEffectiveSeasonalCropCycles(String zoneTopiaId)
public void updateEffectiveCropCycles(String zoneId, List<EffectiveSeasonalCropCycleDto> effectiveSeasonalCropCycles, List<EffectivePerennialCropCycleDto> effectivePerennialCropCycles, List<Price> prices)
updateEffectiveCropCycles in interface EffectiveCropCycleServiceprotected void updateEffectiveCropCyclesWithoutCommit(String zoneId, List<EffectiveSeasonalCropCycleDto> effectiveSeasonalCropCycles, List<EffectivePerennialCropCycleDto> effectivePerennialCropCycles, List<Price> prices)
protected void updateEffectiveSeasonalCropCycles(String zoneId, List<EffectiveSeasonalCropCycleDto> effectiveSeasonalCropCycles)
zoneId - the identifier of the zone on which the crop cycle is abouteffectiveSeasonalCropCycles - seasonal crop cyclesprotected Map<String,CroppingPlanEntry> getNodesCropsByIds(List<EffectiveCropCycleNodeDto> nodeDtos)
protected void removeEffectiveSeasonalCropCycles(Set<EffectiveSeasonalCropCycle> cycles)
protected void removeNodesChilds(Collection<EffectiveCropCycleNode> nodesToRemove)
protected List<EffectiveCropCycleConnection> getConnectionsToRemove(Collection<EffectiveCropCycleNode> nodes)
protected void udpateEffectivePerennialCropCycles(String zoneId, List<EffectivePerennialCropCycleDto> effectivePerennialCropCycles)
zoneId - the identifier of the zone on which the crop cycle is abouteffectivePerennialCropCycles - perennial crop cyclesprotected Map<String,CroppingPlanSpecies> getCroppingPlanSpecies(List<CroppingPlanEntry> targetedZoneCroppingPlanEntries)
protected void removeEffectivePerennialCropCycles(List<EffectivePerennialCropCycle> effectivePerennialCropCycles)
protected void removeEffectiveCropCyclePhaseChildrenObjects(EffectiveCropCyclePhase phase)
protected void updateEffectiveInterventions(List<EffectiveInterventionDto> interventionDtos, EffectiveSeasonalCropCycleDto seasonalCropCycle, org.apache.commons.lang3.tuple.Pair<String,EffectiveCropCycleNode> nodeIdToNode, EffectivePerennialCropCycle perennialCropCycle, EffectiveCropCyclePhase phase, Domain domain)
protected void filterOnDomain(List<EffectiveInterventionDto> interventionDtos, Domain domain)
protected EffectiveSpeciesStade getEffectiveSpeciesStade(Collection<EffectiveSpeciesStade> speciesStades, Map<String,EffectiveSpeciesStade> idToSpeciesStade, SpeciesStadeDto speciesStadeDto, String speciesStadeId, CroppingPlanSpecies croppingPlanSpecies)
public List<Price> getEffectivePrices(String zoneId, List<String> objectIds)
getEffectivePrices in interface EffectiveCropCycleServicepublic List<ToolsCouplingDto> getToolsCouplingModel(String zoneTopiaId, AgrosystInterventionType interventionType)
getToolsCouplingModel in interface EffectiveCropCycleServicepublic void duplicateEffectiveCropCycles(String fromZoneId, String toZoneId)
duplicateEffectiveCropCycles in interface EffectiveCropCycleServiceprotected List<EffectiveInterventionDto> toNewInterventionDtos(List<EffectiveInterventionDto> interventionDtos)
protected EffectiveInterventionDto toNewInterventionDto(EffectiveInterventionDto interventionDto)
protected Map<AbstractAction,AbstractAction> cloneActions(EffectiveInterventionDto newEffectiveInterventionDto)
protected void cloneInputs(EffectiveInterventionDto newEffectiveInterventionDto, Map<AbstractAction,AbstractAction> actionsToDuplicatedActions)
protected void setSpeciesStadeAsNonPersisted(EffectiveInterventionDto newEffectiveInterventionDto)
protected void bindEffectiveInterventionData(EffectiveInterventionDto interventionDto, EffectiveInterventionDto newEffectiveInterventionDto)
public List<ZoneDto> getZones(Collection<String> zoneIds)
getZones in interface EffectiveCropCycleServicepublic InputStream exportEffectiveCropCyclesAsXlsStream(List<String> effectiveCropCycleIds)
exportEffectiveCropCyclesAsXlsStream in interface EffectiveCropCycleServiceprotected void exportEffectiveSeasonalCropCycles(List<EffectiveSeasonalCropCycleDto> seasonalCropCycleDtos, Map<EntityExportTabInfo,List<? extends EntityExportExtra>> sheet, EffectiveCropCycleExportMetadata.EffectiveCropCycleBeanInfo effectiveCropCycleBeanInfo, EffectiveCropCycleExportEntity model) throws CloneNotSupportedException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
protected void exportToolsCouplingsSpeciesActionsInputsFields(List<EffectiveCropCycleExportEntity> itkEntities, Domain domain, EffectiveCropCycleExportEntity model, EffectiveInterventionDto itk) throws CloneNotSupportedException, InvocationTargetException, IllegalAccessException, NoSuchMethodException
protected void exportSpeciesActionsInputsFields(List<EffectiveCropCycleExportEntity> itkEntities, EffectiveInterventionDto itk, EffectiveCropCycleExportEntity model) throws CloneNotSupportedException
CloneNotSupportedExceptionprotected void exportSpeciesStadeFields(SpeciesStadeDto speciesStadeDto, EffectiveCropCycleExportEntity model)
protected void exportActionFields(EffectiveCropCycleExportEntity export, AbstractAction action)
protected void exportInputsFields(List<EffectiveCropCycleExportEntity> itkEntities, EffectiveInterventionDto itk, EffectiveCropCycleExportEntity model) throws CloneNotSupportedException
CloneNotSupportedExceptionprotected EffectiveCropCycleExportEntity exportCommonInterventionFields(EffectiveCropCycleNodeDto node, EffectiveCropCyclePhaseDto phase, EffectivePerennialCropCycleDto perennialCropCycle, EffectiveInterventionDto itk, EffectiveCropCycleExportEntity model) throws CloneNotSupportedException, InvocationTargetException, IllegalAccessException, NoSuchMethodException
protected List<EffectivePerennialCropCycle> getAllEffectivePerennialCropCycles(Zone zone)
protected List<EffectivePerennialCropCycle> getAllEffectivePerennialCropCyclesWithSameCrop(Zone zone, CroppingPlanEntry cp)
protected List<EffectiveSeasonalCropCycle> getAllEffectiveSeasonalCropCycles(Zone zone)
protected List<EffectiveCropCycleNode> getAllEffectiveCropCycleNodes(Zone zone)
protected List<EffectiveSeasonalCropCycle> getAllEffectiveSeasonalCropCycleWithSameCrop(List<EffectiveSeasonalCropCycle> escc, CroppingPlanEntry cp)
public CopyPasteZoneByCampaigns getAvailableZonesForCopy(String zoneTopiaId)
getAvailableZonesForCopy in interface EffectiveCropCycleServiceprotected void addCropTocopyPasteZoneDtoByCampaign(HashMap<Integer,List<CopyPasteZoneDto>> copyPasteZoneDtoByCampaign, CopyPasteZoneDto cropTarget)
protected void copyInterventionsToTargetedNodes(List<EffectiveInterventionDto> interventionDtos, Zone targetedZone, List<String> targetedNodeIds)
protected void validIntermediateStatus(List<EffectiveInterventionDto> interventionDtos, CroppingPlanEntry targetedIntermediateCrop)
protected Map<String,EffectiveIntervention> getEffectiveSeasonalInterventionById(EffectiveCropCycleNode targetedNode)
protected List<EffectiveCropCycleNode> getNodesFromJspIds(List<String> targetedNodeIds)
protected Map<String,String> getSpeciesKeyToSpeciesCode(EffectiveCropCycleNode node, EffectiveCropCycleConnection connection)
protected Map<String,String> doCroppingPlanEntrySpeciesKeyToSpeciesCode(CroppingPlanEntry croppingPlanEntry)
protected void copyInterventionsToTargetedPhases(List<EffectiveInterventionDto> interventionDtos, Zone zone, List<String> targetedPhaseIds)
protected Map<String,String> getFromSpeciesCodeToSpeciesCode(Map<String,String> fromSpeciesKeyToSpeciesCode, Map<String,String> targetedSpeciesKeyToSpeciesCode)
protected List<CroppingPlanSpecies> getFromCroppingPlanSpecieses(List<EffectiveInterventionDto> interventionDtos)
public void copyInterventions(List<TargetedZones> zonesDto, List<EffectiveInterventionDto> interventionDtos)
copyInterventions in interface EffectiveCropCycleServiceprotected Iterable<String> getZoneIdsFromZoneDtos(List<TargetedZones> zonesDto)
public void importPZ0EffectiveCropCycles(Collection<EffectiveCropCycleAndDependencies> effectiveCropCycleAndDependencies)
importPZ0EffectiveCropCycles in interface EffectiveCropCycleServiceprotected void doSeedingActionsAndInputsMigration(List<EffectiveInterventionDto> interventionDtos, CroppingPlanEntry targetedCrop, CroppingPlanEntry targetedIntermediateCrop, Map<String,String> fromSpeciesCodeToSpeciesCode)
protected void addCroppingPanSpeciesSpeciesStades(List<EffectiveInterventionDto> interventionDtos, CroppingPlanEntry targetedNodeOrPhaseCrop, CroppingPlanEntry targetedIntermediateCrop, Map<String,String> fromSpeciesCodeToSpeciesCode)
protected void setSpeciesStadesBySpeciesCode(Map<String,CroppingPlanSpecies> targetedSpeciesByCodes, Map<String,String> fromSpeciesCodeToSpeciesCode, EffectiveInterventionDto interventionDto)
Copyright © 2013–2015 Inra. All rights reserved.