Commit c9f17d5c by jianglong

glemodservice新增函数方法供调用

parent 9cb60f60
package com.brilliance.isc.common.glemod.service.impl; package com.brilliance.isc.common.glemod.service.impl;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.IStream; import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl; import com.brilliance.mda.runtime.mda.impl.StreamImpl;
...@@ -52,8 +53,7 @@ import java.math.BigDecimal; ...@@ -52,8 +53,7 @@ import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.brilliance.mda.runtime.mda.Constants.CR; import static com.brilliance.mda.runtime.mda.Constants.*;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Service("glemodService") @Service("glemodService")
public class GlemodServiceImpl implements GlemodService { public class GlemodServiceImpl implements GlemodService {
...@@ -2004,4 +2004,220 @@ public class GlemodServiceImpl implements GlemodService { ...@@ -2004,4 +2004,220 @@ public class GlemodServiceImpl implements GlemodService {
String branch = directParentBch.getBranch(); String branch = directParentBch.getBranch();
return bchService.listAllChildAndItselfBch(branch); return bchService.listAllChildAndItselfBch(branch);
} }
private String getTrmCodfromType(String trmTyp){
if (StringUtils.isEmpty(trmTyp)){
return null;
}
Trm trm=trmMapper.seletByTrmtyp(trmTyp);
return trm==null?null:trm.getTrmcod();
}
// #!补记账 反向借记账户分录
//#!===================================
// #! Dat 生成流水号的日期
//#! Typ 申报单的类型
//#! Gs 对公/对私
//#! OwnExtKey 地区机构号
//#!===================================
private void CreateCenterCleXGLEEntry(GlemodVo glemod,GleVo gle,int prn,String centerBranch,String centerInr,String argFLG){
String CDFlag = gle.getDbtcdt();
String TrmTyp ="";
switch ( argFLG){
case "I":
TrmTyp = "TC-CLI";
break;
case "O":
TrmTyp = "TC-CLO";
break;
default:
break;
}
// 第一条,总行,借贷方向相反,其他相同
if ("D".equals(CDFlag)) {
gle.setDbtcdt("C");
gle.setPrn(( prn + 2 )+"");
}else{
gle.setDbtcdt("D");
gle.setPrn(( prn - 2 )+"");
}
String Act = getAvailAcc( TrmTyp, gle.getCur(), centerInr, gle.getAmt() );
//#! by HL
gle.setDbtdft(TrmTyp);
gle.setAct(Act);
gle.setTrmtyp(getTrmCodfromType( TrmTyp ));
//#! update txt2
gle.setTxt2(replaceTrmCodForTxt2ByArgTrmtyp( gle.getTxt2(),gle.getTrmtyp() ));
gleStoreEntry( glemod,gle );
}
public String replaceTrmCodForTxt2ByArgTrmtyp(String oldTxt,String argTrmtyp)
{
//!补记账 反向借记账户分txt2生成
//! OldTxt: old txt2
//! argTrmtyp: new trmtyp
String strspac = " ";
String sep = "#";
int pos = Strings.pos(oldTxt,sep);
String line1 = Strings.mid(oldTxt,1,pos - 1);
String voldTxt = Strings.mid(oldTxt,pos + 1);
pos = Strings.pos(voldTxt,sep);
String tempLine = NULLSTR;
String line3 = NULLSTR;
if( pos == 0 )
{
tempLine = voldTxt;
line3 = "";
}
else
{
tempLine = Strings.mid(voldTxt,1,pos - 1);
line3 = Strings.mid(voldTxt,pos + 1);
}
pos = Strings.pos(tempLine," ");
String line2 = NULLSTR;
if( Strings.pos(tempLine,"科目号") > 0 )
{
line2 = "科目号:" + argTrmtyp + strspac;
}
else
{
line2 = "科目号:" + argTrmtyp + strspac + Strings.trim(Strings.mid(tempLine,pos + 1));
}
if( MdaUtils.isEmpty(line3) )
{
return line1 + sep + line2;
}
else
{
return line1 + sep + line2 + sep + line3;
}
}
public String getFXTerm(GlemodVo glemod,String cur1,String cur2,String accCur,String dcflag)
{
String term = "";
String fxTyp = NULLSTR;
int ignore = 0;
switch( SettleContext.getTransName() )
{
case "FXTLOP":
case "FXTLCM":
case "FXTLCN":
term = "FX-SLQ";
//外币兑换平盘
break;
case "FXTFOP":
case "FXTFCM":
case "FXTFCN":
/**
$Term = "FX-FEX"
**/
term = "FX-ELQ";
break;
case "FXTEOP":
case "FXTEQO":
// 暂时只考虑即期外汇买卖
term = "FX-EXS";
//case "FXTLER"
//外币套汇平盘
break;
case "FXTDEP":
case "FXTDEM":
case "FXTDEN":
term = "FX-ELQ";
break;
default:
if( MdaUtils.compareTo(cur1,xrtmod.sysiso()) == 0 || MdaUtils.compareTo(cur2,xrtmod.sysiso()) == 0 )
{
// 结售汇
fxTyp = "";
BizInfoVo bizInfoVo=glemod.getRec();
if (bizInfoVo instanceof FxdBizInfoVo){
fxTyp = ((FxdBizInfoVo) bizInfoVo).getFxtyp();
}
if( MdaUtils.compareTo(fxTyp,"SS") == 0 || MdaUtils.compareTo(fxTyp,"SB") == 0 || MdaUtils.isEmpty(fxTyp) )
{
// 即期
term = "FX-UTL";
}
else
{
// 远期
term = "FX-SUS";
}
}
else
{
// 套汇
// 黑龙江农信套汇走外币兑换
/**
$Term = "FX-UTL"
**/
term = "FX-EXS";
}
}
return term;
}
public void createCenterFXGLEEntryTZBank(GlemodVo glemod,GleVo gle,Integer prn,String centerBranch,String centerInr,String conCur)
{
//取得上下文
// 台州银行分行结售汇后,需要清算到总行的外汇买卖分录
// 判断是否是分行结售汇
if( MdaUtils.compareTo(SettleContext.getUserSession().getBch().getBranch(),centerBranch) == 0 )
{
if(1==1) return;
}
String cDFlag = gle.getDbtcdt();
// 第一条,分行账,借贷方向相反,其他相同
if( MdaUtils.compareTo(cDFlag,"D") == 0 )
{
gle.setDbtcdt( "C");
gle.setPrn( MdaUtils.toString(prn + 2+""));
}
else
{
gle.setDbtcdt( "D");
gle.setPrn( MdaUtils.toString(prn + 1+""));
}
gleStoreEntry( glemod,gle );
// 第二条,总行账,记总行的账号,其他相同
gle.setDbtcdt( cDFlag);
if( MdaUtils.compareTo(cDFlag,"D") == 0 )
{
gle.setPrn( MdaUtils.toString(prn + 1+""));
}
else
{
gle.setPrn( MdaUtils.toString(prn + 2+""));
}
String act = getAvailAcc( gle.getDbtdft(), gle.getCur() + conCur, centerInr, gle.getAmt() );
if( MdaUtils.isEmpty(act) )
{
act = getAvailAcc( gle.getDbtdft(), gle.getCur(), centerInr, gle.getAmt() );
}
gle.setAct( act);
/**
$Pos = Pos( $Act, "A" )
ArgGle\\Act = Mid( $Act, 1, $Pos - 1 ) + CenterBranch + CutComAct( Mid( $Act, $Pos ), "A" )
**/
gleStoreEntry( glemod,gle );
prn= prn+2;
}
} }
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