1 |
package dk.daoas.adressevedligehold.fileupload; |
package dk.daoas.adressevedligehold.coveragefileupload; |
2 |
|
|
3 |
import java.sql.SQLException; |
import java.sql.SQLException; |
4 |
import java.util.ArrayList; |
import java.util.ArrayList; |
13 |
|
|
14 |
import dk.daoas.adressevedligehold.beans.Address; |
import dk.daoas.adressevedligehold.beans.Address; |
15 |
import dk.daoas.adressevedligehold.beans.Address.AddressState; |
import dk.daoas.adressevedligehold.beans.Address.AddressState; |
16 |
|
import dk.daoas.adressevedligehold.coveragefileupload.AddressSourceEntry.EntryType; |
17 |
import dk.daoas.adressevedligehold.db.DatabaseCoverageUpdate; |
import dk.daoas.adressevedligehold.db.DatabaseCoverageUpdate; |
|
import dk.daoas.adressevedligehold.fileupload.AddressSourceEntry.EntryType; |
|
18 |
import dk.daoas.adressevedligehold.tasks.TaskLogger; |
import dk.daoas.adressevedligehold.tasks.TaskLogger; |
19 |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
20 |
import dk.daoas.adressevedligehold.util.MiscUtils; |
import dk.daoas.adressevedligehold.util.MiscUtils; |
21 |
import dk.daoas.adressevedligehold.util.TimingHelper; |
import dk.daoas.adressevedligehold.util.TimingHelper; |
22 |
|
|
23 |
/* |
/* |
24 |
* TODO: håndtering af entry dupletter ! (+ rapportering af dem) |
* |
|
|
|
|
|
|
|
|
|
25 |
*/ |
*/ |
26 |
|
|
27 |
public class AddressManager { |
public class AddressManager { |
191 |
} |
} |
192 |
} |
} |
193 |
|
|
194 |
public void writeBackChanges() { |
public void writeBackChanges() throws Exception{ |
195 |
logger.info("Writing back changes"); |
logger.info("Writing back changes"); |
196 |
TimingHelper timer = new TimingHelper(); |
TimingHelper timer = new TimingHelper(); |
197 |
|
|
229 |
private void visitSingle(AddressSourceEntry entry) { |
private void visitSingle(AddressSourceEntry entry) { |
230 |
TreeMap<Short, ArrayList<Address>> gade = searchStructure.get( entry.gadeid ); |
TreeMap<Short, ArrayList<Address>> gade = searchStructure.get( entry.gadeid ); |
231 |
if (gade == null) { |
if (gade == null) { |
232 |
|
/* No need to register unknown streets, since we create all entries that we can |
233 |
if (! unknownStreets.containsKey(entry.gadeid)) { |
if (! unknownStreets.containsKey(entry.gadeid)) { |
234 |
unknownStreets.put(entry.gadeid, entry.vejnavn); |
unknownStreets.put(entry.gadeid, entry.vejnavn); |
235 |
} |
}*/ |
236 |
|
|
237 |
createFromEntry(entry); // if we get here there was no match - so we need to create it |
createFromEntry(entry); // if we get here there was no match - so we need to create it |
238 |
return; |
return; |
501 |
return; |
return; |
502 |
} |
} |
503 |
|
|
504 |
if (entry.husnr == 999) { |
if (entry.husnr == 999 || entry.husnr == 998) { //frasorter de to højest gyldige husnr - det er typisk special adresser |
505 |
return; |
return; |
506 |
} |
} |
507 |
|
|
523 |
return; |
return; |
524 |
} |
} |
525 |
|
|
526 |
|
if (entry.vejkode > 9999) { |
527 |
|
return; |
528 |
|
} |
529 |
|
|
530 |
if (entry.gadeid == 0) { |
if (entry.gadeid == 0) { |
531 |
return; |
return; |
532 |
} |
} |