Commit c3dcf39f by WeiCong

完善数据结构,调用更加便捷

parent df0f7758
......@@ -289,7 +289,9 @@ public class SWFMessage extends AbstractMessageArea {
return true;
}
} else {
if (setGenericRepetitive((AbstractMessageArea) item, index, ano, rs, cnt)) {
if (parent.getType() == MessageArea.SEQ ?
setGenericRepetitive((AbstractMessageArea) item, index, ano, (List) rs.get(cnt), 0)
: setGenericRepetitive((AbstractMessageArea) item, index, ano, rs, cnt)) {
return true;
}
}
......@@ -312,7 +314,7 @@ public class SWFMessage extends AbstractMessageArea {
MessageArea cp = ((AbstractMessageArea) parent).getFields().get(0);//默认有一个组项
do {
SEQList tmp = (SEQList) parent;
setGenericRepetitive((AbstractMessageArea) cp, index, ano, tmp.getCyc() == 1 ? (List<Object>) rs.get(cnt) : rs, 0);
setGenericRepetitive((AbstractMessageArea) cp, index, ano, rs, cnt);
if (rs.size() <= ++cnt)
return true;
try {
......@@ -450,8 +452,8 @@ public class SWFMessage extends AbstractMessageArea {
} else if (((TagLine) item).getTno() > ano) {
break;
}
} else if (item.getType() == MessageArea.SEQ) {
if (parent.getType() == MessageArea.SEQLIST && ((SEQList) parent).getCyc() == 1) {
} else if (item.getType() == MessageArea.CYCLIST) {
if (parent.getType() == MessageArea.SEQ) {
List<Object> sec = new LinkedList<>();
rs.add(sec);
getGenericRepetitive((AbstractMessageArea) item, index, ano, sec);
......
......@@ -121,17 +121,13 @@ public class ParseSwiftTest extends TestCase {
assertEquals(swf.getGenericByNo("1"), "STMMDL129058636E");
//填充101的循环的Sequence B的21域
List<Object> comList = new LinkedList<>();
List<String> one = new LinkedList<>();
one.add("101651ATT000005W");
comList.add(one);
one = new LinkedList<>();
one.add("321651ATT000005Z");
comList.add(one);
comList.add("101651ATT000005W");
comList.add("321651ATT000005Z");
swf.setGenericByNo("10", comList);
assertEquals(swf.getGenericByNo("10"), comList);
//填充101的循环的Sequence B的23E循环域
comList = new LinkedList<>();
one = new LinkedList<>();
List<String> one = new LinkedList<>();
one.add("CHQB/HELLO");
one.add("CHQB/WORLD");
comList.add(one);
......
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