Commit 5d4d064e by chengzhuoshen

fix bug,移除SwiftTransfer多余的方法

parent e687a878
......@@ -423,81 +423,4 @@ public class SwiftTransfer {
return fetchFinFromMixMessage(mixFilePath);
}
}
/**
* 特殊处理mt报文
* 50F 去掉 1/ 2/ 3/
* 59F 去掉 1/ 2/ 3/
* 保证给新核心系统的报文要素名称地址的正确性
*/
public static String clearFin5059FPrefix(String mtMsg) {
try {
AbstractMT abstractMT = AbstractMT.parse(mtMsg);
if (abstractMT == null
|| abstractMT.getSwiftMessage() == null
|| abstractMT.getSwiftMessage().getBlock4() == null) {
return mtMsg;
}
SwiftBlock4 swiftBlock4 = abstractMT.getSwiftMessage().getBlock4();
Tag tag = swiftBlock4.getTagByName("50F");
if (tag != null) {
Field50F field50F = (Field50F) tag.asField();
String value = field50F.getPartyIdentifier();
if (StringUtil.isNotEmpty(field50F.getNameAndAddress1())) {
value += Mx2MtConstants.NEW_LINE + field50F.getNameAndAddress1();
}
if (StringUtil.isNotEmpty(field50F.getNameAndAddress2())) {
value += Mx2MtConstants.NEW_LINE + field50F.getNameAndAddress2();
}
if (StringUtil.isNotEmpty(field50F.getNameAndAddress3())) {
value += Mx2MtConstants.NEW_LINE + field50F.getNameAndAddress3();
}
if (StringUtil.isNotEmpty(field50F.getNameAndAddress4())) {
value += Mx2MtConstants.NEW_LINE + field50F.getNameAndAddress4();
}
tag.setValue(value);
}
tag = swiftBlock4.getTagByName("59F");
if (tag != null) {
Field59F field59F = (Field59F) tag.asField();
String value = "";
if (StringUtil.isNotEmpty(field59F.getComponent1())) {
value += "/" + field59F.getComponent1();
}
if (StringUtil.isNotEmpty(field59F.getNameAndAddress1())) {
if (StringUtil.isEmpty(value)) {
value += field59F.getNameAndAddress1();
} else {
value += Mx2MtConstants.NEW_LINE + field59F.getNameAndAddress1();
}
}
if (StringUtil.isNotEmpty(field59F.getNameAndAddress2())) {
if (StringUtil.isEmpty(value)) {
value += field59F.getNameAndAddress2();
} else {
value += Mx2MtConstants.NEW_LINE + field59F.getNameAndAddress2();
}
}
if (StringUtil.isNotEmpty(field59F.getNameAndAddress3())) {
if (StringUtil.isEmpty(value)) {
value += field59F.getNameAndAddress3();
} else {
value += Mx2MtConstants.NEW_LINE + field59F.getNameAndAddress3();
}
}
if (StringUtil.isNotEmpty(field59F.getNameAndAddress4())) {
if (StringUtil.isEmpty(value)) {
value += field59F.getNameAndAddress4();
} else {
value += Mx2MtConstants.NEW_LINE + field59F.getNameAndAddress4();
}
}
tag.setValue(value);
}
IConversionService srv = new ConversionService();
return srv.getFIN(abstractMT.getSwiftMessage());
} catch (Exception e) {
throw new SwiftException(e.getMessage());
}
}
}
......@@ -139,7 +139,7 @@ public class MxMessageReader {
infMap.put("ref", tag.getValue());
if (errorInfos != null && errorInfos.size() > 0) {
for (SwiftTranslationErrorInfo errorInfo : errorInfos) {
if (ERROR.T0000T.equals(errorInfo.getErrorCode())
if (ERROR.T0000T.equals(errorInfo.getCode())
&& "Block4/:20:".equals(errorInfo.getLocation())
&& StringUtil.isNotEmpty(errorInfo.getOriginalValue())) {
infMap.put("ref", errorInfo.getOriginalValue());
......@@ -152,7 +152,7 @@ public class MxMessageReader {
infMap.put("tscref", tag.getValue());
if (errorInfos != null && errorInfos.size() > 0) {
for (SwiftTranslationErrorInfo errorInfo : errorInfos) {
if (ERROR.T0000T.equals(errorInfo.getErrorCode())
if (ERROR.T0000T.equals(errorInfo.getCode())
&& "Block4/:21:".equals(errorInfo.getLocation())
&& StringUtil.isNotEmpty(errorInfo.getOriginalValue())) {
infMap.put("tscref", errorInfo.getOriginalValue());
......
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