mirror of
https://github.com/valitydev/newway.git
synced 2024-11-07 01:45:18 +00:00
NEW: Null-check for contract report preferences
This commit is contained in:
parent
b96d1210a3
commit
b421e5d495
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>newway</artifactId>
|
||||
<version>1.0.17-SNAPSHOT</version>
|
||||
<version>1.0.18-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>newway</name>
|
||||
|
@ -57,7 +57,11 @@ public class ContractReportPreferencesChangedHandler extends AbstractClaimChange
|
||||
contractSource.setWtime(null);
|
||||
contractSource.setEventId(eventId);
|
||||
contractSource.setEventCreatedAt(TypeUtil.stringToLocalDateTime(event.getCreatedAt()));
|
||||
ContractUtil.fillReportPreferences(contractSource, reportPreferencesChanged.getServiceAcceptanceActPreferences());
|
||||
if (reportPreferencesChanged != null && reportPreferencesChanged.isSetServiceAcceptanceActPreferences()) {
|
||||
ContractUtil.fillReportPreferences(contractSource, reportPreferencesChanged.getServiceAcceptanceActPreferences());
|
||||
} else {
|
||||
ContractUtil.setNullReportPreferences(contractSource);
|
||||
}
|
||||
contractDao.updateNotCurrent(partyId, contractId);
|
||||
long cntrctId = contractDao.save(contractSource);
|
||||
|
||||
|
@ -119,4 +119,14 @@ public class ContractUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setNullReportPreferences(com.rbkmoney.newway.domain.tables.pojos.Contract contract) {
|
||||
contract.setReportActScheduleId(null);
|
||||
contract.setReportActSignerPosition(null);
|
||||
contract.setReportActSignerFullName(null);
|
||||
contract.setReportActSignerDocument(null);
|
||||
contract.setReportActSignerDocPowerOfAttorneyLegalAgreementId(null);
|
||||
contract.setReportActSignerDocPowerOfAttorneySignedAt(null);
|
||||
contract.setReportActSignerDocPowerOfAttorneyValidUntil(null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user