/[projects]/dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/fileupload/AddressManager.java
ViewVC logotype

Diff of /dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/fileupload/AddressManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2850 by torben, Tue Jan 26 16:50:22 2016 UTC revision 2866 by torben, Thu Jan 28 12:14:50 2016 UTC
# Line 233  public class AddressManager { Line 233  public class AddressManager {
233                          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
234                          return;                          return;
235                  }                  }
236                                    boolean found = false;
237                  for (Address addr : litraList) {                  for (Address addr : litraList) {
238                          if (addr.husnrbogstav.equals(entry.litra) ) {                          if (addr.husnrbogstav.equals(entry.litra) ) {
239                                  updateAddress(addr, entry);                                  updateAddress(addr, entry);
240                                  return; //Done for now - no need to look at the rest of the list                                  found = true; // 1 visit should be enough but as long as there's duplicates on gadeid+husnr+litra we will visit them all
241                                    //when the issue with duplicates is resolved this should be reverted to a return or break
242                          }                          }
243                  }                  }
244                                    if (found == false) {
245                  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
246                    }
247          }          }
248                    
249          private void visitRange(AddressSourceEntry entry) {          private void visitRange(AddressSourceEntry entry) {
# Line 444  public class AddressManager { Line 446  public class AddressManager {
446                                    
447                                    
448                                    
449                  addr.visited = true;                  //addr.visited = true;
450                  if (addr.state == AddressState.NOT_CHANGED) {                  if (addr.state == AddressState.NOT_CHANGED) {
451                          if (addr.distributor == null) {                          if (addr.distributor == null) {
452                                  addr.state = AddressState.OPENED;                                  addr.state = AddressState.OPENED;
# Line 472  public class AddressManager { Line 474  public class AddressManager {
474                  if (entry.kommunekode == 0 || entry.vejkode == 0) {                  if (entry.kommunekode == 0 || entry.vejkode == 0) {
475                          return;                          return;
476                  }                  }
477                    if (entry.kommunekode < 100) {
478                            return;
479                    }
480                    if (Short.parseShort(Integer.toString(entry.gadeid).substring(0, 4)) != entry.postnr) {
481                            return; //gadeid / postnr mismatch
482                    }
483                    
484                                    
485                                    
486                  System.out.println("Opretter adresse ud fra " + entry);                  System.out.println("Opretter adresse ud fra " + entry);
# Line 487  public class AddressManager { Line 496  public class AddressManager {
496                  a.husnr = entry.husnr;                  a.husnr = entry.husnr;
497                  a.husnrbogstav = entry.litra;                  a.husnrbogstav = entry.litra;
498                  a.postnr = entry.postnr;                  a.postnr = entry.postnr;
499                  a.visited = true;                  //a.visited = true;
500                                    
501                  if (entry.ugedage.mandag) {                  if (entry.ugedage.mandag) {
502                          a.ruteMandag = entry.rute;                          a.ruteMandag = entry.rute;

Legend:
Removed from v.2850  
changed lines
  Added in v.2866

  ViewVC Help
Powered by ViewVC 1.1.20