Commit 73065a63 by zhanghou

940,950,910,900读取mt报文数据

parent 38b6b89b
package com.brilliance.swift.mt2mx; package com.brilliance.swift.mt2mx;
import com.brilliance.swift.exception.SwiftException; import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.camt053001.Mt2Mx940950Creator;
import com.brilliance.swift.mt2mx.camt054001.Mt2Mx900910Creator;
import com.brilliance.swift.mt2mx.pacs008001.Mt2MxPacs008001Creator; import com.brilliance.swift.mt2mx.pacs008001.Mt2MxPacs008001Creator;
import com.brilliance.swift.mt2mx.pacs009001.Mt2MxPacs009001Creator; import com.brilliance.swift.mt2mx.pacs009001.Mt2MxPacs009001Creator;
import com.brilliance.swift.mx.SwiftDto2MxCreatorManager; import com.brilliance.swift.mx.SwiftDto2MxCreatorManager;
...@@ -107,6 +109,10 @@ public class Mt2MxCreateManager { ...@@ -107,6 +109,10 @@ public class Mt2MxCreateManager {
return new Mt2MxPacs008001Creator(); return new Mt2MxPacs008001Creator();
} else if ("202".equals(messageType)) { } else if ("202".equals(messageType)) {
return new Mt2MxPacs009001Creator(); return new Mt2MxPacs009001Creator();
} else if("900".equals(messageType)||"910".equals(messageType)){
return new Mt2Mx900910Creator();
} else if("940".equals(messageType)||"950".equals(messageType)){
return new Mt2Mx940950Creator();
} else { } else {
throw new SwiftException("Invalid message type"); throw new SwiftException("Invalid message type");
} }
......
package com.brilliance.swift.mt2mx.camt053001;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxCreator;
import com.brilliance.swift.mt2mx.Mt2MxContextIdentifier;
import com.brilliance.swift.mt2mx.Mt2MxParseFields;
import com.brilliance.swift.mt2mx.camt053001.impl.*;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author zh
* @create 2022-04-24 17:06
*/
public class Mt2Mx940950Creator extends AbstractMt2MxCreator {
@Override
public void preProcess() throws SwiftException {
try {
super.preProcess();
SwiftDto swiftDto = context.get(SwiftDto.class);
BankToCustomerStatement bankToCustomerStatement = new BankToCustomerStatement();
bankToCustomerStatement.setSenderBic(swiftDto.getSenderBic());
bankToCustomerStatement.setReceiverBic(swiftDto.getReceiverBic());
bankToCustomerStatement.setCreateDate(swiftDto.getCreateDate());
bankToCustomerStatement.setMessagePriority(swiftDto.getMessagePriority());
bankToCustomerStatement.setUetr(swiftDto.getUetr());
bankToCustomerStatement.setMessageType("camt.053.001");
context.set(bankToCustomerStatement);
} catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
@Override
public List<Mt2MxParseFields> getParseFieldsList() throws SwiftException {
List<Mt2MxParseFields> list = new ArrayList<>();
list.add(new Camt053001Parse20Field());
list.add(new Camt053001Parse21Field());
list.add(new Camt053001Parse25aField());
list.add(new Camt053001Parse28CField());
list.add(new Camt053001Parse60aField());
list.add(new Camt053001Parse61Field());
list.add(new Camt053001Parse62aField());
list.add(new Camt053001Parse64Field());
list.add(new Camt053001Parse65Field());
list.add(new Camt053001Parse86Field());
return list;
}
@Override
public void postProcess() throws SwiftException {
try {
String outputFilePath = (String)context.get(Mt2MxContextIdentifier.MT_TO_MX_OUTPUT_FILE_PATH, true);
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
context.set(Mt2MxContextIdentifier.MT_TO_SWIFTDTO_OBJ, bankToCustomerStatement);
if (StringUtil.isNotEmpty(outputFilePath)) {
bankToCustomerStatement.write(new File(outputFilePath));
}
} catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.prowidesoftware.swift.model.field.Field20;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse20Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
Field20 field20 = mt940.getField20();
if(field20!=null){
bankToCustomerStatement.setMessageId(field20.getValue());
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
Field20 field20 = mt950.getField20();
if(field20!=null){
bankToCustomerStatement.setMessageId(field20.getValue());
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse21Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.prowidesoftware.swift.model.field.Field25;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse25aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
Field25 field25 = mt940.getField25();
if(field25!=null){
bankToCustomerStatement.setIbanId(field25.getValue());
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
Field25 field25 = mt950.getField25();
if(field25!=null){
bankToCustomerStatement.setIbanId(field25.getValue());
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.prowidesoftware.swift.model.field.Field28C;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse28CField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
Field28C field28C = mt940.getField28C();
if(field28C!=null){
bankToCustomerStatement.setPgNb(field28C.getStatementNumber());
bankToCustomerStatement.setElctrncSeqNb(field28C.getSequenceNumber());
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
Field28C field28C = mt950.getField28C();
if(field28C!=null){
bankToCustomerStatement.setPgNb(field28C.getStatementNumber());
bankToCustomerStatement.setElctrncSeqNb(field28C.getSequenceNumber());
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.common.BalDto;
import com.brilliance.swift.vo.common.BalTypeEnum;
import com.prowidesoftware.swift.model.field.Field60M;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse60aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
if(mt940.getField60F()!=null){
}else if(mt940.getField60M()!=null){
Field60M field60M = mt940.getField60M();
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field60M.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field60M.getDate(), "yyyyMMdd"));
balDto.setCcy(field60M.getCurrency());
balDto.setAmt(field60M.amount());
bankToCustomerStatement.setBalDtoSixZero(balDto);
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
if(mt950.getField60F()!=null){
}else if(mt950.getField60M()!=null){
Field60M field60M = mt950.getField60M();
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field60M.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field60M.getDate(), "yyyyMMdd"));
balDto.setCcy(field60M.getCurrency());
balDto.setAmt(field60M.amount());
bankToCustomerStatement.setBalDtoSixZero(balDto);
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.common.NtryDto;
import com.prowidesoftware.swift.model.field.Field61;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
import java.util.List;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse61Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
List<Field61> field61List = mt940.getField61();
if(field61List.size()>0) {
NtryDto ntryDto = new NtryDto();
for (int i = 0; i < field61List.size(); i++) {
ntryDto.setValDate(DateUtil.parseDate("20"+field61List.get(i).getValueDate(), "yyyyMMdd"));
ntryDto.setBookDate(DateUtil.parseDate("20"+field61List.get(i).getEntryDate(), "yyyyMMdd"));
ntryDto.setCdtDbtInd(field61List.get(i).getDCMark());
ntryDto.setCcy(field61List.get(i).getFundsCode());
ntryDto.setAmt(field61List.get(i).amount());
ntryDto.setCd(field61List.get(i).getTransactionType());
ntryDto.setEndToEndId(field61List.get(i).getReferenceForTheAccountOwner());
ntryDto.setAddtlTxInf(field61List.get(i).getReferenceOfTheAccountServicingInstitution());
ntryDto.setAddtlNtryInf(field61List.get(i).getSupplementaryDetails());
bankToCustomerStatement.addNtryDto(ntryDto);
}
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
List<Field61> field61List = mt950.getField61();
if(field61List.size()>0) {
NtryDto ntryDto = new NtryDto();
for (int i = 0; i < field61List.size(); i++) {
ntryDto.setValDate(DateUtil.parseDate("20"+field61List.get(i).getValueDate(), "yyyyMMdd"));
ntryDto.setBookDate(DateUtil.parseDate("20"+field61List.get(i).getEntryDate(), "yyyyMMdd"));
ntryDto.setCdtDbtInd(field61List.get(i).getDCMark());
ntryDto.setCcy(field61List.get(i).getFundsCode());
ntryDto.setAmt(field61List.get(i).amount());
ntryDto.setCd(field61List.get(i).getTransactionType());
ntryDto.setEndToEndId(field61List.get(i).getReferenceForTheAccountOwner());
ntryDto.setAddtlTxInf(field61List.get(i).getReferenceOfTheAccountServicingInstitution());
ntryDto.setAddtlNtryInf(field61List.get(i).getSupplementaryDetails());
bankToCustomerStatement.addNtryDto(ntryDto);
}
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.common.BalDto;
import com.brilliance.swift.vo.common.BalTypeEnum;
import com.prowidesoftware.swift.model.field.Field62M;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse62aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
if(mt940.getField62F()!=null){
}else if(mt940.getField62M()!=null){
Field62M field62M = mt940.getField62M();
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field62M.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field62M.getDate(), "yyyyMMdd"));
balDto.setCcy(field62M.getCurrency());
balDto.setAmt(field62M.amount());
bankToCustomerStatement.setBalDtoSixTwo(balDto);
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
if(mt950.getField62F()!=null){
}else if(mt950.getField62M()!=null){
Field62M field62M = mt950.getField62M();
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field62M.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field62M.getDate(), "yyyyMMdd"));
balDto.setCcy(field62M.getCurrency());
balDto.setAmt(field62M.amount());
bankToCustomerStatement.setBalDtoSixTwo(balDto);
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.common.BalDto;
import com.brilliance.swift.vo.common.BalTypeEnum;
import com.prowidesoftware.swift.model.field.Field64;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import com.prowidesoftware.swift.model.mt9xx.MT950;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse64Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
Field64 field64 = mt940.getField64();
if(field64!=null) {
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field64.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field64.getDate(), "yyyyMMdd"));
balDto.setCcy(field64.getCurrency());
balDto.setAmt(field64.amount());
bankToCustomerStatement.setBalDtoSixFour(balDto);
}
}else {
MT950 mt950 = (MT950) context.get(AbstractMT.class);
Field64 field64 = mt950.getField64();
if(field64!=null) {
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field64.getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field64.getDate(), "yyyyMMdd"));
balDto.setCcy(field64.getCurrency());
balDto.setAmt(field64.amount());
bankToCustomerStatement.setBalDtoSixFour(balDto);
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.brilliance.swift.vo.common.BalDto;
import com.brilliance.swift.vo.common.BalTypeEnum;
import com.prowidesoftware.swift.model.field.Field65;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import java.util.List;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse65Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
List<Field65> field65List = mt940.getField65();
if(field65List.size()>0){
for (int i = 0; i < field65List.size(); i++) {
BalDto balDto = new BalDto();
balDto.setBalCdtDbtInd(field65List.get(i).getDCMark());
balDto.setDate(DateUtil.parseDate("20"+field65List.get(i).getDate(), "yyyyMMdd"));
balDto.setCcy(field65List.get(i).getCurrency());
balDto.setAmt(field65List.get(i).amount());
bankToCustomerStatement.addBalDtoSixFive(balDto);
}
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt053001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerStatement;
import com.prowidesoftware.swift.model.field.Field86;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT940;
import java.util.List;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt053001Parse86Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerStatement bankToCustomerStatement = context.get(BankToCustomerStatement.class);
if(context.get(AbstractMT.class).getMessageType().equals("940")){
MT940 mt940 = (MT940) context.get(AbstractMT.class);
List<Field86> field86List = mt940.getField86();
if(field86List.size()>0) {
for (int i = 0; i < field86List.size(); i++) {
bankToCustomerStatement.addAddtlStmtInf(field86List.get(i).getNarrative());
}
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxCreator;
import com.brilliance.swift.mt2mx.Mt2MxContextIdentifier;
import com.brilliance.swift.mt2mx.Mt2MxParseFields;
import com.brilliance.swift.mt2mx.camt054001.impl.*;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author zh
* @create 2022-04-24 14:50
*/
public class Mt2Mx900910Creator extends AbstractMt2MxCreator {
@Override
public void preProcess() throws SwiftException {
try {
super.preProcess();
SwiftDto swiftDto = context.get(SwiftDto.class);
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = new BankToCustomerDebitCreditNotification();
bankToCustomerDebitCreditNotification.setSenderBic(swiftDto.getSenderBic());
bankToCustomerDebitCreditNotification.setReceiverBic(swiftDto.getReceiverBic());
bankToCustomerDebitCreditNotification.setCreateDate(swiftDto.getCreateDate());
bankToCustomerDebitCreditNotification.setMessagePriority(swiftDto.getMessagePriority());
bankToCustomerDebitCreditNotification.setUetr(swiftDto.getUetr());
bankToCustomerDebitCreditNotification.setMessageType("camt.054.001");
context.set(bankToCustomerDebitCreditNotification);
} catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
@Override
public List<Mt2MxParseFields> getParseFieldsList() throws SwiftException {
List<Mt2MxParseFields> list = new ArrayList<>();
list.add(new Camt054001Parse13DField());
list.add(new Camt054001Parse20Field());
list.add(new Camt054001Parse21Field());
list.add(new Camt054001Parse25aField());
list.add(new Camt054001Parse32aField());
list.add(new Camt054001Parse50aField());
list.add(new Camt054001Parse52aField());
list.add(new Camt054001Parse56aField());
list.add(new Camt054001Parse72Field());
return list;
}
@Override
public void postProcess() throws SwiftException {
try {
String outputFilePath = (String)context.get(Mt2MxContextIdentifier.MT_TO_MX_OUTPUT_FILE_PATH, true);
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
context.set(Mt2MxContextIdentifier.MT_TO_SWIFTDTO_OBJ, bankToCustomerDebitCreditNotification);
if (StringUtil.isNotEmpty(outputFilePath)) {
bankToCustomerDebitCreditNotification.write(new File(outputFilePath));
}
} catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse13DField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.prowidesoftware.swift.model.field.Field20;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse20Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
Field20 field20 = mt900.getField20();
if(field20!=null){
bankToCustomerDebitCreditNotification.setMessageId(field20.getValue());
}
}else {
MT910 mt910 = (MT910) context.get(AbstractMT.class);
Field20 field20 = mt910.getField20();
if(field20!=null){
bankToCustomerDebitCreditNotification.setMessageId(field20.getValue());
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.prowidesoftware.swift.model.field.Field21;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse21Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
Field21 field21 = mt900.getField21();
if(field21!=null){
bankToCustomerDebitCreditNotification.setEndToEndId(field21.getValue());
}
}else {
MT910 mt910 = (MT910) context.get(AbstractMT.class);
Field21 field21 = mt910.getField21();
if(field21!=null){
bankToCustomerDebitCreditNotification.setEndToEndId(field21.getValue());
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.prowidesoftware.swift.model.field.Field25;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse25aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
Field25 field25 = mt900.getField25();
if(field25!=null){
bankToCustomerDebitCreditNotification.setIbanId(field25.getValue());
}
}else {
MT910 mt910 = (MT910) context.get(AbstractMT.class);
Field25 field25 = mt910.getField25();
if(field25!=null){
bankToCustomerDebitCreditNotification.setIbanId(field25.getValue());
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.brilliance.swift.vo.common.CcyFormatAmount;
import com.prowidesoftware.swift.model.field.Field32A;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse32aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
Field32A field32A = mt900.getField32A();
if(field32A!=null){
bankToCustomerDebitCreditNotification.setDate(DateUtil.parseDate("20"+field32A.getDate(), "yyyyMMdd"));
CcyFormatAmount cfa = new CcyFormatAmount();
cfa.setCcy(field32A.getCurrency());
cfa.setAmt(field32A.amount());
bankToCustomerDebitCreditNotification.setValueAmount(cfa);
}
}else {
MT910 mt910 = (MT910) context.get(AbstractMT.class);
Field32A field32A = mt910.getField32A();
if(field32A!=null){
bankToCustomerDebitCreditNotification.setDate(DateUtil.parseDate("20"+field32A.getDate(), "yyyyMMdd"));
CcyFormatAmount cfa = new CcyFormatAmount();
cfa.setCcy(field32A.getCurrency());
cfa.setAmt(field32A.amount());
bankToCustomerDebitCreditNotification.setValueAmount(cfa);
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.brilliance.swift.vo.common.PartyDto;
import com.brilliance.swift.vo.common.PartyTypeEnum;
import com.prowidesoftware.swift.model.field.Field25;
import com.prowidesoftware.swift.model.field.Field50A;
import com.prowidesoftware.swift.model.field.Field50K;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse50aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("910")){
MT910 mt910 = (MT910) context.get(AbstractMT.class);
PartyDto partyDto = null;
if(mt910.getField50A()!=null){
Field50A field50A = mt910.getField50A();
partyDto = new PartyDto();
if (StringUtil.isNotEmpty(field50A.getAccount())) {
partyDto.setPartyAcct(buildPartyAccount(field50A.getAccount()));
}
partyDto.setPartyBic(field50A.getBIC());
}else if (mt910.getField50F()!=null){
}else if(mt910.getField50K()!=null){
Field50K field50K = mt910.getField50K();
partyDto = new PartyDto();
if (StringUtil.isNotEmpty(field50K.getAccount())) {
partyDto.setPartyAcct(buildPartyAccount(field50K.getAccount()));
}
partyDto.setPartyName(field50K.getNameAndAddressLine1());
if (StringUtil.isNotEmpty(field50K.getNameAndAddressLine2())) {
partyDto.addAddress(field50K.getNameAndAddressLine2());
}
if (StringUtil.isNotEmpty(field50K.getNameAndAddressLine3())) {
partyDto.addAddress(field50K.getNameAndAddressLine3());
}
if (StringUtil.isNotEmpty(field50K.getNameAndAddressLine4())) {
partyDto.addAddress(field50K.getNameAndAddressLine4());
}
}
if(partyDto!=null){
bankToCustomerDebitCreditNotification.setPartyDtoFiveZero(partyDto);
}
}
}catch (Exception e){
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.brilliance.swift.vo.common.PartyDto;
import com.brilliance.swift.vo.common.PartyTypeEnum;
import com.prowidesoftware.swift.model.field.Field20;
import com.prowidesoftware.swift.model.field.Field52A;
import com.prowidesoftware.swift.model.field.Field52D;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse52aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
PartyDto partyDto = null;
if(mt900.getField52A()!=null){
Field52A field52A = mt900.getField52A();
partyDto = new PartyDto();
partyDto.setPartyBic(field52A.getBIC());
}else if (mt900.getField52D() != null) {
Field52D field52D = mt900.getField52D();
partyDto = new PartyDto();
if (StringUtil.isNotEmpty(field52D.getAccount())) {
partyDto.setPartyAcct(buildPartyAccount(field52D.getAccount()));
}
partyDto.setPartyName(field52D.getNameAndAddressLine1());
if (StringUtil.isNotEmpty(field52D.getNameAndAddressLine2())) {
partyDto.addAddress(field52D.getNameAndAddressLine2());
}
if (StringUtil.isNotEmpty(field52D.getNameAndAddressLine3())) {
partyDto.addAddress(field52D.getNameAndAddressLine3());
}
if (StringUtil.isNotEmpty(field52D.getNameAndAddressLine4())) {
partyDto.addAddress(field52D.getNameAndAddressLine4());
}
}
if (partyDto != null) {
bankToCustomerDebitCreditNotification.setPartyDtoFiveTwo(partyDto);
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.brilliance.swift.vo.common.PartyDto;
import com.prowidesoftware.swift.model.field.Field56A;
import com.prowidesoftware.swift.model.field.Field56D;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse56aField extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("910")){
MT910 mt910 = (MT910) context.get(AbstractMT.class);
PartyDto partyDto = null;
if(mt910.getField56A()!=null){
Field56A field56A = mt910.getField56A();
partyDto = new PartyDto();
partyDto.setPartyBic(field56A.getBIC());
partyDto.setPartyAcct(buildPartyAccount(field56A.getAccount()));
}else if(mt910.getField56D()!=null){
Field56D field56D = mt910.getField56D();
partyDto = new PartyDto();
partyDto.setPartyName(field56D.getNameAndAddressLine1());
if (StringUtil.isNotEmpty(field56D.getNameAndAddressLine2())) {
partyDto.addAddress(field56D.getNameAndAddressLine2());
}
if (StringUtil.isNotEmpty(field56D.getNameAndAddressLine3())) {
partyDto.addAddress(field56D.getNameAndAddressLine3());
}
if (StringUtil.isNotEmpty(field56D.getNameAndAddressLine4())) {
partyDto.addAddress(field56D.getNameAndAddressLine4());
}
partyDto.setPartyAcct(buildPartyAccount(field56D.getAccount()));
}
if(partyDto!=null){
bankToCustomerDebitCreditNotification.setPartyDtoFiveSix(partyDto);
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
package com.brilliance.swift.mt2mx.camt054001.impl;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.AbstractMt2MxParseFields;
import com.brilliance.swift.vo.BankToCustomerDebitCreditNotification;
import com.prowidesoftware.swift.model.field.Field20;
import com.prowidesoftware.swift.model.field.Field72;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import com.prowidesoftware.swift.model.mt9xx.MT910;
/**
* @author zh
* @create 2022-04-24 14:59
*/
public class Camt054001Parse72Field extends AbstractMt2MxParseFields {
@Override
public void parseFields() throws SwiftException {
try {
BankToCustomerDebitCreditNotification bankToCustomerDebitCreditNotification = context.get(BankToCustomerDebitCreditNotification.class);
if(context.get(AbstractMT.class).getMessageType().equals("900")){
MT900 mt900 = (MT900) context.get(AbstractMT.class);
Field72 field72 = mt900.getField72();
if(field72!=null){
bankToCustomerDebitCreditNotification.setAddtlTxInf(field72.getValue());
}
}else {
MT910 mt910 = (MT910) context.get(AbstractMT.class);
Field72 field72 = mt910.getField72();
if(field72!=null){
bankToCustomerDebitCreditNotification.setAddtlTxInf(field72.getValue());
}
}
}catch (Exception e) {
throw new SwiftException("ERROR", e.getMessage());
}
}
}
...@@ -12,102 +12,78 @@ import java.util.List; ...@@ -12,102 +12,78 @@ import java.util.List;
* @author zh * @author zh
* @create 2022-04-21 16:36 * @create 2022-04-21 16:36
*/ */
public class BankToCustomerDebitCreditNotification{ public class BankToCustomerDebitCreditNotification extends SwiftDto{
protected String messageType; protected String endToEndId;
protected String senderBic; protected String ibanId;
protected String receiverBic; protected Date date;
protected Date createDate; protected CcyFormatAmount valueAmount;
protected MessagePriority messagePriority; protected PartyDto partyDtoFiveZero;
protected String messageId; protected PartyDto partyDtoFiveTwo;
protected String uetr; protected PartyDto partyDtoFiveSix;
protected List<PartyDto> partyDto;
protected CcyFormatAmount ccyFormatAmount;
protected String addtlTxInf; protected String addtlTxInf;
public String getMessageType() { public String getEndToEndId() {
return messageType; return endToEndId;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getSenderBic() {
return senderBic;
} }
public void setSenderBic(String senderBic) { public void setEndToEndId(String endToEndId) {
this.senderBic = senderBic; this.endToEndId = endToEndId;
} }
public String getReceiverBic() { public String getIbanId() {
return receiverBic; return ibanId;
} }
public void setReceiverBic(String receiverBic) { public void setIbanId(String ibanId) {
this.receiverBic = receiverBic; this.ibanId = ibanId;
} }
public Date getCreateDate() { public Date getDate() {
return createDate; return date;
} }
public void setCreateDate(Date createDate) { public void setDate(Date date) {
this.createDate = createDate; this.date = date;
} }
public MessagePriority getMessagePriority() { public CcyFormatAmount getValueAmount() {
return messagePriority; return valueAmount;
} }
public void setMessagePriority(MessagePriority messagePriority) { public void setValueAmount(CcyFormatAmount valueAmount) {
this.messagePriority = messagePriority; this.valueAmount = valueAmount;
} }
public String getMessageId() { public PartyDto getPartyDtoFiveZero() {
return messageId; return partyDtoFiveZero;
} }
public void setMessageId(String messageId) { public void setPartyDtoFiveZero(PartyDto partyDtoFiveZero) {
this.messageId = messageId; this.partyDtoFiveZero = partyDtoFiveZero;
} }
public String getUetr() { public PartyDto getPartyDtoFiveTwo() {
return uetr; return partyDtoFiveTwo;
}
public void setUetr(String uetr) {
this.uetr = uetr;
}
public List<PartyDto> getPartyDto() {
if(partyDto == null){
partyDto = new ArrayList<>();
}
return this.partyDto;
} }
public BankToCustomerDebitCreditNotification addPartyDto(PartyDto partyDto) { public void setPartyDtoFiveTwo(PartyDto partyDtoFiveTwo) {
getPartyDto().add(partyDto); this.partyDtoFiveTwo = partyDtoFiveTwo;
return this;
} }
public CcyFormatAmount getCcyFormatAmount() { public PartyDto getPartyDtoFiveSix() {
return ccyFormatAmount; return partyDtoFiveSix;
} }
public void setCcyFormatAmount(CcyFormatAmount ccyFormatAmount) { public void setPartyDtoFiveSix(PartyDto partyDtoFiveSix) {
this.ccyFormatAmount = ccyFormatAmount; this.partyDtoFiveSix = partyDtoFiveSix;
} }
public String getAddtlTxInf() { public String getAddtlTxInf() {
......
...@@ -13,107 +13,92 @@ import java.util.List; ...@@ -13,107 +13,92 @@ import java.util.List;
* @author zh * @author zh
* @create 2022-04-21 16:56 * @create 2022-04-21 16:56
*/ */
public class BankToCustomerStatement { public class BankToCustomerStatement extends SwiftDto{
protected String messageType; protected String ibanId;
protected String senderBic; protected String pgNb;
protected String receiverBic; protected String elctrncSeqNb;
protected Date createDate; protected BalDto balDtoSixZero;
protected MessagePriority messagePriority; protected List<NtryDto> ntryDto;
protected String messageId;
protected String uetr; protected BalDto balDtoSixTwo;
protected List<PartyDto> partyDto; protected BalDto balDtoSixFour;
protected List<BalDto> balDto; protected List<BalDto> balDtoSixFive;
protected List<NtryDto> ntryDto; protected List<String> addtlStmtInf;
protected String addtlStmtInf; public String getIbanId() {
return ibanId;
public String getMessageType() {
return messageType;
} }
public void setMessageType(String messageType) { public void setIbanId(String ibanId) {
this.messageType = messageType; this.ibanId = ibanId;
} }
public String getSenderBic() { public String getPgNb() {
return senderBic; return pgNb;
} }
public void setSenderBic(String senderBic) { public void setPgNb(String pgNb) {
this.senderBic = senderBic; this.pgNb = pgNb;
} }
public String getReceiverBic() { public String getElctrncSeqNb() {
return receiverBic; return elctrncSeqNb;
} }
public void setReceiverBic(String receiverBic) { public void setElctrncSeqNb(String elctrncSeqNb) {
this.receiverBic = receiverBic; this.elctrncSeqNb = elctrncSeqNb;
} }
public Date getCreateDate() { public BalDto getBalDtoSixZero() {
return createDate; return balDtoSixZero;
} }
public void setCreateDate(Date createDate) { public void setBalDtoSixZero(BalDto balDtoSixZero) {
this.createDate = createDate; this.balDtoSixZero = balDtoSixZero;
} }
public MessagePriority getMessagePriority() { public BalDto getBalDtoSixFour() {
return messagePriority; return balDtoSixFour;
} }
public void setMessagePriority(MessagePriority messagePriority) { public void setBalDtoSixFour(BalDto balDtoSixFour) {
this.messagePriority = messagePriority; this.balDtoSixFour = balDtoSixFour;
} }
public String getMessageId() { public List<BalDto> getBalDtoSixFive() {
return messageId; if(balDtoSixFive == null){
balDtoSixFive = new ArrayList<>();
} }
return balDtoSixFive;
public void setMessageId(String messageId) {
this.messageId = messageId;
} }
public String getUetr() { public BankToCustomerStatement addBalDtoSixFive(BalDto balDtoSixFive) {
return uetr; getBalDtoSixFive().add(balDtoSixFive);
} return this;
public void setUetr(String uetr) {
this.uetr = uetr;
} }
public List<PartyDto> getPartyDto() { public List<String> getAddtlStmtInf() {
if(partyDto == null){ if(addtlStmtInf == null){
partyDto = new ArrayList<>(); addtlStmtInf = new ArrayList<>();
} }
return this.partyDto; return addtlStmtInf;
} }
public BankToCustomerStatement addPartyDto(PartyDto partyDto) { public BankToCustomerStatement addAddtlStmtInf(String addtlStmtInf) {
getPartyDto().add(partyDto); getAddtlStmtInf().add(addtlStmtInf);
return this; return this;
} }
public List<BalDto> getBalDto() { public BankToCustomerStatement addNtryDto(NtryDto ntryDto){
if(balDto == null){ getNtryDto().add(ntryDto);
balDto = new ArrayList<>();
}
return this.balDto;
}
public BankToCustomerStatement addBalDto(BalDto balDto) {
getBalDto().add(balDto);
return this; return this;
} }
...@@ -124,16 +109,11 @@ public class BankToCustomerStatement { ...@@ -124,16 +109,11 @@ public class BankToCustomerStatement {
return ntryDto; return ntryDto;
} }
public BankToCustomerStatement addNtryDto(NtryDto ntryDto) { public BalDto getBalDtoSixTwo() {
getNtryDto().add(ntryDto); return balDtoSixTwo;
return this;
}
public String getAddtlStmtInf() {
return addtlStmtInf;
} }
public void setAddtlStmtInf(String addtlStmtInf) { public void setBalDtoSixTwo(BalDto balDtoSixTwo) {
this.addtlStmtInf = addtlStmtInf; this.balDtoSixTwo = balDtoSixTwo;
} }
} }
...@@ -9,8 +9,6 @@ import java.util.Date; ...@@ -9,8 +9,6 @@ import java.util.Date;
*/ */
public class BalDto { public class BalDto {
private String balCd;
private String balCdtDbtInd; private String balCdtDbtInd;
private Date date; private Date date;
...@@ -19,14 +17,6 @@ public class BalDto { ...@@ -19,14 +17,6 @@ public class BalDto {
private BigDecimal amt = BigDecimal.ZERO; private BigDecimal amt = BigDecimal.ZERO;
public String getBalCd() {
return balCd;
}
public void setBalCd(String balCd) {
this.balCd = balCd;
}
public String getBalCdtDbtInd() { public String getBalCdtDbtInd() {
return balCdtDbtInd; return balCdtDbtInd;
} }
......
package com.brilliance.swift.vo.common; package com.brilliance.swift.vo.common;
import com.sun.org.apache.bcel.internal.classfile.Code;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -14,15 +17,11 @@ public class NtryDto { ...@@ -14,15 +17,11 @@ public class NtryDto {
private String cdtDbtInd; private String cdtDbtInd;
private String rvslInd; private String ccy;
private String sts;
private Date date;
private String amt; private BigDecimal amt = BigDecimal.ZERO;
private String ccy; private String cd;
private String endToEndId; private String endToEndId;
...@@ -56,46 +55,30 @@ public class NtryDto { ...@@ -56,46 +55,30 @@ public class NtryDto {
this.cdtDbtInd = cdtDbtInd; this.cdtDbtInd = cdtDbtInd;
} }
public String getRvslInd() { public String getCd() {
return rvslInd; return cd;
} }
public void setRvslInd(String rvslInd) { public void setCd(String cd) {
this.rvslInd = rvslInd; this.cd = cd;
} }
public String getSts() { public String getCcy() {
return sts; return ccy;
}
public void setSts(String sts) {
this.sts = sts;
}
public Date getDate() {
return date;
} }
public void setDate(Date date) { public void setCcy(String ccy) {
this.date = date; this.ccy = ccy;
} }
public String getAmt() { public BigDecimal getAmt() {
return amt; return amt;
} }
public void setAmt(String amt) { public void setAmt(BigDecimal amt) {
this.amt = amt; this.amt = amt;
} }
public String getCcy() {
return ccy;
}
public void setCcy(String ccy) {
this.ccy = ccy;
}
public String getEndToEndId() { public String getEndToEndId() {
return endToEndId; return endToEndId;
} }
...@@ -128,21 +111,4 @@ public class NtryDto { ...@@ -128,21 +111,4 @@ public class NtryDto {
this.addtlNtryInf = addtlNtryInf; this.addtlNtryInf = addtlNtryInf;
} }
@Override
public String toString() {
return "Ntry{" +
"ValDate=" + ValDate +
", BookDate=" + BookDate +
", cdtDbtInd='" + cdtDbtInd + '\'' +
", rvslInd='" + rvslInd + '\'' +
", sts='" + sts + '\'' +
", date=" + date +
", amt='" + amt + '\'' +
", ccy='" + ccy + '\'' +
", endToEndId='" + endToEndId + '\'' +
", acctSvcrRef='" + acctSvcrRef + '\'' +
", addtlTxInf='" + addtlTxInf + '\'' +
", addtlNtryInf='" + addtlNtryInf + '\'' +
'}';
}
} }
package com.brilliance.mt2mx.camt053001;
import com.brilliance.swift.mt2mx.Mt2MxCreateManager;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
public class Test940Camt053001 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT940.txt");
//String xmlStr = new Mt2MxCreateManager().mt2mx(file, "d:/test/pacs008.xml", null);
//System.out.println(xmlStr);
SwiftDto swiftDto = new Mt2MxCreateManager().mt2SwiftDto(file, "d:/test/940camt0530.txt", null);
System.out.println(swiftDto.toString());
}
}
package com.brilliance.mt2mx.camt053001;
import com.brilliance.swift.mt2mx.Mt2MxCreateManager;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
public class Test950Camt053001 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT950.txt");
//String xmlStr = new Mt2MxCreateManager().mt2mx(file, "d:/test/pacs008.xml", null);
//System.out.println(xmlStr);
SwiftDto swiftDto = new Mt2MxCreateManager().mt2SwiftDto(file, "d:/test/950camt0530.txt", null);
System.out.println(swiftDto.toString());
}
}
package com.brilliance.mt2mx.camt054001;
import com.brilliance.swift.mt2mx.Mt2MxCreateManager;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
public class Test900Camt054001 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT900.txt");
//String xmlStr = new Mt2MxCreateManager().mt2mx(file, "d:/test/pacs008.xml", null);
//System.out.println(xmlStr);
SwiftDto swiftDto = new Mt2MxCreateManager().mt2SwiftDto(file, "d:/test/900camt0540.txt", null);
System.out.println(swiftDto.toString());
}
}
package com.brilliance.mt2mx.camt054001;
import com.brilliance.swift.mt2mx.Mt2MxCreateManager;
import com.brilliance.swift.vo.SwiftDto;
import java.io.File;
public class Test910Camt054001 {
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("user.dir")+"\\swiftCore\\src\\main\\resources\\swiftTxt\\MT910.txt");
//String xmlStr = new Mt2MxCreateManager().mt2mx(file, "d:/test/pacs008.xml", null);
//System.out.println(xmlStr);
SwiftDto swiftDto = new Mt2MxCreateManager().mt2SwiftDto(file, "d:/test/910camt0540.txt", null);
System.out.println(swiftDto.toString());
}
}
package com.brilliance.mx2mt.mt900;
import com.prowidesoftware.swift.model.field.Field;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt9xx.MT900;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* @author zh
* @create 2022-04-20 15:13
*/
public class TestMT900obj {
public static void main(String[] args) throws IOException {
AbstractMT mt900 = MT900.parse(new File("E:\\environment\\xinchenworkplace\\swiftMx2Mt\\swiftCore\\src\\main\\resources\\swiftTxt\\MT900.txt"));
for (Field field : mt900.getFields()) {
List<String> components = field.getComponents();
System.out.println(components.get(0));
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment