Project

General

Profile

« Previous | Next » 

Revision 1a2954e6

Added by Andreas Müller almost 5 years ago

ref #7823 add createdUpdated info to occurrences for E+M import

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelOccurrenceImport.java
83 83
                " SELECT DISTINCT pt.RIdentifier AS taxonId, occ.OccurrenceId, occ.Native, occ.Introduced, " +
84 84
            		" occ.Cultivated, occ.StatusUnknown, occ.WorldDistCompl, occ.Notes occNotes, " +
85 85
            		" sumcat.emOccurSumCatId, sumcat.Short, sumcat.Description, " +
86
                	" sumcat.OutputCode, ar.AreaId, ar.TDWGCode " + emCode +
86
                	" sumcat.OutputCode, ar.AreaId, ar.TDWGCode, "
87
                	+ " occ.Created_When , occ.Updated_When, occ.Created_Who , occ.Updated_Who, occ.notes " + emCode +
87 88
                " FROM emOccurrence occ " +
88 89
                	" INNER JOIN emArea ar ON occ.AreaFk = ar.AreaId " +
89 90
                	" INNER JOIN PTaxon pt ON occ.PTNameFk = pt.PTNameFk AND occ.PTRefFk = pt.PTRefFk " +
......
218 219
                    TaxonDescription taxonDescription = getTaxonDescription(newTaxonId, oldTaxonId, oldDescription, taxonMap, occurrenceId, sourceRef);
219 220
                    for (NamedArea area : areas){
220 221
                    	Distribution distribution = Distribution.NewInstance(area, status);
222
                    	boolean excludeNotes = true;
223
                    	doCreatedUpdatedNotes(state, distribution, rs, false, excludeNotes);
221 224
                        if (StringUtils.isNotBlank(alternativeStatusString)){
222 225
                            AnnotationType type = getAnnotationType(state, BerlinModelTransformer.uuidAnnoTypeDistributionStatus, "Original distribution status", "Original distribution status", null, null);
223 226
                            Annotation annotation = Annotation.NewInstance(alternativeStatusString, type, null);
......
238 241
	                            }
239 242
                            }else{
240 243
                            	countDuplicates++;
244
                            	distribution = duplicate;
241 245
                            	duplicate.addImportSource(String.valueOf(occurrenceId), NAMESPACE, state.getTransactionalSourceReference(), null);
242 246
                            	logger.info("Distribution is duplicate");	                           }
243 247
                        } else {
......
373 377
	/**
374 378
     * Tests if a distribution with the same tdwgArea and the same status already exists in the description.
375 379
     * If so the old distribution is returned
376
     * @param description
377
     * @param tdwgArea
378
     * @return false, if dupplicate exists. True otherwise.
380
     * @return false, if duplicate exists. True otherwise.
379 381
     */
380 382
    private Distribution checkIsNoDuplicate(TaxonDescription description, Distribution distribution, Map<Integer, String> duplicateMap, Integer bmDistributionId){
381 383
    	for (DescriptionElementBase descElBase : description.getElements()){

Also available in: Unified diff