Commit a4726e76 by jianglong

新增FXTFCM交易

parent 4b48cf1e
......@@ -2,3 +2,4 @@
funds_fxtssb_000000=Settlement
funds_fxtsss_000000=Settlement
funds_fxtfop_000000=Foreign Exchange Liquidation
\ No newline at end of file
0002=This field is mandatory
funds_fxtssb_000000=Settlement
funds_fxtsss_000000=Settlement
\ No newline at end of file
funds_fxtsss_000000=Settlement
funds_fxtfop_000000=Foreign Exchange Liquidation
......@@ -23,7 +23,9 @@ public class FtdselController {
@RequestMapping("/query")
public ResponseSet list(@RequestBody FtdVo vo) {
return ResponseSet.simpleSuccess(ftdselService.query(vo));
return ResponseSet.simpleSuccess(
ftdselService.query(vo)
);
}
/**
* 处理按钮查看能够进行的交易
......
......@@ -72,8 +72,8 @@ public class FxToolComponent {
fxdgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(fxdgrp.getCbs().getMax(), "CPD", inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(fxdgrp.getCbs().getNom1(), "CPD", inr, "NOMSUM", "AMT1", date);
cbsmodService.cbsGetBalance(fxdgrp.getCbs().getMax(), "FXD", inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(fxdgrp.getCbs().getNom1(), "FXD", inr, "NOMSUM", "AMT1", date);
//获取ptspta信息
storePtsToGrp(fxdgrp, inr, "FXD");
return fxdgrp;
......
package com.brilliance.isc.funds.fxtfcm.check;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.common.transaction.newcheck.ValidResult;
import com.brilliance.isc.common.transaction.newcheck.Validate;
import com.brilliance.isc.common.util.Utils;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
import com.brilliance.isc.funds.vo.funds.FxtfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: FxtfcmValidator
......@@ -73,4 +81,6 @@ public class FxtfcmValidator extends AbstractModuleValidator <FxtfcmStoreBo>{
}
return null;
}
}
package com.brilliance.isc.funds.fxtfcm.register.settle;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.register.settle.DefaultSettleRegister;
import com.brilliance.isc.common.register.settle.ISettleRegister;
import com.brilliance.isc.common.setglg.service.SetglgService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import javax.annotation.Resource;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component("fxtfcm.settleRegister")
public class FxtfcmSettleRegister implements ISettleRegister {
......@@ -26,6 +34,16 @@ public class FxtfcmSettleRegister implements ISettleRegister {
@Autowired
private GlemodService glemodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private FxToolComponent fxToolComponent;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
......@@ -33,69 +51,89 @@ public class FxtfcmSettleRegister implements ISettleRegister {
}
private void transRegister(SetmodVo setmodVo) {
// FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
//
// setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
// setglgService.setglgClrAmount ( setmodVo.getSetglg(),"SET" );
// //!==============================================
// //2、付出外币资金:
// //借:281105外汇买卖对外平盘 (A外币)
// //贷:112306/1125存放境内/外同业 (A外币)
// //!==============================================
// String act1 = null;
// String dbtKey = null;
// String acctyp = null;
// String acc = null;
// String cdtKey = null;
// BigDecimal baseunit = null;
// if( ! MdaUtils.isEmpty(rec.getFxtyp()) )
// {
// //#卖出确认
// //D:281105(A外币)
// act1 = glemodService.getAvailAcc ( "FT-FCR", this.getFxdgrp().getCbs().getNom1().getCur(), "", this, setmodVo.getSetamt() );
// dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "APL", this.getSetmod().getDoccur(), setmodVo.getSetamt(), "SET", "FTD", "F", act1, "SET" );
// /**
// $Act1 = SETMOD\\GLEMOD.GetAvailAcc ( "FX-ELQ", FXDGRP\\CBS\\MAX\\CUR, "", self, SETMOD\\SETAMT )
// $DbtKey = \\SETMOD\\SETGLG.SetglgAddAmount ( "SET", "OWN", SETMOD\\DOCCUR, SETMOD\\SETAMT, "SET", "FXD", "F", $Act1, "SET" )
//
// **/
// // cz modify 增加中间中间账户
// if( this.getFxdgrp().getAct().isRolSet() )
// {
// if( this.getFxdgrp().getAct().isDemestic() )
// {
// acctyp = "DB-CLR";
// acc = this.getSetmod().getGlemod().getAvailAcc ( acctyp, this.getSetmod().getDoccur(), this.getFxdgrp().getAct().getPts().getPtyinr(), this, setmodVo.getSetamt() );
// cdtKey = this.getSetmod().getSetglg().setglgAddAmount ( "SET", "APL", this.getSetmod().getDoccur(), setmodVo.getSetamt().negate(), "", "DBC", "C", acc, "" );
// }
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
Fxdgrp fxdgrp = fxToolComponent.getFxdgrpByInr(rec.getObjinr());
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO;
String nom1Cur = NULLSTR;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
maxCur= setmodVo.getCbsMap().get("MAX").getCur();
}
if (setmodVo.getCbsMap().get("NOM1") != null) {
nom1Amt = setmodVo.getCbsMap().get("NOM1").getAmt();
nom1Cur= setmodVo.getCbsMap().get("NOM1").getCur();
}
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"SET" );
//!==============================================
//2、付出外币资金:
//借:281105外汇买卖对外平盘 (A外币)
//贷:112306/1125存放境内/外同业 (A外币)
//!==============================================
String act1 = null;
String dbtKey = null;
String acctyp = null;
String acc = null;
String cdtKey = null;
BigDecimal baseunit = null;
if( ! MdaUtils.isEmpty(rec.getFxtyp()) )
{
//#卖出确认
//D:281105(A外币)
act1 = glemodService.getAvailAcc ( "FX-SPR", nom1Cur, "", setmodVo.getSetamt() );
dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "APL", nom1Cur, setmodVo.getSetamt(), "SET", "FTD", "F", act1, "SET" );
/**
$Act1 = SETMOD\\GLEMOD.GetAvailAcc ( "FX-ELQ", FXDGRP\\CBS\\MAX\\CUR, "", self, SETMOD\\SETAMT )
$DbtKey = \\SETMOD\\SETGLG.SetglgAddAmount ( "SET", "OWN", SETMOD\\DOCCUR, SETMOD\\SETAMT, "SET", "FXD", "F", $Act1, "SET" )
**/
// cz modify 增加中间中间账户
if( ptsptaToolComponent.ptsIsRolSet(fxdgrp.getAct()) )
{
if( 1==1 )
{
acctyp = "DB-CLR";
acc = glemodService.getAvailAcc ( acctyp,maxCur, fxdgrp.getAct().getPts().getPtyinr(), setmodVo.getSetamt() );
cdtKey =setglgService.setglgAddAmount ( setglg,"SET", "APL", maxCur, setmodVo.getSetamt().negate(), "", "DBC", "C", acc, "" );
}
// else
// {
// acctyp = "DB-FOG";
// acc = this.getSetmod().getGlemod().getAvailAcc ( acctyp, this.getSetmod().getDoccur(), this.getFxdgrp().getAct().getPts().getPtyinr(), this, setmodVo.getSetamt() );
// cdtKey = this.getSetmod().getSetglg().setglgAddAmount ( "SET", "APL", this.getSetmod().getDoccur(), setmodVo.getSetamt().negate(), "", "PAC", "C", acc, "" );
// }
// }
// else
// {
// if( this.getFxdgrp().getApl().isDemestic() )
// {
// acctyp = "DB-CLR";
// acc = this.getSetmod().getGlemod().getAvailAcc ( acctyp, this.getSetmod().getDoccur(), this.getFxdgrp().getApl().getPts().getPtyinr(), this, setmodVo.getSetamt() );
// cdtKey = this.getSetmod().getSetglg().setglgAddAmount ( "SET", "APL", this.getSetmod().getDoccur(), setmodVo.getSetamt().negate(), "", "DBC", "C", acc, "" );
// }
}
else
{
if( 1==1 )
{
acctyp = "DB-CLR";
acc = glemodService.getAvailAcc ( acctyp, maxCur, fxdgrp.getApl().getPts().getPtyinr(), setmodVo.getSetamt() );
cdtKey = setglgService.setglgAddAmount ( setglg,"SET", "APL", maxCur, setmodVo.getSetamt().negate(), "", "DBC", "C", acc, "" );
}
// else
// {
// acctyp = "DB-FOG";
// acc = this.getSetmod().getGlemod().getAvailAcc ( acctyp, this.getSetmod().getDoccur(), this.getFxdgrp().getApl().getPts().getPtyinr(), this, setmodVo.getSetamt() );
// cdtKey = this.getSetmod().getSetglg().setglgAddAmount ( "SET", "APL", this.getSetmod().getDoccur(), setmodVo.getSetamt().negate(), "", "PAC", "C", acc, "" );
// }
// }
// //C:112306/1125外币
// //如果ACT未赋值,则APL为我行的账户行
// setglgService.setglgAddAmtFldAccCur ( setmodVo.getSetglg(),"SET", dbtKey, this.getFxdgrp().getCbs().getNom1().getCur() );
// baseunit = Dynamic.crossRatebas( this.getFxdgrp().getCbs().getMax().getCur(), this.getFxdgrp().getCbs().getNom1().getCur() );
// setglgService.setglgAddAmtFldExtRat ( "SET", dbtKey, Decimals.mul(1.00,baseunit), this.getFxdgrp().getRec().getRat() );
// }
// this.getSetmod().setglgAllValDat ( this.getFxdgrp().getRec().getValdat(), "D" );
}
//C:112306/1125外币
//如果ACT未赋值,则APL为我行的账户行
setglgService.setglgAddAmtFldAccCur ( setmodVo.getSetglg(),"SET", dbtKey, nom1Cur );
baseunit = xrtmodService.crossRatebas( maxCur, nom1Cur );
setglgService.setglgAddAmtFldExtRat ( setmodVo.getSetglg(),"SET", dbtKey, Decimals.mul(1.00,baseunit), fxdgrp.getRec().getRat() );
}
//setglgService.setglgAllValDat ( fxdgrp.getRec().getValdat(), "D" );
}
}
package com.brilliance.isc.funds.fxtfcm.service;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
public interface FxtfcmService {
void initFxtfcm(FxtfcmStoreBo fxtfcmStoreBo);
void defaultFxtfcm (FxtfcmStoreBo fxtfcmStoreBo);
}
package com.brilliance.isc.funds.fxtfcm.service.Impl;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.isc.funds.fxtfcm.service.FxtfcmService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@Service
public class FxtfcmServiceImpl implements FxtfcmService {
private static final Logger logger = LoggerFactory.getLogger(FxtfcmServiceImpl.class);
@Override
public void initFxtfcm(FxtfcmStoreBo fxtfcmStoreBo) {
initFxtfcm950(fxtfcmStoreBo);
initFxtfcm1000(fxtfcmStoreBo);
}
private void initFxtfcm950(FxtfcmStoreBo fxtfcmStoreBo) {
}
private void initFxtfcm1000(FxtfcmStoreBo fxtfcmStoreBo) {
// if( Platform.checkUsrBranch("1") )
// {
// this.getFxtp().setPansta( PanStaShow);
// this.getFxtp().getAplp().setPansta( PanStaShow);
// this.getAplaccp().setPansta( PanStaEdit);
// this.getFxtp().getActp().setPansta( PanStaEdit);
// Systems.resetVisible(this.getFxtp(),"ovwp");
// Systems.setActivePanel(this.getCnfp());
// // FXDGRP\\CBS\\NOM1\\CUR = SYSISO
// Systems.resetEnabled(this.getFxtp(),"amtp");
// Systems.setValues(this.getFxdgrp().getRec(),"fxtyp","FB" + CR + "FS");
// }
// else
// {
// this.getFxtp().setPansta( PanStaShow);
// this.getFxtp().getAplp().setPansta( PanStaShow);
// this.getAplaccp().setPansta( PanStaShow);
// this.getFxtp().getActp().setPansta( PanStaShow);
// Systems.resetVisible(this.getFxtp(),"ovwp");
// Systems.setActivePanel(this.getCnfp());
// Systems.resetEnabled(this,"cnfp");
// // FXDGRP\\CBS\\NOM1\\CUR = SYSISO
// Systems.resetEnabled(this.getFxtp(),"amtp");
// }
}
@Override
public void defaultFxtfcm(FxtfcmStoreBo fxtfcmStoreBo) {
}
}
package com.brilliance.isc.funds.fxtfop.check;
import com.brilliance.isc.bo.Fxd;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.common.transaction.newcheck.ValidResult;
import com.brilliance.isc.common.transaction.newcheck.Validate;
import com.brilliance.isc.funds.bo.funds.FxtfopStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtssbStoreBo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
......@@ -26,5 +31,70 @@ public class FxtfopValidator extends AbstractModuleValidator<FxtfopStoreBo> {
return maps;
}
/**
* source:fxtfop.0011.script
*/
@Validate(path="fxdgrp.rec.opndat")
public ValidResult checkFxdgrpRecOpndatN1000(FxtfopStoreBo bo){
Fxd rec = bo.getFxdgrp().getRec();
if( MdaUtils.isEmpty(rec.getOpndat()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fxtfop.0012.script
*/
@Validate(path="fxdgrp.rec.valdat")
public ValidResult checkFxdgrpRecValdatN1000(FxtfopStoreBo bo){
Fxd rec = bo.getFxdgrp().getRec();
if( MdaUtils.isEmpty(rec.getValdat()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fxtfop.0013.script
*/
@Validate(path="fxdgrp.rec.rat")
public ValidResult checkFxdgrpRecRatN1000(FxtfopStoreBo bo){
Fxd rec = bo.getFxdgrp().getRec();
if( MdaUtils.isEmpty(rec.getRat()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fxtfop.0014.script
*/
@Validate(path="fxdgrp.apl.pts.extkey")
public ValidResult checkFxdgrpAplPtsExtkeyN1000(FxtfopStoreBo bo){
if( MdaUtils.isEmpty(bo.getFxdgrp().getApl().getPts().getExtkey()) )
{
return errorMandatory();
}
return null;
}
}
......@@ -218,11 +218,11 @@ public class FxtfopTransactionServiceImpl extends AbstractTransactionService<Fxt
cbsmodService.cbsTrnSetNew("TRN", trnmodVo.getTrn().getInr());
Fxacbs cbs = transactionVo.getFxdgrp().getCbs();
String trninr = transactionHelpService.getTrninr();
trnmodService.cbsTrnStore("MAXAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), "Foreign Exchange Liquidation", transactionVo.getFxdgrp(), trninr);
trnmodService.cbsTrnStore("NOMAMT", "AMT1", Dates.today(), cbs.getNom1().getCur(), cbs.getNom1().getAmt(), I18nUtil.getMessage("funds_fxtfop_000000"), transactionVo.getFxdgrp(), trninr);
trnmodService.cbsTrnStore("MAXAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), "funds_fxtfop_000000", transactionVo.getFxdgrp().getRec(), trninr);
trnmodService.cbsTrnStore("NOMAMT", "AMT1", Dates.today(), cbs.getNom1().getCur(), cbs.getNom1().getAmt(), I18nUtil.getMessage("funds_fxtfop_000000"), transactionVo.getFxdgrp().getRec(), trninr);
if ("FS".equals(transactionVo.getFxdgrp().getRec().getFxtyp()) ||"FB".equals(transactionVo.getFxdgrp().getRec().getFxtyp())){
trnmodService.cbsTrnStore("OPNAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtfop_000000"), transactionVo.getFxdgrp(), trninr);
trnmodService.cbsTrnStore("OPNAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtfop_000000"), transactionVo.getFxdgrp().getRec(), trninr);
}
}
......
......@@ -2,7 +2,9 @@ package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.bo.model.Fxtp;
import com.brilliance.isc.bo.model.Mt30m;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......@@ -16,12 +18,25 @@ import lombok.Data;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtfcmStoreVo extends BaseTransactionVo {
//APLACC's Account
private String acc2= null;
//OWNACC's Account
private String acc1= null;
//发送MT300
private String swtflg= null;
//XMLPanel fxt300l1的内置block
private String fxt300l1blk= null;
private Fxdgrp fxdgrp;
//private Fxtmod fxtmod;
private Fxtp fxtp;
private Mt30m mt30m;
private PtsptaVo aplacc;
@Override
public void reset() {
super.reset();
......
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