more fixes for import

This commit is contained in:
Timotheus Pokorra 2024-11-11 22:54:35 +01:00 committed by Dev und Test fuer hsadminng
parent 5f6e4da28d
commit 4d7b6ca8ab

View File

@ -81,6 +81,8 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
private static final Map<Integer, HsOfficePersonType> PERSON_TYPES_BY_CONTACT = Map.of( private static final Map<Integer, HsOfficePersonType> PERSON_TYPES_BY_CONTACT = Map.of(
90072, HsOfficePersonType.NATURAL_PERSON, 90072, HsOfficePersonType.NATURAL_PERSON,
90641, HsOfficePersonType.LEGAL_PERSON, 90641, HsOfficePersonType.LEGAL_PERSON,
90368, HsOfficePersonType.LEGAL_PERSON,
90564, HsOfficePersonType.NATURAL_PERSON,
-1, HsOfficePersonType.LEGAL_PERSON -1, HsOfficePersonType.LEGAL_PERSON
); );
@ -966,6 +968,8 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
HsOfficePersonEntity contactPerson = partnerPerson; HsOfficePersonEntity contactPerson = partnerPerson;
if (!StringUtils.equals(rec.getString("firma"), partnerPerson.getTradeName()) || if (!StringUtils.equals(rec.getString("firma"), partnerPerson.getTradeName()) ||
partnerPerson.getPersonType() != determinePersonType(rec) || partnerPerson.getPersonType() != determinePersonType(rec) ||
!StringUtils.equals(rec.getString("title"), partnerPerson.getTitle()) ||
!StringUtils.equals(rec.getString("salut"), partnerPerson.getSalutation()) ||
!StringUtils.equals(rec.getString("first_name"), partnerPerson.getGivenName()) || !StringUtils.equals(rec.getString("first_name"), partnerPerson.getGivenName()) ||
!StringUtils.equals(rec.getString("last_name"), partnerPerson.getFamilyName())) { !StringUtils.equals(rec.getString("last_name"), partnerPerson.getFamilyName())) {
contactPerson = addPerson(HsOfficePersonEntity.builder().build(), rec); contactPerson = addPerson(HsOfficePersonEntity.builder().build(), rec);