This commit is contained in:
Ivan Nikolaev-Axenov 2024-12-18 11:13:05 +03:00
parent c94bf2a57a
commit 7b4ede233b
8 changed files with 97 additions and 202 deletions

View file

@ -1,66 +1,52 @@
package ru.spcex.clearing.xml.exporter.logic.data.tags.objects; package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import ru.clearing.classes.statics.data.sdf.SDf02; import ru.clearing.classes.statics.data.sdf.SDf02;
public class DF02ObjectTag extends ObjectTag<SDf02> { public class DF02ObjectTag extends ObjectTag<SDf02> {
@JacksonXmlProperty(isAttribute = true, localName = "CURR_CODE") @JacksonXmlProperty(isAttribute = true, localName = "CURR_CODE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String currCode; private String currCode;
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String account; private String account;
@JacksonXmlProperty(isAttribute = true, localName = "REMAINDER") @JacksonXmlProperty(isAttribute = true, localName = "REMAINDER")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String remainder; private String remainder;
@JacksonXmlProperty(isAttribute = true, localName = "DEAL") @JacksonXmlProperty(isAttribute = true, localName = "DEAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String deal; private String deal;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_CODE") @JacksonXmlProperty(isAttribute = true, localName = "ACC_CODE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accCode; private String accCode;
@JacksonXmlProperty(isAttribute = true, localName = "DAT") @JacksonXmlProperty(isAttribute = true, localName = "DAT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate dat; private LocalDate dat;
@JacksonXmlProperty(isAttribute = true, localName = "MARKET") @JacksonXmlProperty(isAttribute = true, localName = "MARKET")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String market; private String market;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_NAME") @JacksonXmlProperty(isAttribute = true, localName = "ACC_NAME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accName; private String accName;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "ACC_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accType; private String accType;
@JacksonXmlProperty(isAttribute = true, localName = "SUMENGAGE") @JacksonXmlProperty(isAttribute = true, localName = "SUMENGAGE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sumengage; private String sumengage;
@JacksonXmlProperty(isAttribute = true, localName = "SUMUNBLOK") @JacksonXmlProperty(isAttribute = true, localName = "SUMUNBLOK")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sumunblock; private String sumunblock;
@JacksonXmlProperty(isAttribute = true, localName = "FILE_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "FILE_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String fileType; private String fileType;
@JacksonXmlProperty(isAttribute = true, localName = "RESULT") @JacksonXmlProperty(isAttribute = true, localName = "RESULT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String result; private String result;
public DF02ObjectTag() { public DF02ObjectTag() {
@ -70,19 +56,19 @@ public class DF02ObjectTag extends ObjectTag<SDf02> {
@Override @Override
public void setData(SDf02 entity) { public void setData(SDf02 entity) {
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy"); final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy");
this.currCode = entity.getCurr_code(); this.currCode = Optional.ofNullable(entity.getCurr_code()).orElse("");
this.account = entity.getAccount(); this.account = Optional.ofNullable(entity.getAccount()).orElse("");
this.remainder = entity.getRemainder(); this.remainder = Optional.ofNullable(entity.getRemainder()).orElse("");
this.deal = entity.getDeal(); this.deal = Optional.ofNullable(entity.getDeal()).orElse("");
this.accCode = entity.getAcc_code(); this.accCode = Optional.ofNullable(entity.getAcc_code()).orElse("");
this.dat = LocalDate.parse(entity.getDat(), dtf); this.dat = LocalDate.parse(entity.getDat(), dtf);
this.market = entity.getMarket(); this.market = Optional.ofNullable(entity.getMarket()).orElse("");
this.accName = entity.getAcc_name(); this.accName = Optional.ofNullable(entity.getAcc_name()).orElse("");
this.accType = entity.getAcc_type(); this.accType = Optional.ofNullable(entity.getAcc_type()).orElse("");
this.sumengage = entity.getSumengage(); this.sumengage = Optional.ofNullable(entity.getSumengage()).orElse("");
this.sumunblock = entity.getSumunblock(); this.sumunblock = Optional.ofNullable(entity.getSumunblock()).orElse("");
this.fileType = entity.getFile_type(); this.fileType = Optional.ofNullable(entity.getFile_type()).orElse("");
this.result = entity.getResult(); this.result = Optional.ofNullable(entity.getResult()).orElse("");
} }
@Override @Override

View file

@ -2,37 +2,30 @@ package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import ru.clearing.classes.statics.data.sdf.SDf03; import ru.clearing.classes.statics.data.sdf.SDf03;
public class DF03ObjectTag extends ObjectTag<SDf03> { public class DF03ObjectTag extends ObjectTag<SDf03> {
@JacksonXmlProperty(isAttribute = true, localName = "SEG_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "SEG_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String segType; private String segType;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "DOC_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docType; private String docType;
@JacksonXmlProperty(isAttribute = true, localName = "DOCNM_REF") @JacksonXmlProperty(isAttribute = true, localName = "DOCNM_REF")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docnmRef; private String docnmRef;
@JacksonXmlProperty(isAttribute = true, localName = "DOCNMPREV") @JacksonXmlProperty(isAttribute = true, localName = "DOCNMPREV")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docnmprev; private String docnmprev;
@JacksonXmlProperty(isAttribute = true, localName = "C_ACC_DEB") @JacksonXmlProperty(isAttribute = true, localName = "C_ACC_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String cAccDeb; private String cAccDeb;
@JacksonXmlProperty(isAttribute = true, localName = "SBANKNAM") @JacksonXmlProperty(isAttribute = true, localName = "SBANKNAM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sbanknam1; private String sbanknam1;
@JsonIgnore @JsonIgnore
private String sbanknam2; private String sbanknam2;
@ -44,11 +37,9 @@ public class DF03ObjectTag extends ObjectTag<SDf03> {
private String sbanknam5; private String sbanknam5;
@JacksonXmlProperty(isAttribute = true, localName = "C_ACC_CRED") @JacksonXmlProperty(isAttribute = true, localName = "C_ACC_CRED")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String cAccCred; private String cAccCred;
@JacksonXmlProperty(isAttribute = true, localName = "RBANKNAM") @JacksonXmlProperty(isAttribute = true, localName = "RBANKNAM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String rbanknam1; private String rbanknam1;
@JsonIgnore @JsonIgnore
private String rbanknam2; private String rbanknam2;
@ -60,24 +51,19 @@ public class DF03ObjectTag extends ObjectTag<SDf03> {
private String rbanknam5; private String rbanknam5;
@JacksonXmlProperty(isAttribute = true, localName = "PAY_DATE") @JacksonXmlProperty(isAttribute = true, localName = "PAY_DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate payDate; private LocalDate payDate;
@JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL") @JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String payVal; private String payVal;
@JacksonXmlProperty(isAttribute = true, localName = "SUM_DEB") @JacksonXmlProperty(isAttribute = true, localName = "SUM_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sumDeb; private String sumDeb;
@JacksonXmlProperty(isAttribute = true, localName = "SPECIF_1") @JacksonXmlProperty(isAttribute = true, localName = "SPECIF_1")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String specif1; private String specif1;
@JacksonXmlProperty(isAttribute = true, localName = "IMP_RESULT") @JacksonXmlProperty(isAttribute = true, localName = "IMP_RESULT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String impResult; private String impResult;
@ -88,27 +74,27 @@ public class DF03ObjectTag extends ObjectTag<SDf03> {
@Override @Override
public void setData(SDf03 entity) { public void setData(SDf03 entity) {
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy"); final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy");
this.segType = entity.getSeg_type(); this.segType = Optional.ofNullable(entity.getSeg_type()).orElse("");
this.docType = entity.getDoc_type(); this.docType = Optional.ofNullable(entity.getDoc_type()).orElse("");
this.docnmRef = entity.getDocnm_ref(); this.docnmRef = Optional.ofNullable(entity.getDocnm_ref()).orElse("");
this.docnmprev = entity.getDocnmprev(); this.docnmprev = Optional.ofNullable(entity.getDocnmprev()).orElse("");
this.cAccDeb = entity.getC_acc_deb(); this.cAccDeb = Optional.ofNullable(entity.getC_acc_deb()).orElse("");
this.sbanknam1 = entity.getSbanknam1(); this.sbanknam1 = Optional.ofNullable(entity.getSbanknam1()).orElse("");
this.sbanknam2 = entity.getSbanknam2(); this.sbanknam2 = Optional.ofNullable(entity.getSbanknam2()).orElse("");
this.sbanknam3 = entity.getSbanknam3(); this.sbanknam3 = Optional.ofNullable(entity.getSbanknam3()).orElse("");
this.sbanknam4 = entity.getSbanknam4(); this.sbanknam4 = Optional.ofNullable(entity.getSbanknam4()).orElse("");
this.sbanknam5 = entity.getSbanknam5(); this.sbanknam5 = Optional.ofNullable(entity.getSbanknam5()).orElse("");
this.cAccCred = entity.getC_acc_cred(); this.cAccCred = Optional.ofNullable(entity.getC_acc_cred()).orElse("");
this.rbanknam1 = entity.getRbanknam1(); this.rbanknam1 = Optional.ofNullable(entity.getRbanknam1()).orElse("");
this.rbanknam2 = entity.getRbanknam2(); this.rbanknam2 = Optional.ofNullable(entity.getRbanknam2()).orElse("");
this.rbanknam3 = entity.getRbanknam3(); this.rbanknam3 = Optional.ofNullable(entity.getRbanknam3()).orElse("");
this.rbanknam4 = entity.getRbanknam4(); this.rbanknam4 = Optional.ofNullable(entity.getRbanknam4()).orElse("");
this.rbanknam5 = entity.getRbanknam5(); this.rbanknam5 = Optional.ofNullable(entity.getRbanknam5()).orElse("");
this.payDate = LocalDate.parse(entity.getPay_date(), dtf); this.payDate = LocalDate.parse(entity.getPay_date(), dtf);
this.payVal = entity.getPay_val(); this.payVal = Optional.ofNullable(entity.getPay_val()).orElse("");
this.sumDeb = entity.getSum_deb(); this.sumDeb = Optional.ofNullable(entity.getSum_deb()).orElse("");
this.specif1 = entity.getSpecif_1(); this.specif1 = Optional.ofNullable(entity.getSpecif_1()).orElse("");
this.impResult = entity.getImp_result(); this.impResult = Optional.ofNullable(entity.getImp_result()).orElse("");
} }
@Override @Override

View file

@ -1,8 +1,6 @@
package ru.spcex.clearing.xml.exporter.logic.data.tags.objects; package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
@ -13,21 +11,17 @@ import ru.clearing.classes.statics.data.sdf.SDf05;
public class DF05ObjectTag extends ObjectTag<SDf05> { public class DF05ObjectTag extends ObjectTag<SDf05> {
@JacksonXmlProperty(isAttribute = true, localName = "TP") @JacksonXmlProperty(isAttribute = true, localName = "TP")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private BigDecimal tp; private BigDecimal tp;
@JacksonXmlProperty(isAttribute = true, localName = "DT") @JacksonXmlProperty(isAttribute = true, localName = "DT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate dt; private LocalDate dt;
@JacksonXmlProperty(isAttribute = true, localName = "TM") @JacksonXmlProperty(isAttribute = true, localName = "TM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "hh:mm:ss") @JsonFormat(pattern = "hh:mm:ss")
private LocalTime tm; private LocalTime tm;
@JacksonXmlProperty(isAttribute = true, localName = "PR") @JacksonXmlProperty(isAttribute = true, localName = "PR")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String pr; private String pr;
public DF05ObjectTag() { public DF05ObjectTag() {

View file

@ -1,71 +1,56 @@
package ru.spcex.clearing.xml.exporter.logic.data.tags.objects; package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import ru.clearing.classes.statics.data.sdf.SDf07; import ru.clearing.classes.statics.data.sdf.SDf07;
public class DF07ObjectTag extends ObjectTag<SDf07> { public class DF07ObjectTag extends ObjectTag<SDf07> {
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String account; private String account;
@JacksonXmlProperty(isAttribute = true, localName = "SUM") @JacksonXmlProperty(isAttribute = true, localName = "SUM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private BigDecimal sum; private BigDecimal sum;
@JacksonXmlProperty(isAttribute = true, localName = "MARKET") @JacksonXmlProperty(isAttribute = true, localName = "MARKET")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String market; private String market;
@JacksonXmlProperty(isAttribute = true, localName = "TYPE") @JacksonXmlProperty(isAttribute = true, localName = "TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String type; private String type;
@JacksonXmlProperty(isAttribute = true, localName = "DEAL") @JacksonXmlProperty(isAttribute = true, localName = "DEAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String deal; private String deal;
@JacksonXmlProperty(isAttribute = true, localName = "CLIENTN") @JacksonXmlProperty(isAttribute = true, localName = "CLIENTN")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String clientN; private String clientN;
@JacksonXmlProperty(isAttribute = true, localName = "INN") @JacksonXmlProperty(isAttribute = true, localName = "INN")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String inn; private String inn;
@JacksonXmlProperty(isAttribute = true, localName = "BIC") @JacksonXmlProperty(isAttribute = true, localName = "BIC")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String bic; private String bic;
@JacksonXmlProperty(isAttribute = true, localName = "SPEC") @JacksonXmlProperty(isAttribute = true, localName = "SPEC")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String spec; private String spec;
@JacksonXmlProperty(isAttribute = true, localName = "NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "NUMBER")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private BigDecimal number; private BigDecimal number;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_NUM") @JacksonXmlProperty(isAttribute = true, localName = "DOC_NUM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docNum; private String docNum;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_DATE") @JacksonXmlProperty(isAttribute = true, localName = "DOC_DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate docDate; private LocalDate docDate;
@JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL") @JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String payVal; private String payVal;
@JacksonXmlProperty(isAttribute = true, localName = "RESULT") @JacksonXmlProperty(isAttribute = true, localName = "RESULT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private BigDecimal result; private BigDecimal result;
@ -76,20 +61,20 @@ public class DF07ObjectTag extends ObjectTag<SDf07> {
@Override @Override
public void setData(SDf07 entity) { public void setData(SDf07 entity) {
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy"); final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy");
this.account = entity.getAccount(); this.account = Optional.ofNullable(entity.getAccount()).orElse("");
this.sum = entity.getSum(); this.sum = entity.getSum();
this.market = entity.getMarket(); this.market = Optional.ofNullable(entity.getMarket()).orElse("");
this.type = entity.getType(); this.type = Optional.ofNullable(entity.getType()).orElse("");
this.deal = entity.getDeal(); this.deal = Optional.ofNullable(entity.getDeal()).orElse("");
this.clientN = entity.getClientN(); this.clientN = Optional.ofNullable(entity.getClientN()).orElse("");
this.inn = entity.getInn(); this.inn = Optional.ofNullable(entity.getInn()).orElse("");
this.bic = entity.getBic(); this.bic = Optional.ofNullable(entity.getBic()).orElse("");
this.spec = entity.getSpec(); this.spec = Optional.ofNullable(entity.getSpec()).orElse("");
this.number = entity.getNumber(); this.number = entity.getNumber();
this.result = entity.getResult(); this.result = entity.getResult();
this.docNum = entity.getDoc_num(); this.docNum = Optional.ofNullable(entity.getDoc_num()).orElse("");
this.docDate = LocalDate.parse(entity.getDoc_date(), dtf); this.docDate = LocalDate.parse(entity.getDoc_date(), dtf);
this.payVal = entity.getPay_val(); this.payVal = Optional.ofNullable(entity.getPay_val()).orElse("");
} }
@Override @Override

View file

@ -2,8 +2,6 @@ package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -14,15 +12,12 @@ import ru.clearing.classes.statics.data.sdf.SDf51;
public class DF51ObjectTag extends ObjectTag<SDf51> { public class DF51ObjectTag extends ObjectTag<SDf51> {
@JacksonXmlProperty(isAttribute = true, localName = "NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "NUMBER")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String number; private String number;
@JacksonXmlProperty(isAttribute = true, localName = "UNIXTIME") @JacksonXmlProperty(isAttribute = true, localName = "UNIXTIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private Long unixtime; private Long unixtime;
@JacksonXmlProperty(isAttribute = true, localName = "DATETIME") @JacksonXmlProperty(isAttribute = true, localName = "DATETIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime datetime; private LocalDateTime datetime;

View file

@ -1,45 +1,36 @@
package ru.spcex.clearing.xml.exporter.logic.data.tags.objects; package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import ru.clearing.classes.statics.data.sdf.SDf53; import ru.clearing.classes.statics.data.sdf.SDf53;
public class DF53ObjectTag extends ObjectTag<SDf53> { public class DF53ObjectTag extends ObjectTag<SDf53> {
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String account; private String account;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_NAME") @JacksonXmlProperty(isAttribute = true, localName = "ACC_NAME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accName; private String accName;
@JacksonXmlProperty(isAttribute = true, localName = "DEAL") @JacksonXmlProperty(isAttribute = true, localName = "DEAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String deal; private String deal;
@JacksonXmlProperty(isAttribute = true, localName = "DATE") @JacksonXmlProperty(isAttribute = true, localName = "DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate date; private LocalDate date;
@JacksonXmlProperty(isAttribute = true, localName = "STATUS") @JacksonXmlProperty(isAttribute = true, localName = "STATUS")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private Long status; private Long status;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "ACC_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accType; private String accType;
@JacksonXmlProperty(isAttribute = true, localName = "RESULT") @JacksonXmlProperty(isAttribute = true, localName = "RESULT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String result; private String result;
public DF53ObjectTag() { public DF53ObjectTag() {
super(SDf53.class); super(SDf53.class);
} }
@ -47,13 +38,13 @@ public class DF53ObjectTag extends ObjectTag<SDf53> {
@Override @Override
public void setData(SDf53 entity) { public void setData(SDf53 entity) {
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy"); final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy");
this.account = entity.getAccount(); this.account = Optional.ofNullable(entity.getAccount()).orElse("");
this.accName = entity.getAccName(); this.accName = Optional.ofNullable(entity.getAccName()).orElse("");
this.deal = entity.getDeal(); this.deal = Optional.ofNullable(entity.getDeal()).orElse("");
this.date = LocalDate.parse(entity.getDate(), dtf); this.date = LocalDate.parse(entity.getDate(), dtf);
this.status = entity.getStatus(); this.status = entity.getStatus();
this.accType = entity.getAccType(); this.accType = Optional.ofNullable(entity.getAccType()).orElse("");
this.result = entity.getResult(); this.result = Optional.ofNullable(entity.getResult()).orElse("");
} }
@Override @Override

View file

@ -2,41 +2,33 @@ package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import ru.clearing.classes.statics.data.sdf.SDf54; import ru.clearing.classes.statics.data.sdf.SDf54;
public class DF54ObjectTag extends ObjectTag<SDf54> { public class DF54ObjectTag extends ObjectTag<SDf54> {
@JacksonXmlProperty(isAttribute = true, localName = "SEG_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "SEG_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String segType; private String segType;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "DOC_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docType; private String docType;
@JacksonXmlProperty(isAttribute = true, localName = "DOCNM_REF") @JacksonXmlProperty(isAttribute = true, localName = "DOCNM_REF")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docnmRef; private String docnmRef;
@JacksonXmlProperty(isAttribute = true, localName = "DOCNMPREV") @JacksonXmlProperty(isAttribute = true, localName = "DOCNMPREV")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docnmprev; private String docnmprev;
@JacksonXmlProperty(isAttribute = true, localName = "SBANKCODE") @JacksonXmlProperty(isAttribute = true, localName = "SBANKCODE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sbankcode; private String sbankcode;
@JacksonXmlProperty(isAttribute = true, localName = "C_ACC_DEB") @JacksonXmlProperty(isAttribute = true, localName = "C_ACC_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String cAccDeb; private String cAccDeb;
@JacksonXmlProperty(isAttribute = true, localName = "SBANKNAM") @JacksonXmlProperty(isAttribute = true, localName = "SBANKNAM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sbanknam1; private String sbanknam1;
@JsonIgnore @JsonIgnore
private String sbanknam2; private String sbanknam2;
@ -48,15 +40,12 @@ public class DF54ObjectTag extends ObjectTag<SDf54> {
private String sbanknam5; private String sbanknam5;
@JacksonXmlProperty(isAttribute = true, localName = "RBANKCODE") @JacksonXmlProperty(isAttribute = true, localName = "RBANKCODE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String rbankcode; private String rbankcode;
@JacksonXmlProperty(isAttribute = true, localName = "C_ACC_CRED") @JacksonXmlProperty(isAttribute = true, localName = "C_ACC_CRED")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String cAccCred; private String cAccCred;
@JacksonXmlProperty(isAttribute = true, localName = "RBANKNAM") @JacksonXmlProperty(isAttribute = true, localName = "RBANKNAM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String rbanknam1; private String rbanknam1;
@JsonIgnore @JsonIgnore
private String rbanknam2; private String rbanknam2;
@ -68,28 +57,22 @@ public class DF54ObjectTag extends ObjectTag<SDf54> {
private String rbanknam5; private String rbanknam5;
@JacksonXmlProperty(isAttribute = true, localName = "OP_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "OP_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String opType; private String opType;
@JacksonXmlProperty(isAttribute = true, localName = "OP_ORDER") @JacksonXmlProperty(isAttribute = true, localName = "OP_ORDER")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String opOrder; private String opOrder;
@JacksonXmlProperty(isAttribute = true, localName = "PAY_DATE") @JacksonXmlProperty(isAttribute = true, localName = "PAY_DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate payDate; private LocalDate payDate;
@JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL") @JacksonXmlProperty(isAttribute = true, localName = "PAY_VAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String payVal; private String payVal;
@JacksonXmlProperty(isAttribute = true, localName = "SUM_DEB") @JacksonXmlProperty(isAttribute = true, localName = "SUM_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sumDeb; private String sumDeb;
@JacksonXmlProperty(isAttribute = true, localName = "SCLIENTN") @JacksonXmlProperty(isAttribute = true, localName = "SCLIENTN")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sclientn1; private String sclientn1;
@JsonIgnore @JsonIgnore
private String sclientn2; private String sclientn2;
@ -99,19 +82,15 @@ public class DF54ObjectTag extends ObjectTag<SDf54> {
private String sclientn4; private String sclientn4;
@JacksonXmlProperty(isAttribute = true, localName = "INN_DEB") @JacksonXmlProperty(isAttribute = true, localName = "INN_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String innDeb; private String innDeb;
@JacksonXmlProperty(isAttribute = true, localName = "KPP_DEB") @JacksonXmlProperty(isAttribute = true, localName = "KPP_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String kppDeb; private String kppDeb;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_DEB") @JacksonXmlProperty(isAttribute = true, localName = "ACC_DEB")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accDeb; private String accDeb;
@JacksonXmlProperty(isAttribute = true, localName = "RCLIENTN") @JacksonXmlProperty(isAttribute = true, localName = "RCLIENTN")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String rclientn1; private String rclientn1;
@JsonIgnore @JsonIgnore
private String rclientn2; private String rclientn2;
@ -121,52 +100,40 @@ public class DF54ObjectTag extends ObjectTag<SDf54> {
private String rclientn4; private String rclientn4;
@JacksonXmlProperty(isAttribute = true, localName = "INN_CRED") @JacksonXmlProperty(isAttribute = true, localName = "INN_CRED")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String innCred; private String innCred;
@JacksonXmlProperty(isAttribute = true, localName = "KPP_CRED") @JacksonXmlProperty(isAttribute = true, localName = "KPP_CRED")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String kppCred; private String kppCred;
@JacksonXmlProperty(isAttribute = true, localName = "ACC_KR_1") @JacksonXmlProperty(isAttribute = true, localName = "ACC_KR_1")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String accKr1; private String accKr1;
@JacksonXmlProperty(isAttribute = true, localName = "SPECIF_1") @JacksonXmlProperty(isAttribute = true, localName = "SPECIF_1")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String specif1; private String specif1;
@JacksonXmlProperty(isAttribute = true, localName = "SEND_TYPE") @JacksonXmlProperty(isAttribute = true, localName = "SEND_TYPE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String sendType; private String sendType;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_RESULT") @JacksonXmlProperty(isAttribute = true, localName = "DOC_RESULT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docResult; private String docResult;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_NUM") @JacksonXmlProperty(isAttribute = true, localName = "DOC_NUM")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String docNum; private String docNum;
@JacksonXmlProperty(isAttribute = true, localName = "DOC_DATE") @JacksonXmlProperty(isAttribute = true, localName = "DOC_DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate docDate; private LocalDate docDate;
@JacksonXmlProperty(isAttribute = true, localName = "VALUE_DATE") @JacksonXmlProperty(isAttribute = true, localName = "VALUE_DATE")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate valueDate; private LocalDate valueDate;
@JacksonXmlProperty(isAttribute = true, localName = "SWIFT_BEN") @JacksonXmlProperty(isAttribute = true, localName = "SWIFT_BEN")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String swiftBen; private String swiftBen;
@JacksonXmlProperty(isAttribute = true, localName = "SWIFT_INT") @JacksonXmlProperty(isAttribute = true, localName = "SWIFT_INT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String swiftInt; private String swiftInt;
public DF54ObjectTag() { public DF54ObjectTag() {
super(SDf54.class); super(SDf54.class);
} }
@ -174,51 +141,51 @@ public class DF54ObjectTag extends ObjectTag<SDf54> {
@Override @Override
public void setData(SDf54 entity) { public void setData(SDf54 entity) {
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy"); final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yy");
this.segType = entity.getSeg_type(); this.segType = Optional.ofNullable(entity.getSeg_type()).orElse("");
this.docType = entity.getDoc_type(); this.docType = Optional.ofNullable(entity.getDoc_type()).orElse("");
this.docnmRef = entity.getDocnm_ref(); this.docnmRef = Optional.ofNullable(entity.getDocnm_ref()).orElse("");
this.docnmprev = entity.getDocnmprev(); this.docnmprev = Optional.ofNullable(entity.getDocnmprev()).orElse("");
this.sbankcode = entity.getSbankcode(); this.sbankcode = Optional.ofNullable(entity.getSbankcode()).orElse("");
this.cAccDeb = entity.getC_acc_deb(); this.cAccDeb = Optional.ofNullable(entity.getC_acc_deb()).orElse("");
this.sbanknam1 = entity.getSbanknam1(); this.sbanknam1 = Optional.ofNullable(entity.getSbanknam1()).orElse("");
this.sbanknam2 = entity.getSbanknam2(); this.sbanknam2 = Optional.ofNullable(entity.getSbanknam2()).orElse("");
this.sbanknam3 = entity.getSbanknam3(); this.sbanknam3 = Optional.ofNullable(entity.getSbanknam3()).orElse("");
this.sbanknam4 = entity.getSbanknam4(); this.sbanknam4 = Optional.ofNullable(entity.getSbanknam4()).orElse("");
this.sbanknam5 = entity.getSbanknam5(); this.sbanknam5 = Optional.ofNullable(entity.getSbanknam5()).orElse("");
this.rbankcode = entity.getRbankcode(); this.rbankcode = Optional.ofNullable(entity.getRbankcode()).orElse("");
this.cAccCred = entity.getC_acc_cred(); this.cAccCred = Optional.ofNullable(entity.getC_acc_cred()).orElse("");
this.rbanknam1 = entity.getRbanknam1(); this.rbanknam1 = Optional.ofNullable(entity.getRbanknam1()).orElse("");
this.rbanknam2 = entity.getRbanknam2(); this.rbanknam2 = Optional.ofNullable(entity.getRbanknam2()).orElse("");
this.rbanknam3 = entity.getRbanknam3(); this.rbanknam3 = Optional.ofNullable(entity.getRbanknam3()).orElse("");
this.rbanknam4 = entity.getRbanknam4(); this.rbanknam4 = Optional.ofNullable(entity.getRbanknam4()).orElse("");
this.rbanknam5 = entity.getRbanknam5(); this.rbanknam5 = Optional.ofNullable(entity.getRbanknam5()).orElse("");
this.opType = entity.getOp_type(); this.opType = Optional.ofNullable(entity.getOp_type()).orElse("");
this.opOrder = entity.getOp_order(); this.opOrder = Optional.ofNullable(entity.getOp_order()).orElse("");
this.payDate = LocalDate.parse(entity.getPay_date(), dtf); this.payDate = LocalDate.parse(entity.getPay_date(), dtf);
this.payVal = entity.getPay_val(); this.payVal = Optional.ofNullable(entity.getPay_val()).orElse("");
this.sumDeb = entity.getSum_deb(); this.sumDeb = Optional.ofNullable(entity.getSum_deb()).orElse("");
this.sclientn1 = entity.getSclientn1(); this.sclientn1 = Optional.ofNullable(entity.getSclientn1()).orElse("");
this.sclientn2 = entity.getSclientn2(); this.sclientn2 = Optional.ofNullable(entity.getSclientn2()).orElse("");
this.sclientn3 = entity.getSclientn3(); this.sclientn3 = Optional.ofNullable(entity.getSclientn3()).orElse("");
this.sclientn4 = entity.getSclientn4(); this.sclientn4 = Optional.ofNullable(entity.getSclientn4()).orElse("");
this.innDeb = entity.getInn_deb(); this.innDeb = Optional.ofNullable(entity.getInn_deb()).orElse("");
this.kppDeb = entity.getKpp_deb(); this.kppDeb = Optional.ofNullable(entity.getKpp_deb()).orElse("");
this.accDeb = entity.getAcc_deb(); this.accDeb = Optional.ofNullable(entity.getAcc_deb()).orElse("");
this.rclientn1 = entity.getRclientn1(); this.rclientn1 = Optional.ofNullable(entity.getRclientn1()).orElse("");
this.rclientn2 = entity.getRclientn2(); this.rclientn2 = Optional.ofNullable(entity.getRclientn2()).orElse("");
this.rclientn3 = entity.getRclientn3(); this.rclientn3 = Optional.ofNullable(entity.getRclientn3()).orElse("");
this.rclientn4 = entity.getRclientn4(); this.rclientn4 = Optional.ofNullable(entity.getRclientn4()).orElse("");
this.innCred = entity.getInn_cred(); this.innCred = Optional.ofNullable(entity.getInn_cred()).orElse("");
this.kppCred = entity.getKpp_cred(); this.kppCred = Optional.ofNullable(entity.getKpp_cred()).orElse("");
this.accKr1 = entity.getAcc_kr_1(); this.accKr1 = Optional.ofNullable(entity.getAcc_kr_1()).orElse("");
this.specif1 = entity.getSpecif_1(); this.specif1 = Optional.ofNullable(entity.getSpecif_1()).orElse("");
this.sendType = entity.getSend_type(); this.sendType = Optional.ofNullable(entity.getSend_type()).orElse("");
this.docResult = entity.getDoc_result(); this.docResult = Optional.ofNullable(entity.getDoc_result()).orElse("");
this.docNum = entity.getDoc_num(); this.docNum = Optional.ofNullable(entity.getDoc_num()).orElse("");
this.docDate = LocalDate.parse(entity.getDoc_date(), dtf); this.docDate = LocalDate.parse(entity.getDoc_date(), dtf);
this.valueDate = LocalDate.parse(entity.getValue_date(), dtf); this.valueDate = LocalDate.parse(entity.getValue_date(), dtf);
this.swiftBen = entity.getSwift_ben(); this.swiftBen = Optional.ofNullable(entity.getSwift_ben()).orElse("");
this.swiftInt = entity.getSwift_int(); this.swiftInt = Optional.ofNullable(entity.getSwift_int()).orElse("");
} }
@Override @Override

View file

@ -1,50 +1,41 @@
package ru.spcex.clearing.xml.exporter.logic.data.tags.objects; package ru.spcex.clearing.xml.exporter.logic.data.tags.objects;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Objects; import java.util.Objects;
import java.util.Optional;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import ru.clearing.classes.statics.data.sdf.SDf56; import ru.clearing.classes.statics.data.sdf.SDf56;
public class DF56ObjectTag extends ObjectTag<SDf56> { public class DF56ObjectTag extends ObjectTag<SDf56> {
@JacksonXmlProperty(isAttribute = true, localName = "NUMBER") @JacksonXmlProperty(isAttribute = true, localName = "NUMBER")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String number; private String number;
@JacksonXmlProperty(isAttribute = true, localName = "SUNIXTIME") @JacksonXmlProperty(isAttribute = true, localName = "SUNIXTIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private Long startUnixtime; private Long startUnixtime;
@JacksonXmlProperty(isAttribute = true, localName = "SDATETIME") @JacksonXmlProperty(isAttribute = true, localName = "SDATETIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime startDatetime; private LocalDateTime startDatetime;
@JacksonXmlProperty(isAttribute = true, localName = "EUNIXTIME") @JacksonXmlProperty(isAttribute = true, localName = "EUNIXTIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private Long endUnixtime; private Long endUnixtime;
@JacksonXmlProperty(isAttribute = true, localName = "EDATETIME") @JacksonXmlProperty(isAttribute = true, localName = "EDATETIME")
@JsonSetter(nulls = Nulls.AS_EMPTY)
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime endDatetime; private LocalDateTime endDatetime;
@JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT") @JacksonXmlProperty(isAttribute = true, localName = "ACCOUNT")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String account; private String account;
@JacksonXmlProperty(isAttribute = true, localName = "DEAL") @JacksonXmlProperty(isAttribute = true, localName = "DEAL")
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String deal; private String deal;
public DF56ObjectTag() { public DF56ObjectTag() {
super(SDf56.class); super(SDf56.class);
} }
@ -56,8 +47,8 @@ public class DF56ObjectTag extends ObjectTag<SDf56> {
this.startDatetime = Instant.ofEpochMilli(this.startUnixtime).atZone(ZoneId.systemDefault()).toLocalDateTime(); this.startDatetime = Instant.ofEpochMilli(this.startUnixtime).atZone(ZoneId.systemDefault()).toLocalDateTime();
this.endUnixtime = Long.valueOf(entity.getEnd_datetime()); this.endUnixtime = Long.valueOf(entity.getEnd_datetime());
this.endDatetime = Instant.ofEpochMilli(this.endUnixtime).atZone(ZoneId.systemDefault()).toLocalDateTime(); this.endDatetime = Instant.ofEpochMilli(this.endUnixtime).atZone(ZoneId.systemDefault()).toLocalDateTime();
this.account = entity.getAccount() == null ? "" : entity.getAccount(); this.account = Optional.ofNullable(entity.getAccount()).orElse("");
this.deal = entity.getDeal() == null ? "" : entity.getDeal(); this.deal = Optional.ofNullable(entity.getDeal()).orElse("");
} }
@Override @Override