Commit bf59b139 by huangshunlin

汇入/汇出清算 即期结售汇报价

parent 2e3f178e
0002=This field is mandatory
funds_fxtssb_000000=Settlement
funds_fxtsss_000000=Settlement
funds_fxtsqo_000000=Settlement
funds_fxtsqo_000001=远期结售汇交割提示:{0}
funds_fxtsqo_000002=The clearing amount has to be positive.
funds_fxtsqo_000003=非汇款业务请输入业务编号
funds_fxtsqo_000004={0}
funds_fxtfop_000000=Foreign Exchange Liquidation
funds_fxtfcn_CT000009=Foreign Exchange Liquidation
0136=This contract is overdrawn by {0}
funds_crtcri_000000=Clearing in
0002=This field is mandatory
funds_fxtssb_000000=Settlement
funds_fxtsss_000000=Settlement
funds_fxtsqo_000000=Settlement
funds_fxtsqo_000001=远期结售汇交割提示:{0}
funds_fxtsqo_000002=The clearing amount has to be positive.
funds_fxtsqo_000003=非汇款业务请输入业务编号
funds_fxtsqo_000004={0}
funds_fxtfop_000000=Foreign Exchange Liquidation
funds_fxtfcn_CT000009=Foreign Exchange Liquidation
0136=This contract is overdrawn by {0}
funds_crtcri_000000=Clearing in
package com.brilliance.isc.funds.common.component;
import com.brilliance.isc.bo.*;
import com.brilliance.isc.bo.model.Cracbs;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.bo.model.Crtmod;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.exception.CommonServiceException;
import com.brilliance.isc.common.sysmod.SysmodService;
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.util.Utils;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.BchMapper;
import com.brilliance.isc.mda.dao.CrdMapper;
import com.brilliance.isc.vo.TrncodVo;
import com.brilliance.mda.runtime.mda.Constants;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Streams;
import com.brilliance.mda.runtime.mda.util.Strings;
import com.google.common.collect.ImmutableBiMap;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
import java.util.*;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrToolComponent
* @description: 清算 crtmod crdlod
* @author: huangshunlin
* @create: 2024-10-16 20:24
*/
@Component
public class CrToolComponent {
@Autowired
private CrdMapper crdMapper;
@Autowired
private PtsptaToolComponent ptsptaToolComponent;
@Autowired
private CbsmodService cbsmodService;
@Autowired
private SysmodService sysmodService;
@Autowired
private TrnmodService trnmodService;
@Autowired
private BchMapper bchMapper;
public Crdgrp getCrdgrpByInr(String inr) {
Crd rec = new Crd();
rec.setInr(inr);
rec = crdMapper.selectByPrimaryKey(rec);
if (Objects.isNull(rec)) {
throw new CommonServiceException("主键" + inr + "找不到Crd数据");
}
Crdgrp crdgrp = new Crdgrp();
crdgrp.reset();
crdgrp.setRec(rec);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(crdgrp.getCbs().getMax(), "CRD", inr, "MAXSUM", "AMT1", date);
//获取ptspta信息
storePtsToGrp(crdgrp, inr, "CRD");
return crdgrp;
}
public void storePtsToGrp(Object grpObject, String objInr, String objType) {
//找ptspta数据
Map<String, PtsptaVo> maps = ptsptaToolComponent.getPtsptaList(objInr, objType);
if (maps.size() > 0) {
maps.keySet().forEach(key -> {
PtsptaVo ptsptaVo = maps.get(key);
if (key.equalsIgnoreCase("INT")) {
key = "tmpint";
}
Utils.setFieldValue(grpObject, key.toLowerCase(), ptsptaVo);
});
}
}
public void collectCbsMap(TransactionServiceSet set, String prefix, Cracbs cbs, String... cbsNames) {
Map<String, Cbb> cbsMap = set.getCbsMap();
if (cbsMap == null) {
cbsMap = new HashMap<>();
}
for (String name : cbsNames) {
Cbb cbb = Utils.getFieldValue(cbs, name);
if (cbb != null) {
cbsMap.put(prefix.toUpperCase() + name.toUpperCase(), cbb);
}
}
set.setCbsMap(cbsMap);
}
public void collectPtsList(TransactionServiceSet set, Crdgrp crdgrp, String... ptsNames) {
if (ptsNames == null) {
//找所有的ptspta对象
Field[] fields = crdgrp.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
if (PtsptaVo.class.equals(field.getType())) {
PtsptaVo ptspta = Utils.getFieldValue(crdgrp, field.getName());
if (ptspta != null) {
set.addPtspta(transferFrom(ptspta));
}
}
}
} else {
for (String name : ptsNames) {
PtsptaVo ptspta = Utils.getFieldValue(crdgrp, name);
if (ptspta != null && ptspta.getPts() != null && StringUtils.isNotEmpty(ptspta.getPts().getRol())) {
set.addPtspta(transferFrom(ptspta));
}
}
}
}
/**
* 根据STL结构的ptspta转化成抽象组件的ptspta,结构不一样
*
* @param ptsptas
* @return List<com.brilliance.common.vo.PtsptaVo>
*/
protected PtsptaVo transferFrom(PtsptaVo ptsptas) {
PtsptaVo ptspta = ptsptas;
ptspta.setRol(ptsptas.getPts().getRol());
ptspta.setPtsinr(ptsptas.getPts().getInr());
ptspta.setNam(ptsptas.getPts().getNam());
ptspta.setPtyinr(ptsptas.getPts().getPtyinr());
ptspta.setPtainr(ptsptas.getPts().getPtainr());
ptspta.setExtkey(ptsptas.getPts().getExtkey());
ptspta.setDftdsp(ptsptas.getPts().getDftdsp());
ptspta.setDftcur(ptsptas.getPts().getDftcur());
ptspta.setDftact(ptsptas.getPts().getDftact());
ptspta.setDftfeecur(ptsptas.getPts().getDftfeecur());
ptspta.setDftactptainr(ptsptas.getPts().getDftactptainr());
ptspta.setDftselrol(ptsptas.getPts().getDftsetrol());
ptspta.setGlggrpflg(ptsptas.getPts().getGlggrpflg());
ptspta.setRef(ptsptas.getPts().getRef());
ptspta.setPtytyp(ptsptas.getPtytyp());
ptspta.setPtyextkey(ptsptas.getPtyextkey());
ptspta.setAdrblk(ptsptas.getPts().getAdrblk());
return ptspta;
}
public String getCrdInrByOwnref(String ownref) {
Crd crd = crdMapper.selectByOwnref(ownref);
if (crd != null && StringUtils.isNotEmpty(crd.getInr())) {
return crd.getInr();
} else {
return null;
}
}
public void isFXTrnAllowed(Crdgrp crdgrp, TrncodVo trncodVo) {
}
/**
* source:crtmod.0000.script
*/
public void getref(Crdgrp crdgrp) {
//! Set reference number, if not already set (usually called in transaction`s MTABUT\\SAV Event)
//>>>ZL: FRA000052 相关交易增加按钮GETREF---
//<<<ZL: END----
/**
$Length = 6
**/
int length = 5;
// modify for hangzhou
String tbl = NULLSTR;
switch (crdgrp.getRec().getClrtyp()) {
case "I":
if (MdaUtils.compareTo(crdgrp.getRec().getTrntyp(), "") == 0) {
tbl = "CM";
} else {
tbl = "CI";
}
break;
case "O":
tbl = "CO";
break;
}
if (MdaUtils.isEmpty(crdgrp.getRec().getOwnref())) {
crdgrp.getRec().setOwnref(sysmodService.getRef(tbl, length));
}
}
/**
* source:crtmod.0001.script
*/
public void sav(Crdgrp crdgrp) {
// saves contract including texts. CBS resp. of transaction
trnmodService.trnStoreContract(crdgrp);
}
/**
* source:crtmod.0002.script
*/
public void setObjNam(String objref, String nam) {
//Setting OBJNAM. If the setting of OBJREF is not standard, here you can change it.
// ctx.absGet(Sysmod.class).setObjnam(NULLSTR);
// ctx.absGet(Sysmod.class).setObjnam(objref + "/" + nam);
}
/**
* source:crtmod.0003.script
*/
public void saveClearingEntry(Crtmod crtmod, TrnmodVo trnmodVo) {
trnmodVo.reset();
crtmod.reset();
// 根据AutoRegistration创造
IStream parstm = crtmod.getParstm();
if (MdaUtils.isEmpty(parstm)) {
return;
}
//crdgrp
Crdgrp argGrp = crtmod.getCrdgrp();
String argGrpPath = Strings.getLine(parstm, 1);
String argFrm = Strings.getLine(parstm, 2);
String argTxt = Strings.getLine(parstm, 3);
Crd rec = argGrp.getRec();
// 只有汇出清算CRTCRO交易才会需要指定SMHINR
if (MdaUtils.compareTo(argFrm, "CRTCRO") == 0) {
if (MdaUtils.isEmpty(crtmod.getSmhinr())) {
return;
}
}
String recRef = rec.getOwnref();
Trn trn = trnmodVo.getTrn();
// 不新增SMH记录
// SPT指向需要清算的MT202那条SMH
Spt spt = new Spt();
crtmod.setCrtspt(spt);
crtmod.getCrtspt().setFrm(argFrm);
crtmod.getCrtspt().setTxt(argTxt);
crtmod.getCrtspt().setObjnam(Strings.getText("自动清分. $1 $2", recRef, rec.getNam()));
crtmod.getCrtspt().setSmhinr(crtmod.getSmhinr());
crtmod.getCrtspt().setOwnref(recRef);
crtmod.getCrtspt().setObjtyp("CRD");
crtmod.getCrtspt().setObjinr(Utils.recGetInr(rec));
crtmod.getCrtspt().setOwnusr(trn.getUsr());
Argument<String> pathBox = new Argument<String>("", crtmod.getCrtspt().getOwnusg());
sysmodService.getTrnUSG(pathBox);
crtmod.getCrtspt().setOwnusg(pathBox.value);
if (MdaUtils.isEmpty(crtmod.getCrtspt().getOwnusg())) {
crtmod.getCrtspt().setOwnusg(trn.getUsg());
}
crtmod.getCrtspt().setHldflg("R");
crtmod.getCrtspt().setCreobjtyp("TRN");
crtmod.getCrtspt().setCreobjinr(trn.getInr());
trnmodService.trnORDSetSPTAUT(trnmodVo, crtmod.getCrtspt());
// 自动提交到清算中心
//增加实体信息
String ety = SettleContext.getUserEty().getExtkey();
String bchInr = "";
String sql = "SELECT INR FROM BCH WHERE LEV = '1' AND CLRFLG = 'X' and etyextkey='" + ety + "'";
List<Bch> bchList = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(bchList)) {
bchInr = bchList.get(0).getInr();
}
crtmod.getCrtspt().setBchkeyinr(bchInr);
crtmod.getCrtspt().setBranchinr(bchInr);
IStream sptStm = new StreamImpl();
Streams.streamClear(sptStm);
// Systems.setContext("SAVEDATASKIPEMPTY", true);
// String argMod = MdaDriver.getModuleInfo(argGrp, tdModuleInfoClass);
String argMod = "CRDGRP";
Utils.saveData(argGrp.getRec(), sptStm, "", argMod + "\\");
// Systems.setContext("SAVEDATASKIPEMPTY", false);
IStream bakStm = new StreamImpl();
Streams.streamClear(bakStm);
Streams.streamSet(bakStm, sptStm);
sysmodService.sptSaveEntry(crtmod.getCrtspt(), argGrp.getRec(), Constants.SptWaitingRegistration, bakStm, "");
}
/**
* source:crtmod.0004.script
*/
public void registerClearingEntry(Crtmod crtmod, String argGrpPath, String argFrm, String argTxt) {
IStream parstm = crtmod.getParstm();
Streams.streamClear(parstm);
Streams.streamInsert(parstm, 0, argGrpPath);
Streams.streamInsert(parstm, 0, argFrm);
Streams.streamInsert(parstm, 0, argTxt);
}
}
package com.brilliance.isc.funds.crtcri.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.CrtcriStoreBo;
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: CrtcriValidator
* @description: 汇入清算 Crtcri 校验
* @author: huangshunlin
* @create: 2024-10-16 20:26
*/
@Component
public class CrtcriValidator extends AbstractModuleValidator<CrtcriStoreBo> {
@Override
@PostConstruct
public void register() {
super.register();
}
@Override
public Map<String, String> validate(CrtcriStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
/**
* source:crtcri.0006.script
*/
@Validate(path = "crdgrp.rec.rcvobjtyp")
public ValidResult checkCrdgrpRecRcvobjtypN1000(CrtcriStoreBo vo) {
if (MdaUtils.isEmpty(vo.getCrdgrp().getRec().getRcvobjtyp())) {
return errorMandatory();
}
return null;
}
/**
* source:crtcri.0007.script
*/
@Validate(path = "crdgrp.rec.rcvbchinr")
public ValidResult checkCrdgrpRecRcvbchinrN1000(CrtcriStoreBo vo) {
if (MdaUtils.isEmpty(vo.getCrdgrp().getRec().getRcvbchinr())) {
return errorMandatory();
}
return null;
}
/**
* source:crtcri.0015.script
*/
@Validate(path = "crdgrp.cbs.max.amt")
public ValidResult checkCrdgrpCbsMaxAmtN1000(CrtcriStoreBo vo) {
if (MdaUtils.compareTo(vo.getCrdgrp().getCbs().getMax().getAmt(), 0) <= 0) {
return ValidResult.build(false, getMessage("funds_fxtsqo_000002"));
}
return null;
}
/**
* source:crtcri.0017.script
*/
@Validate(path = "crdgrp.rec.msgref")
public ValidResult checkCrdgrpRecMsgrefN1000(CrtcriStoreBo vo) {
// 除了汇款交易,其他均要指定业务
if (MdaUtils.compareTo(vo.getCrdgrp().getRec().getRcvobjtyp(), "CPD") != 0 && MdaUtils.isEmpty(vo.getCrdgrp().getRec().getRcvobjinr())) {
return ValidResult.build(false, getMessage("funds_fxtsqo_000003"));
}
return null;
}
/**
* source:crtcri.0023.script
*/
@Validate(path = "crdgrp.rec.errmsg")
public ValidResult checkCrdgrpRecErrmsgN1000(CrtcriStoreBo vo) {
if (MdaUtils.compareTo(vo.getCrdgrp().getRec().getSta(), "E") == 0) {
return ValidResult.build(false, getMessage("funds_fxtsqo_000004", vo.getCrdgrp().getRec().getErrmsg()));
}
return null;
}
}
package com.brilliance.isc.funds.crtcri.document;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.CrtcriStoreBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @program: isc-funds
* @ClassName: crtcriDocSet
* @description: 汇入清算 crtcri 面函
* @author: huangshunlin
* @create: 2024-10-16 20:27
*/
@Component("crtcri.docset")
public class CrtcriDocSet extends AbstractTransactionDocSet<CrtcriStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(CrtcriDocSet.class);
/**
* 构建需要支持的面函组件
*/
@PostConstruct
public void buildMember() {
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
}
package com.brilliance.isc.funds.crtcri.register.doc;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: CrtcriDocumentRegister
* @description: 汇入清算 Crtcri 面函注册
* @author: huangshunlin
* @create: 2024-10-16 20:27
*/
@Component("crtcri.documentRegister")
public class CrtcriDocumentRegister implements IDocumentRegister {
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc) {
}
}
package com.brilliance.isc.funds.crtcri.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: CrtcriFeeRegister
* @description: 汇入清算 Crtcri 费用注册
* @author: huangshunlin
* @create: 2024-10-16 20:27
*/
@Component("crtcri.feeRegister")
public class CrtcriFeeRegister extends AbstractFeeRegister {
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
setmodFeeRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
}
}
package com.brilliance.isc.funds.crtcri.register.settle;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.common.component.PtsptaToolComponent;
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.crtcri.service.CrtcriTransactionServiceImpl;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcriSettleRegister
* @description: 汇入清算 Crtcri 结算注册
* @author: huangshunlin
* @create: 2024-10-16 20:27
*/
@Component("crtcri.settleRegister")
public class CrtcriSettleRegister implements ISettleRegister {
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private SetmodService setmodService;
@Autowired
private PtsptaToolComponent ptsptaToolComponent;
@Resource(name = "crtcri.transaction")
CrtcriTransactionServiceImpl fxtsssTransactionService;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
/**
* source:crtcri.0009.script
*/
private void transRegister(SetmodVo setmodVo) {
CrdBizInfoVo rec = (CrdBizInfoVo) setmodVo.getRec();
String maxCur = "";
BigDecimal maxAmt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
maxCur = setmodVo.getCbsMap().get("MAX").getCur();
}
setmodVo.setDocamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount(setglg, "TRN");
String rol = NULLSTR;
List<PtsptaVo> ptsList = setmodVo.getPtsList();
if (CollectionUtils.isNotEmpty(ptsList)) {
// if (this.getCrdgrp().getAcc().isRolSet()) {
if (ptsptaToolComponent.ptsIsRolSet(ptsList, "ACC")) {
rol = "ACC";
} else {
rol = "SND";
}
}
String dbtKey = setmodService.setGlgAmt(setmodVo, "TRN", rol, setmodVo.getDoccur(), maxAmt, "");
if (!MdaUtils.isEmpty(rec.getForare())) {
// this.getTrnmod().getTrnism().setDefDsp(rol, "D", "NOD" + CR + "VOD" + CR + "ARD");
} else {
// this.getTrnmod().getTrnism().setDefDsp(rol, "D", "NOD" + CR + "VOD");
}
Act rcvact = new Act();
if (MdaUtils.isEmpty(rec.getRcvactInr()) && !MdaUtils.isEmpty(rec.getRcvbchinr())) {
if (MdaUtils.compareTo(rec.getCustyp(), "1") == 0) {
// 对私
rcvact = fxtsssTransactionService.readClearingAct("SP-RIP", rec.getRcvbchinr(), maxCur);
} else {
// 对公
rcvact = fxtsssTransactionService.readClearingAct("SP-RIC", rec.getRcvbchinr(), maxCur);
}
}
String cdtKey = setglgService.setglgAddAmount(setglg, "TRN", "OWN", setmodVo.getDoccur(), maxAmt.negate(),
"", "SPC", "A", rcvact.getExtkey(), "");
setmodVo.setFeeclirol(rol);
setmodService.setglgAllValDat(setmodVo, rec.getOpndat(), "D");
}
}
package com.brilliance.isc.funds.crtcri.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.crtcri.service.CrtcriTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.CrtcriStructMapper;
import com.brilliance.isc.funds.vo.funds.CrtcriStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
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: CrtcriResource
* @description: 汇入清算 Crtcri 请求入口
* @author: huangshunlin
* @create: 2024-10-08 15:34
*/
@RestController
@RequestMapping("/crtcri")
@Api("汇入清算")
public class CrtcriResource extends AbstractTransactionController<CrtcriStoreVo> {
@Resource
private CrtcriStructMapper crtcriStructMapper;
public IStructMapper getStructMapper() {
return crtcriStructMapper;
}
@Resource(name = "crtcri.transaction")
CrtcriTransactionServiceImpl crtcriTransactionService;
@Autowired
private SettleContext settleContext;
/**
* 获取业务参号
*
* @param crtcriStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody CrtcriStoreVo crtcriStoreVo) {
String ref = crtcriTransactionService.getRef(crtcriStoreVo);
return ResponseSet.simpleSuccess(ref);
}
}
package com.brilliance.isc.funds.crtcri.service;
import cn.hutool.core.bean.BeanUtil;
import com.brilliance.isc.bo.*;
import com.brilliance.isc.bo.model.Crdgrp;
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.component.PtsptaToolComponent;
import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.nosmod.NosmodService;
import com.brilliance.isc.common.ordmod.service.OrdmodService;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
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.I18nUtil;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.util.Utils;
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.CrtcriStoreBo;
import com.brilliance.isc.funds.common.component.CrToolComponent;
import com.brilliance.isc.funds.crtcri.check.CrtcriValidator;
import com.brilliance.isc.funds.vo.funds.CrtcriStoreVo;
import com.brilliance.isc.mda.dao.*;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.*;
import com.google.common.collect.ImmutableBiMap;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcriTransactionServiceImpl
* @description: 汇入清算 Crtcri 业务处理
* @author: huangshunlin
* @create: 2024-10-16 22:35
*/
@Service("crtcri.transaction")
public class CrtcriTransactionServiceImpl extends AbstractTransactionService<CrtcriStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(CrtcriTransactionServiceImpl.class);
@Resource
private CrtcriValidator crtcriValidator;
@Resource
private XrtmodService xrtmodService;
@Resource
private SysmodService sysmodService;
@Resource
private CrToolComponent crToolComponent;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private SettleContext settleContext;
@Resource
private CbsmodService cbsmodService;
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private SetmodService setmodService;
@Resource
private ActMapper actMapper;
@Resource
private SmhMapper smhMapper;
@Resource
private PtyMapper ptyMapper;
@Resource
private PtaMapper ptaMapper;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Resource
private BchMapper bchMapper;
@Resource
private TrnMapper trnMapper;
@Resource
private OrdmodService ordmodService;
@Resource
private PublicMapper publicMapper;
@Autowired
private NosmodService nosmodService;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDOC_SERVICE, "N");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.BOPSET_JSH_SERVICE, "Y");
}
@Override
protected void txnSave(CrtcriStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
/**
* source:crtcri.0013.script
*/
public void ruleMtabutSavN500(CrtcriStoreBo bo) {
Crdgrp crdgrp = bo.getCrdgrp();
crToolComponent.getref(crdgrp);
// 1. Create (rsp. update) Contract (incl. Texts)
// change state
bo.getCrdgrp().getRec().setSta("D");
crToolComponent.sav(crdgrp);
// 2. Build Transaction from CRDGRP
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
trnmodService.trnSetFromContract(trnmodVo);
cbsSav(bo);
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getTrntyp(), "M") == 0) {
// 手工清算,登记SPT后续交易
manualClear(bo);
}
String sql = NULLSTR;
if (sysmodService.sptIsAnyLoaded(bo.getSpt().getSta()) && !sysmodService.sptIsIncLoaded(bo.getSpt().getSta())) {
// 处理Repair后Take,修改对公/对私处理的情况
if (!MdaUtils.isEmpty(bo.getCrdgrp().getRec().getSptinr())) {
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getCustyp(), "0") == 0) {
// 对公
sql = "UPDATE SPT SET DELFLG = ' ' WHERE INR = '" + bo.getCrdgrp().getRec().getSptinr() + "'";
} else {
// 对私
sql = "UPDATE SPT SET DELFLG = 'X' WHERE INR = '" + bo.getCrdgrp().getRec().getSptinr() + "'";
}
int count = publicMapper.updateByTableNameAndInr(ImmutableBiMap.of("sql", sql));
logger.info("update spt count ={}", count);
}
}
SetmodVo setmodVo = transactionHelpService.getTransactionStoreSet().getSetmodVo();
nosmodService.savNostro(bo.getNosmod(), setmodVo, trnmodVo);
}
/**
* source:crtcri.0012.script
*/
private void cbsSav(CrtcriStoreBo bo) {
String trninr = transactionHelpService.getTrninr();
cbsmodService.cbsTrnSetNew("TRN", trninr);
trnmodService.cbsTrnStore("MAXAMT", "AMT1", Dates.today(), bo.getCrdgrp().getCbs().getMax().getCur()
, bo.getCrdgrp().getCbs().getMax().getAmt(), I18nUtil.getMessage("funds_crtcri_000000"),
bo.getCrdgrp().getRec(), trninr);
}
@Override
protected Map<String, String> txnCheck(CrtcriStoreBo transactionVo) {
return crtcriValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(CrtcriStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(CrtcriStoreBo transactionVo) {
return null;
}
@Override
public CrtcriStoreBo init(CrtcriStoreBo crtcriStoreBo) {
crtcriStoreBo.reset();
init950(crtcriStoreBo);
init1000(crtcriStoreBo);
return crtcriStoreBo;
}
/**
* source:crtcri.0001.script
*/
public void init1000(CrtcriStoreBo bo) {
// 不让Break
// Systems.setValues(bo.getCrdgrp().getRec(), "rcvobjtyp", "CPD" + CR + "BOD" + CR + "CCD" + CR + "CLD" + CR + "BED" + CR + "BTD" + CR + "GID");
bo.getCrdgrp().getRec().setErrmsg(NULLSTR);
if (sysmodService.sptIsIncLoaded(bo.getSpt().getSta())) {
bo.getCrdgrp().getCbs().getMax().setCur(bo.getSpt().getRelcur());
bo.getCrdgrp().getCbs().getMax().setAmt(bo.getSpt().getRelamt());
// TODO bo.getCrdgrp().getRec().setMsgact(bo.getSpt().getAct59());
bo.getCrdgrp().getRec().setMsgref(bo.getSpt().getObjref());
bo.getCrdgrp().getRec().setClrtyp("I");
bo.getCrdgrp().getRec().setTrntyp("A");
bo.getCrdgrp().getRec().setCredat(Dates.today());
bo.getCrdgrp().getRec().setOpndat(Dates.today());
bo.getCrdgrp().getRec().setSptinr(bo.getSpt().getInr());
Smh querySmh = new Smh();
querySmh.setInr(bo.getSpt().getSmhinr());
Smh smh = smhMapper.selectByPrimaryKey(querySmh);
if (Objects.isNull(smh)) {
bo.getCrdgrp().getRec().setSta("E");
bo.getCrdgrp().getRec().setErrmsg("根据主键" + bo.getSpt().getSmhinr() + "未找到表记录");
} else {
bo.setSmh(smh);
// bo.getCrdgrp().getRec().setRcvbic(bo.getSmh().getRcvkey());
bo.getCrdgrp().getRec().setMsgtyp(bo.getSmh().getMsgtyp());
bo.getCrdgrp().getRec().setMsginr(bo.getSmh().getInr());
if (!MdaUtils.isEmpty(bo.getSmh().getGrpinr())) {
String sql = "select * from smh WHERE GRPINR = '" + bo.getSmh().getGrpinr() + "' AND INR <> '" + bo.getSmh().getInr() + "'";
List<Smh> smhList = smhMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isEmpty(smhList)) {
bo.getCrdgrp().getRec().setSta("E");
bo.getCrdgrp().getRec().setErrmsg("根据GRPINR" + bo.getSpt().getSmhinr() + "未找到表记录");
} else {
bo.setCorsmh(smhList.get(0));
bo.getCrdgrp().getRec().setBndtyp(bo.getCorsmh().getMsgtyp());
bo.getCrdgrp().getRec().setBndinr(bo.getCorsmh().getInr());
if (!MdaUtils.isEmpty(bo.getCorsmh().getRelcur()) && !MdaUtils.isEmpty(bo.getCorsmh().getRelamt())) {
bo.getCrdgrp().getCbs().getMax().setCur(bo.getCorsmh().getRelcur());
bo.getCrdgrp().getCbs().getMax().setAmt(bo.getCorsmh().getRelamt());
}
}
} else {
MdaUtils.clear(bo.getCorsmh());
}
}
if (MdaUtils.isEmpty(bo.getCrdgrp().getRec().getSta())) {
Argument<String> pathBox = new Argument<String>("", bo.getCrdgrp().getRec().getSta());
Argument<String> pathBox1 = new Argument<String>("", bo.getCrdgrp().getRec().getErrmsg());
checkValidity(pathBox, pathBox1, bo);
bo.getCrdgrp().getRec().setSta(pathBox.value);
bo.getCrdgrp().getRec().setErrmsg(pathBox1.value);
}
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getSta(), "W") == 0) {
// Dynamic.sysWarningSet(SYSWRNTypeWarning, bo.getCrdgrp().getRec().getErrmsg(), "CLEARINGWARNINGS");
} else {
// Dynamic.sysWarningSet(SYSWRNTypeWarning, "", "CLEARINGWARNINGS");
}
} else {
if (sysmodService.sptIsAnyLoaded(bo.getSpt().getSta())) {
bo.setRcvobjtyp(bo.getCrdgrp().getRec().getRcvobjtyp());
}
}
}
/**
* source:crtcri.0002.script
*/
private void init950(CrtcriStoreBo crtcriStoreBo) {
crtcriStoreBo.setClrsta("I");
}
@Override
public void beforeSave(CrtcriStoreBo transactionVo) {
transactionVo.reset();
transactionVo.reset();
Crdgrp crdgrp = transactionVo.getCrdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(crdgrp.getRec());
transactionServiceSet.setTransactionVo(transactionVo);
crToolComponent.collectCbsMap(transactionServiceSet, "", crdgrp.getCbs(), "max");
crToolComponent.collectPtsList(transactionServiceSet, crdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, CrtcriStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getCrdgrp().getRec().getInr());
}
public String getRef(CrtcriStoreVo crtcriStoreVo) {
crtcriStoreVo.reset();
PtsptaVo ptsptaVo = crtcriStoreVo.getCrdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
if (Objects.isNull(wrkbch)) {
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Crdgrp crdgrp = crtcriStoreVo.getCrdgrp();
crToolComponent.getref(crdgrp);
return crdgrp.getRec().getOwnref();
}
private SetmodVo buildSetmodVo(CrtcriStoreVo vo) {
SetmodVo setmodVo = new SetmodVo();
return setmodVo;
}
/**
* source:crtcri.0008.script
*
* @param trmTyp
* @param bchInr
* @param cur bo.getCrdgrp().getCbs().getMax().getCur()
* @return
*/
public Act readClearingAct(String trmTyp, String bchInr, String cur) {
String sql = "select * from act WHERE HOLPTYINR = (SELECT PTYINR FROM BCH WHERE INR = '" + bchInr
+ "') AND (CUR = ' ' OR CUR = '" + cur + "') AND TRMTYP = '"
+ trmTyp + "' AND ACCTYP = 'O'";
List<Act> actList = actMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isEmpty(actList) || actList.size() > 1) {
return new Act();
} else {
Act rcvact = actList.get(0);
int pos = Strings.pos(rcvact.getExtkey(), "A");
if (pos > 0) {
// text = Codetables.getCodeValueText(bo.getCrdgrp().getRec(), "rcvbchinr", bo.getCrdgrp().getRec().getRcvbchinr());
String text = "";
rcvact.setExtkey(Strings.mid(rcvact.getExtkey(), 1, pos - 1) +
Strings.mid(text, 1, 4) + Strings.mid(rcvact.getExtkey(), pos + 4));
}
pos = Strings.pos(rcvact.getExtkey(), "B");
if (pos > 0) {
rcvact.setExtkey(Strings.mid(rcvact.getExtkey(), 1, pos - 1)
+ Strings.mid(Codetables.getCodetableLabelOfTd(cur, "CURKEY", Systems.getLang()), 1, 2)
+ Strings.mid(rcvact.getExtkey(), pos + 2));
}
return rcvact;
}
}
/**
* source:crtcri.0000.script
*/
public void checkValidity(Argument<String> rc, Argument<String> errMsg, CrtcriStoreBo bo) {
rc.value = "";
errMsg.value = "";
// 检查是主报文还是副报文
if (bo.getSmh().getGrpseq() == 2) {
rc.value = "E";
errMsg.value = "副报文无法进行清算,请选择对应的主报文进行清算";
return;
}
String maxCur = bo.getCrdgrp().getCbs().getMax().getCur();
// 读取发报行
String sndKey = NULLSTR;
if (Strings.len(bo.getSmh().getSndkey()) == 11) {
sndKey = bo.getSmh().getSndkey();
} else {
sndKey = Strings.mid(bo.getSmh().getSndkey(), 1, 8) + Strings.mid(bo.getSmh().getSndkey(), 10);
}
// DRF 多实体情况下,需要添加实体的判断
// String sql = "SELECT INR FROM PTY WHERE EXTKEY = '" + sndKey + "' AND ETGEXTKEY= " + DpToolComponents.sqlLit(SettleContext.getUserSession().getEty().getEtg());
Pty pty = ptyMapper.selectByExtkey(sndKey);
if (Objects.nonNull(pty)) {
ptsptaToolComponent.ptsmodGetPtsptaFromPtyINR(bo.getCrdgrp().getSnd(), pty.getInr());
bo.getCrdgrp().getSnd().getPts().setRef(bo.getSmh().getF20());
} else {
rc.value = "E";
errMsg.value = "找不到发报行或发报行记录不惟一,无法清算";
return;
}
// 检查关联情况
switch (bo.getSmh().getMsgtyp()) {
case "103":
// 判断是否带头寸的103报文
// 1、非账户行发来的103,全部不带头寸
// 2、账户行发来的103,53A、54A为空则带头寸,否则不带头寸
if (!checkAccBank(bo)) {
}
break;
case "202":
case "910":
// 判断是否是不带头寸的202/910报文
if (!checkAccBank(bo)) {
rc.value = "E";
errMsg.value = "非账户行的202/910报文无法清算";
return;
} else {
// 根据业务Reference判断
if (!MdaUtils.isEmpty(bo.getCrdgrp().getRec().getMsgref())) {
switch (Strings.mid(bo.getCrdgrp().getRec().getMsgref(), 6, 2)) {
case "FT":
case "PT":
case "FX":
case "DX":
// 资金类报文,不提示
rc.value = "E";
errMsg.value = "资金类头寸报文,请手工清分到资金部";
return;
case "LC":
case "AL":
case "AB":
case "SG":
case "AD":
case "CR":
case "LT":
case "BT":
case "BP":
case "OC":
case "CC":
case "CL":
case "CH":
case "IC":
case "LG":
case "GA":
case "GC":
case "CG":
case "EF":
case "IF":
case "OF":
case "FB":
case "FS":
case "FI":
case "JN":
case "CO":
case "KZ":
case "DD":
case "TZ":
case "JD":
// 非汇款业务
rc.value = "W";
errMsg.value = "未绑定业务报文,请确认后再提交";
break;
default:
if (MdaUtils.compareTo(Strings.mid(bo.getCrdgrp().getRec().getMsgref(), 1, 1), "J") == 0) {
// 资金类报文,不提示
rc.value = "E";
errMsg.value = "资金类头寸报文,请手工清分到资金部";
return;
}
}
} else {
// 认为是汇款业务
rc.value = "E";
errMsg.value = "请先绑定MT103报文后再进行清算";
return;
}
}
break;
case "400":
case "756":
// 必须绑定头寸报文才能清算
if (!checkAccBank(bo)) {
if (MdaUtils.isEmpty(bo.getCorsmh().getInr())) {
rc.value = "E";
errMsg.value = "非账户行的756/400请绑定头寸报文后再进行清算";
return;
}
}
break;
}
// 判断起息日
/*TODO SMH 表没有valdat
if (!MdaUtils.isEmpty(bo.getCorsmh().getInr())) {
bo.getCrtp().setValdat(bo.getCorsmh().getValdat());
if (Dates.diff(bo.getCorsmh().getValdat(), Dates.today()) > 0) {
rc.value = "E";
errMsg.value = "后起息的报文无法提前清分,请于" + Formats.format(bo.getCorsmh().getValdat(), "YYYY年MM月DD日") + "后进行清算";
return;
}
} else {
bo.getCrtp().setValdat(bo.getSmh().getValdat());
if (Dates.diff(bo.getSmh().getValdat(), Dates.today()) > 0) {
rc.value = "E";
errMsg.value = "后起息的报文无法提前清分,请于" + Formats.format(bo.getSmh().getValdat(), "YYYY年MM月DD日") + "后进行清算";
return;
}
}*/
// 读取同业账户(账户行情况下已经在判断是否账户行中读取)
if (!MdaUtils.isEmpty(bo.getCorsmh().getInr()) && MdaUtils.isEmpty(bo.getSndact().getInr())) {
// 读取账户行
if (Strings.len(bo.getCorsmh().getSndkey()) == 11) {
sndKey = bo.getCorsmh().getSndkey();
} else {
sndKey = Strings.mid(bo.getCorsmh().getSndkey(), 1, 8) + Strings.mid(bo.getCorsmh().getSndkey(), 10);
}
String sql = "SELECT INR FROM PTY WHERE EXTKEY = '" + sndKey + "'";
List<Pty> ptyList = ptyMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(ptyList) && ptyList.size() == 1) {
ptsptaToolComponent.ptsmodGetPtsptaFromPtyINR(bo.getCrdgrp().getAcc(), ptyList.get(0).getInr());
bo.getCrdgrp().getAcc().getPts().setRef(bo.getCorsmh().getF20());
} else {
rc.value = "W";
errMsg.value = "找不到账户行或账户行记录不惟一,请手工指定发报行";
return;
}
// readAct(bo.getSysmod().getBch().getPtyinr(), bo.getCrdgrp().getAcc().getPts().getPtyinr(), bo.getSndact());
readAct("", bo.getCrdgrp().getAcc().getPts().getPtyinr(), bo.getSndact(), maxCur);
if (Objects.isNull(bo.getSndact()) || StringUtils.isEmpty(bo.getSndact().getInr())) {
rc.value = "E";
errMsg.value = "账户行未维护存放同业账户,请在DBxACT中维护账号后清算";
return;
}
}
// 自动清分
// 1、根据账号Tag59清分
if (!MdaUtils.isEmpty(bo.getCrdgrp().getRec().getMsgact())) {
List<Act> actListByExtkey = actMapper.getActListByExtkey(bo.getCrdgrp().getRec().getMsgact());
// ctx.getDaoSession().dbRead(bo.getAplact(), bo.getCrdgrp().getRec().getMsgact(), "EXTKEY");
if (CollectionUtils.isEmpty(actListByExtkey)) {
rc.value = "W";
errMsg.value = "客户账号在数据库中不存在,请手工清分";
return;
}
bo.setAplact(actListByExtkey.get(0));
// TODO act 表没有 bchkeyinr 考虑到多个PTA的情况
// if (!MdaUtils.isEmpty(bo.getAplact().getBchkeyinr())) {
// ctx.getDaoSession().dbRead(bo.getCrdgrp().getApl().getPta(), bo.getAplact().getBchkeyinr(), "BRANCHINR", bo.getAplact().getHolptyinr(), "PTYINR");
// } else {
// ctx.getDaoSession().dbRead(bo.getCrdgrp().getApl().getPta(), bo.getAplact().getHolptyinr(), "PTYINR");
// }
List<Pta> ptaList = ptaMapper.selectByPtyInr(bo.getAplact().getHolptyinr());
if (CollectionUtils.isEmpty(ptaList)) {
rc.value = "W";
errMsg.value = "无此客户地址,请手工指定下划机构";
MdaUtils.clear(bo.getCrdgrp().getApl().getPta());
return;
} else {
if (ptaList.size() > 1) {
rc.value = "W";
errMsg.value = "此客户有多个地址,请手工指定下划机构";
MdaUtils.clear(bo.getCrdgrp().getApl().getPta());
return;
}
}
bo.getCrdgrp().getApl().setPta(ptaList.get(0));
PtsptaVo apl = ptsptaToolComponent.getPtsptaFromPtaINR(bo.getCrdgrp().getApl().getPta().getInr());
bo.getCrdgrp().setApl(apl);
bo.getCrdgrp().getRec().setRcvbchinr(bo.getCrdgrp().getApl().getPta().getBranchinr());
// 有账号的报文只有MT103
bo.getCrdgrp().getRec().setRcvobjtyp("CPD");
// 判断对公汇款还是对私汇款
// 台州银行判断客户号,第一位1-4为对私,5-8为对公
switch (Strings.mid(bo.getCrdgrp().getApl().getPta().getPtyextkey(), 1, 1)) {
case "1":
case "2":
case "3":
case "4":
bo.getCrdgrp().getRec().setCustyp("1");
break;
case "5":
case "6":
case "7":
case "8":
bo.getCrdgrp().getRec().setCustyp("0");
break;
}
}
// 2、根据OwnRef Tag21清分
String branchInr = NULLSTR;
String objTyp = NULLSTR;
String objInr = NULLSTR;
if (!MdaUtils.isEmpty(bo.getCrdgrp().getRec().getMsgref()) && MdaUtils.isEmpty(bo.getCrdgrp().getRec().getMsgact())) {
String sql = "SELECT DISTINCT(BRANCHINR), OBJTYP, OBJINR FROM TRN WHERE OWNREF = '" + bo.getCrdgrp().getRec().getMsgref() + "'";
List<Trn> trnList = trnMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isEmpty(trnList)) {
rc.value = "W";
errMsg.value = "国结系统中无对应此业务编号的交易,请手工指定下划机构";
return;
} else {
branchInr = trnList.get(0).getBranchinr();
objTyp = trnList.get(0).getObjtyp();
objInr = trnList.get(0).getObjinr();
bo.getCrdgrp().getRec().setRcvbchinr(branchInr);
bo.getCrdgrp().getRec().setRcvobjtyp(objTyp);
bo.getCrdgrp().getRec().setRcvobjinr(objInr);
}
}
// 3、根据收报行的Swift Code清分
String rcvKey = NULLSTR;
if (MdaUtils.isEmpty(bo.getCrdgrp().getRec().getRcvbchinr())) {
if (Strings.len(bo.getSmh().getRcvkey()) == 11) {
rcvKey = bo.getSmh().getRcvkey();
} else {
rcvKey = Strings.mid(bo.getSmh().getRcvkey(), 1, 8) + Strings.mid(bo.getSmh().getRcvkey(), 10);
}
String sql = "SELECT INR FROM BCH WHERE SWFCOD = '" + rcvKey + "' AND LEV <> '0'";
List<Bch> bchList = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(bchList) && bchList.size() == 1) {
bo.getCrdgrp().getRec().setRcvbchinr(bchList.get(0).getInr());
} else {
rc.value = "W";
errMsg.value = "多家分支行公用一个Swift Code,请手工指定下划机构";
return;
}
}
// 如果下发行没有权限经办业务,则转到它的上级经办机构 TODO bch 没有 wrkflg
String sql = "SELECT WRKFLG, BCHKEY FROM BCH WHERE INR = '" + bo.getCrdgrp().getRec().getRcvbchinr() + "'";
String wrkFlg = "";
String bchKey = "";
List<Bch> bchList = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(bchList)) {
// wrkFlg = bchList.get(0).getWrkflg();
bchKey = bchList.get(0).getBchkey();
}
String wrkInr = NULLSTR;
if (MdaUtils.isEmpty(wrkFlg)) {
sql = "SELECT INR FROM BCH WHERE BRANCH = '" + bchKey + "'";
List<Bch> list = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(list)) {
wrkInr = list.get(0).getInr();
}
bo.getCrdgrp().getRec().setRcvbchinr(wrkInr);
}
// 取得下发行的清算账号
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getCustyp(), "1") == 0) {
// 对私
readClearingAct("SP-RIP", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
} else {
bo.getCrdgrp().getRec().setCustyp("0");
// 对公
readClearingAct("SP-RIC", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
}
}
/**
* source:crtcri.0003.script
*/
public boolean checkAccBank(CrtcriStoreBo bo) {
/* // 检查是否账户行关系
// 账户行的账号持有者为清算中心
// 需检查同业存放和存放同业
boolean boolVar = false;
// readAct(bo.getSysmod().getBch().getPtyinr(), bo.getCrdgrp().getSnd().getPts().getPtyinr(), bo.getSndact());
readAct(SettleContext.getUserSession().getOwnpts().getPtyinr(), bo.getCrdgrp().getSnd().getPts().getPtyinr(),
bo.getSndact(),bo.getCrdgrp().getCbs().getMax().getCur());
if (ctx.getErrorCode() != tdOdbcNotFound) {
if (!MdaUtils.isEmpty(bo.getSndact().getInr())) {
boolVar = true;
}
} else {
//检查同业存放
readVOAct(bo.getCrdgrp().getSnd().getPts().getPtyinr(), bo.getSysmod().getBch().getPtyinr(), bo.getSndact());
if (ctx.getErrorCode() != tdOdbcNotFound) {
if (!MdaUtils.isEmpty(bo.getSndact().getInr())) {
boolVar = true;
}
}
}*/
return true;
}
/**
* source:crtcri.0004.script
*
* @param holPtyInr
* @param serPtyInr
* @param act
* @param cur bo.getCrdgrp().getCbs().getMax().getCur()
*/
public void readAct(String holPtyInr, String serPtyInr, Act act, String cur) {
//todo act 没有 SERPTYINR字段
// String sql = "SELECT * from act WHERE HOLPTYINR = '" + holPtyInr + "' AND SERPTYINR = '" + serPtyInr + "' AND CUR = '" + cur + "' AND TYP = 'DB'";
String sql = "SELECT * from act WHERE HOLPTYINR = '" + holPtyInr + "' AND CUR = '" + cur + "' AND TYP = 'DB'";
List<Act> actList = actMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(actList)) {
BeanUtil.copyProperties(actList.get(0), act);
}
}
/**
* source:crtcri.0005.script
*/
public void setBranchCodeValue() {
String sql = "SELECT INR, BRANCH||BCHNAME FROM BCH WHERE WRKFLG = 'X'";
}
/**
* source:crtcri.0020.script
*/
public void manualClear(CrtcriStoreBo bo) {
bo.setCrtspt(new Spt());
bo.getCrtspt().setObjtyp(bo.getCrdgrp().getRec().getRcvobjtyp());
bo.getCrtspt().setObjinr(bo.getCrdgrp().getRec().getRcvobjinr());
switch (bo.getCrtspt().getObjtyp()) {
case "CPD":
bo.getCrtspt().setFrm("CPTADV");
break;
case "BOD":
bo.getCrtspt().setFrm("BOTSET");
break;
case "CCD":
bo.getCrtspt().setFrm("CCTSET");
break;
case "BED":
bo.getCrtspt().setFrm("BETSET");
break;
case "BTD":
bo.getCrtspt().setFrm("BTTSET");
break;
case "GID":
bo.getCrtspt().setFrm("GETSET");
break;
case "CLD":
bo.getCrtspt().setFrm("CLTSET");
break;
}
bo.getCrtspt().setTxt("N-SWIFT Doc Clearing");
bo.getCrtspt().setObjnam(Strings.getText(MdaUtils.getI18NString("crtcri", "CT000008"), bo.getCrdgrp().getRec().getNam()));
bo.getCrtspt().setOwnusr(SettleContext.getUserSession().getUsr().getExtkey());
bo.getCrtspt().setOwnusg("OU");
bo.getCrtspt().setCreobjtyp("TRN");
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
String trninr = transactionHelpService.getTrninr();
bo.getCrtspt().setCreobjinr(trninr);
// 业务的经办机构
// bo.getCrtspt().setBchkeyinr(Datas.getContent(this, bo.getCrdgrp().getRec().getRcvobjtyp() + "GRP\\REC\\BRANCHINR"));
String bchkeyinr = Utils.getFieldValue(bo, bo.getCrdgrp().getRec().getRcvobjtyp() + "GRP\\REC\\BRANCHINR");
bo.getCrtspt().setBchkeyinr(bchkeyinr);
if (MdaUtils.isEmpty(bo.getCrtspt().getBchkeyinr())) {
bo.getCrtspt().setBchkeyinr(bo.getCrdgrp().getRec().getRcvbchinr());
}
bo.getCrtspt().setBranchinr(bo.getCrtspt().getBchkeyinr());
bo.getCrtspt().setCredat(Dates.today());
bo.getCrtspt().setOrdinr(ordmodService.ordGetINR(trnmodVo.getOrdmod()));
//清算发起标识 TODO
// bo.getCrtspt().setClrflg("Y");
bo.getCrtspt().setHldflg("R");
IStream clrStm = new StreamImpl();
Streams.streamClear(clrStm);
// Systems.setContext("SAVEDATASKIPEMPTY", true);
// IModule mod = MdaDriver.getModule(this, bo.getCrdgrp().getRec().getRcvobjtyp() + "GRP");
Object mod = Utils.getFieldValue(bo, bo.getCrdgrp().getRec().getRcvobjtyp() + "GRP");
Utils.saveData(mod, clrStm, "", bo.getCrdgrp().getRec().getRcvobjtyp() + "GRP\\");
// Systems.setContext("SAVEDATASKIPEMPTY", false);
// sta - ?
String sta = "CLI";
sysmodService.sptSaveEntry(bo.getCrtspt(), Utils.getFieldValue(mod, "REC"), sta, clrStm, "");
}
}
package com.brilliance.isc.funds.crtcro.check;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.funds.bo.funds.CrtcroStoreBo;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: CrtcroValidator
* @description: 汇出清算 Crtcro 校验
* @author: huangshunlin
* @create: 2024-10-17 22:38
*/
@Component
public class CrtcroValidator extends AbstractModuleValidator<CrtcroStoreBo> {
@Override
@PostConstruct
public void register() {
super.register();
}
@Override
public Map<String, String> validate(CrtcroStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
}
package com.brilliance.isc.funds.crtcro.document;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.CrtcroStoreBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @program: isc-funds
* @ClassName: CrtcroDocSet
* @description: 汇出清算 Crtcro 面函
* @author: huangshunlin
* @create: 2024-10-17 22:39
*/
@Component("crtcro.docset")
public class CrtcroDocSet extends AbstractTransactionDocSet<CrtcroStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(CrtcroDocSet.class);
/**
* 构建需要支持的面函组件
*/
@PostConstruct
public void buildMember() {
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
}
package com.brilliance.isc.funds.crtcro.register.doc;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: CrtcroDocumentRegister
* @description: 汇出清算 Crtcro 面函注册
* @author: huangshunlin
* @create: 2024-10-17 22:39
*/
@Component("crtcro.documentRegister")
public class CrtcroDocumentRegister implements IDocumentRegister {
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc) {
}
}
package com.brilliance.isc.funds.crtcro.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: CrtcroFeeRegister
* @description: 汇入清算 Crtcro 费用注册
* @author: huangshunlin
* @create: 2024-10-17 22:40
*/
@Component("crtcro.feeRegister")
public class CrtcroFeeRegister extends AbstractFeeRegister {
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
setmodFeeRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
}
}
package com.brilliance.isc.funds.crtcro.register.settle;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.common.component.PtsptaToolComponent;
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.crtcro.service.CrtcroTransactionServiceImpl;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcroSettleRegister
* @description: 汇入清算 Crtcro 结算注册
* @author: huangshunlin
* @create: 2024-10-16 20:27
*/
@Component("crtcro.settleRegister")
public class CrtcroSettleRegister implements ISettleRegister {
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private SetmodService setmodService;
@Autowired
private PtsptaToolComponent ptsptaToolComponent;
@Resource(name = "crtcro.transaction")
CrtcroTransactionServiceImpl fxtsssTransactionService;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
/**
* source:crtcro.0009.script
*/
private void transRegister(SetmodVo setmodVo) {
}
}
package com.brilliance.isc.funds.crtcro.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.crtcro.service.CrtcroTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.CrtcroStructMapper;
import com.brilliance.isc.funds.vo.funds.CrtcroStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
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: CrtcroResource
* @description: 汇出清算 Crtcro 请求入口
* @author: huangshunlin
* @create: 2024-10-17 22:41
*/
@RestController
@RequestMapping("/crtcro")
@Api("汇入清算")
public class CrtcroResource extends AbstractTransactionController<CrtcroStoreVo> {
@Resource
private CrtcroStructMapper crtcroStructMapper;
public IStructMapper getStructMapper() {
return crtcroStructMapper;
}
@Resource(name = "crtcro.transaction")
CrtcroTransactionServiceImpl crtcroTransactionService;
@Autowired
private SettleContext settleContext;
/**
* 获取业务参号
*
* @param crtcroStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody CrtcroStoreVo crtcroStoreVo) {
String ref = crtcroTransactionService.getRef(crtcroStoreVo);
return ResponseSet.simpleSuccess(ref);
}
}
package com.brilliance.isc.funds.crtcro.service;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.bo.model.Crdgrp;
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.glemod.service.GlemodService;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
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.CrtcroStoreBo;
import com.brilliance.isc.funds.common.component.CrToolComponent;
import com.brilliance.isc.funds.crtcro.check.CrtcroValidator;
import com.brilliance.isc.funds.vo.funds.CrtcroStoreVo;
import com.brilliance.isc.mda.dao.ActMapper;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Objects;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcroTransactionServiceImpl
* @description: 汇出清算 Crtcro 业务处理
* @author: huangshunlin
* @create: 2024-10-17 22:42
*/
@Service("crtcro.transaction")
public class CrtcroTransactionServiceImpl extends AbstractTransactionService<CrtcroStoreBo> {
@Resource
private CrtcroValidator crtcroValidator;
@Resource
private XrtmodService xrtmodService;
@Resource
private SysmodService sysmodService;
@Resource
private CrToolComponent crToolComponent;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private SettleContext settleContext;
@Resource
private CbsmodService cbsmodService;
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private SetmodService setmodService;
@Resource
private ActMapper actMapper;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDOC_SERVICE, "N");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.BOPSET_JSH_SERVICE, "Y");
}
@Override
protected void txnSave(CrtcroStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
public void ruleMtabutSavN500(CrtcroStoreBo bo) {
}
private void cbsSav(CrtcroStoreBo bo, TrnmodVo trnmodVo) {
}
@Override
protected Map<String, String> txnCheck(CrtcroStoreBo transactionVo) {
return crtcroValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(CrtcroStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(CrtcroStoreBo transactionVo) {
return null;
}
@Override
public CrtcroStoreBo init(CrtcroStoreBo crtcroStoreBo) {
crtcroStoreBo.reset();
init1000(crtcroStoreBo);
return crtcroStoreBo;
}
/**
* source:crtcro.0001.script
*/
public void init1000(CrtcroStoreBo bo) {
}
private void init950(CrtcroStoreBo crtcroStoreBo) {
}
@Override
public void beforeSave(CrtcroStoreBo transactionVo) {
transactionVo.reset();
transactionVo.reset();
Crdgrp crdgrp = transactionVo.getCrdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(crdgrp.getRec());
transactionServiceSet.setTransactionVo(transactionVo);
crToolComponent.collectCbsMap(transactionServiceSet, "", crdgrp.getCbs(), "max");
crToolComponent.collectPtsList(transactionServiceSet, crdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, CrtcroStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getCrdgrp().getRec().getInr());
}
public String getRef(CrtcroStoreVo crtcroStoreVo) {
crtcroStoreVo.reset();
PtsptaVo ptsptaVo = crtcroStoreVo.getCrdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
if (Objects.isNull(wrkbch)) {
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Crdgrp crdgrp = crtcroStoreVo.getCrdgrp();
crToolComponent.getref(crdgrp);
return crdgrp.getRec().getOwnref();
}
private SetmodVo buildSetmodVo(CrtcroStoreVo vo) {
SetmodVo setmodVo = new SetmodVo();
return setmodVo;
}
}
package com.brilliance.isc.funds.fxtsqo.check;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.funds.bo.funds.FxtsqoStoreBo;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: FxtsqoValidator
* @description: 即期结售汇报价 Fxtsqo 校验
* @author: huangshunlin
* @create: 2024-10-18 15:38
*/
@Component
public class FxtsqoValidator extends AbstractModuleValidator<FxtsqoStoreBo> {
@Override
@PostConstruct
public void register() {
super.register();
}
@Override
public Map<String, String> validate(FxtsqoStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
}
package com.brilliance.isc.funds.fxtsqo.document;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FxtsqoStoreBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @program: isc-funds
* @ClassName: FxtsqoDocSet
* @description: 即期结售汇报价 Fxtsqo 面函
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtsqo.docset")
public class FxtsqoDocSet extends AbstractTransactionDocSet<FxtsqoStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(FxtsqoDocSet.class);
/**
* 构建需要支持的面函组件
*/
@PostConstruct
public void buildMember() {
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
}
package com.brilliance.isc.funds.fxtsqo.register.diasav;
import com.brilliance.isc.common.register.diasav.CommonDiasavRegister;
import com.brilliance.isc.common.register.diasav.IDiasavRegister;
import com.brilliance.isc.common.trndia.service.TrndiaService;
import com.brilliance.isc.common.trndia.vo.TrndiaVo;
import com.brilliance.isc.common.util.I18nUtil;
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 static com.brilliance.mda.runtime.mda.Constants.DiaToReplace;
@Component("fxtsqo.diasavRegister")
public class FxtsqoDiasavRegister implements IDiasavRegister {
@Autowired
private CommonDiasavRegister commonDiasavRegister;
@Autowired
private TrndiaService trndiaService;
@Override
public void diasav(TrndiaVo trndia) {
this.trnDiasav(trndia);
commonDiasavRegister.diasav(trndia);
}
/**
* source:fxtsqo.0006.script
*/
private void trnDiasav(TrndiaVo trndiaVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) trndiaVo.getRec();
if (!MdaUtils.isEmpty(rec.getSetdat())) {
trndiaService.trnDiaSet(trndiaVo, "FXDSET", rec.getSetdat(), "EXP",
I18nUtil.getMessage("funds_fxtsqo_000001", rec.getOwnref()), "FXTSST", DiaToReplace);
}
trndiaService.trnDiaSetDone(trndiaVo, "QUOTE");
}
}
package com.brilliance.isc.funds.fxtsqo.register.doc;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FxtsqoDocumentRegister
* @description: 即期结售汇报价 Fxtsqo 面函注册
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtsqo.documentRegister")
public class FxtsqoDocumentRegister implements IDocumentRegister {
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc) {
}
}
package com.brilliance.isc.funds.fxtsqo.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("fxtsqo.feeRegister")
public class FxtsqoFeeRegister extends AbstractFeeRegister {
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
setmodFeeRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
}
}
package com.brilliance.isc.funds.fxtsqo.register.settle;
import com.brilliance.isc.bo.Cbb;
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.vo.SetmodVo;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
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.math.BigDecimal;
import java.util.Map;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component("fxtsqo.settleRegister")
public class FxtsqoSettleRegister implements ISettleRegister {
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
/**
* source:fxtsqo.0005.script
*/
private void transRegister(SetmodVo setmodVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
Map<String, Cbb> cbsMap = setmodVo.getCbsMap();
BigDecimal maxAmt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
}
String nom1Cur = NULLSTR;
if (setmodVo.getCbsMap().get("NOM1") != null) {
nom1Cur = setmodVo.getCbsMap().get("NOM1").getCur();
}
setmodVo.setDocamt(maxAmt);
setmodVo.setOpnamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount(setglg, "TRN");
setglgService.setglgClrAmount(setglg, "SET");
String dsp1 = NULLSTR;
String dsp2 = NULLSTR;
String acc = NULLSTR;
String acc2 = NULLSTR;
String dbtKey = NULLSTR;
String cdtKey = NULLSTR;
if (!MdaUtils.isEmpty(rec.getRat())) {
if (MdaUtils.compareTo(Strings.mid(rec.getFxtyp(), 1, 1), "S") == 0) {
if (MdaUtils.compareTo(rec.getDsp(), "CA") == 0) {
dsp1 = "LO";
} else {
dsp1 = rec.getDsp();
}
if (MdaUtils.compareTo(rec.getDsp2(), "CA") == 0) {
dsp2 = "LO";
} else {
dsp2 = rec.getDsp2();
}
acc = rec.getAcc();
acc2 = rec.getAcc2();
} else {
dsp1 = "RP";
dsp2 = "RP";
acc = "";
acc2 = "";
}
if (MdaUtils.compareTo(Strings.mid(rec.getFxtyp(), 2, 1), "B") == 0) {
dbtKey = setglgService.setglgAddAmount(setglg, "TRN", "APL", setmodVo.getDoccur(), setmodVo.getSetamt(), "", dsp1 + "D", "F", acc, "");
cdtKey = setglgService.setglgAddAmount(setglg, "SET", "APL", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "SET", dsp2 + "C", "F", acc2, "SET");
setglgService.setglgAddAmtFldAccCur(setglg, "SET", cdtKey, nom1Cur);
setglgService.setglgAddAmtFldExtRat(setglg, "SET", cdtKey, BigDecimal.ONE, rec.getRat());
setglgService.setSettlementDetails(setglg, "B", "APL", rec.getTrnman(), rec.getTrdint());
} else {
cdtKey = setglgService.setglgAddAmount(setglg, "TRN", "APL", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "", dsp1 + "C", "F", acc, "");
dbtKey = setglgService.setglgAddAmount(setglg, "SET", "APL", setmodVo.getDoccur(), setmodVo.getSetamt(), "SET", dsp2 + "D", "F", acc2, "SET");
setglgService.setglgAddAmtFldAccCur(setglg, "SET", dbtKey, nom1Cur);
setglgService.setglgAddAmtFldExtRat(setglg, "SET", dbtKey, BigDecimal.ONE, rec.getRat());
setglgService.setSettlementDetails(setglg, "S", "APL", rec.getTrnman(), rec.getTrdout());
}
}
}
}
package com.brilliance.isc.funds.fxtsqo.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.fxtsqo.service.FxtsqoTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtsqoStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtsqoStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FxtsqoResource
* @description: 即期结售汇报价 Fxtsqo 请求入口
* @author: huangshunlin
* @create: 2024-10-18 15:34
*/
@RestController
@RequestMapping("/fxtsqo")
@Api("即期结售汇报价")
public class FxtsqoResource extends AbstractTransactionController<FxtsqoStoreVo> {
@Resource
private FxtsqoStructMapper fxtsqoStructMapper;
public IStructMapper getStructMapper() {
return fxtsqoStructMapper;
}
@Resource(name = "fxtsqo.transaction")
FxtsqoTransactionServiceImpl fxtsqoTransactionService;
@Autowired
private SettleContext settleContext;
}
package com.brilliance.isc.funds.fxtsqo.service;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Fxd;
import com.brilliance.isc.bo.model.Fxdgrp;
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.glemod.service.GlemodService;
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.I18nUtil;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.funds.bo.funds.FxtsqoStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtlop.service.FxtpService;
import com.brilliance.isc.funds.fxtsqo.check.FxtsqoValidator;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
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.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: fxtsqoTransactionServiceImpl
* @description: 即期售汇报价 fxtsqo 业务处理
* @author: huangshunlin
* @create: 2024-10-18 15:35
*/
@Service("fxtsqo.transaction")
public class FxtsqoTransactionServiceImpl extends AbstractTransactionService<FxtsqoStoreBo> {
@Resource
private FxtsqoValidator fxtsqoValidator;
@Resource
private XrtmodService xrtmodService;
@Resource
private SysmodService sysmodService;
@Resource
private FxToolComponent fxToolComponent;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private SettleContext settleContext;
@Resource
private CbsmodService cbsmodService;
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private SetmodService setmodService;
@Resource
private FxtpService fxtpService;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
}
@Override
protected void txnSave(FxtsqoStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
/**
* source:fxtsqo.0002.script
*/
public void ruleMtabutSavN500(FxtsqoStoreBo bo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
fxToolComponent.getref(bo.getFxdgrp());
// 1. Create (rsp. update) Contract (incl. Texts)
fxToolComponent.sav(bo.getFxdgrp(), BigDecimal.ZERO);
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract(trnmodVo);
cbsSav(bo);
// save documents
}
/**
* source:fxtsqo.0003.script
*/
private void cbsSav(FxtsqoStoreBo bo) {
String trninr = transactionHelpService.getTrninr();
cbsmodService.cbsTrnSetNew("TRN", trninr);
trnmodService.cbsTrnStore("NOMAMT", "AMT1", Dates.today(), bo.getFxdgrp().getCbs().getNom1().getCur(),
bo.getFxdgrp().getCbs().getNom1().getAmt(), I18nUtil.getMessage("funds_fxtsqo_000000"), bo.getFxdgrp().getRec(), trninr);
if (MdaUtils.compareTo(Strings.mid(bo.getFxdgrp().getRec().getFxtyp(), 1, 1), "S") == 0) {
trnmodService.cbsTrnStore("UTLAMT", "AMT1", Dates.today(), bo.getFxdgrp().getCbs().getMax().getCur(),
bo.getFxdgrp().getCbs().getMax().getAmt(), I18nUtil.getMessage("funds_fxtsqo_000000"), bo.getFxdgrp().getRec(), trninr);
}
}
@Override
protected Map<String, String> txnCheck(FxtsqoStoreBo transactionVo) {
return fxtsqoValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(FxtsqoStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD");
Fxd rec = transactionVo.getFxdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFxtyp(rec.getFxtyp());
bizInfoVo.setAcc(rec.getAcc());
bizInfoVo.setAcc2(rec.getAcc2());
bizInfoVo.setDsp(rec.getDsp());
bizInfoVo.setDsp2(rec.getDsp2());
bizInfoVo.setTrdint(rec.getTrdint());
bizInfoVo.setTrdout(rec.getTrdout());
bizInfoVo.setTrnman(rec.getTrnman());
bizInfoVo.setRat(rec.getRat());
bizInfoVo.setSetdat(rec.getSetdat());
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FxtsqoStoreBo transactionVo) {
return null;
}
@Override
public FxtsqoStoreBo init(FxtsqoStoreBo FxtsqoStoreBo) {
FxtsqoStoreBo.reset();
init1000(FxtsqoStoreBo);
return FxtsqoStoreBo;
}
/**
* source:fxtsqo.0001.script
*/
public void init1000(FxtsqoStoreBo bo) {
bo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
Bch bch = bchService.getByBchInr(bo.getFxdgrp().getRec().getBchkeyinr());
Bch wrkbch = bchService.getByBchInr(bo.getFxdgrp().getRec().getBranchinr());
SettleContext.getUserSession().setBch(bch);
SettleContext.getUserSession().setWrkbch(wrkbch);
// ctx.getDaoSession().dbRead(this.getSysmod().getBch(),this.getFxdgrp().getRec().getBchkeyinr(),"INR");
// ctx.getDaoSession().dbRead(this.getSysmod().getWrkbch(),this.getFxdgrp().getRec().getBranchinr(),"INR");
}
/**
* source:fxtsqo.0000.script
*/
private void init950(FxtsqoStoreBo bo) {
// this.getTrnmod().troLockExistingContract ( this.getFxdgrp());
String inr = bo.getFxdgrp().getRec().getInr();
Fxdgrp dbFxdgrp = fxToolComponent.getFxdgrpByInr(inr);
bo.setFxdgrp(dbFxdgrp);
}
@Override
public void beforeSave(FxtsqoStoreBo transactionVo) {
transactionVo.reset();
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, FxtsqoStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFxdgrp().getRec().getInr());
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Smh;
import com.brilliance.isc.bo.Spt;
import com.brilliance.isc.bo.model.*;
import com.brilliance.isc.common.nosmod.vo.Nosmod;
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;
/**
* @program: isc-funds
* @ClassName: CrtcriStoreBo
* @description: 汇入清算 bo
* @author: huangshunlin
* @create: 2024-10-16 20:24
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtcriStoreBo extends BaseTransactionVo {
//Status I-INCOMING, O-OUTGOING, N-NOTNEED (max=1)
private String clrsta = NULLSTR;
//Object Type of Associated Contract Optional (max=6)
private String rcvobjtyp = NULLSTR;
private Crdgrp crdgrp;
private Crtp crtp;
private Smh smh;
private Smh corsmh;
private Act sndact;
private Act aplact;
private Act rcvact;
private Spt crtspt;
private Bodgrp bodgrp;
private Ccdgrp ccdgrp;
private Bedgrp bedgrp;
private Ledgrp ledgrp;
private Btdgrp btdgrp;
private Ltdgrp ltdgrp;
private Gidgrp gidgrp;
// private Cldgrp cldgrp;
private Cpdgrp cpdgrp;
private Nosmod nosmod;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
if (crtp == null) {
crtp = new Crtp();
}
crtp.reset();
if (smh == null) {
smh = new Smh();
}
if (corsmh == null) {
corsmh = new Smh();
}
if (sndact == null) {
sndact = new Act();
}
if (aplact == null) {
aplact = new Act();
}
if (rcvact == null) {
rcvact = new Act();
}
if (crtspt == null) {
crtspt = new Spt();
}
if (bodgrp == null) {
bodgrp = new Bodgrp();
}
bodgrp.reset();
if (ccdgrp == null) {
ccdgrp = new Ccdgrp();
}
ccdgrp.reset();
if (bedgrp == null) {
bedgrp = new Bedgrp();
}
bedgrp.reset();
if (ledgrp == null) {
ledgrp = new Ledgrp();
}
ledgrp.reset();
if (btdgrp == null) {
btdgrp = new Btdgrp();
}
btdgrp.reset();
if (ltdgrp == null) {
ltdgrp = new Ltdgrp();
}
ltdgrp.reset();
if (gidgrp == null) {
gidgrp = new Gidgrp();
}
gidgrp.reset();
if (cpdgrp == null) {
cpdgrp = new Cpdgrp();
}
cpdgrp.reset();
if (nosmod == null) {
nosmod = new Nosmod();
}
nosmod.reset();
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Gle;
import com.brilliance.isc.bo.Smh;
import com.brilliance.isc.bo.Trn;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.bo.model.Crtmod;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcroStoreBo
* @description: 汇出清算 bo
* @author: huangshunlin
* @create: 2024-10-17 22:37
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtcroStoreBo extends BaseTransactionVo {
//Direct payment one message (max=1)
private String dirindflg = NULLSTR;
//Which MT to beneficiary institution (max=3)
private String sftmt = NULLSTR;
//Message Init Flag (max=1)
private String msgflg = NULLSTR;
//21 TAG for MTs (max=16)
private String tag21 = NULLSTR;
//Amount (scale=3)
private BigDecimal amt32 = new BigDecimal("0.00");
//Amount (scale=3)
private BigDecimal amt33 = new BigDecimal("0.00");
//Currency (max=3)
private String cur32 = NULLSTR;
//Currency (max=3)
private String cur33 = NULLSTR;
//valdat in tag 32
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dat32;
//valdat in tag 33
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dat33;
//swift tag 71B (max=35)
private String tag71b = NULLSTR;
//II_BIC in MTs (max=12)
private String ownbic = NULLSTR;
//Tag 999 (max=65)
private String tag999 = NULLSTR;
//Status I-INCOMING, O-OUTGOING, N-NOTNEED (max=1)
private String clrsta = NULLSTR;
private Crdgrp crdgrp;
private Crtmod crtmod;
private Trn cretrn;
private Smh cresmh;
private Smh bndsmh;
private Gle spcgle;
private Act pacact;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
if (crtmod == null) {
crtmod = new Crtmod();
}
crtmod.reset();
if (cretrn == null) {
cretrn = new Trn();
}
if (cresmh == null) {
cresmh = new Smh();
}
if (bndsmh == null) {
bndsmh = new Smh();
}
if (spcgle == null) {
spcgle = new Gle();
}
if (pacact == null) {
pacact = new Act();
}
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: CrtctfStoreBo
* @description: 转汇清算 bo
* @author: huangshunlin
* @create: 2024-10-16 21:44
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtctfStoreBo extends BaseTransactionVo {
private Crdgrp crdgrp;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
}
}
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.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: FxtsqoStoreBo
* @description: 即期结售汇报价bo
* @author: huangshunlin
* @create: 2024-10-18 15:51
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtsqoStoreBo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
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();
}
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.CrtcriStoreBo;
import com.brilliance.isc.funds.vo.funds.CrtcriStoreVo;
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: CrtcriStructMapper
* @description: 汇入清算 Crtcri Bo、Vo之间的转换处理类。如果有很复杂的函数,则可以用适配器模式重写
* @author: huangshunlin
* @create: 2024-10-16 20:30
*/
@Mapper(componentModel = "spring")
public interface CrtcriStructMapper extends IBaseStructMapper<CrtcriStoreBo, CrtcriStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
CrtcriStructMapper INSTANCE = Mappers.getMapper(CrtcriStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
CrtcriStoreBo voTransferToBo(CrtcriStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(CrtcriStoreVo vo, @MappingTarget CrtcriStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
CrtcriStoreVo boTransferToVo(CrtcriStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(CrtcriStoreBo bo, @MappingTarget CrtcriStoreVo vo);
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.CrtcroStoreBo;
import com.brilliance.isc.funds.vo.funds.CrtcroStoreVo;
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: CrtcroStructMapper
* @description: 汇出清算 Crtcro Bo、Vo之间的转换处理类。如果有很复杂的函数,则可以用适配器模式重写
* @author: huangshunlin
* @create: 2024-10-16 20:30
*/
@Mapper(componentModel = "spring")
public interface CrtcroStructMapper extends IBaseStructMapper<CrtcroStoreBo, CrtcroStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
CrtcroStructMapper INSTANCE = Mappers.getMapper(CrtcroStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
CrtcroStoreBo voTransferToBo(CrtcroStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(CrtcroStoreVo vo, @MappingTarget CrtcroStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
CrtcroStoreVo boTransferToVo(CrtcroStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(CrtcroStoreBo bo, @MappingTarget CrtcroStoreVo vo);
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.CrtctfStoreBo;
import com.brilliance.isc.funds.vo.funds.CrtctfStoreVo;
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: CrtctfStructMapper
* @description: 转汇清算 Crtctf Bo、Vo之间的转换处理类。如果有很复杂的函数,则可以用适配器模式重写
* @author: huangshunlin
* @create: 2024-10-16 21:44
*/
@Mapper(componentModel = "spring")
public interface CrtctfStructMapper extends IBaseStructMapper<CrtctfStoreBo, CrtctfStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
CrtctfStructMapper INSTANCE = Mappers.getMapper(CrtctfStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
CrtctfStoreBo voTransferToBo(CrtctfStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(CrtctfStoreVo vo, @MappingTarget CrtctfStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
CrtctfStoreVo boTransferToVo(CrtctfStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(CrtctfStoreBo bo, @MappingTarget CrtctfStoreVo vo);
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.FxtsqoStoreBo;
import com.brilliance.isc.funds.vo.funds.FxtsqoStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;
/**
* @program: isc-funds
* @ClassName: FxtsqoStructMapper
* @description: 即期结售汇报价 转换Fxtsqo Bo、Vo之间的转换处理类。如果有很复杂的函数,则可以用适配器模式重写
* @author: huangshunlin
* @create: 2024-10-18 15:27
*/
@Mapper(componentModel = "spring")
public interface FxtsqoStructMapper extends IBaseStructMapper<FxtsqoStoreBo, FxtsqoStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FxtsqoStructMapper INSTANCE = Mappers.getMapper(FxtsqoStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FxtsqoStoreBo voTransferToBo(FxtsqoStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
void voUpdateToBo(FxtsqoStoreVo vo, @MappingTarget FxtsqoStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FxtsqoStoreVo boTransferToVo(FxtsqoStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FxtsqoStoreBo bo, @MappingTarget FxtsqoStoreVo vo);
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Smh;
import com.brilliance.isc.bo.Spt;
import com.brilliance.isc.bo.model.Cpdgrp;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.bo.model.Crtp;
import com.brilliance.isc.common.nosmod.vo.Nosmod;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.vo.model.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcriStoreVo
* @description: 汇入清算 bo
* @author: huangshunlin
* @create: 2024-10-16 20:26
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtcriStoreVo extends BaseTransactionVo {
//Status I-INCOMING, O-OUTGOING, N-NOTNEED (max=1)
private String clrsta = NULLSTR;
//Object Type of Associated Contract Optional (max=6)
private String rcvobjtyp = NULLSTR;
private Crdgrp crdgrp;
private Crtp crtp;
private Smh smh;
private Smh corsmh;
private Act sndact;
private Act aplact;
private Act rcvact;
private Spt crtspt;
private Bodgrp bodgrp;
private Ccdgrp ccdgrp;
private Bedgrp bedgrp;
private Ledgrp ledgrp;
private Btdgrp btdgrp;
private Ltdgrp ltdgrp;
private Gidgrp gidgrp;
// private Cldgrp cldgrp;
private Cpdgrp cpdgrp;
private Nosmod nosmod;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
if (crtp == null) {
crtp = new Crtp();
}
crtp.reset();
if (smh == null) {
smh = new Smh();
}
if (corsmh == null) {
corsmh = new Smh();
}
if (sndact == null) {
sndact = new Act();
}
if (aplact == null) {
aplact = new Act();
}
if (rcvact == null) {
rcvact = new Act();
}
if (crtspt == null) {
crtspt = new Spt();
}
if (bodgrp == null) {
bodgrp = new Bodgrp();
}
bodgrp.reset();
if (ccdgrp == null) {
ccdgrp = new Ccdgrp();
}
ccdgrp.reset();
if (bedgrp == null) {
bedgrp = new Bedgrp();
}
bedgrp.reset();
if (ledgrp == null) {
ledgrp = new Ledgrp();
}
ledgrp.reset();
if (btdgrp == null) {
btdgrp = new Btdgrp();
}
btdgrp.reset();
if (ltdgrp == null) {
ltdgrp = new Ltdgrp();
}
ltdgrp.reset();
if (gidgrp == null) {
gidgrp = new Gidgrp();
}
gidgrp.reset();
if (cpdgrp == null) {
cpdgrp = new Cpdgrp();
}
cpdgrp.reset();
// private Cldgrp cldgrp;
if (nosmod == null) {
nosmod = new Nosmod();
}
nosmod.reset();
}
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Gle;
import com.brilliance.isc.bo.Smh;
import com.brilliance.isc.bo.Trn;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.bo.model.Crtmod;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
* @ClassName: CrtcriStoreVo
* @description: 汇出清算 bo
* @author: huangshunlin
* @create: 2024-10-17 22:33
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtcroStoreVo extends BaseTransactionVo {
//Direct payment one message (max=1)
private String dirindflg = NULLSTR;
//Which MT to beneficiary institution (max=3)
private String sftmt = NULLSTR;
//Message Init Flag (max=1)
private String msgflg = NULLSTR;
//21 TAG for MTs (max=16)
private String tag21 = NULLSTR;
//Amount (scale=3)
private BigDecimal amt32 = new BigDecimal("0.00");
//Amount (scale=3)
private BigDecimal amt33 = new BigDecimal("0.00");
//Currency (max=3)
private String cur32 = NULLSTR;
//Currency (max=3)
private String cur33 = NULLSTR;
//valdat in tag 32
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dat32;
//valdat in tag 33
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date dat33;
//swift tag 71B (max=35)
private String tag71b = NULLSTR;
//II_BIC in MTs (max=12)
private String ownbic = NULLSTR;
//Tag 999 (max=65)
private String tag999 = NULLSTR;
//Status I-INCOMING, O-OUTGOING, N-NOTNEED (max=1)
private String clrsta = NULLSTR;
private Crdgrp crdgrp;
private Crtmod crtmod;
private Trn cretrn;
private Smh cresmh;
private Smh bndsmh;
private Gle spcgle;
private Act pacact;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
if (crtmod == null) {
crtmod = new Crtmod();
}
crtmod.reset();
if (cretrn == null) {
cretrn = new Trn();
}
if (cresmh == null) {
cresmh = new Smh();
}
if (bndsmh == null) {
bndsmh = new Smh();
}
if (spcgle == null) {
spcgle = new Gle();
}
if (pacact == null) {
pacact = new Act();
}
}
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: CrtctfStoreVo
* @description: 转汇清算 bo
* @author: huangshunlin
* @create: 2024-10-16 21:43
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class CrtctfStoreVo extends BaseTransactionVo {
private Crdgrp crdgrp;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
}
crdgrp.reset();
}
}
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: FxtsqoStoreVo
* @description: 即期结售汇 报价 bo
* @author: huangshunlin
* @create: 2024-10-18 15:26
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtsqoStoreVo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
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