Commit c266a268 by s_guodong

测试多数据源

parent 880890a7
......@@ -79,15 +79,11 @@
<groupId>com.brilliance</groupId>
<artifactId>jrxx-bean</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/jrxx-bean.jar</systemPath>
</dependency>
<dependency>
<groupId>com.brilliance</groupId>
<artifactId>jrxx</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/jrxx.jar</systemPath>
</dependency>
</dependencies>
......
......@@ -11,6 +11,7 @@ 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.brilliance.mda.support.mybatis.DynamicDataSourceContextHolder;
import com.ceb.gjjs.mda.bo.Chn;
import com.ceb.gjjs.mda.bo.Wanrec;
import com.ceb.gjjs.mda.global.Platform;
......@@ -29,7 +30,7 @@ import java.util.regex.Pattern;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
*
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@Getter
......@@ -322,7 +323,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="clrbtn",order=100)
public boolean ruleClrbtnN100(){
IContext ctx = MdaEnv.getContext();
//清空
this.setChnipt(NULLSTR);
//$rcvdatsta = Platform.formatDateTime(Platform.today(),"0");
......@@ -346,26 +347,26 @@ public class Rcvp extends AbstractModule{
this.setSta(NULLSTR);
//显示
//Platform.setModified($rcvdatsta);
//Platform.setModified($rcvdatend);
//Platform.setModified($msgtyp);
Platform.clearDatafield(MdaDriver.getDatafield(this,"lstdatsta"));
Platform.clearDatafield(MdaDriver.getDatafield(this,"lstdatend"));
......@@ -380,7 +381,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="expexl",order=100)
public boolean ruleExpexlN100(){
IContext ctx = MdaEnv.getContext();
IStream is = this.getExpexl();
is.setType("xls");
......@@ -650,7 +651,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="msggrp.rcvlst",order=100)
public boolean ruleMsggrpRcvlstN100(){
IContext ctx = MdaEnv.getContext();
//双击根据交易来跳转
int index = 0;
//记下选择项
......@@ -742,7 +743,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="schbtn",order=200)
public boolean ruleSchbtnN200(){
IContext ctx = MdaEnv.getContext();
MdaUtils.clear(this.getMsggrp().getBlklst());
//对时间的约束
if(MdaUtils.isEmpty(this.getRcvdatsta()))
......@@ -831,11 +832,13 @@ public class Rcvp extends AbstractModule{
//20190827新增电子信用证查询语句
else if("exl".equals(this.getMsgtyp()))
{
DynamicDataSourceContextHolder.setDataSourceType("datasource1");
// sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'990' and m2.subtyp<>'900'";
sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'990'";
}
else
{
DynamicDataSourceContextHolder.setDataSourceType("datasource2");
//sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'601' AND m2.subtyp<>'900' ";
sql = " WHERE m1.inr=m2.inr AND m1.dir='>' AND m1.pntinr IS NULL AND m2.subtyp<>'NCK' AND m2.subtyp<>'ACK' AND m2.subtyp<>'010' AND m2.subtyp<>'020' ";
}
......@@ -1098,7 +1101,7 @@ public class Rcvp extends AbstractModule{
//增加实体查询条件
// sql = sql + $\\sysmod.getEtySql("m2");
String maxsql="SELECT count(*) maxnum FROM mps m1,mpi m2 "+sql;
log.info("{}","select rcv maxsql="+maxsql);
......@@ -1116,7 +1119,7 @@ public class Rcvp extends AbstractModule{
// Platform.message(#CT000461,"查询的数据总量查过:"+maxcount1+"笔,请注意查询条件!");
// return;
// }
Platform.mdbReadset(new IModuleList[]{this.getMsggrp().getMpss(),this.getMsggrp().getMpis()},0,sql,sqldata.toArray());
//组合成为rcvlst
int error =ctx.getErrorCode();
......@@ -1160,7 +1163,7 @@ public class Rcvp extends AbstractModule{
if(!"blksel".equals(ctx.getTransName()))
{
log.debug("{}","将查询结果添加至rcvlst中");
// 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"),
......@@ -1231,7 +1234,7 @@ public class Rcvp extends AbstractModule{
if(!"blksel".equals(ctx.getTransName()))
{
log.debug("{}","查出rcvlst记录"+this.getMsggrp().getRcvlst().fullSize());
if(this.getMsggrp().getRcvlst().fullSize() == 0)
{
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000462"),MdaUtils.getI18NString("rcvp","CT000520"));
......@@ -1240,7 +1243,7 @@ public class Rcvp extends AbstractModule{
else
{
log.debug("{}","查出blklst记录"+this.getMsggrp().getBlklst().fullSize());
if(this.getMsggrp().getBlklst().fullSize() == 0)
{
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000624"),MdaUtils.getI18NString("rcvp","CT000625"));
......@@ -1248,6 +1251,8 @@ public class Rcvp extends AbstractModule{
}
return true;
}
......@@ -1257,7 +1262,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="actblk",order=100)
public boolean ruleActblkN100(){
IContext ctx = MdaEnv.getContext();
Platform.mchain("dbldta");
return true;
......@@ -1269,7 +1274,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="gener202",order=100)
public boolean ruleGener202N100(){
IContext ctx = MdaEnv.getContext();
//20180704新加方法,供业务手工生成发往账户行的202报文
//需查找未转发前的报文信息
this.setValdat(null);
......@@ -1296,8 +1301,8 @@ public class Rcvp extends AbstractModule{
dbc = Platform.sdbCounter(preownref202,"000");
String ownref202 = preownref202 + dbc;
this.setOwnref( ownref202);
return true;
}
......@@ -1308,7 +1313,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="gen202",order=100)
public boolean ruleGen202N100(){
IContext ctx = MdaEnv.getContext();
if(!MdaUtils.isEmpty(this.getOthref()) && this.getOthref().length() > 16)
{
ctx.setFieldError(this,"othref",MdaUtils.getI18NString("rcvp","CT001002"));
......@@ -1344,11 +1349,11 @@ public class Rcvp extends AbstractModule{
}
this.setMsg202(NULLSTR);
this.setMsgdtl202(NULLSTR);
if(generOther202Message())//生成转汇报文
{
}
return true;
......@@ -1360,8 +1365,8 @@ public class Rcvp extends AbstractModule{
@Rule(target="close202",order=100)
public boolean ruleClose202N100(){
IContext ctx = MdaEnv.getContext();
return true;
}
......@@ -1372,7 +1377,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="sav202",order=100)
public boolean ruleSav202N100(){
IContext ctx = MdaEnv.getContext();
/******************************
* 保存202报文
******************************/
......@@ -1401,7 +1406,7 @@ public class Rcvp extends AbstractModule{
log.debug("{}","message save successfull...");
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT001144"),MdaUtils.getI18NString("rcvp","CT001145"));
//Platform.sdbUnLock($mdtmod\\smpmod\\mps);
return true;
}
......@@ -1412,8 +1417,8 @@ public class Rcvp extends AbstractModule{
@Rule(target="close",order=100)
public boolean ruleCloseN100(){
IContext ctx = MdaEnv.getContext();
return true;
}
......@@ -1424,7 +1429,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="gjsbak",order=100)
public boolean ruleGjsbakN100(){
IContext ctx = MdaEnv.getContext();
int index = 0;
log.debug("{}","index:"+index);
......@@ -1437,7 +1442,7 @@ public class Rcvp extends AbstractModule{
//$msggrp\\gjsmsg\\inr = $msggrp\\rcvlst[index]\\uetr.getValue();//请求报文的唯一标识
//$msggrp\\gjsmsg\\inr = Platform.sdbCounter("TB0001","00000000000000000000000000000000");
this.getMsggrp().getGjsmsg().setCod( "TB0001");//业务代码,退报
this.getMsggrp().getGjsmsg().setOthref( this.getMsggrp().getRcvlst().getElement(index).getOthref());//报文业务编号
this.getMsggrp().getGjsmsg().setOwnref( this.getMsggrp().getRcvlst().getElement(index).getOwnref());//报文相关业务编号
......@@ -1471,7 +1476,7 @@ public class Rcvp extends AbstractModule{
this.getMsggrp().getGjsmsg().setMessagechannel( this.getMsggrp().getMps().getSrcchncod());//报文渠道
log.info("{}","退报报文messagechannel:"+ this.getMsggrp().getMps().getSrcchncod());
return true;
}
......@@ -1482,8 +1487,8 @@ public class Rcvp extends AbstractModule{
@Rule(target="rtnbtn",order=100)
public boolean ruleRtnbtnN100(){
IContext ctx = MdaEnv.getContext();
return true;
}
......@@ -1494,9 +1499,9 @@ public class Rcvp extends AbstractModule{
@Rule(target="gjsbakbtn",order=100)
public boolean ruleGjsbakbtnN100(){
IContext ctx = MdaEnv.getContext();
//Platform.message(#CT000383,#CT000384);
if(MdaUtils.isEmpty(this.getMsggrp().getGjsmsg().getBakdat()))
{
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000395"),MdaUtils.getI18NString("rcvp","CT000396"));
......@@ -1508,7 +1513,7 @@ public class Rcvp extends AbstractModule{
String inr = Platform.sdbCounter("TB0001","00000000000000000000000000000000");
lst.add(inr);//请求报文唯一标识
lst.add(this.getMsggrp().getGjsmsg().getCod());//业务代码
String bakdat = "";//退报请求发送时间
if(!MdaUtils.isEmpty(this.getMsggrp().getGjsmsg().getBakdat()))
bakdat = MdaUtils.format(this.getMsggrp().getGjsmsg().getBakdat(),"yyyy-MM-dd");
......@@ -1573,12 +1578,12 @@ public class Rcvp extends AbstractModule{
String snddat = MdaUtils.format(this.getMsggrp().getGjsmsg().getSnddat(),"yyyy-MM-dd");
lst.add(snddat);//原报发送时间
String rmk = "";
if(!MdaUtils.isEmpty(this.getMsggrp().getGjsmsg().getRmk()))
rmk = this.getMsggrp().getGjsmsg().getRmk();
lst.add(rmk);//备注
Boolean success = (Boolean)MdaUtils.invoke("cn.com.brilliance.psbc.service.gjjs.SendTBFileToGjjs","generateAndSendFile",lst);
if(success)
......@@ -1586,7 +1591,7 @@ public class Rcvp extends AbstractModule{
else
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000529"),MdaUtils.getI18NString("rcvp","CT000530"));
return true;
}
......@@ -1597,8 +1602,8 @@ public class Rcvp extends AbstractModule{
@Rule(target="rtn",order=100)
public boolean ruleRtnN100(){
IContext ctx = MdaEnv.getContext();
return true;
}
......@@ -1609,7 +1614,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="batchsendbtn",order=100)
public boolean ruleBatchsendbtnN100(){
IContext ctx = MdaEnv.getContext();
//判断查询的列表是否为空
if(this.getMsggrp().getRcvlst().size() <= 0)
{
......@@ -1669,7 +1674,7 @@ public class Rcvp extends AbstractModule{
{
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000528"),MdaUtils.getI18NString("rcvp","CT000529"));
Platform.mdbCommit();
//成功,计数+1
successCount++;
}
......@@ -1683,7 +1688,7 @@ public class Rcvp extends AbstractModule{
//index++;
}
//移除重发成功的记录,更新rcvlst 列表
String info = "选中" + index + "条记录,成功发送" + successCount + "条,发送失败" + (index - successCount) + "条." ;
MdaUtils.prompt(MdaUtils.getI18NString("rcvp","CT000532"),info);
......@@ -1698,7 +1703,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="msggrp.blklst",order=100)
public boolean ruleMsggrpBlklstN100(){
IContext ctx = MdaEnv.getContext();
//双击根据交易来跳转
int index = 0;
//记下选择项
......@@ -1725,7 +1730,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="casebtn",order=100)
public boolean ruleCasebtnN100(){
IContext ctx = MdaEnv.getContext();
if(this.getMsggrp().getBlklst().size() <= 0)
{
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000857"),MdaUtils.getI18NString("rcvp","CT000858"));
......@@ -1806,7 +1811,7 @@ public class Rcvp extends AbstractModule{
this.getQrtmod().getQrd().setCurusr( MdaEnv.getLoginUser());
this.getQrtmod().getQrd().setRelrfn( this.getMsggrp().getBlklst().getElement(j).getOthref());//???
this.getQrtmod().getQrd().setOtht20( this.getMsggrp().getBlklst().getElement(j).getOthref());//???
this.getQrtmod().getQrd().setDes( "灰名单-"+ baks+":手动批量新建CASE");
String dir = ">";
this.getQrtmod().getQrd().setRevbak( this.getMsggrp().getBlklst().getElement(j).getRcvbic());
......@@ -1906,7 +1911,7 @@ public class Rcvp extends AbstractModule{
}
Platform.mdbCommit();
ctx.setMessage(MdaUtils.getI18NString("rcvp","CT000863"),MdaUtils.getI18NString("rcvp","CT000864"));
}
......@@ -1920,7 +1925,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="ignchkbtn",order=100)
public boolean ruleIgnchkbtnN100(){
IContext ctx = MdaEnv.getContext();
//全部忽略CASE
if(this.getMsggrp().getBlklst().size()<=0)
return true;
......@@ -1941,7 +1946,7 @@ public class Rcvp extends AbstractModule{
}
this.setIgnflg("1");
}
return true;
}
......@@ -1952,7 +1957,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="caschkbtn",order=100)
public boolean ruleCaschkbtnN100(){
IContext ctx = MdaEnv.getContext();
//全部选中CASE
if(this.getMsggrp().getBlklst().size()<=0)
return true;
......@@ -1973,11 +1978,11 @@ public class Rcvp extends AbstractModule{
}
this.setCasflg("1");
}
//log.info("pagesize="+$msggrp\\blklst.getPageSize());
// log.info("Page="+$msggrp\\blklst.getPage());
return true;
}
......@@ -1988,7 +1993,7 @@ public class Rcvp extends AbstractModule{
@Rule(target="ignorebtn",order=100)
public boolean ruleIgnorebtnN100(){
IContext ctx = MdaEnv.getContext();
//批量忽略操作;
if(this.getMsggrp().getBlklst().size() <= 0)
{
......@@ -2046,7 +2051,7 @@ public class Rcvp extends AbstractModule{
@Check(target="sndbak",order=100)
public boolean checkSndbakN100(){
IContext ctx = MdaEnv.getContext();
if(MdaUtils.isEmpty(this.getSndbak()))
return true;
String sndbak = this.getSndbak();
......@@ -2056,7 +2061,7 @@ public class Rcvp extends AbstractModule{
ctx.setFieldError(this,"sndbak",MdaUtils.getI18NString("rcvp","CT000096"));
}
this.setSndbak( sndbak);
return true;
}
......@@ -2067,7 +2072,7 @@ public class Rcvp extends AbstractModule{
@Check(target="revbak",order=100)
public boolean checkRevbakN100(){
IContext ctx = MdaEnv.getContext();
if(MdaUtils.isEmpty(this.getRevbak()))
return true;
String revbak = this.getRevbak();
......@@ -2077,124 +2082,109 @@ public class Rcvp extends AbstractModule{
ctx.setFieldError(this,"revbak",MdaUtils.getI18NString("rcvp","CT000103"));
}
this.setRevbak( revbak);
return true;
}
/**
* source:rcvp.@0009.script
*/
@Check(target="msgtyp",order=100)
public boolean checkMsgtypN100(){
IContext ctx = MdaEnv.getContext();
/*if(Platform.isEmpty($msgtyp.getValue()))
{
Platform.error($msgtyp,#CT000221);
return false;
}
else if("sf2".equals($msgtyp.getValue()))
{
Platform.setDefaultDB("swd");
Platform.setValues($subtyp,getMtyList());
Platform.setModified($subtyp);
Platform.enable($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.enable($gpi);
Platform.enable($uetr);
Platform.disable($lcnb);
}
else if("mx".equals($msgtyp.getValue()))
{
Platform.setDefaultDB("swd");
Platform.setValues($subtyp,getMxList());//将码表的值动态绑定给subtyp
Platform.setModified($subtyp);
Platform.enable($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.enable($gpi);
Platform.enable($uetr);
Platform.disable($lcnb);
}
else if("txt".equals($msgtyp.getValue()))
{
//境内外币业务数据库更换为swd
Platform.setDefaultDB("swd");
Platform.setValues($subtyp,getFmtList());
Platform.setModified($subtyp);
Platform.enable($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.disable($gpi);
Platform.clear($gpi);
Platform.setModified($gpi);
Platform.enable($uetr);
Platform.disable($lcnb);
}
else if("fxl".equals($msgtyp.getValue()))
{
//境内外币业务数据库更换为swd
Platform.setDefaultDB("swd");
Platform.setValues($subtyp,getFxpsList());
Platform.setModified($subtyp);
Platform.enable($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.disable($gpi);
Platform.clear($gpi);
Platform.setModified($gpi);
Platform.enable($uetr);
Platform.disable($lcnb);
}
else if("xml".equals($msgtyp.getValue()))
{
Platform.setDefaultDB("fxd");
Platform.setValues($subtyp,getCipsList());
Platform.setModified($subtyp);
Platform.enable($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.disable($gpi);
Platform.clear($gpi);
Platform.setModified($gpi);
Platform.enable($uetr);
Platform.disable($lcnb);
}
//20190827CCJ新增 电子信用证报文查询
else if("exl".equals($msgtyp.getValue()))
{
$this.elcsCfg();
}
else
{
Platform.clear($subtyp);
Platform.setModified($subtyp);
Platform.disable($sty);
Platform.clear($sty);
Platform.setModified($sty);
Platform.disable($gpi);
Platform.clear($gpi);
Platform.setModified($gpi);
Platform.disable($lcnb);
}*/
/**
* source:rcvp.@0009.script
*/
@Check(target="msgtyp",order=100)
public boolean checkMsgtypN100(){
DynamicDataSourceContextHolder.setDataSourceType("datasource2");
IContext ctx = MdaEnv.getContext();
if(MdaUtils.isEmpty(this.getMsgtyp()))
{
ctx.setFieldError(this,"msgtyp",MdaUtils.getI18NString("rcvp","CT000221"));
return false;
}
else
if("sf2".equals(this.getMsgtyp()))
{
Platform.setDefaultDB("swd");
MdaUtils.setValues(this,"subtyp",getMtyList());
return true;
}
/**
this.setSty(NULLSTR);
}
else if("txt".equals(this.getMsgtyp()))
{
//境内外币业务数据库更换为swd
Platform.setDefaultDB("swd");
MdaUtils.setValues(this,"subtyp",getFmtList());
this.setSty(NULLSTR);
this.setGpi(NULLSTR);
}
else if("xml".equals(this.getMsgtyp()))
{
Platform.setDefaultDB("fxd");
MdaUtils.setValues(this,"subtyp",getCipsList());
this.setSty(NULLSTR);
this.setGpi(NULLSTR);
}
//20190827CCJ新增 电子信用证报文查询
else if("exl".equals(this.getMsgtyp()))
{
this.elcsCfg();
}
else if("mx".equals(this.getMsgtyp()))
{
Platform.setDefaultDB("swd");
this.setSubtyp(NULLSTR);
this.setGpi(NULLSTR);
}
else
{
this.setSubtyp(NULLSTR);
this.setSty(NULLSTR);
this.setGpi(NULLSTR);
}
return true;
}
/**
* source:rcvp.@0014.script
*/
@Check(target="othref",order=100)
public boolean checkOthrefN100(){
IContext ctx = MdaEnv.getContext();
Platform.transAndCheckRef(MdaDriver.getDatafield(this,"othref"));
return true;
......@@ -2206,7 +2196,7 @@ public class Rcvp extends AbstractModule{
@Check(target="ownref",order=100)
public boolean checkOwnrefN100(){
IContext ctx = MdaEnv.getContext();
Platform.transAndCheckRef(MdaDriver.getDatafield(this,"ownref"));
return true;
......@@ -2218,12 +2208,12 @@ public class Rcvp extends AbstractModule{
@Check(target="rcvactbic",order=100)
public boolean checkRcvactbicN100(){
IContext ctx = MdaEnv.getContext();
if(!MdaUtils.isEmpty(this.getRcvactbic()))
{
String scd = this.getRcvactbic();
this.setRcvactbic( scd.toUpperCase());
}
return true;
......@@ -2235,7 +2225,7 @@ public class Rcvp extends AbstractModule{
@Check(target="rcvactbic",order=150)
public boolean checkRcvactbicN150(){
IContext ctx = MdaEnv.getContext();
Platform.transAndCheckBIC(MdaDriver.getDatafield(this,"rcvactbic"));
return true;
......@@ -2247,7 +2237,7 @@ public class Rcvp extends AbstractModule{
@Check(target="uetr",order=100)
public boolean checkUetrN100(){
IContext ctx = MdaEnv.getContext();
Platform.transAndCheckUetr(MdaDriver.getDatafield(this,"uetr"));
return true;
......@@ -2260,7 +2250,7 @@ public class Rcvp extends AbstractModule{
@Init(order=100)
public boolean init100(){
IContext ctx = MdaEnv.getContext();
//检验是否应当重新初始化并查询
//禁用行内系统,初始查询
if(MdaUtils.isReturnCall())
......@@ -2275,23 +2265,23 @@ public class Rcvp extends AbstractModule{
this.setLdevim( ":");
//除了新一代异常/发送失败报文,其他均不显示
if(!"rcvsel".equals(ctx.getTransName()))
{
//灰显行内系统
//灰显行内收报起始日期
//灰显行内收报截止日期
///如果某条已处理,在此处删除该条
String pcdsta = (String)ctx.restoreData("pcdsta");
......@@ -2305,7 +2295,7 @@ public class Rcvp extends AbstractModule{
//20181121新增国结退报功能
//Platform.invisible($gjsbak);
if("rcvsel,bk,GJS".equals(ctx.getTransName()))
//20190426新增发送异常报文重新发送交易
if("exemsg".equals(ctx.getTransName()))
......@@ -2316,77 +2306,77 @@ public class Rcvp extends AbstractModule{
MdaUtils.setValues(this,"sta",staList);
//设置初始值
this.setSta( "E");
MdaUtils.setValues(this,"chnipt",getChnList());
this.setChnipt( "ZYW");
//拦截类型灰显
}
//20190516 新增新一代退报申请交易
if("rcvsel,apbk,ZYW".equals(ctx.getTransName()))
{
this.setSta( "D");
MdaUtils.setValues(this,"chnipt",getChnList());
this.setSubtyp( "910");
this.setChnipt( "ZYW");
//拦截类型灰显
}
//20190516 新增新一代退报审核交易
if("rcvsel,adbk,ZYW".equals(ctx.getTransName()))
{
this.setSta( "T");
this.setSubtyp( "910");
MdaUtils.setValues(this,"chnipt",getChnList());
this.setChnipt( "ZYW");
//拦截类型灰显
}
//黑名单
// if("rcvsel,bl".equals(Platform.getTransName()))
if("blksel".equals(ctx.getTransName())||"rcvsel,bl".equals(ctx.getTransName()))
{
this.setTblvis( "黑名单状态");
//拦截类型显示
this.setBlktyplab( "拦截类型");
this.setBlktypvim( ":");
//20210902
//$subtyp.setValue("103");
//Platform.visible($namblk);
this.setBlksta( "B"); //默认只查在黑名单状态的
///如果某条已处理,在此处删除该条
......@@ -2399,33 +2389,33 @@ public class Rcvp extends AbstractModule{
}
else if("rcvsel,dzf".equals(ctx.getTransName()))
{
//拦截类型灰显
}
else
{
//Platform.invisible($namblk);
//拦截类型灰显
}
if(MdaUtils.isReturnCall())
{
return true;
}
//暂时禁掉sty
//动态列表
/*if("sf2".equals($msgtyp.getValue()))
{
......@@ -2449,11 +2439,11 @@ public class Rcvp extends AbstractModule{
this.setMsgtyp( "xml");
Platform.setDefaultDB("swd");
MdaUtils.setValues(this,"subtyp",getMtyList());
String transname = ctx.getTransName();
if("rcvsel,ra".equals(transname)||"rcvsel,dzf".equals(transname))
{
}
// if("rcvsel,bl".equals(Platform.getTransName()))
if("blksel".equals(ctx.getTransName())||"rcvsel,bl".equals(ctx.getTransName()))
......@@ -2463,7 +2453,7 @@ public class Rcvp extends AbstractModule{
if("rcvsel,fs".equals(ctx.getTransName()))
{
this.setMsgtyp( "exl");
this.elcsCfg();
}
List<CodetableItem> gpilst = new ArrayList<CodetableItem>();
......@@ -2472,7 +2462,7 @@ public class Rcvp extends AbstractModule{
MdaUtils.setValues(this,"gpi",gpilst);
if(!"sf2".equals(this.getMsgtyp()))
{
}
/*String frm = Platform.getTransName();
String[] str = frm.split(",");
......@@ -2501,7 +2491,7 @@ public class Rcvp extends AbstractModule{
this.setRcvdatend( Platform.formatDateTime(MdaUtils.today(),"235959"));
//$lstdatsta = Platform.formatDateTime(Platform.add(Platform.today(),-3),"0");
//$lstdatend = Platform.formatDateTime(Platform.today(),"235959");
//清空显示列表
if(this.getMsggrp().getRcvlst().fullSize() == 1 &&MdaUtils.isEmpty(this.getMsggrp().getRcvlst().getElement(0).getRcvdattim()))
{
......@@ -2786,7 +2776,7 @@ public class Rcvp extends AbstractModule{
}
this.setMsg202( msg202);
this.setMsgdtl202( this.getMsg202());
return true;
}
/**
......@@ -2952,16 +2942,16 @@ public class Rcvp extends AbstractModule{
ctx.setErrorCode(NO_ERROR);
Platform.setDefaultDB("fxd");
MdaUtils.setValues(this,"subtyp",getElcsList());
logger.info("设置之后的db:{}",Platform.getDefaultDB());
this.setSty(NULLSTR);
this.setGpi(NULLSTR);
}
/**
* source:rcvp.@0052.script
......@@ -3063,7 +3053,7 @@ public class Rcvp extends AbstractModule{
//mtyval = mtyval.substring(5);
// mtyList.add(new CodetableItem(mtyval,mtyval));
// }
mtyList.add(new CodetableItem(mtyval,mtyval));
}
else
......
......@@ -45,6 +45,50 @@ spring:
password:
datasource1:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@114.115.138.98:9400:XE
username: TEST
password: test
type: com.alibaba.druid.pool.DruidDataSource
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
# druid 配置: https://github.com/alibaba/druid/wiki/
#初始化链接数
initialSize: 1
minIdle: 1
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: select 1 from dual
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,stat用于监控界面,'wall'用于防火墙防御sql注入, slf4j用于druid记录sql日志
filters: stat,slf4j
#,wall
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
useGlobalDataSourceStat: false
datasource2:
url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 123456
#driverClassName: com.mysql.jdbc.Driver
driver-class-name: com.mysql.jdbc.Driver
envConfig:
rootPath: workRoot
cache:
......@@ -53,4 +97,6 @@ envConfig:
#缓存失效时间(秒)
expireAfterAccess: 3600
#序列化方式
serializer: kryo
\ No newline at end of file
serializer: kryo
package com.brilliance.mda.support.mybatis;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.sql.DataSource;
import java.util.HashMap;
/**
* @Description 注册数据源头
* @Author s_guodong
* @Date 2023/5/24
*/
@Configuration
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class DataSourceConfiguration {
/**
* 数据源1
*/
@Bean(name = "datasource1")
@Qualifier("datasource1")
@ConfigurationProperties(prefix = "spring.datasource1")
public DruidDataSource datasource1() {
return new DruidDataSource();
}
/**
* 数据源2
*/
@Bean(name = "datasource2")
@Qualifier("datasource2")
@ConfigurationProperties(prefix = "spring.datasource2")
public DruidDataSource datasource2() {
return new DruidDataSource();
}
@Bean(name = "dynamicDataSource")
@Primary
public DataSource dynamicDataSource() {
DynamicDataSource dynamicDataSource = new DynamicDataSource();
dynamicDataSource.myMap = new HashMap<>(2);
dynamicDataSource.myMap.put("datasource1", datasource1());
dynamicDataSource.myMap.put("datasource2", datasource2());
dynamicDataSource.setTargetDataSources(dynamicDataSource.myMap);
dynamicDataSource.setDefaultTargetDataSource(datasource1());
DynamicDataSourceContextHolder.dataSourceIds.addAll(dynamicDataSource.myMap.keySet());
return dynamicDataSource;
}
}
package com.brilliance.mda.support.mybatis;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import java.util.Map;
/**
* @Description
* @Author s_guodong
* @Date 2023/5/24
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
public Map<Object, Object> myMap = null;
@Override
protected Object determineCurrentLookupKey() {
return DynamicDataSourceContextHolder.getDataSourceType();
}
}
package com.brilliance.mda.support.mybatis;
import java.util.ArrayList;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2023/5/24
*/
public class DynamicDataSourceContextHolder {
private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();
public static List<Object> dataSourceIds = new ArrayList<Object>();
public static void setDataSourceType(String dataSourceType) {
contextHolder.set(dataSourceType);
}
public static String getDataSourceType() {
return contextHolder.get();
}
public static void clearDataSourceType() {
contextHolder.remove();
}
public static boolean containsDataSource(String dataSourceId) {
return dataSourceIds.contains(dataSourceId);
}
}
package com.brilliance.mda.support.mybatis.dync.mapper;
import com.brilliance.mda.support.mybatis.DynamicDataSourceContextHolder;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -16,6 +17,7 @@ public class DbExecuteMapper {
final String FNAME = this.getClass().getName();
public List<Map<String,Object>> dyncReadForMap(Map<String,Object> params){
DynamicDataSourceContextHolder.setDataSourceType("datasource2");
return sqlSessionTemplate.selectList(FNAME+".dyncReadForMap",params);
}
public int dyncUpdateForMap(Map<String,Object> params){
......
......@@ -86,9 +86,7 @@
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.1.0.2</version>
<scope>system</scope>
<systemPath>${basedir}/../lib/ojdbc6-12.1.0.2.jar</systemPath>
<version>11.2.0.3</version>
</dependency>
</dependencies>
......
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