Commit 5050b135 by jianglong

新增fttfcm交易代码,修改ftTool类

parent 62dfa1dd
......@@ -37,4 +37,5 @@ build/
workroot/log
workroot/DUMP
\ No newline at end of file
workroot/DUMP
logs/*
package com.brilliance.isc.funds.common.component;
import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.vo.model.CbbVo;
import com.brilliance.isc.bo.Cnd;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Ftt;
import com.brilliance.isc.vo.model.FtdVo;
import com.brilliance.isc.vo.model.FttVo;
import com.brilliance.isc.bo.model.*;
import com.brilliance.isc.vo.model.*;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.exception.CommonServiceException;
......
package com.brilliance.isc.funds.common.register.cci;
import com.brilliance.isc.bo.Cci;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Pts;
import com.brilliance.isc.common.register.cci.CliBanInfo;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.FtdMapper;
import com.brilliance.isc.mda.dao.PtsMapper;
import com.brilliance.mda.runtime.mda.impl.Argument;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
@Component("FTD.cciRegister")
public class FtdCliBanInfo implements CliBanInfo{
public class FtdCliBanInfo implements CliBanInfo {
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private PtsMapper ptsMapper;
@Resource
private FtdMapper ftdMapper;
/**
* source:ftdlod.0006.script
*/
@Override
public void buildValue(String objinr, String objtyp, List<PtsptaVo> ptsptaVos, Cci cci) {
//getFxdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
for (PtsptaVo ptsptaVo : ptsptaVos) {
ptsList.add(ptsptaVo.getPts());
}
}
if (CollectionUtils.isEmpty(ptsList)) {
return;
}
//! Defines role of the bank and the customer of the passed contract and PTAINR of the role as well
//! The passed contract has to be loaded completely
// role can be set dynamically dependent on the contract context
cci.setCcicusrol("APL");
Optional<Pts> optionalPts = ptsList.stream().filter(pts -> cci.getCcicusrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts.isPresent()) {
cci.setCcicusptainr(optionalPts.get().getPtainr());
}
cci.setCcibanptainr("");
cci.setCcibanrol("");
//getFtdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
for (PtsptaVo ptsptaVo : ptsptaVos) {
ptsList.add(ptsptaVo.getPts());
}
}
if (CollectionUtils.isEmpty(ptsList)) {
return;
}
//! Defines role of the bank and the customer of the passed contract and PTAINR of the role as well
//! The passed contract has to be loaded completely
// role can be set dynamically dependent on the contract context
Ftd ftd=ftdMapper.selectByInr(objinr);
switch(ftd.getFttyp() )
{
case "LI":
case "DI":
cci.setCcicusrol("TRO");
break;
case "LO":
case "DO":
cci.setCcicusrol("TRi");
break;
case "PT":
cci.setCcicusrol("TRO");
break;
default:
}
Optional<Pts> optionalPts = ptsList.stream().filter(pts -> cci.getCcicusrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts.isPresent()) {
cci.setCcicusptainr(optionalPts.get().getPtainr());
}
cci.setCcibanptainr("");
cci.setCcibanrol("");
}
}
package com.brilliance.isc.funds.fttfcm.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.FttfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.Dates;
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.*;
/**
* @program: isc-funds
* @ClassName: FttfcmValidator
* @description: 结售汇平盘确认 Fttfcm 校验
* @author: 肖桐
* @create: 2024-10-11 11:28
*/
@Component
public class FttfcmValidator extends AbstractModuleValidator <FttfcmStoreBo>{
@Override
@PostConstruct
public void register(){
super.register();;
}
@Override
public Map<String, String> validate(FttfcmStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
/**
* source:fttfcm.0018.script
*/
@Validate(path="fttp.mt32m.s30x")
public ValidResult checkFttpMt32mS30xN1000(FttfcmStoreBo bo){
if( ( MdaUtils.compareTo(bo.getFttp().getMt32m().getS22b(),"CONF") == 0 || MdaUtils.compareTo(bo.getFttp().getMt32m().getS22b(),"ROLL") == 0 ) && MdaUtils.isEmpty(bo.getFttp().getMt32m().getS30x()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0022.script
*/
@Validate(path="ftdgrp.cbs.ins.amt")
public ValidResult checkFtdgrpCbsInsAmtN1000(FttfcmStoreBo bo){
if( MdaUtils.compareTo(bo.getFttp().getPansta(),PanStaAdd) == 0 || MdaUtils.compareTo(bo.getFttp().getPansta(),PanStaEdit) == 0 )
{
if( MdaUtils.isEmpty(bo.getFtdgrp().getCbs().getIns().getAmt()) )
{
return errorMandatory();
}
}
return null;
}
/**
* source:fttfcm.0023.script
*/
@Validate(path="ftdgrp.rec.cntfra")
public ValidResult checkFtdgrpRecCntfraN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getCntfra()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0024.script
*/
@Validate(path="ftdgrp.rec.matdat")
public ValidResult checkFtdgrpRecMatdatN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getMatdat()) )
{
return errorMandatory();
}
else
{
if( ! MdaUtils.isEmpty(bo.getFtdgrp().getRec().getValdat()) && Dates.diff(bo.getFtdgrp().getRec().getValdat(),bo.getFtdgrp().getRec().getMatdat())>0 )
{
return ValidResult.build(false, MdaUtils.getI18NString("fttfcm","CT000008"));
}
}
return null;
}
/**
* source:fttfcm.0025.script
*/
@Validate(path="ftdgrp.rec.rat")
public ValidResult checkFtdgrpRecRatN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getRat()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0038.script
*/
@Validate(path="ftdgrp.rec.bnktyp")
public ValidResult checkFtdgrpRecBnktypN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getBnktyp()) )
{
return errorMandatory();
}
return null;
}
}
package com.brilliance.isc.funds.fttfcm.document;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.Formats;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Service("fttfcm.BuildFtt320l1")
public class BuildFtt320l1 {
public Map<String, Object> build(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap map = new HashMap();
map.putAll(printHeader(trnBo, doceotVo));
//map.putAll(printBody(trnBo, doceotVo));
map.putAll(printFooter(trnBo, doceotVo));
return map;
}
private Map<String, Object> printHeader(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap<String, Object> map = new HashMap<>();
String title = "";
title = " Formatted outgoing message / mt320 Viewer";
map.put("title", title);
return map;
}
private Map<String, Object> printFooter(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap<String, Object> map = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String format = sdf.format(new Date());
String footer = Strings.getText("Diary printed by $1 on $2 at $3 during the change",
SettleContext.getUserSession().getUsr().getExtkey(), Formats.fmtDateLong(Dates.today()), format);
map.put("footer", footer);
return map;
}
}
package com.brilliance.isc.funds.fttfcm.document;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Component("fttfcm.docset")
public class FttfcmDocset extends AbstractTransactionDocSet<FttfcmStoreBo> {
@Resource
private BuildFtt320l1 buildFtt320l1;
@PostConstruct
public void buildMember() {
buildLetterProvider("fttfcm","FTT3001");
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
public Map<String,Object> buildExtraMapForLetter(FttfcmStoreBo trnbo, DoceotVo doceotVo){
if (MdaUtils.compareTo(doceotVo.getDocnam(),"FTT3001")==0){
return buildFtt320l1.build(trnbo,doceotVo);
} else {
return new HashMap<>();
}
}
}
package com.brilliance.isc.funds.fttfcm.register.dissav;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.common.register.diasav.IDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.DftcreDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavZZZRegister;
import com.brilliance.isc.common.register.diasav.common.TrtcreDiasavRegister;
import com.brilliance.isc.common.trndia.service.TrndiaService;
import com.brilliance.isc.common.trndia.vo.TrndiaVo;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
* @program: isc-funds
* @ClassName: FttfcmDiasavRegister
* @description: 结售汇平盘确认 Fttfcm 备忘录注册
* @author: Lenovo
* @create: 2024-10-11 17:30
*/
@Component("fttfcm.diasavRegister")
public class FttfcmDiasavRegister implements IDiasavRegister {
@Autowired
private TrndiaService trndiaService;
@Autowired
private LiaallDiasavRegister liaallDiasavRegister;
@Autowired
private LiaallDiasavZZZRegister liaallDiasavZZZRegister;
@Autowired
private TrtcreDiasavRegister trtcreDiasavRegister;
@Autowired
private DftcreDiasavRegister dftcreDiasavRegister;
@Override
public void diasav(TrndiaVo trndia) {
trnDiasav(trndia);
liaallDiasavRegister.diasav(trndia);
liaallDiasavZZZRegister.diasav(trndia);
trtcreDiasavRegister.diasav(trndia);
dftcreDiasavRegister.diasav(trndia);
}
private void trnDiasav(TrndiaVo trndiaVo) {
FtdBizInfoVo ftdBizInfoVo=(FtdBizInfoVo)trndiaVo.getRec();
//取得上下文
Date date = null;
if (!MdaUtils.isEmpty(ftdBizInfoVo.getMatdat())) {
date = NULLDATE;
if (Dates.diff(ftdBizInfoVo.getMatdat(), Dates.today()) < 3) {
date = Dates.today();
} else {
date = Dates.add(ftdBizInfoVo.getMatdat(), -3);
}
trndiaService.trnDiaSet(trndiaVo, "FTDMAT", date, "EXP", Strings.getText("资金拆借到期提示:", ftdBizInfoVo.getOwnref()), "FTTFMT", DiaToReplace);
}
}
}
\ No newline at end of file
package com.brilliance.isc.funds.fttfcm.register.doc;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.register.document.common.SetmodDocumentRegister;
import com.brilliance.isc.common.trndoc.service.TrndocService;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.fttfcm.service.FttfcmTransactionServiceImpl;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Systems;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
/**
* @program: isc-funds
* @ClassName: FttfcmDocumentRegister
* @description: 结售汇平盘确认 Fttfcm 报文注册
* @author: Lenovo
* @create: 2024-10-11 17:47
*/
@Component("fttfcm.documentRegister")
public class FttfcmDocumentRegister implements IDocumentRegister {
@Autowired
TrndocService trndocService;
@Resource
PtsptaToolComponent ptsptaToolComponent;
@Autowired
private SetmodDocumentRegister setmodDocumentRegister;
@Resource
FtToolComponent ftToolComponent;
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
setmodDocumentRegister.registerDocument(trndoc);
//entmodDocumentRegister.registerDocument(trndoc);
}
public void doRegister(TrndocVo trndoc){
FtdBizInfoVo rec = (FtdBizInfoVo) trndoc.getRec();
PtsptaVo troPtspta = ptsptaToolComponent.getPtsFromListByRol(trndoc.getPtsptas(), "TRO");
PtsptaVo triPtspta = ptsptaToolComponent.getPtsFromListByRol(trndoc.getPtsptas(), "TRI");
if( 1==1 )
{
if( ptsptaToolComponent.ptsIsRolSet(troPtspta ))
{
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRO", "" );
break;
case "199":
trndocService.defDocEot ( trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRO", "" );
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRO", "" );
break;
}
}
if( ptsptaToolComponent.ptsIsRolSet(triPtspta) )
{
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRI", "" );
break;
case "199":
trndocService.defDocEot (trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRI", "" );
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRI", "" );
break;
}
}
}
}
}
package com.brilliance.isc.funds.fttfcm.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.DocumentFeeRegister;
import com.brilliance.isc.common.register.fee.common.LiaallFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setfeg.service.SetfegService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FttfcmFeeRegister
* @description: 结售汇平盘确认 Fttfcm 费用注册
* @author: Lenovo
* @create: 2024-10-11 17:36
*/
@Component("fttfcm.feeRegister")
public class FttfcmFeeRegister extends AbstractFeeRegister {
@Autowired
private SetfegService setfegService;
@Autowired
private DocumentFeeRegister documentFeeRegister;
@Autowired
private LiaallFeeRegister liaallFeeRegister;
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
setmodFeeRegister.registerSettlement(setmodVo);
documentFeeRegister.registerSettlement(setmodVo);
liaallFeeRegister.registerSettlement(setmodVo);
}
}
package com.brilliance.isc.funds.fttfcm.register.liaall;
import com.brilliance.isc.common.liaall.vo.LiaallVo;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.liaall.ILiaallRegister;
import com.brilliance.isc.common.register.liaall.common.LiaallRegister;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FttfcmLiaallRegister
* @description: 结售汇平盘确认 Fttfcm 表外注册
* @author: Lenovo
* @create: 2024-10-11 17:41
*/
@Component("fttfcm.liaallSetTransaction")
public class FttfcmLiaallRegister implements ILiaallRegister {
@Autowired
private LiaallRegister liaallRegister;
@Override
public void liaallSetTransaction(LiaallVo liaallVo) {
liaallRegister.liaallSetTransaction(liaallVo);
}
}
package com.brilliance.isc.funds.fttfcm.register.settle;
import com.brilliance.isc.bo.model.Ftdgrp;
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.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.mda.runtime.mda.util.Formats;
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.*;
import static com.brilliance.mda.runtime.mda.Constants.CR;
@Component("fttfcm.settleRegister")
public class FttfcmSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private GlemodService glemodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
FtdBizInfoVo rec = (FtdBizInfoVo) setmodVo.getRec();
//Ftdgrp ftdgrp = ftToolComponent.getFtdgrpByInr(rec.getObjinr());
PtsptaVo tri = ptsptaToolComponent.getPtsFromListByRol(setmodVo.getPtsList(), "TRI");
PtsptaVo tro = ptsptaToolComponent.getPtsFromListByRol(setmodVo.getPtsList(), "TRO");
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO;
String opn1Cur=NULLSTR;
BigDecimal opn1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
maxCur= setmodVo.getCbsMap().get("MAX").getCur();
}
if (setmodVo.getCbsMap().get("OPN1") != null) {
opn1Amt= setmodVo.getCbsMap().get("OPN1").getAmt();
opn1Cur= setmodVo.getCbsMap().get("OPN1").getCur();
}
setmodVo.setDoccur(maxCur);
setmodVo.setDocamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
String acctyp = NULLSTR;
String acc = NULLSTR;
String cdtKey = NULLSTR;
String dbtKey = NULLSTR;
switch( rec.getFttyp() )
{
// 资金拆出
case "LO":
acctyp = "";
acc = "";
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "FL-FOG";
}
else
{
acctyp = "FL-DO" + rec.getBnktyp();
}
//贷记
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI", setmodVo.getDoccur(), maxAmt.negate(), "", "PAC", "C", "", "" );
acc = glemodService.getAvailAcc ( acctyp,setmodVo.getDoccur(), tri.getPts().getPtyinr(), maxAmt );
dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI",setmodVo.getDoccur(),maxAmt, "", "FLD", "C", acc, "" );
setmodVo.setFeeclirol( "TRI" );
// 定存存出
break;
case "DO":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRI.IsDemestic then
$acctyp = "DB-CLR"
else
$acctyp = "DB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "DB-FOG";
}
else
{
acctyp = "DB-CLR";
}
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI",setmodVo.getDoccur(),maxAmt.negate(), "", "PAC", "C", "", "" );
acc =glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(),tri.getPts().getPtyinr(), maxAmt );
/**
$DbtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRI", SETMOD\\DOCCUR, FTDGRP\\CBS\\MAX\\AMT, "", "DBD", "A", $acc, "" )
**/
dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI", setmodVo.getDoccur(),maxAmt, "", "DBD", "C", acc, "" );
setmodVo.setFeeclirol ( "TRI" );
// 资金拆入
break;
case "LI":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRO.IsDemestic then
$acctyp = "FB-DOM"
else
$acctyp = "FB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "FB-FOG";
}
else
{
acctyp = "FB-DO" + rec.getBnktyp();
}
acc = glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(),tro.getPts().getPtyinr(), maxAmt.negate() );
//贷记
/**
$CdtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRO", SETMOD\\DOCCUR, -FTDGRP\\CBS\\MAX\\AMT, "", "FBC", "A", $acc, "" )
**/
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO", setmodVo.getDoccur(),maxAmt.negate(), "", "FBC", "C", acc, "" );
//借记
dbtKey =setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO",setmodVo.getDoccur(), maxAmt, "", "FTD", "C", "", "" );
setmodVo.setFeeclirol ( "TRO" );
// 定存吸存
break;
case "DI":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRO.IsDemestic then
$acctyp = "DB-CLR"
else
$acctyp = "DB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "VO-FOG";
}
else
{
acctyp = "VO-BO" + rec.getBnktyp();
}
acc = glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(), tro.getPts().getPtyinr(), maxAmt.negate() );
/**
$CdtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRO", SETMOD\\DOCCUR, -FTDGRP\\CBS\\MAX\\AMT, "", "VOC", "A", $acc, "" )
**/
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO",setmodVo.getDoccur(), maxAmt.negate(), "", "VOC", "C", acc, "" );
dbtKey =setglgService.setglgAddAmount (setmodVo.getSetglg(), "TRN", "TRO",setmodVo.getDoccur(), maxAmt, "", "FTD", "C", "", "" );
setmodVo.setFeeclirol ( "TRO" );
break;
}
setmodService.setglgAllValDat ( setmodVo, rec.getValdat(), "D" );
}
}
package com.brilliance.isc.funds.fttfcm.register.wfe;
import com.brilliance.isc.common.trnism.service.IWfeRegister;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.common.wfmmod.service.WfmmodService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component("fttfcm"+"."+ IWfeRegister.REGISTER_NAME)
public class FttfcmWfeRegister implements IWfeRegister {
@Override
public void wfeRegister(TrnmodVo trnmodVo){
}
}
package com.brilliance.isc.funds.fttfcm.resource;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.fttfcm.service.FttfcmTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FttfcmResource
* @description: 结售汇平盘确认 Fttfcm 请求入口
* @author: xiaotong
* @create: 2024-10-11 17:09
*/
@RestController
@RequestMapping("/fttfcm")
public class FttfcmResource extends AbstractTransactionController<FttfcmStoreVo> {
@Resource
private FttfcmStructMapper fttfcmStructMapper;
public IStructMapper getStructMapper() {
return fttfcmStructMapper;
}
@Resource
FttfcmTransactionServiceImpl fttfcmTransactionService;
/**
* 根据结售汇类型 等获取业务参号
*
* @param FttfcmStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FttfcmStoreVo fttfcmStoreVo) {
String ref = fttfcmTransactionService.getRef(fttfcmStoreVo);
return ResponseSet.simpleSuccess(ref);
}
}
package com.brilliance.isc.funds.fttfcm.service;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.isc.vo.model.FtdVo;
import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.liaall.service.LiaallService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.common.transaction.AbstractTransactionService;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.transaction.help.TransactionServiceSet;
import com.brilliance.isc.common.trnmod.service.TrnmodService;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.fttfcm.check.FttfcmValidator;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brilliance.isc.mda.dao.ActMapper;
import com.brilliance.isc.common.component.SptDataComponent;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static com.brilliance.mda.runtime.mda.Constants.*;
import static com.brilliance.mda.runtime.mda.Constants.CR;
/**
* @program: isc-funds
* @ClassName: FttfcmTransactionServiceImpl
* @description: 结售汇平盘确认 Fttfcm 业务处理
* @author: xiaotong
* @create: 2024-10-11 15:20
*/
@Service("fttfcm.transaction")
public class FttfcmTransactionServiceImpl extends AbstractTransactionService<FttfcmStoreBo> {
@Resource
private FttfcmValidator fttfcmValidator;
// @Autowired
// private FttfcmService fttfcmService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private TrnmodService trnmodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private CbsmodService cbsmodService;
@Resource
private LiaallService liaallService;
@Resource
private SettleContext settleContext;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private SysmodService sysmodService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private ActMapper actMapper;
@Resource
private SetmodService setmodService;
@Autowired
private FttfcmStructMapper fttfcmStructMapper;
@Autowired
SptDataComponent sptDataComponent;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDOC_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.UMDMOD_SERVICE, "N");
// serviceRegisterMaps.put(CommonContants.LIMMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_RMB_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_SZSB_BOPREM_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_CFABOP_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.FANXIQIAN_SERVICE, "Y");
}
@Override
protected void txnSave(FttfcmStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
@Override
protected Map<String, String> txnCheck(FttfcmStoreBo transactionVo) {
return fttfcmValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(FttfcmStoreBo transactionVo) {
FtdBizInfoVo bizInfoVo = new FtdBizInfoVo();
bizInfoVo.setObjtyp("FTD");
Ftd rec = transactionVo.getFtdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFttyp(rec.getFttyp());
bizInfoVo.setRat(rec.getRat());
bizInfoVo.setValdat(rec.getValdat());
bizInfoVo.setBnktyp(rec.getBnktyp());
bizInfoVo.setMsgtyp(transactionVo.getFttp().getMsgtyp());
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FttfcmStoreBo transactionVo) {
return null;
}
@Override
public FttfcmStoreBo init(FttfcmStoreBo fttfcmStoreBo) {
fttfcmStoreBo.reset();
init950(fttfcmStoreBo);
init1000(fttfcmStoreBo);
initFtdgrpRecOpndatN1000(fttfcmStoreBo);
return fttfcmStoreBo;
}
private void init950(FttfcmStoreBo fttfcmStoreBo) {
}
private void init1000(FttfcmStoreBo bo) {
if( ! sysmodService.sptIsAnyLoaded(bo.getSpt().getSta()) )
{
bo.getFttp().setMsgtyp( "320");
}
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
bo.getFtdgrp().getRec().setOwnusr(extkey);
bo.getFtdgrp().getRec().setUsr(extkey);
bo.getFtdgrp().getRec().setBnktyp("9");
bo.getFttp().setBnaktypflg("X");
}
@Override
public void beforeSave(FttfcmStoreBo transactionVo) {
transactionVo.reset();
Ftdgrp ftdgrp = transactionVo.getFtdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(ftdgrp.getRec());
transactionServiceSet.setBlk(ftdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
ftToolComponent.collectCbsMap(transactionServiceSet, "", ftdgrp.getCbs(), "max", "ins", "opn1", "opn2");
ftToolComponent.collectPtsList(transactionServiceSet, ftdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FttfcmStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFtdgrp().getRec().getInr());
}
public void ruleMtabutSavN500(FttfcmStoreBo bo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
ftToolComponent.getref(bo.getFtdgrp());
// 1. Create (rsp. update) Contract (incl. Texts)
bo.getFtdgrp().getRec().setCnfdat( Dates.today());
ftToolComponent.sav(bo.getFtdgrp());
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract ( trnmodVo);
cbsSav(bo,trnmodVo);
// save documents
//TODO
//记录116台账
//transactionVo.getNosmod().savNostro();
}
public String getRef(FttfcmStoreVo fttfcmStorevo) {
FttfcmStoreBo fttfcmStoreBo= fttfcmStructMapper.voTransferToBo(fttfcmStorevo);
return getRef(fttfcmStoreBo);
}
public String getRef(FttfcmStoreBo fttfcmStoreBo) {
fttfcmStoreBo.reset();
PtsptaVo ptsptaVo = fttfcmStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}else{
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
SettleContext.getUserSession().setWrkbch(wrkbch);
}
Ftdgrp ftdgrp = fttfcmStoreBo.getFtdgrp();
ftToolComponent.getref(ftdgrp);
return ftdgrp.getRec().getOwnref();
}
public void cbsSav(FttfcmStoreBo transactionVo, TrnmodVo trnmodVo) {
String trninr = transactionHelpService.getTrninr();
cbsmodService.cbsTrnSetNew("TRN",trnmodVo.getTrn().getInr());
trnmodService.cbsTrnStore("MAXAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getMax().getCur(),transactionVo.getFtdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fttfcm","CT000003"),transactionVo.getFtdgrp().getRec(),trninr);
trnmodService.cbsTrnStore("INSAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getIns().getCur(),transactionVo.getFtdgrp().getCbs().getIns().getAmt(),MdaUtils.getI18NString("fttfcm","CT000009"),transactionVo.getFtdgrp().getRec(),trninr);
if( MdaUtils.compareTo(transactionVo.getFtdgrp().getRec().getFttyp(),"LI") == 0 || MdaUtils.compareTo(transactionVo.getFtdgrp().getRec().getFttyp(),"DI") == 0 )
{
trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getMax().getCur(),transactionVo.getFtdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fttfcm","CT000010"),transactionVo.getFtdgrp().getRec(),trninr);
}
cbsmodService.cbsTrnCommit();
}
//Event fttp.msgtyp
public boolean ruleFttpMsgtypN1000(FttfcmStoreBo vo){
vo.reset();
SetglgVo setglgVo=vo.getSetglg();
for(int i = 1;i <= setglgVo.getSetgll().size();i++)
{
setglgVo.getSetgll().get(i).setMacold(NULLSTR);
}
return true;
}
/**
* source:fttfcm.0031.script
*/
@JsonIgnore
public void setMTn99(FttfcmStoreBo fttfcmStoreBo)
{
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
String blk = "ATTN:NANFANG SUB-BRANCH";
blk = blk + CR + "PLS DEBIT OUR A/C NO. " + fttp.getTriact() + " WITH " + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur()) + " FOR FIXED DEPOSIT DEAL, DETAILS BELOW:";
blk = blk + CR + "VALUE DATE: " + Formats.format(ftdgrp.getRec().getValdat(),"YYYYMMDD");
blk = blk + CR + "MATURITY DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND AMOUNT: " + ftdgrp.getCbs().getMax().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur());
blk = blk + CR + "INTEREST DUE DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND INTEREST AMT: " + ftdgrp.getCbs().getIns().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getIns().getAmt(),ftdgrp.getCbs().getIns().getCur());
blk = blk + CR + "INTEREST RATE: " + MdaUtils.toString(ftdgrp.getRec().getRat());
blk = blk + CR + "DATCOUNT FRACTION: " + ftdgrp.getRec().getCntfra();
blk = blk + CR + "PLS EFFECT OVER OUR ACCOUNT.";
blk = blk + CR + ".";
blk = blk + CR + "BEST REGARD";
blk = blk + CR + "IBD";
fttfcmStoreBo.setNarblk( blk);
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DO") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LO") == 0 )
{
fttfcmStoreBo.setRelref( ftdgrp.getTri().getPts().getRef());
}
else
{
fttfcmStoreBo.setRelref( ftdgrp.getTro().getPts().getRef());
}
}
public boolean defaultSwtn99N1000(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
String blk = NULLSTR;
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("narblk"))
{
blk = "ATTN:NANFANG SUB-BRANCH";
blk = blk + CR + "PLS DEBIT OUR A/C NO. " + fttp.getTriact() + " WITH " + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur()) + " FOR FIXED DEPOSIT DEAL, DETAILS BELOW:";
blk = blk + CR + "VALUE DATE: " + Formats.format(ftdgrp.getRec().getValdat(),"YYYYMMDD");
blk = blk + CR + "MATURITY DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND AMOUNT: " + ftdgrp.getCbs().getMax().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur());
blk = blk + CR + "INTEREST DUE DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND INTEREST AMT: " + ftdgrp.getCbs().getIns().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getIns().getAmt(),ftdgrp.getCbs().getIns().getCur());
blk = blk + CR + "INTEREST RATE: " + MdaUtils.toString(ftdgrp.getRec().getRat());
blk = blk + CR + "DATCOUNT FRACTION: " + ftdgrp.getRec().getCntfra();
blk = blk + CR + "PLS EFFECT OVER OUR ACCOUNT.";
blk = blk + CR + ".";
blk = blk + CR + "BEST REGARD";
blk = blk + CR + "IBD";
fttfcmStoreBo.setNarblk( blk);
}
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("relref"))
{
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DO") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LO") == 0 )
{
fttfcmStoreBo.setRelref( ftdgrp.getTri().getPts().getRef());
}
else
{
fttfcmStoreBo.setRelref( ftdgrp.getTro().getPts().getRef());
}
}
return true;
}
/**
* source:fttfcm.0035.script
*/
//@Default(target="fttp.triact",order=1200)
public List<String> defaultFttpTriactN1200(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
/**
if not IsEmpty( FTDGRP\\CBS\\MAX\\CUR ) and not IsEmpty( FTDGRP\\ACT\\PTS\\PTYINR ) and ( FTDGRP\\REC\\FTTYP == "DO" or FTDGRP\\REC\\FTTYP == "LO" ) then
**/
List<String> actLst=new ArrayList<>();
if( ! MdaUtils.isEmpty(ftdgrp.getCbs().getMax().getCur()) && ! MdaUtils.isEmpty(ftdgrp.getAct().getPts().getPtyinr()) )
{
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getTri().getPtyinr() + "' AND TYP = 'DB'";
List<String > actList = actMapper.getSerAccByConditionSql(sql);
if( ! fttp.isModified("triact") && actLst.size()>0) {
fttp.setTriact( actLst.get(1));
}
}
else{
fttp.setTriact(NULLSTR);
}
return actLst;
}
public List<String> defaultFttpTroactN1200(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
/**
if not IsEmpty( FTDGRP\\CBS\\MAX\\CUR ) and not IsEmpty( FTDGRP\\ACT\\PTS\\PTYINR ) and ( FTDGRP\\REC\\FTTYP == "DO" or FTDGRP\\REC\\FTTYP == "LO" ) then
**/
List<String> actLst=new ArrayList<>();
if( ! MdaUtils.isEmpty(ftdgrp.getCbs().getMax().getCur()) && ! MdaUtils.isEmpty(ftdgrp.getAct().getPts().getPtyinr()) )
{
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getTro().getPtyinr() + "' AND TYP = 'DB'";
List<String > actList = actMapper.getSerAccByConditionSql(sql);
if( ! fttp.isModified("troact") && actLst.size()>0) {
fttp.setTroact( actLst.get(1));
}
}
else{
fttp.setTroact(NULLSTR);
}
return actLst;
}
/**
* source:fttfcm.0003.script
*/
//@Default(target="ftdgrp.rec.opndat",order=1000)
public boolean initFtdgrpRecOpndatN1000(FttfcmStoreBo fttfcmStoreBo){
if( MdaUtils.isEmpty(fttfcmStoreBo.getFtdgrp().getRec().getOpndat()) )
{
fttfcmStoreBo.getFtdgrp().getRec().setOpndat( Dates.today());
}
if( MdaUtils.isEmpty(fttfcmStoreBo.getFtdgrp().getRec().getValdat()) )
{
fttfcmStoreBo.getFtdgrp().getRec().setValdat( Dates.today());
}
return true;
}
/**
* source:fttfcm.0019.script
*/
//@Default(target="ftdgrp.cbs.ins.amt",order=1000)
public boolean defaultFtdgrpCbsInsAmtN1000(FttfcmStoreBo fttfcmStoreBo){
switch( fttfcmStoreBo.getFtdgrp().getRec().getCntfra() )
{
case "ACT/365":
case "AFI/365":
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( xrtmodService.amtRnd( Decimals.div(Decimals.mul(Decimals.div(Decimals.mul(fttfcmStoreBo.getFtdgrp().getCbs().getMax().getAmt(),fttfcmStoreBo.getFtdgrp().getRec().getRat()),100),Dates.diff(fttfcmStoreBo.getFtdgrp().getRec().getMatdat(),fttfcmStoreBo.getFtdgrp().getRec().getValdat())),365), fttfcmStoreBo.getFtdgrp().getCbs().getIns().getCur() ));
break;
case "ACT/360":
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( xrtmodService.amtRnd( Decimals.div(Decimals.mul(Decimals.div(Decimals.mul(fttfcmStoreBo.getFtdgrp().getCbs().getMax().getAmt(),fttfcmStoreBo.getFtdgrp().getRec().getRat()),100),Dates.diff(fttfcmStoreBo.getFtdgrp().getRec().getMatdat(),fttfcmStoreBo.getFtdgrp().getRec().getValdat())),360), fttfcmStoreBo.getFtdgrp().getCbs().getIns().getCur() ));
break;
default:
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( new BigDecimal("0"));
}
return true;
}
/**
* source:fttfcm.0020.script
*/
//@Default(target="ftdgrp.cbs.ins.cur",order=1000)
public boolean defaultFtdgrpCbsInsCurN1000(FttfcmStoreBo fttfcmStoreBo){
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setCur( fttfcmStoreBo.getFtdgrp().getCbs().getMax().getCur());
return true;
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcmStoreBo extends BaseTransactionVo {
String narblk=NULLSTR;
String relref=NULLSTR;
private Ftdgrp ftdgrp;
private Fttp fttp;
@Override
public void reset(){
super.reset();
if (ftdgrp == null){
ftdgrp = new Ftdgrp();
}
ftdgrp.reset();
if (fttp == null){
fttp = new Fttp();
}
fttp.reset();
}
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring")
public interface FttfcmStructMapper extends IBaseStructMapper<FttfcmStoreBo, FttfcmStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FxtfcmStructMapper INSTANCE = Mappers.getMapper(FxtfcmStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FttfcmStoreBo voTransferToBo(FttfcmStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FttfcmStoreVo vo, @MappingTarget FttfcmStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FttfcmStoreVo boTransferToVo(FttfcmStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FttfcmStoreBo bo, @MappingTarget FttfcmStoreVo vo);
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcmStoreVo extends BaseTransactionVo {
String narblk=NULLSTR;
String relref=NULLSTR;
private FtdgrpVo ftdgrp;
private FttpVo fttp;
@Override
public void reset() {
super.reset();
if (ftdgrp == null) {
ftdgrp = new FtdgrpVo();
}
ftdgrp.reset();
if (fttp == null) {
fttp = new FttpVo();
}
fttp.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