Commit 5050b135 by jianglong

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

parent 62dfa1dd
......@@ -38,3 +38,4 @@ build/
workroot/log
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
//getFtdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
......@@ -37,7 +50,30 @@ public class FtdCliBanInfo implements CliBanInfo{
//! 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");
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());
......@@ -46,4 +82,5 @@ public class FtdCliBanInfo implements CliBanInfo{
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.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