Commit 98debfde by lixinyi

ack逻辑修改

parent c8727197
...@@ -14,12 +14,14 @@ import com.brilliance.swift.mx2element.pacs008001.Mx2ElementPacs008001Creator; ...@@ -14,12 +14,14 @@ import com.brilliance.swift.mx2element.pacs008001.Mx2ElementPacs008001Creator;
import com.brilliance.swift.mx2element.pacs009001.Mx2ElementPacs009001Creator; import com.brilliance.swift.mx2element.pacs009001.Mx2ElementPacs009001Creator;
import com.brilliance.swift.mx2element.xsys011001.Mx2ElementXsys011001Creator; import com.brilliance.swift.mx2element.xsys011001.Mx2ElementXsys011001Creator;
import com.brilliance.swift.mx2element.xsys01200101.Mx2ElementXsys012001Creator; import com.brilliance.swift.mx2element.xsys01200101.Mx2ElementXsys012001Creator;
import com.brilliance.swift.util.SwiftTransferUtil;
import com.brilliance.swift.util.XmlUtil; import com.brilliance.swift.util.XmlUtil;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.prowidesoftware.swift.model.MxId; import com.prowidesoftware.swift.model.MxId;
import com.prowidesoftware.swift.model.mx.AbstractMX; import com.prowidesoftware.swift.model.mx.AbstractMX;
import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
...@@ -34,10 +36,21 @@ public class Mx2ElementCreatorManager { ...@@ -34,10 +36,21 @@ public class Mx2ElementCreatorManager {
public Map<String, Object> mx2ElementMaps(String xmlStr) throws SwiftException { public Map<String, Object> mx2ElementMaps(String xmlStr) throws SwiftException {
xmlStr = XmlUtil.handlingXml(xmlStr); xmlStr = XmlUtil.handlingXml(xmlStr);
MxId mxId = XmlUtil.getMxMessageType(xmlStr); MxId mxId = XmlUtil.getMxMessageType(xmlStr);
String messageType = mxId.getBusinessProcess().name() String messageType = "";
+ mxId.getFunctionality() //增加ISO ACK/NAK处理逻辑
+ mxId.getVariant() Map<String,String> ackNakMap= SwiftTransferUtil.anasyIsoACKNAK(xmlStr);
+ mxId.getVersion(); Map<String, Object> objectMap = new HashMap<>();
if(ackNakMap!=null){
for (Map.Entry<String, String> entry : ackNakMap.entrySet()) {
objectMap.put(entry.getKey(), entry.getValue());
}
return objectMap;
}else {
messageType = mxId.getBusinessProcess().name()
+ mxId.getFunctionality()
+ mxId.getVariant()
+ mxId.getVersion();
}
if (mxId == null) { if (mxId == null) {
throw new SwiftException("找不到MX报文类型"); throw new SwiftException("找不到MX报文类型");
} }
......
...@@ -934,13 +934,21 @@ public class SwiftTransferUtil { ...@@ -934,13 +934,21 @@ public class SwiftTransferUtil {
throw new SwiftException("parse iso xml error:" + e.getMessage()); throw new SwiftException("parse iso xml error:" + e.getMessage());
} }
String mtAckNakStr=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Interventions.Intervention.Contents.AckNack.PseudoAckNack"); String mtAckNakStr=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Interventions.Intervention.Contents.AckNack.PseudoAckNack");
String valdat=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Interventions.Intervention.CreationTime");
String senderReference=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.SenderReference"); String senderReference=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.SenderReference");
String messageIdentifier=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.MessageIdentifier"); String messageIdentifier=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.MessageIdentifier");
String uetr=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.NetworkInfo.SWIFTNetNetworkInfo.Reference");
String sndbic=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.Sender.FullName.X1");
String rcvbic=XmlUtil.getXmlNodeValue(document,"DataPDU.Header.TransmissionReport.Message.Receiver.FullName.X1");
Map<String, String> maps =new HashMap<>(); Map<String, String> maps =new HashMap<>();
String result=""; String result="";
maps.put("mtAckNakStr",mtAckNakStr); maps.put("mtAckNakStr",mtAckNakStr);
maps.put("senderReference",senderReference); maps.put("senderReference",senderReference);
maps.put("messageIdentifier",messageIdentifier); maps.put("messageIdentifier",messageIdentifier);
maps.put("UETR",uetr);
maps.put("sndbic",sndbic);
maps.put("rcvbic",rcvbic);
maps.put("valdat",valdat);
if(StringUtil.isNotEmpty(mtAckNakStr)){ if(StringUtil.isNotEmpty(mtAckNakStr)){
if(mtAckNakStr.contains("{311:ACK")){ if(mtAckNakStr.contains("{311:ACK")){
result="ACK"; result="ACK";
...@@ -948,7 +956,8 @@ public class SwiftTransferUtil { ...@@ -948,7 +956,8 @@ public class SwiftTransferUtil {
result="NAK"; result="NAK";
} }
} }
maps.put("result",result); maps.put("mty",result);
maps.put("messageType",result);
// System.out.println("maps="+maps); // System.out.println("maps="+maps);
return maps; return maps;
} }
......
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