Commit c1dcf8da by xiaotong

FXTFCM交易代码逻辑迁移

parent 7b54a174
package com.brilliance.isc.funds.fxtfcm.check;
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.FxtfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: FxtfcmValidator
* @description: 结售汇平盘确认 Fxtfcm 校验
* @author: 肖桐
* @create: 2024-10-11 11:28
*/
@Component
public class FxtfcmValidator extends AbstractModuleValidator <FxtfcmStoreBo>{
@Override
@PostConstruct
public void register(){
super.register();;
}
@Override
public Map<String, String> validate(FxtfcmStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
/**
* source:fxtfcm.0023.script
*/
@Validate(path="fxdgrp.apl.pts.ref")
public ValidResult checkFxdgrpAplPtsRefN1000(FxtfcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && ( MdaUtils.compareTo(vo.getMt30m().getS22a(),"AMND") == 0 || MdaUtils.compareTo(vo.getMt30m().getS22a(),"CANC") == 0 ) )
{
if( MdaUtils.isEmpty(vo.getFxdgrp().getApl().getPts().getRef()) )
{
return errorMandatory();
}
}
return null;
}
/**
* source:fxtfcm.0024.script
*/
@Validate(path="mt30m.rbc.pts.extkey")
public ValidResult checkMt30mRbcPtsExtkeyN1000(FxtfcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && MdaUtils.isEmpty(vo.getMt30m().getRbc().getPts().getExtkey()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fxtfcm.0025.script
*/
@Validate(path="mt30m.owc.pts.extkey")
public ValidResult checkMt30mOwcPtsExtkeyN1000(FxtfcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && MdaUtils.isEmpty(vo.getMt30m().getOwc().getPts().getExtkey()) )
{
return errorMandatory();
}
return null;
}
}
package com.brilliance.isc.funds.fxtfcm.document;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
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("fxtfcm.BuildFxt300l1")
public class BuildFxt300l1 {
public Map<String, Object> build(FxtfcmStoreBo 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(FxtfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap<String, Object> map = new HashMap<>();
String title = "";
title = " Formatted outgoing message / mt300 Viewer";
map.put("title", title);
return map;
}
private Map<String, Object> printFooter(FxtfcmStoreBo 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.fxtfcm.document;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
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("fxtfcm.docset")
public class FxtfcmDocset extends AbstractTransactionDocSet<FxtfcmStoreBo> {
@Resource
private BuildFxt300l1 buildFxt300l1;
@PostConstruct
public void buildMember() {
buildLetterProvider("fxtfcm","FXT3001");
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
public Map<String,Object> buildExtraMapForLetter(FxtfcmStoreBo trnbo, DoceotVo doceotVo){
if (MdaUtils.compareTo(doceotVo.getDocnam(),"FXT3001")==0){
return buildFxt300l1.build(trnbo,doceotVo);
} else {
return new HashMap<>();
}
}
}
package com.brilliance.isc.funds.fxtfcm.register.dissav;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FxtfcmDiasavRegister
* @description: 结售汇平盘确认 Fxtfcm 备忘录注册
* @author: Lenovo
* @create: 2024-10-11 17:30
*/
@Component("fxtfcm.diasavRegister")
public class FxtfcmDiasavRegister 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) {
}
}
\ No newline at end of file
package com.brilliance.isc.funds.fxtfcm.register.doc;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.register.document.IDocumentRegister;
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.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FxtfcmDocumentRegister
* @description: 结售汇平盘确认 Fxtfcm 报文注册
* @author: Lenovo
* @create: 2024-10-11 17:47
*/
@Component("fxtfcm.documentRegister")
public class FxtfcmDocumentRegister implements IDocumentRegister {
@Autowired
TrndocService trndocService;
@Resource
PtsptaToolComponent ptsptaToolComponent;
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc){
FxdBizInfoVo rec = (FxdBizInfoVo) trndoc.getRec();
PtsptaVo aplVo = ptsptaToolComponent.getPtsFromListByRol(trndoc.getPtsptas(), "APL");
if (!MdaUtils.isEmpty(rec.getSwtflg())) {
trndocService.defDocEot(trndoc, "TRN", "300", "\\FXT300L1", "LET", 0, aplVo.getPts().getPtainr(), "\\FXDGRP\\REC", "MT 300", "TRO", "");
}
}
}
package com.brilliance.isc.funds.fxtfcm.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: FxtfcmFeeRegister
* @description: 结售汇平盘确认 Fxtfcm 费用注册
* @author: Lenovo
* @create: 2024-10-11 17:36
*/
@Component("fxtfcm.feeRegister")
public class FxtfcmFeeRegister 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.fxtfcm.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: FxtfcmLiaallRegister
* @description: 结售汇平盘确认 Fxtfcm 表外注册
* @author: Lenovo
* @create: 2024-10-11 17:41
*/
@Component("fxtfcm.liaallSetTransaction")
public class FxtfcmLiaallRegister implements ILiaallRegister {
@Autowired
private LiaallRegister liaallRegister;
@Override
public void liaallSetTransaction(LiaallVo liaallVo) {
liaallRegister.liaallSetTransaction(liaallVo);
}
}
package com.brilliance.isc.funds.fxtfcm.register.settle;
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.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
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 java.math.BigDecimal;
@Component("fxtfcm.settleRegister")
public class FxtfcmSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private GlemodService glemodService;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
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, "" );
// }
// 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
// {
// 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" );
}
}
package com.brilliance.isc.funds.fxtfcm.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("fxtfcm"+"."+ IWfeRegister.REGISTER_NAME)
public class FxtfcmWfeRegister implements IWfeRegister {
@Override
public void wfeRegister(TrnmodVo trnmodVo){
}
}
package com.brilliance.isc.funds.fxtfcm.resource;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.isc.funds.transfer.transaction.FxtfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtfcmStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FxtfcmResource
* @description: 结售汇平盘确认 Fxtfcm 请求入口
* @author: xiaotong
* @create: 2024-10-11 17:09
*/
@RestController
@RequestMapping("/fxtfcm")
public class FxtfcmResource extends AbstractTransactionController<FxtfcmStoreVo> {
@Resource
private FxtfcmStructMapper fxtfcmStructMapper;
public IStructMapper getStructMapper() {
return fxtfcmStructMapper;
}
}
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.fxtfcm.service.Impl;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
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.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.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtfcm.check.FxtfcmValidator;
import com.brilliance.isc.funds.fxtfcm.service.FxtfcmService;
import com.brilliance.isc.funds.fxtlop.check.FxtlopValidator;
import com.brilliance.isc.funds.fxtlop.service.FxtlopService;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: FxtfcmTransactionServiceImpl
* @description: 结售汇平盘确认 Fxtfcm 业务处理
* @author: xiaotong
* @create: 2024-10-11 15:20
*/
@Service("fxtfcm.transaction")
public class FxtfcmTransactionServiceImpl extends AbstractTransactionService<FxtfcmStoreBo> {
@Resource
private FxtfcmValidator fxtfcmValidator;
@Autowired
private FxtfcmService fxtfcmService;
@Resource
private FxToolComponent fxToolComponent;
@Resource
private TrnmodService trnmodService;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private CbsmodService cbsmodService;
@Resource
private LiaallService liaallService;
@Resource
private SettleContext settleContext;
@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(FxtfcmStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
@Override
protected Map<String, String> txnCheck(FxtfcmStoreBo transactionVo) {
return fxtfcmValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(FxtfcmStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD");
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FxtfcmStoreBo transactionVo) {
return null;
}
@Override
public FxtfcmStoreBo init(FxtfcmStoreBo fxtfcmStoreBo) {
fxtfcmStoreBo.reset();
fxtfcmService.initFxtfcm(fxtfcmStoreBo);
fxtfcmService.defaultFxtfcm(fxtfcmStoreBo);
return fxtfcmStoreBo;
}
@Override
public void beforeSave(FxtfcmStoreBo transactionVo) {
transactionVo.reset();
Fxdgrp fxdgrp = transactionVo.getFxdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(fxdgrp.getRec());
transactionServiceSet.setBlk(fxdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
fxToolComponent.collectCbsMap(transactionServiceSet, "", fxdgrp.getCbs(), "max", "nom1", "opn1", "opn2");
fxToolComponent.collectPtsList(transactionServiceSet, fxdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FxtfcmStoreBo transactionVo) {
}
public void ruleMtabutSavN500(FxtfcmStoreBo transactionVo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
fxToolComponent.getref(transactionVo.getFxdgrp());
// 1. Create (rsp. update) Contract (incl. Texts)
transactionVo.getFxdgrp().getRec().setCnfdat( Dates.today());
if( MdaUtils.compareTo(transactionVo.getFxdgrp().getCbs().getOpn2().getAmt(),0) == 0 )
{
transactionVo.getFxdgrp().getRec().setClsdat( Dates.today());
}
transactionVo.getFxdgrp().setAcc(transactionVo.getAplacc());
fxToolComponent.sav(transactionVo.getFxdgrp(), BigDecimal.ZERO);
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract ( trnmodVo);
cbsSav(transactionVo,trnmodVo);
// save documents
//记录116台账
//transactionVo.getNosmod().savNostro();
}
public void cbsSav(FxtfcmStoreBo transactionVo, TrnmodVo trnmodVo) {
cbsmodService.cbsTrnSetNew("TRN",trnmodVo.getTrn().getInr());
//#cgl
//平盘登记后产生4条CBB,MAX,NOM,OPN,OPN2
//后续两个交易分别消OPN和OPN2
String trninr = transactionHelpService.getTrninr();
trnmodService.cbsTrnStore("MAXAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000000"),transactionVo.getFxdgrp(),trninr);
trnmodService.cbsTrnStore("NOMAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getNom1().getCur(),transactionVo.getFxdgrp().getCbs().getNom1().getAmt(),MdaUtils.getI18NString("fxtlop","CT000001"),transactionVo.getFxdgrp(),trninr);
/**
if FXDGRP\\REC\\FXTYP.is ( "LB" ) or FXDGRP\\REC\\FXTYP.is ( "LS" ) then
**/
/**
if FXDGRP\\REC\\FXTYP.is ( "LB" ) then
**/
if( MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LB")== 0 || MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LS")== 0 )
{
trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000002"),transactionVo.getFxdgrp(),trninr);
}
liaallService.storeAll(transactionHelpService.getTransactionStoreSet().getLiaall());
//Platform.cbsTrnCommit();
}
}
package com.brilliance.isc.funds.bo.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;
/**
* @program: isc-funds
* @ClassName: FxtfcmStoreBo
* @description: 结售汇平盘确认bo
* @author: xiaotong
* @create: 2024-10-11 11:42
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtfcmStoreBo 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();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
}
fxtp.reset();
}
}
package com.brilliance.isc.funds.transfer.transaction;
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.FxtlopStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
/**
* @program: isc-funds
* @ClassName: FxtfcmStructMapper
* @description:
* @author: xiaotong
* @create: 2024-10-11 17:17
*/
@Mapper(componentModel = "spring")
public interface FxtfcmStructMapper extends IBaseStructMapper<FxtfcmStoreBo, FxtfcmStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FxtfcmStructMapper INSTANCE = Mappers.getMapper(FxtfcmStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FxtfcmStoreBo voTransferToBo(FxtfcmStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FxtfcmStoreVo vo, @MappingTarget FxtfcmStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FxtfcmStoreVo boTransferToVo(FxtfcmStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FxtfcmStoreBo bo, @MappingTarget FxtfcmStoreVo vo);
}
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.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: FxtfcmStoreVo
* @description: 结售汇平盘确认bo
* @author: xiaotong
* @create: 2024-10-11 11:42
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtfcmStoreVo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
//private Fxtmod fxtmod;
private Fxtp fxtp;
@Override
public void reset() {
super.reset();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
}
fxtp.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