Commit 7371e304 by s_guodong

连表查询

parent ee9542a7
package com.ceb.gjjs.mda.manager.module;
import java.util.*;
import java.math.BigDecimal;
import com.brilliance.mda.runtime.annotation.BDGetter;
import com.brilliance.mda.runtime.annotation.Check;
import com.brilliance.mda.runtime.annotation.Init;
import com.brilliance.mda.runtime.annotation.Rule;
import com.brilliance.mda.runtime.mda.*;
import com.brilliance.mda.runtime.mda.impl.*;
import com.brilliance.mda.runtime.annotation.*;
import com.brilliance.mda.runtime.mda.driver.*;
import static com.brilliance.mda.runtime.mda.Constants.*;
import com.brilliance.mda.runtime.mda.util.*;
import com.fasterxml.jackson.annotation.*;
import java.util.regex.*;
import lombok.Getter;
import lombok.Setter;
import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import com.brilliance.mda.runtime.mda.impl.AbstractModule;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.ceb.gjjs.mda.bo.Chn;
import com.ceb.gjjs.mda.bo.Wanrec;
import com.ceb.gjjs.mda.global.Platform;
import com.ceb.gjjs.mda.bo.Chn;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
*
*/
......@@ -1151,7 +1160,46 @@ public class Rcvp extends AbstractModule{
if(!"blksel".equals(ctx.getTransName()))
{
log.debug("{}","将查询结果添加至rcvlst中");
this.getMsggrp().getRcvlst().add(this.getMsggrp().getMpss().getElement(i).getInr(),this.getMsggrp().getMpss().getElement(i).getDir(),this.getMsggrp().getMpss().getElement(i).getSrcchncod(),this.getMsggrp().getMpss().getElement(i).getChncod(),this.getMsggrp().getMpss().getElement(i).getNxtchncod(),this.getMsggrp().getMpss().getElement(i).getTgtchncod(),this.getMsggrp().getMpss().getElement(i).getSmhinr(),this.getMsggrp().getMpss().getElement(i).getSta(),this.getMsggrp().getMpss().getElement(i).getRspsta(),this.getMsggrp().getMpss().getElement(i).getRcvdattim(),this.getMsggrp().getMpss().getElement(i).getLstdattim(),this.getMsggrp().getMpss().getElement(i).getSttdattim(),this.getMsggrp().getMpss().getElement(i).getTgtdattime(),this.getMsggrp().getMpss().getElement(i).getSnddattim(),this.getMsggrp().getMpss().getElement(i).getRspdattim(),this.getMsggrp().getMpis().getElement(i).getOwnref(),this.getMsggrp().getMpis().getElement(i).getOthref(),this.getMsggrp().getMpis().getElement(i).getSndbic(),this.getMsggrp().getMpis().getElement(i).getRcvbic(),this.getMsggrp().getMpis().getElement(i).getAct(),this.getMsggrp().getMpis().getElement(i).getDtlchg(),this.getMsggrp().getMpis().getElement(i).getCur(),this.getMsggrp().getMpis().getElement(i).getAmt(),this.getMsggrp().getMpis().getElement(i).getValdat(),this.getMsggrp().getMpis().getElement(i).getMsgtyp(),this.getMsggrp().getMpis().getElement(i).getSubtyp(),this.getMsggrp().getMpis().getElement(i).getActbic(),this.getMsggrp().getMpis().getElement(i).getT53bic(),this.getMsggrp().getMpis().getElement(i).getGpi(),this.getMsggrp().getMpis().getElement(i).getUetr(),this.getMsggrp().getMpss().getElement(i).getLstdattim(),this.getMsggrp().getMpis().getElement(i).getLcnb(), this.getMsggrp().getMpss().getElement(i).getSweflg(),this.getMsggrp().getMpss().getElement(i).getBlktyp(),this.getMsggrp().getMpss().getElement(i).getXhxflg(),this.getMsggrp().getMpis().getElement(i).getLoginoprtp(),this.getMsggrp().getMpis().getElement(i).getSid(),this.getMsggrp().getMpis().getElement(i).getMtp(),this.getMsggrp().getMpis().getElement(i).getTxtpcd(),this.getMsggrp().getMpis().getElement(i).getCtgpcd(),this.getMsggrp().getMpis().getElement(i).getMid(),this.getMsggrp().getMpis().getElement(i).getCredat(),this.getMsggrp().getMpis().getElement(i).getInsgdp(),this.getMsggrp().getMpis().getElement(i).getInsdpl(),this.getMsggrp().getMpis().getElement(i).getInsgty(),this.getMsggrp().getMpis().getElement(i).getInsgpl(),this.getMsggrp().getMpis().getElement(i).getInsddp(),this.getMsggrp().getMpis().getElement(i).getInsddl(),this.getMsggrp().getMpis().getElement(i).getInsdty(),this.getMsggrp().getMpis().getElement(i).getInspdl(),this.getMsggrp().getMpis().getElement(i).getSyscod(),this.getMsggrp().getMpis().getElement(i).getRmk(),this.getMsggrp().getMpis().getElement(i).getOrgmid(),this.getMsggrp().getMpis().getElement(i).getOrginspty(),this.getMsggrp().getMpis().getElement(i).getOrginapty(),this.getMsggrp().getMpis().getElement(i).getOrgmsgtyp(),this.getMsggrp().getMpis().getElement(i).getOrgsnddat(),this.getMsggrp().getMpis().getElement(i).getStscod(),this.getMsggrp().getMpis().getElement(i).getPrcmsgdig(),this.getMsggrp().getMpis().getElement(i).getRspmsg(),this.getMsggrp().getMpis().getElement(i).getPrcsts(),this.getMsggrp().getMpis().getElement(i).getProccd(),this.getMsggrp().getMpis().getElement(i).getRjcinf(),this.getMsggrp().getMpis().getElement(i).getSstdat(),this.getMsggrp().getMpis().getElement(i).getRcvdat(),this.getMsggrp().getMpis().getElement(i).getTrndat(),this.getMsggrp().getMpis().getElement(i).getOrpmid(),this.getMsggrp().getMpis().getElement(i).getOrpinspty(),this.getMsggrp().getMpis().getElement(i).getOrpinapty(),this.getMsggrp().getMpis().getElement(i).getOrityp(),this.getMsggrp().getMpis().getElement(i).getOridat(),this.getMsggrp().getMpis().getElement(i).getOrists(),this.getMsggrp().getMpis().getElement(i).getOpinfo(),this.getMsggrp().getMpis().getElement(i).getOriaccdat(),this.getMsggrp().getMpis().getElement(i).getTrasts(),this.getMsggrp().getMpis().getElement(i).getBllpaysts(),this.getMsggrp().getMpis().getElement(i).getRemark());
// this.getMsggrp().getRcvlst().add( this.getMsggrp().getMpss().getElement(i).getDatafields().toArray(new IDatafield[0]));
this.getMsggrp().getRcvlst().add(MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"inr"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"dir"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"srcchncod"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"chncod"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"nxtchncod"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"tgtchncod"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"smhinr"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"sta"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"rspsta"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"rcvdattim"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"lstdattim"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"tgtdattime"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"sttdattim"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"snddattim"),
MdaDriver.getDatafield(this.getMsggrp().getMpss().getElement(i),"rspdattim"),
MdaDriver.getDatafield(this.getMsggrp().getMpis().getElement(i),"ownref"),
MdaDriver.getDatafield(this.getMsggrp().getMpis().getElement(i),"othref")
);
//$msggrp\\rcvlst.add($msggrp\\mpss[i]\\inr,$msggrp\\mpss[i]\\dir,$msggrp\\mpss[i]\\srcchncod
// ,$msggrp\\mpss[i]\\chncod,$msggrp\\mpss[i]\\nxtchncod,$msggrp\\mpss[i]\\tgtchncod
// ,$msggrp\\mpss[i]\\smhinr,$msggrp\\mpss[i]\\sta,$msggrp\\mpss[i]\\rspsta
// ,$msggrp\\mpss[i]\\rcvdattim,$msggrp\\mpss[i]\\lstdattim,$msggrp\\mpss[i]\\sttdattim
// ,$msggrp\\mpss[i]\\tgtdattime,$msggrp\\mpss[i]\\snddattim,$msggrp\\mpss[i]\\rspdattim
// ,$msggrp\\mpis[i]\\ownref,$msggrp\\mpis[i]\\othref,$msggrp\\mpis[i]\\sndbic,$msggrp\\mpis[i]\\rcvbic
// ,$msggrp\\mpis[i]\\act,$msggrp\\mpis[i]\\dtlchg,$msggrp\\mpis[i]\\cur,$msggrp\\mpis[i]\\amt,$msggrp\\mpis[i]\\valdat
// ,$msggrp\\mpis[i]\\msgtyp,$msggrp\\mpis[i]\\subtyp,$msggrp\\mpis[i]\\actbic,$msggrp\\mpis[i]\\t53bic,$msggrp\\mpis[i]\\gpi
// ,$msggrp\\mpis[i]\\uetr,$msggrp\\mpss[i]\\lstdattim,$msggrp\\mpis[i]\\lcnb, $msggrp\\mpss[i]\\sweflg,$msggrp\\mpss[i]\\blktyp,$msggrp\\mpss[i]\\xhxflg
// ,$msggrp\\mpis[i]\\loginoprtp,$msggrp\\mpis[i]\\sid,$msggrp\\mpis[i]\\mtp,$msggrp\\mpis[i]\\txtpcd,$msggrp\\mpis[i]\\ctgpcd
// ,$msggrp\\mpis[i]\\mid,$msggrp\\mpis[i]\\credat,$msggrp\\mpis[i]\\insgdp,$msggrp\\mpis[i]\\insdpl,$msggrp\\mpis[i]\\insgty
// ,$msggrp\\mpis[i]\\insgpl,$msggrp\\mpis[i]\\insddp,$msggrp\\mpis[i]\\insddl,$msggrp\\mpis[i]\\insdty,$msggrp\\mpis[i]\\inspdl
// ,$msggrp\\mpis[i]\\syscod,$msggrp\\mpis[i]\\rmk,$msggrp\\mpis[i]\\orgmid,$msggrp\\mpis[i]\\orginspty,$msggrp\\mpis[i]\\orginapty
// ,$msggrp\\mpis[i]\\orgmsgtyp,$msggrp\\mpis[i]\\orgsnddat,$msggrp\\mpis[i]\\stscod,$msggrp\\mpis[i]\\prcmsgdig,$msggrp\\mpis[i]\\rspmsg
// ,$msggrp\\mpis[i]\\prcsts,$msggrp\\mpis[i]\\proccd,$msggrp\\mpis[i]\\rjcinf,$msggrp\\mpis[i]\\sstdat,$msggrp\\mpis[i]\\rcvdat
// ,$msggrp\\mpis[i]\\trndat,$msggrp\\mpis[i]\\orpmid,$msggrp\\mpis[i]\\orpinspty,$msggrp\\mpis[i]\\orpinapty,$msggrp\\mpis[i]\\orityp
// ,$msggrp\\mpis[i]\\oridat,$msggrp\\mpis[i]\\orists,$msggrp\\mpis[i]\\opinfo,$msggrp\\mpis[i]\\oriaccdat,$msggrp\\mpis[i]\\trasts
// ,$msggrp\\mpis[i]\\bllpaysts,$msggrp\\mpis[i]\\remark);
if("mx".equals(this.getMsgtyp()))
{
this.getMsggrp().getRcvlst().getElement(i).setMsgtyp( this.getMsgtyp());
......
......@@ -217,8 +217,17 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
}
@Override
public void dbReadset(IModuleList[] lists, int maxSize, String whereClause, Object[] datas) {
public <T extends IModule> int dbReadset(IModuleList<T>[] lists, int maxSize, String whereClause, Object[] datas) {
List<Class<? extends IModule>> clazzList = new ArrayList<>();
for (IModuleList iModule : lists) {
clazzList.add(iModule.getDataClass());
}
MybatisArgumentAdapter adapter = new MybatisArgumentAdapter(SELECT, clazzList, whereClause, datas);
for (IModuleList iModule : lists) {
List<T> result = this.dyncRead(iModule.getDataClass(), adapter);
iModule.addAll(result);
}
return lists[0].size();
}
@Override
......@@ -296,6 +305,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
return String.format(sqlIdTemplate, namespacePackage, clazz.getSimpleName(), sid);
}
private <T> T dyncReadOne(Class<? extends IModule> clazz, MybatisArgumentAdapter adapter) {
String sqlId = getSqlId(clazz, SQLID_DYNCREAD);
......@@ -316,6 +326,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
return new ArrayList<>(list);
}
private <T> List<T> dyncRead(Class<T> clazz, Map params) {
String sqlId = getSqlId(clazz, SQLID_DYNCREAD);
......
......@@ -24,7 +24,7 @@ public interface IDaoSession {
<T extends IModule> int dbReadset(IModuleList<T> list, String whereSql,Object[] params);
void dbReadset(IModuleList[] lists, int maxSize, String whereClause, Object[] datas);
<T extends IModule> int dbReadset(IModuleList<T>[] lists, int maxSize, String whereClause, Object[] datas);
void dbReadset(IModuleList[] lists, String whereClause, Object[] datas);
void dbExecuteSQL(String sql,Object... params);
......
......@@ -166,12 +166,12 @@ public class ModuleList<T extends IModule> extends ArrayList<T> implements IModu
@JsonIgnore
public T getElement(int idx) {
return super.get(--idx);
return super.get(idx--);
}
private void setFieldValue(String name, Object value, T bean) {
try {
Field f = this.getDataClass().getField(name);
Field f = this.getDataClass().getDeclaredField(name);
f.setAccessible(true);
f.set(bean, value);
} catch (Exception e) {
......
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