Commit 0da79133 by zhanghou

修改了camt02900109到mt196,mt296的逻辑

parent 78fa6e3c
......@@ -114,6 +114,8 @@ public class Mx2MtConstants {
public static final String MX_END_TO_END_ID_DEFAULT_VALUE = "NOTPROVIDED";
public static final String MX_TO_MT_DEFAULT_VALUE = "NOTPROVIDED";
public static final String MT_TO_MX_DEFAULT_VALUE = "NOTPROVIDED";
/**
* 外部参数名称
*/
......
......@@ -1423,7 +1423,7 @@ public abstract class AbstractMt2MxParseField implements Mt2MxParseField {
}
}
protected void mt_To_mxField76(String mt76, Map<String, Object> maps){
protected String mt_To_mxField76(String mt76, Map<String, Object> maps){
String mt76Value = mt76.replace("\r\n//", "").trim();
String status = "";
String reason = "";
......@@ -1498,6 +1498,11 @@ public abstract class AbstractMt2MxParseField implements Mt2MxParseField {
cxlStsRsnInfMaps.put("addtlInf",addtlInfJsonArray);
}
addtlInfJsonArray.addAll(list);
if(StringUtil.isNotEmpty(status)){
return status;
}else {
return "";
}
}
protected String getMxType(String mtType){
String mxType = "";
......
......@@ -22,7 +22,12 @@ public abstract class AbstractMt2MxCamt029001ParseField extends AbstractMt2MxPar
appHdrMaps = (Map<String, Object>)jsonMaps.get("appHdr");
Map<String, Object> rsltnOfInvstgtnMaps = (Map<String, Object>)jsonMaps.get("rsltnOfInvstgtn");
assgnmtMaps = (Map<String, Object>)rsltnOfInvstgtnMaps.get("assgnmt");
stsMaps = (Map<String, Object>)rsltnOfInvstgtnMaps.get("sts");
if(rsltnOfInvstgtnMaps.containsKey("sts")){
stsMaps = (Map<String, Object>)rsltnOfInvstgtnMaps.get("sts");
}else {
stsMaps = new HashMap<>();
rsltnOfInvstgtnMaps.put("sts",stsMaps);
}
JSONArray cxlDtlsJsonArray = (JSONArray) rsltnOfInvstgtnMaps.get("cxlDtls");
cxlDtlsMaps = (Map<String, Object>)cxlDtlsJsonArray.get(0);
}
......
package com.brilliance.swift.mt2mx.camt029001;
import com.alibaba.fastjson.JSONArray;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.mt2mx.AbstractMt2MxCreator;
import com.brilliance.swift.mt2mx.Mt2MxContextIdentifier;
import com.brilliance.swift.mt2mx.Mt2MxParseField;
import com.brilliance.swift.mt2mx.camt029001.impl.*;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import org.sss.common.model.IFactory;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -54,13 +56,30 @@ public class Mt2MxCamt029001Creator extends AbstractMt2MxCreator {
String receiverBic = (String) context.get(Mt2MxContextIdentifier.MT_RECEIVE_BIC, true);
if (StringUtil.isNotEmpty(receiverBic)) {
Map<String, Object> assgneMaps = new HashMap<>();
assgnmtMaps.put("assgnr",assgneMaps);
assgnmtMaps.put("assgne",assgneMaps);
Map<String, Object> agtMaps = new HashMap<>();
assgneMaps.put("agt",agtMaps);
mt_to_mxBICFI(sendBic, agtMaps);
mt_to_mxBICFI(receiverBic, agtMaps);
}
Map<String, Object> rslvdCaseMaps = null;
if(txInfAndStsMaps.containsKey("rslvdCase")){
rslvdCaseMaps = (Map<String, Object>) txInfAndStsMaps.get("rslvdCase");
}else {
rslvdCaseMaps = new HashMap<>();
txInfAndStsMaps.put("rslvdCase",rslvdCaseMaps);
}
Map<String, Object> cretrMaps = new HashMap<>();
Map<String, Object> agtMaps = new HashMap<>();
Map<String, Object> finInstnIdMaps = new HashMap<>();
Map<String, Object> pstlAdrMaps = new HashMap<>();
rslvdCaseMaps.put("cretr",cretrMaps);
cretrMaps.put("agt",agtMaps);
agtMaps.put("finInstnId",finInstnIdMaps);
finInstnIdMaps.put("nm", Mx2MtConstants.MT_TO_MX_DEFAULT_VALUE);
finInstnIdMaps.put("pstlAdr",pstlAdrMaps);
JSONArray adrLineJsonArray = new JSONArray();
pstlAdrMaps.put("adrLine",adrLineJsonArray);
adrLineJsonArray.add(Mx2MtConstants.MT_TO_MX_DEFAULT_VALUE);
}
@Override
......
package com.brilliance.swift.mt2mx.camt029001.impl;
import com.alibaba.fastjson.JSONArray;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mt2mx.camt029001.AbstractMt2MxCamt029001ParseField;
import com.brilliance.swift.util.DateUtil;
......@@ -40,6 +41,7 @@ public class Camt029001Parse11RField extends AbstractMt2MxCamt029001ParseField {
String mxType = getMxType(mtType);
orgnlGrpInfMaps.put("orgnlMsgNmId",mxType);
orgnlGrpInfMaps.put("orgnlCreDtTm",dateStr+"T00:00:00+00:00");
orgnlGrpInfMaps.put("orgnlMsgId", Mx2MtConstants.MT_TO_MX_DEFAULT_VALUE);
}
} catch (ParseException e) {
throw new SwiftException("ERROR", e.getMessage());
......
......@@ -20,7 +20,10 @@ public class Camt029001Parse76Field extends AbstractMt2MxCamt029001ParseField {
if (tag76 != null) {
Field76 field76 = (Field76)tag76.asField();
Map<String, Object> txInfAndStsMaps = getTxInfAndStsMaps();
mt_To_mxField76(field76.getValue(),txInfAndStsMaps);
String sts = mt_To_mxField76(field76.getValue(), txInfAndStsMaps);
if("CNCL".equals(sts)||"PDCR".equals(sts)||"RJCR".equals(sts)){
stsMaps.put("conf",sts);
}
}
}
}
......@@ -22,8 +22,10 @@ public class Camt029001Parse77AField extends AbstractMt2MxCamt029001ParseField {
Field77A field77A = (Field77A)tag77A.asField();
String String77A = field77A.getValue().replace("\r\n//", "").replace("\r\n","");
int index = String77A.indexOf("/UETR/");
String uetr = String77A.substring(index+6);
txInfAndStsMaps.put("orgnlUETR",uetr);
if(index>-1){
String uetr = String77A.substring(index+6);
txInfAndStsMaps.put("orgnlUETR",uetr);
}
}
}
}
{1:F01NDEAFIHHXXXX0000000000}{2:O2960000991231HELSFIHHXXXX00000000009912310000N}{3:{121:8a562c67-ca16-48ba-b074-65581be6f001}}{4:
:20:CNCL-ID001
:21:CSE-001
:76:/CNCL/AGNT/HELLO,WORLD.HELLO,WORLD.
:76:/RJCR/ASDF/HELLO,WORLD.HELLO,WORLD.
//HELLO,WORLD.HELLO,WORLD.HELLO,WOR
//LD.HELLO,WORLD.HELLO,WORLD.HELLO,
//HELLO,WORLD.HELLO,WORLD.
//WORLD.HELLO,WORLD.HELLO,WORLD.HEL
//LO,WORLD.HELLO,WORLD.HELLO,WORLD.
//HELLO,WORLD.HELLO,WORLD.HELLO,WOR
......@@ -15,4 +15,4 @@
//be6f001
:11R:202
210217
-}
-}
\ No newline at end of file
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