Commit f70e2d2f by zhoujunpeng

Merge remote-tracking branch 'origin/develop' into develop

parents 51b4b6f9 bee1ec8e
......@@ -37,4 +37,5 @@ build/
workroot/log
workroot/DUMP
\ No newline at end of file
workroot/DUMP
logs/*
......@@ -10,3 +10,4 @@ funds_fxtfop_000000=Foreign Exchange Liquidation
funds_fxtfcn_CT000009=Foreign Exchange Liquidation
0136=This contract is overdrawn by {0}
funds_crtcri_000000=Clearing in
funds_crtcr0_000000=付款清算
......@@ -13,3 +13,4 @@ funds_fxtfcn_CT000009=Foreign Exchange Liquidation
fttfcm=资金拆借到期提示:
funds_crtcri_000000=Clearing in
funds_crtcr0_000000=
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.bo.model.*;
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.transaction.vo.BaseTransactionVo;
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.mda.dao.*;
import com.brilliance.isc.vo.TrncodVo;
import com.brilliance.mda.runtime.mda.Constants;
import com.brilliance.mda.runtime.mda.IStream;
......@@ -28,9 +26,9 @@ 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 javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.*;
......@@ -46,25 +44,58 @@ import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component
public class CrToolComponent {
@Autowired
@Resource
private CrdMapper crdMapper;
@Autowired
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Autowired
@Resource
private CbsmodService cbsmodService;
@Autowired
@Resource
private SysmodService sysmodService;
@Autowired
@Resource
private TrnmodService trnmodService;
@Autowired
@Resource
private BchMapper bchMapper;
@Resource
private CpdMapper cpdMapper;
@Resource
private CptMapper cptMapper;
@Resource
private CndMapper cndMapper;
@Resource
private BcdMapper bcdMapper;
@Resource
private BctMapper bctMapper;
@Resource
private BrdMapper brdMapper;
@Resource
private BrtMapper brtMapper;
@Resource
private LidMapper lidMapper;
@Resource
private LitMapper litMapper;
@Resource
private GidMapper gidMapper;
@Resource
private GitMapper gitMapper;
public Crdgrp getCrdgrpByInr(String inr) {
Crd rec = new Crd();
rec.setInr(inr);
......@@ -238,7 +269,7 @@ public class CrToolComponent {
/**
* source:crtmod.0003.script
*/
public void saveClearingEntry(Crtmod crtmod, TrnmodVo trnmodVo) {
public void saveClearingEntry(Crtmod crtmod, TrnmodVo trnmodVo, BaseTransactionVo bo) {
trnmodVo.reset();
crtmod.reset();
// 根据AutoRegistration创造
......@@ -247,7 +278,7 @@ public class CrToolComponent {
return;
}
//crdgrp
Crdgrp argGrp = crtmod.getCrdgrp();
Crdgrp argGrp = Utils.getFieldValue(bo,"crdgrp");
String argGrpPath = Strings.getLine(parstm, 1);
String argFrm = Strings.getLine(parstm, 2);
String argTxt = Strings.getLine(parstm, 3);
......@@ -321,4 +352,149 @@ public class CrToolComponent {
Streams.streamInsert(parstm, 0, argTxt);
}
public Cpdgrp getCpdgrpByInr(String inr) {
Cpd cpd = new Cpd();
cpd.setInr(inr);
cpd = cpdMapper.selectByPrimaryKey(cpd);
if (cpd == null) {
throw new CommonServiceException("主键" + inr + "找不到CPD数据");
}
Cpdgrp cpdgrp = new Cpdgrp();
cpdgrp.reset();
cpdgrp.setRec(cpd);
Cpt cpt = new Cpt();
cpt.setInr(inr);
cpt = cptMapper.selectByPrimaryKey(cpt);
cpdgrp.setBlk(cpt);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(cpdgrp.getCbs().getMax(), "CPD", inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(cpdgrp.getCbs().getNom1(), "CPD", inr, "NOMSUM", "AMT1", date);
//获取ptspta信息
storePtsToGrp(cpdgrp, inr, "CPD");
//获取cnd信息
getCndInfo(cpdgrp, inr, "CPD");
return cpdgrp;
}
public void getCndInfo(Cpdgrp cpdgrp, String objInr, String objType) {
List<Cnd> cnds = cndMapper.selectByObjtypAndObjinr(objType, objInr);
if (!MdaUtils.isEmpty(cnds)) {
cpdgrp.setPyebchkey(cnds.get(0).getPyebchkey());
cpdgrp.setPyebchnam(cnds.get(0).getPyebchnam());
}
}
public Bcdgrp getBcdgrpByInr(String inr) {
Bcd rec = new Bcd();
rec.setInr(inr);
rec = bcdMapper.selectByPrimaryKey(rec);
if (rec == null) {
throw new CommonServiceException("主键" + inr + "找不到BCD数据");
}
String objtyp = "BCD";
Bcdgrp bcdgrp = new Bcdgrp();
bcdgrp.reset();
bcdgrp.setRec(rec);
Bct blk = new Bct();
blk.setInr(inr);
blk = bctMapper.selectByPrimaryKey(blk);
bcdgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(bcdgrp.getCbs().getMax(), objtyp, inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(bcdgrp.getCbs().getOpn1(), objtyp, inr, "OPN", "AMT1", date);
//获取ptspta信息
storePtsToGrp(bcdgrp, inr, objtyp);
return bcdgrp;
}
public Brdgrp getBrdgrpByInr(String inr) {
Brd rec = new Brd();
rec.setInr(inr);
rec = brdMapper.selectByPrimaryKey(rec);
if (rec == null) {
throw new CommonServiceException("主键" + inr + "找不到BRD数据");
}
String objtyp = "BRD";
Brdgrp brdgrp = new Brdgrp();
brdgrp.reset();
brdgrp.setRec(rec);
Brt blk = new Brt();
blk.setInr(inr);
blk = brtMapper.selectByPrimaryKey(blk);
brdgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(brdgrp.getCbs().getMax(), objtyp, inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(brdgrp.getCbs().getOpn1(), objtyp, inr, "OPN", "AMT1", date);
//getAamCbsPerDate MAX2/OPN2
cbsmodService.cbsGetBalance(brdgrp.getCbs().getMax2(), objtyp, inr, "MAXSUM", "AMT2", date);
cbsmodService.cbsGetBalance(brdgrp.getCbs().getOpn2(), objtyp, inr, "OPN", "AMT2", date);
//获取ptspta信息
storePtsToGrp(brdgrp, inr, objtyp);
return brdgrp;
}
public Lidgrp getLidgrpByInr(String inr) {
Lid rec = new Lid();
rec.setInr(inr);
rec = lidMapper.selectByPrimaryKey(rec);
if (rec == null) {
throw new CommonServiceException("主键" + inr + "找不到LID数据");
}
String objtyp = "LID";
Lidgrp lidgrp = new Lidgrp();
lidgrp.reset();
lidgrp.setRec(rec);
Lit blk = new Lit();
blk.setInr(inr);
blk = litMapper.selectByPrimaryKey(blk);
lidgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(lidgrp.getCbs().getMax(), objtyp, inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(lidgrp.getCbs().getNom1(), objtyp, inr, "NOMSUM", "AMT1", date);
cbsmodService.cbsGetBalance(lidgrp.getCbs().getOpn1(), objtyp, inr, "OPN", "AMT1", date);
//getAamCbsPerDate MAX2/OPN2
cbsmodService.cbsGetBalance(lidgrp.getCbs().getMax2(), objtyp, inr, "MAXSUM", "AMT2", date);
cbsmodService.cbsGetBalance(lidgrp.getCbs().getOpn2(), objtyp, inr, "OPN", "AMT2", date);
//获取ptspta信息
storePtsToGrp(lidgrp, inr, objtyp);
return lidgrp;
}
public Gidgrp getGidgrpByInr(String inr) {
Gid rec = new Gid();
rec.setInr(inr);
rec = gidMapper.selectByPrimaryKey(rec);
if (rec == null) {
throw new CommonServiceException("主键" + inr + "找不到GID数据");
}
String objtyp = "GID";
Gidgrp gidgrp = new Gidgrp();
gidgrp.reset();
gidgrp.setRec(rec);
Git blk = new Git();
blk.setInr(inr);
blk = gitMapper.selectByPrimaryKey(blk);
gidgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(gidgrp.getCbs().getMax(), objtyp, inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(gidgrp.getCbs().getOpn1(), objtyp, inr, "OPN", "AMT1", date);
cbsmodService.cbsGetBalance(gidgrp.getCbs().getCnf(), objtyp, inr, "CNFSUM", "AMT1", date);
//getAamCbsPerDate MAX2/OPN2
cbsmodService.cbsGetBalance(gidgrp.getCbs().getMax2(), objtyp, inr, "MAXSUM", "AMT2", date);
cbsmodService.cbsGetBalance(gidgrp.getCbs().getOpn2(), objtyp, inr, "OPN", "AMT2", date);
//获取ptspta信息
storePtsToGrp(gidgrp, inr, objtyp);
return gidgrp;
}
}
package com.brilliance.isc.funds.common.component;
import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.vo.model.CbbVo;
import com.brilliance.isc.bo.Cnd;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Ftt;
import com.brilliance.isc.vo.model.FtdVo;
import com.brilliance.isc.vo.model.FttVo;
import com.brilliance.isc.bo.model.*;
import com.brilliance.isc.vo.model.*;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.exception.CommonServiceException;
......
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.diary.controller.AbstractDiaryController;
import com.brilliance.isc.common.api.diary.vo.DiaryRequestVo;
import com.brilliance.isc.common.api.diary.vo.DiaryResponseVo;
import com.brilliance.isc.common.trndia.vo.DiaVo;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Diary组件
*/
@RestController
@RequestMapping("/crd")
public class CrdDiaryController extends AbstractDiaryController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 试算备忘录入口
*
* @param diaryRequestVo
* @return
*/
@RequestMapping("/trndia/calcDiaries")
@Override
public ResponseSet<DiaryResponseVo> calcDiaries(@RequestBody DiaryRequestVo<CrdBizInfoVo, CrdBizAmdInfoVo> diaryRequestVo) {
return super.calcDiaries(diaryRequestVo);
}
/**
* 计算备忘录状态入口
*
* @param diaVo
* @return
*/
@RequestMapping("/trndia/calculateDiamodflg")
@Override
public ResponseSet<String> calculateDiamodflg(@RequestBody DiaVo diaVo) {
return super.calculateDiamodflg(diaVo);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.fee.controller.AbstractFeeDetailController;
import com.brilliance.isc.common.api.fee.vo.FeeDetailRequestVo;
import com.brilliance.isc.common.api.fee.vo.FeeDetailResponseVo;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 费用组件
*/
@RestController
@RequestMapping("/crd")
public class CrdFeeDetailController extends AbstractFeeDetailController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 试算费用入口
*
* @param feeDetailRequestVo
* @return
*/
@RequestMapping("/setmod/calcFeeDetail")
@Override
public ResponseSet<FeeDetailResponseVo> calcFeeDetail(@RequestBody FeeDetailRequestVo<CrdBizInfoVo, CrdBizAmdInfoVo> feeDetailRequestVo) {
return super.calcFeeDetail(feeDetailRequestVo);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.gle.controller.AbstractGleController;
import com.brilliance.isc.common.api.gle.vo.GlentryRequest;
import com.brilliance.isc.common.api.gle.vo.GlentryResponse;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 会计分录组件
*/
@RestController
@RequestMapping("/crd")
public class CrdGleController extends AbstractGleController<CrdBizInfoVo> {
/**
* 会计分录试算入口
*
* @param glentryRequest
* @return ResponseSet<GlentryResponse>
*/
@RequestMapping("/gle/assertGle")
@Override
public ResponseSet<GlentryResponse> generateGlentry(@RequestBody GlentryRequest<CrdBizInfoVo> glentryRequest) {
return super.generateGlentry(glentryRequest);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.liaall.controller.AbstractLiaallController;
import com.brilliance.isc.common.api.liaall.vo.LiaallRequest;
import com.brilliance.isc.common.api.liaall.vo.LiaallResponse;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 表外记账组件
*/
@RestController
@RequestMapping("/crd")
public class CrdLiaallController extends AbstractLiaallController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 表外记账试算服务
*
* @param liaallRequest
* @return
*/
@RequestMapping("/liaall/assertLiaall")
@Override
public ResponseSet<LiaallResponse> calcLiaall(@RequestBody LiaallRequest<CrdBizInfoVo, CrdBizAmdInfoVo> liaallRequest) {
return super.calcLiaall(liaallRequest);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.lim.controller.AbstractLimController;
import com.brilliance.isc.common.api.lim.vo.LimRequest;
import com.brilliance.isc.common.api.lim.vo.LimResponse;
import com.brilliance.isc.common.api.lim.vo.YapinRequest;
import com.brilliance.isc.common.api.lim.vo.YapinResponse;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 额度组件
*/
@RestController
@RequestMapping("/crd")
public class CrdLimController extends AbstractLimController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 额度初始化
*
* @param limRequest
* @return
*/
@RequestMapping("/lim/limInit")
@Override
public ResponseSet<LimResponse> limInit(@RequestBody LimRequest<CrdBizInfoVo, CrdBizAmdInfoVo> limRequest) {
return super.limInit(limRequest);
}
/**
* 额度查询入口
*
* @param limRequest
* @return
*/
@RequestMapping("/lim/limQuery")
@Override
public ResponseSet<LimResponse> limQuery(@RequestBody LimRequest<CrdBizInfoVo, CrdBizAmdInfoVo> limRequest) {
return super.limQuery(limRequest);
}
/**
* 额度试算入口
*
* @param limRequest
* @return
*/
@RequestMapping("/lim/limPreCal")
@Override
public ResponseSet<LimResponse> limPreCal(@RequestBody LimRequest<CrdBizInfoVo, CrdBizAmdInfoVo> limRequest) {
return super.limPreCal(limRequest);
}
/**
* 转授权查询
*
* @param limRequest
* @return
*/
@RequestMapping("/lim/limZsqQuery")
@Override
public ResponseSet<LimResponse> limZsqQuery(@RequestBody LimRequest<CrdBizInfoVo, CrdBizAmdInfoVo> limRequest) {
return super.limZsqQuery(limRequest);
}
@RequestMapping("/lim/yapinQuery")
public ResponseSet<YapinResponse> yapinQuery(@RequestBody YapinRequest<CrdBizInfoVo, CrdBizAmdInfoVo> yapinRequest) {
return super.yapinQuery(yapinRequest);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.settle.controller.AbstractSettleDetailController;
import com.brilliance.isc.common.api.settle.vo.AccountRequestVo;
import com.brilliance.isc.common.api.settle.vo.AccountResponseVo;
import com.brilliance.isc.common.api.settle.vo.SettleDetailRequestVo;
import com.brilliance.isc.common.api.settle.vo.SettleDetailResponseVo;
import com.brilliance.isc.common.setgll.vo.SetgllVo;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 账务组件
*/
@RestController
@RequestMapping("/crd")
public class CrdSettleDetailController extends AbstractSettleDetailController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 试算账务入口
*
* @param settleDetailRequestVo
* @return
*/
@RequestMapping("/setmod/calcSettleDetail")
@Override
public ResponseSet<SettleDetailResponseVo> calcSettleDetail(@RequestBody SettleDetailRequestVo<CrdBizInfoVo, CrdBizAmdInfoVo> settleDetailRequestVo) {
return super.calcSettleDetail(settleDetailRequestVo);
}
/**
* 获取核心账户信息
*
* @param accountRequestVo
* @return
*/
@RequestMapping("/getCoreAcctInfo")
@Override
public ResponseSet<AccountResponseVo> getCoreAccountCode(@RequestBody AccountRequestVo accountRequestVo) {
return super.getCoreAccountCode(accountRequestVo);
}
/**
* 获取账户信息
*
* @param setgllVo
* @return
*/
@RequestMapping("/getAcctInfo")
@Override
public ResponseSet<SetgllVo> getAcctInfo(@RequestBody SetgllVo setgllVo) {
return super.getAcctInfo(setgllVo);
}
}
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.common.api.trndoc.controller.AbstractTrndocController;
import com.brilliance.isc.common.api.trndoc.vo.TrndocRequest;
import com.brilliance.isc.common.api.trndoc.vo.TrndocResponse;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.funds.CrdBizAmdInfoVo;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.Map;
/**
* 报文面函组件
*/
@RestController
@RequestMapping("/crd")
public class CrdTrndocController extends AbstractTrndocController<CrdBizInfoVo, CrdBizAmdInfoVo> {
/**
* 面函报文试算入口
*
* @param trndoc
* @return
*/
@RequestMapping("/docpan/assertTrndoc")
@Override
public ResponseSet<TrndocResponse> assertTrndoc(@RequestBody TrndocRequest<CrdBizInfoVo, CrdBizAmdInfoVo> trndoc) {
return super.assertTrndoc(trndoc);
}
/**
* 面函报文预览功能
*
* @param paramMap
* @return
* @throws IOException
*/
@RequestMapping("/docpan/showDOCS")
@Override
public ResponseSet<TrndocResponse> showDOCS(@RequestBody Map<String, Object> paramMap) throws IOException {
return super.showDOCS(paramMap);
}
}
package com.brilliance.isc.funds.common.register.cci;
import com.brilliance.isc.bo.Cci;
import com.brilliance.isc.bo.Pts;
import com.brilliance.isc.common.register.cci.CliBanInfo;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.PtsMapper;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Component("CRD.cciRegister")
public class CrdCliBanInfo implements CliBanInfo {
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private PtsMapper ptsMapper;
/**
* source:crdlod.0004.script
*/
@Override
public void buildValue(String objinr, String objtyp, List<PtsptaVo> ptsptaVos, Cci cci) {
//getCrdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
for (PtsptaVo ptsptaVo : ptsptaVos) {
ptsList.add(ptsptaVo.getPts());
}
}
if (CollectionUtils.isEmpty(ptsList)) {
return;
}
//! Defines role of the bank and the customer of the passed contract and PTAINR of the role as well
//! The passed contract has to be loaded completely
// role can be set dynamically dependent on the contract context
cci.setCcicusrol("APL");
Optional<Pts> optionalPts = ptsList.stream().filter(pts -> cci.getCcicusrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts.isPresent()) {
cci.setCcicusptainr(optionalPts.get().getPtainr());
}
cci.setCcibanrol("SND");
Optional<Pts> optionalPts2 = ptsList.stream().filter(pts -> cci.getCcibanrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts2.isPresent()) {
cci.setCcibanptainr(optionalPts2.get().getPtainr());
}
}
}
package com.brilliance.isc.funds.common.register.cci;
import com.brilliance.isc.bo.Cci;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Pts;
import com.brilliance.isc.common.register.cci.CliBanInfo;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.FtdMapper;
import com.brilliance.isc.mda.dao.PtsMapper;
import com.brilliance.mda.runtime.mda.impl.Argument;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
@Component("FTD.cciRegister")
public class FtdCliBanInfo implements CliBanInfo{
public class FtdCliBanInfo implements CliBanInfo {
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private PtsMapper ptsMapper;
@Resource
private FtdMapper ftdMapper;
/**
* source:ftdlod.0006.script
*/
@Override
public void buildValue(String objinr, String objtyp, List<PtsptaVo> ptsptaVos, Cci cci) {
//getFxdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
for (PtsptaVo ptsptaVo : ptsptaVos) {
ptsList.add(ptsptaVo.getPts());
}
}
if (CollectionUtils.isEmpty(ptsList)) {
return;
}
//! Defines role of the bank and the customer of the passed contract and PTAINR of the role as well
//! The passed contract has to be loaded completely
// role can be set dynamically dependent on the contract context
cci.setCcicusrol("APL");
Optional<Pts> optionalPts = ptsList.stream().filter(pts -> cci.getCcicusrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts.isPresent()) {
cci.setCcicusptainr(optionalPts.get().getPtainr());
}
cci.setCcibanptainr("");
cci.setCcibanrol("");
//getFtdCliBanInfo
List<Pts> ptsList = ptsMapper.getPtsByObjInrTyp(objinr, objtyp);
if (CollectionUtils.isEmpty(ptsList)) {
ptsList = new ArrayList<>();
for (PtsptaVo ptsptaVo : ptsptaVos) {
ptsList.add(ptsptaVo.getPts());
}
}
if (CollectionUtils.isEmpty(ptsList)) {
return;
}
//! Defines role of the bank and the customer of the passed contract and PTAINR of the role as well
//! The passed contract has to be loaded completely
// role can be set dynamically dependent on the contract context
Ftd ftd=ftdMapper.selectByInr(objinr);
switch(ftd.getFttyp() )
{
case "LI":
case "DI":
cci.setCcicusrol("TRO");
break;
case "LO":
case "DO":
cci.setCcicusrol("TRi");
break;
case "PT":
cci.setCcicusrol("TRO");
break;
default:
}
Optional<Pts> optionalPts = ptsList.stream().filter(pts -> cci.getCcicusrol().equalsIgnoreCase(pts.getRol())).findFirst();
if (optionalPts.isPresent()) {
cci.setCcicusptainr(optionalPts.get().getPtainr());
}
cci.setCcibanptainr("");
cci.setCcibanrol("");
}
}
......@@ -10,15 +10,16 @@ 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.mda.dao.ActMapper;
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 java.util.Objects;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
......@@ -46,7 +47,11 @@ public class CrtcriSettleRegister implements ISettleRegister {
@Resource(name = "crtcri.transaction")
CrtcriTransactionServiceImpl fxtsssTransactionService;
CrtcriTransactionServiceImpl crtcriTransactionService;
@Autowired
private ActMapper actMapper;
@Override
public void registerSettlement(SetmodVo setmodVo) {
......@@ -71,13 +76,11 @@ public class CrtcriSettleRegister implements ISettleRegister {
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";
}
if (ptsptaToolComponent.ptsIsRolSet(ptsList, "ACC")) {
rol = "ACC";
} else {
rol = "SND";
}
String dbtKey = setmodService.setGlgAmt(setmodVo, "TRN", rol, setmodVo.getDoccur(), maxAmt, "");
......@@ -86,18 +89,22 @@ public class CrtcriSettleRegister implements ISettleRegister {
} else {
// this.getTrnmod().getTrnism().setDefDsp(rol, "D", "NOD" + CR + "VOD");
}
Act rcvact = new Act();
String act = rec.getRcvactExtkey();
Act rcvact = null;
if (MdaUtils.isEmpty(rec.getRcvactInr()) && !MdaUtils.isEmpty(rec.getRcvbchinr())) {
if (MdaUtils.compareTo(rec.getCustyp(), "1") == 0) {
// 对私
rcvact = fxtsssTransactionService.readClearingAct("SP-RIP", rec.getRcvbchinr(), maxCur);
rcvact = crtcriTransactionService.readClearingAct("SP-RIP", rec.getRcvbchinr(), maxCur);
} else {
// 对公
rcvact = fxtsssTransactionService.readClearingAct("SP-RIC", rec.getRcvbchinr(), maxCur);
rcvact = crtcriTransactionService.readClearingAct("SP-RIC", rec.getRcvbchinr(), maxCur);
}
}
if (Objects.nonNull(rcvact)) {
act = rcvact.getExtkey();
}
String cdtKey = setglgService.setglgAddAmount(setglg, "TRN", "OWN", setmodVo.getDoccur(), maxAmt.negate(),
"", "SPC", "A", rcvact.getExtkey(), "");
"", "SPC", "A", act, "");
setmodVo.setFeeclirol(rol);
setmodService.setglgAllValDat(setmodVo, rec.getOpndat(), "D");
}
......
......@@ -2,11 +2,13 @@ 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.bo.funds.CrtcriStoreBo;
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 com.brilliance.mda.runtime.mda.CodetableItem;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @program: isc-funds
......@@ -49,10 +52,21 @@ public class CrtcriResource extends AbstractTransactionController<CrtcriStoreVo>
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody CrtcriStoreVo crtcriStoreVo) {
String ref = crtcriTransactionService.getRef(crtcriStoreVo);
CrtcriStoreBo crtcriStoreBo = crtcriStructMapper.voTransferToBo(crtcriStoreVo);
String ref = crtcriTransactionService.getRef(crtcriStoreBo);
return ResponseSet.simpleSuccess(ref);
}
/**
* 获取业务经办机构
*
* @return
*/
@PostMapping("/getBranchCodeValue")
public Object getBranchCodeValue() {
List<CodetableItem> list = crtcriTransactionService.getBranchCodeValue();
return ResponseSet.simpleSuccess(list);
}
}
......@@ -3,17 +3,16 @@ 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.bo.model.Crtp;
import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.cache.pty.PtyCacheService;
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;
......@@ -30,9 +29,9 @@ 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.isc.vo.funds.CrdBizInfoVo;
import com.brilliance.mda.runtime.mda.CodetableItem;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
......@@ -46,9 +45,11 @@ import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
......@@ -69,8 +70,6 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
@Resource
private CrtcriValidator crtcriValidator;
@Resource
private XrtmodService xrtmodService;
@Resource
private SysmodService sysmodService;
......@@ -90,8 +89,6 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
......@@ -99,12 +96,6 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
@Resource
private BchService bchService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private SetmodService setmodService;
@Resource
private ActMapper actMapper;
......@@ -134,9 +125,15 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
@Resource
private PublicMapper publicMapper;
@Autowired
@Resource
private NosmodService nosmodService;
@Resource
private PtyCacheService ptyCacheService;
@Resource
private CrtpService crtpService;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
......@@ -208,8 +205,20 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
@Override
protected BizInfoVo buildBizInfo(CrtcriStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
Crd rec = transactionVo.getCrdgrp().getRec();
Crtp crtp = transactionVo.getCrtp();
CrdBizInfoVo bizInfoVo = new CrdBizInfoVo();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setObjtyp("CRD");
bizInfoVo.setForare(crtp.getForare());
bizInfoVo.setOpndat(rec.getOpndat());
bizInfoVo.setRcvbchinr(rec.getRcvbchinr());
bizInfoVo.setCustyp(rec.getCustyp());
bizInfoVo.setRcvactInr(transactionVo.getRcvact().getInr());
bizInfoVo.setRcvactExtkey(transactionVo.getRcvact().getExtkey());
bizInfoVo.setRcvobjtyp(rec.getRcvobjtyp());
Cpd cpd = transactionVo.getCpdgrp().getRec();
bizInfoVo.setValdat(cpd.getValdat());
return bizInfoVo;
}
......@@ -236,7 +245,7 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
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().setMsgact(bo.getSpt().getAct59());
bo.getCrdgrp().getRec().setMsgref(bo.getSpt().getObjref());
bo.getCrdgrp().getRec().setClrtyp("I");
bo.getCrdgrp().getRec().setTrntyp("A");
......@@ -251,7 +260,7 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
bo.getCrdgrp().getRec().setErrmsg("根据主键" + bo.getSpt().getSmhinr() + "未找到表记录");
} else {
bo.setSmh(smh);
// bo.getCrdgrp().getRec().setRcvbic(bo.getSmh().getRcvkey());
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())) {
......@@ -270,7 +279,8 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
}
}
} else {
MdaUtils.clear(bo.getCorsmh());
// MdaUtils.clear(bo.getCorsmh());
bo.setCorsmh(new Smh());
}
}
if (MdaUtils.isEmpty(bo.getCrdgrp().getRec().getSta())) {
......@@ -300,6 +310,9 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
*/
private void init950(CrtcriStoreBo crtcriStoreBo) {
crtcriStoreBo.setClrsta("I");
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
crtcriStoreBo.getCrdgrp().getRec().setOwnusr(extkey);
defaultCrdgrpRecCustypN1000(crtcriStoreBo);
}
@Override
......@@ -322,31 +335,17 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
}
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;
public String getRef(CrtcriStoreBo bo) {
bo.reset();
if (Objects.isNull(SettleContext.getUserSession().getWrkbch()) || StringUtils.isEmpty(SettleContext.getUserSession().getWrkbch().getInr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Crdgrp crdgrp = crtcriStoreVo.getCrdgrp();
Crdgrp crdgrp = bo.getCrdgrp();
crToolComponent.getref(crdgrp);
return crdgrp.getRec().getOwnref();
}
private SetmodVo buildSetmodVo(CrtcriStoreVo vo) {
SetmodVo setmodVo = new SetmodVo();
return setmodVo;
}
/**
* source:crtcri.0008.script
......@@ -357,7 +356,16 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
* @return
*/
public Act readClearingAct(String trmTyp, String bchInr, String cur) {
String sql = "select * from act WHERE HOLPTYINR = (SELECT PTYINR FROM BCH WHERE INR = '" + bchInr
// 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'";
Bch bch = new Bch();
bch.setInr(bchInr);
Bch dbBch = bchMapper.selectByPrimaryKey(bch);
if (Objects.isNull(dbBch)) {
return new Act();
}
String sql = "select * from act WHERE HOLPTYINR in (SELECT inr FROM pty WHERE extkey = '" + dbBch.getSwfcod()
+ "') AND (CUR = ' ' OR CUR = '" + cur + "') AND TRMTYP = '"
+ trmTyp + "' AND ACCTYP = 'O'";
List<Act> actList = actMapper.dyncRead(ImmutableBiMap.of("sql", sql));
......@@ -368,7 +376,8 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
int pos = Strings.pos(rcvact.getExtkey(), "A");
if (pos > 0) {
// text = Codetables.getCodeValueText(bo.getCrdgrp().getRec(), "rcvbchinr", bo.getCrdgrp().getRec().getRcvbchinr());
String text = "";
// BRANCH || BCHNAME
String text = dbBch.getBranch() + dbBch.getBchname();
rcvact.setExtkey(Strings.mid(rcvact.getExtkey(), 1, pos - 1) +
Strings.mid(text, 1, 4) + Strings.mid(rcvact.getExtkey(), pos + 4));
}
......@@ -641,20 +650,19 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
return;
}
}
// 如果下发行没有权限经办业务,则转到它的上级经办机构 TODO bch 没有 wrkflg
String sql = "SELECT WRKFLG, BCHKEY FROM BCH WHERE INR = '" + bo.getCrdgrp().getRec().getRcvbchinr() + "'";
String wrkFlg = "";
// 如果下发行没有权限经办业务,则转到它的上级经办机构 原代码的wrkflg 对应BCHTYP (1:经办行)
String sql = "SELECT BCHTYP, BCHKEY FROM BCH WHERE INR = '" + bo.getCrdgrp().getRec().getRcvbchinr() + "'";
String bchtyp = "";
String bchKey = "";
List<Bch> bchList = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(bchList)) {
// wrkFlg = bchList.get(0).getWrkflg();
bchtyp = bchList.get(0).getBchtyp();
bchKey = bchList.get(0).getBchkey();
}
String wrkInr = NULLSTR;
if (MdaUtils.isEmpty(wrkFlg)) {
sql = "SELECT INR FROM BCH WHERE BRANCH = '" + bchKey + "'";
if (MdaUtils.isEmpty(bchtyp) || MdaUtils.compareTo(bchtyp, "1") != 0) {
// sql = "SELECT INR FROM BCH WHERE BRANCH = '" + bchKey + "'";
sql = "SELECT INR FROM BCH WHERE bchtyp='1' and BRANCH = '" + bchKey + "'";
List<Bch> list = bchMapper.dyncRead(ImmutableBiMap.of("sql", sql));
if (CollectionUtils.isNotEmpty(list)) {
wrkInr = list.get(0).getInr();
......@@ -664,11 +672,13 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
// 取得下发行的清算账号
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getCustyp(), "1") == 0) {
// 对私
readClearingAct("SP-RIP", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
Act act = readClearingAct("SP-RIP", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
bo.setRcvact(act);
} else {
bo.getCrdgrp().getRec().setCustyp("0");
// 对公
readClearingAct("SP-RIC", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
Act act = readClearingAct("SP-RIC", bo.getCrdgrp().getRec().getRcvbchinr(), maxCur);
bo.setRcvact(act);
}
}
......@@ -720,13 +730,6 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
}
/**
* source:crtcri.0005.script
*/
public void setBranchCodeValue() {
String sql = "SELECT INR, BRANCH||BCHNAME FROM BCH WHERE WRKFLG = 'X'";
}
/**
* source:crtcri.0020.script
......@@ -791,6 +794,58 @@ public class CrtcriTransactionServiceImpl extends AbstractTransactionService<Crt
sysmodService.sptSaveEntry(bo.getCrtspt(), Utils.getFieldValue(mod, "REC"), sta, clrStm, "");
}
/**
* source:crtcri.0021.script
*/
public void defaultCrdgrpRecCustypN1000(CrtcriStoreBo bo) {
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getRcvobjtyp(), "CPD") != 0) {
bo.getCrdgrp().getRec().setCustyp("0");
}
}
/**
* source:crtcri.0016.script
*/
public void defaultCrdgrpRecNamN1000(CrtcriStoreBo bo) {
//! Default name of contract; usually contract amount and information about the client is used
if (!bo.getCrdgrp().getRec().isModified("nam")) {
if (MdaUtils.compareTo(bo.getCrdgrp().getRec().getClrtyp(), "O") == 0) {
// Dynamic.ptsmodGetPtyOfPtspta(bo.getCrdgrp().getRcv(), bo.getTrnmod().getPtsmod().getPty());
//根据前一个参数里的pta的ptyinr 读取出pty 放到 ptsmod的pty下
// Pty dbPty = ptyCacheService.getPtyById(bo.getCrdgrp().getRcv().getPta().getPtyinr());
String nam = bo.getCrdgrp().getRec().getMsgtyp() + " " + bo.getCrdgrp().getCbs().getMax().getCur() + " "
+ Formats.fmtAmount(bo.getCrdgrp().getCbs().getMax().getAmt(), bo.getCrdgrp().getCbs().getMax().getCur())
+ " " + bo.getCrdgrp().getRec().getRcvobjtyp() + "/" + bo.getCrdgrp().getRcv().getPts().getNam();
bo.getCrdgrp().getRec().setNam(Strings.mid(nam, 1, 40));
} else {
// Dynamic.ptsmodGetPtyOfPtspta(bo.getCrdgrp().getSnd(), bo.getTrnmod().getPtsmod().getPty());
// Pty dbPty = ptyCacheService.getPtyById(bo.getCrdgrp().getSnd().getPta().getPtyinr());
String nam = bo.getCrdgrp().getRec().getMsgtyp() + " " + bo.getCrdgrp().getCbs().getMax().getCur() + " "
+ Formats.fmtAmount(bo.getCrdgrp().getCbs().getMax().getAmt(), bo.getCrdgrp().getCbs().getMax().getCur())
+ " " + bo.getCrdgrp().getRec().getRcvobjtyp() + "/" + bo.getCrdgrp().getSnd().getPta().getNam();
bo.getCrdgrp().getRec().setNam(Strings.mid(nam, 1, 40));
}
}
}
public List<CodetableItem> getBranchCodeValue() {
List<Map<String, Object>> list = crtpService.setBranchCodeValue();
List<CodetableItem> collect = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) {
collect = list.stream().map(item -> {
String val = (String) item.get("VAL");
String txt = (String) item.get("TXT");
return new CodetableItem(txt, val);
}).collect(Collectors.toList());
}
return collect;
}
}
package com.brilliance.isc.funds.crtcri.service;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import java.util.List;
import java.util.Map;
/**
* @program: isc-funds
* @ClassName: CrtpService
* @description: crtp清算 公共方法
* @author: huangshunlin
* @create: 2024-10-22 11:24
*/
public interface CrtpService {
void defaultCrdgrpRecOwnusrN1000(BaseTransactionVo bo);
void defaultClearingN1000(BaseTransactionVo bo);
List<Map<String, Object>> setBranchCodeValue();
}
package com.brilliance.isc.funds.crtcri.service.impl;
import com.brilliance.isc.bo.model.Crdgrp;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.util.Utils;
import com.brilliance.isc.funds.crtcri.service.CrtpService;
import com.brilliance.isc.mda.dao.PublicMapper;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.google.common.collect.ImmutableBiMap;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @program: isc-funds
* @ClassName: CrtpServiceImpl
* @description: crtp 清算 公共方法
* @author: huangshunlin
* @create: 2024-10-22 11:25
*/
@Service
public class CrtpServiceImpl implements CrtpService {
@Resource
private SysmodService sysmodService;
@Resource
private PublicMapper publicMapper;
/**
* source:crtp.0002.script
*/
// @Default(target="crdgrp.rec.ownusr",order=1000)
public void defaultCrdgrpRecOwnusrN1000(BaseTransactionVo bo) {
Crdgrp crdgrp = Utils.getFieldValue(bo, "crdgrp");
if (Objects.isNull(crdgrp)) {
return;
}
//! Set OWNUSR if not already set
if (MdaUtils.isEmpty(crdgrp.getRec().getOwnusr())) {
crdgrp.getRec().setOwnusr(SettleContext.getUserSession().getUsr().getExtkey());
}
}
/**
* source:crtp.0007.script
*/
// @Default(value={"crdgrp.rec.clrtyp","crdgrp.rec.trntyp"},order=1000)
public void defaultClearingN1000(BaseTransactionVo bo) {
Crdgrp crdgrp = Utils.getFieldValue(bo, "crdgrp");
if (Objects.isNull(crdgrp)) {
return;
}
// 给汇入清算/汇出清算赋值的清算类型赋值
if (MdaUtils.isEmpty(crdgrp.getRec().getClrtyp())) {
if (sysmodService.sptIsRimLoaded(bo.getSpt().getSta())) {
// 从Register队列进的全部是汇出清算
crdgrp.getRec().setClrtyp("O");
// 自动清算
crdgrp.getRec().setTrntyp("A");
} else {
if (sysmodService.sptIsIncLoaded(bo.getSpt().getSta())) {
// 从Incoming队列进的全部是汇入清算
crdgrp.getRec().setClrtyp("I");
// 自动清算
crdgrp.getRec().setTrntyp("A");
} else {
// 其他情况,根据交易名称判断
if (MdaUtils.compareTo(SettleContext.getTransName(), "CRTCRO") == 0) {
crdgrp.getRec().setClrtyp("O");
} else {
crdgrp.getRec().setClrtyp("I");
}
// 手工清算
crdgrp.getRec().setTrntyp("M");
}
}
}
}
/**
* source:crtp.0006.script
*/
public List<Map<String, Object>> setBranchCodeValue() {
//########################
//!初始化实体机构
//########################
String ety = SettleContext.getUserEty().getExtkey();
String sql = "SELECT INR as val , BRANCH||BCHNAME as txt FROM BCH WHERE bchtyp = '1' AND ETYEXTKEY='" + ety + "'";
// String sql = "SELECT INR as val , BRANCH||BCHNAME as txt FROM BCH WHERE wrkflg = 'X' AND ETYEXTKEY='" + ety + "'";
List<Map<String, Object>> list = publicMapper.dyncQueryMapList(ImmutableBiMap.of("sql", sql));
return list;
}
}
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;
......@@ -11,13 +10,12 @@ 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.Date;
import java.util.List;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
......@@ -55,9 +53,43 @@ public class CrtcroSettleRegister implements ISettleRegister {
}
/**
* source:crtcro.0009.script
* source:crtcro.0002.script
*/
private void transRegister(SetmodVo setmodVo) {
CrdBizInfoVo rec = (CrdBizInfoVo) setmodVo.getRec();
BigDecimal maxAmt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
}
setmodVo.setDocamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount(setglg, "TRN");
String dbtKey = setglgService.setglgAddAmount(setglg, "TRN", "OWN", setmodVo.getDoccur(), maxAmt, "", "SPD",
"A", rec.getSpcgleAct(), "");
String rol = NULLSTR;
List<PtsptaVo> ptsList = setmodVo.getPtsList();
// if (this.getCrdgrp().getAcc().isRolSet()) {
if (ptsptaToolComponent.ptsIsRolSet(ptsList, "ACC")) {
rol = "ACC";
} else {
rol = "RCV";
}
String cdtKey = setmodService.setGlgAmt(setmodVo, "TRN", rol, setmodVo.getDoccur(), maxAmt.negate(), "");
// TODO this.getTrnmod().getTrnism().setDefDsp(rol, "C", "PAC" + CR + "VOC");
Date valDat = rec.getOpndat();
switch (rec.getRcvobjtyp()) {
case "CPD":
valDat = rec.getValdat();
break;
case "GID":
break;
case "BCD":
break;
case "BRD":
break;
}
setglgService.setglgAddAmtFldValDat(setglg, "TRN", cdtKey, valDat);
}
}
......@@ -2,6 +2,7 @@ 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.bo.funds.CrtcroStoreBo;
import com.brilliance.isc.funds.crtcro.service.CrtcroTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.CrtcroStructMapper;
import com.brilliance.isc.funds.vo.funds.CrtcroStoreVo;
......@@ -49,7 +50,8 @@ public class CrtcroResource extends AbstractTransactionController<CrtcroStoreVo>
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody CrtcroStoreVo crtcroStoreVo) {
String ref = crtcroTransactionService.getRef(crtcroStoreVo);
CrtcroStoreBo bo = crtcroStructMapper.voTransferToBo(crtcroStoreVo);
String ref = crtcroTransactionService.getRef(bo);
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 cn.hutool.core.bean.BeanUtil;
import com.brilliance.isc.bo.*;
import com.brilliance.isc.bo.model.*;
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.setmod.service.SetmodService;
import com.brilliance.isc.common.exception.CommonServiceException;
import com.brilliance.isc.common.nosmod.NosmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.common.transaction.AbstractTransactionService;
......@@ -18,22 +18,28 @@ 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.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 com.brilliance.isc.mda.dao.GleMapper;
import com.brilliance.isc.mda.dao.PtyMapper;
import com.brilliance.isc.mda.dao.SmhMapper;
import com.brilliance.isc.vo.funds.CrdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.google.common.collect.ImmutableBiMap;
import org.apache.commons.collections.CollectionUtils;
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;
......@@ -53,15 +59,18 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
private CrtcroValidator crtcroValidator;
@Resource
private XrtmodService xrtmodService;
@Resource
private SysmodService sysmodService;
@Resource
private CrToolComponent crToolComponent;
@Resource
private ActMapper actMapper;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
......@@ -73,24 +82,24 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private PtyratMapper ptyratMapper;
@Autowired
private NosmodService nosmodService;
@Resource
private SetmodService setmodService;
private SmhMapper smhMapper;
@Resource
private GleMapper gleMapper;
@Resource
private ActMapper actMapper;
private PtyMapper ptyMapper;
@PostConstruct
public void regisertService() {
......@@ -107,12 +116,34 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
ruleMtabutSavN500(transactionVo);
}
/**
* source:crtcro.0020.script
*/
public void ruleMtabutSavN500(CrtcroStoreBo 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);
SetmodVo setmodVo = transactionHelpService.getTransactionStoreSet().getSetmodVo();
nosmodService.savNostro(bo.getNosmod(), setmodVo, trnmodVo);
}
private void cbsSav(CrtcroStoreBo bo, TrnmodVo trnmodVo) {
/**
* source:crtcro.0021.script
*/
private void cbsSav(CrtcroStoreBo bo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
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_crtcr0_000000"), bo.getCrdgrp().getRec(), trninr);
}
@Override
......@@ -122,8 +153,20 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
@Override
protected BizInfoVo buildBizInfo(CrtcroStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
Crd rec = transactionVo.getCrdgrp().getRec();
Crtp crtp = transactionVo.getCrtp();
CrdBizInfoVo bizInfoVo = new CrdBizInfoVo();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setObjtyp("CRD");
bizInfoVo.setForare(crtp.getForare());
bizInfoVo.setOpndat(rec.getOpndat());
bizInfoVo.setRcvbchinr(rec.getRcvbchinr());
bizInfoVo.setCustyp(rec.getCustyp());
String act = transactionVo.getSpcgle().getAct();
bizInfoVo.setSpcgleAct(act);
bizInfoVo.setRcvobjtyp(rec.getRcvobjtyp());
Cpd cpd = transactionVo.getCpdgrp().getRec();
bizInfoVo.setValdat(cpd.getValdat());
return bizInfoVo;
}
......@@ -135,6 +178,7 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
@Override
public CrtcroStoreBo init(CrtcroStoreBo crtcroStoreBo) {
crtcroStoreBo.reset();
init950(crtcroStoreBo);
init1000(crtcroStoreBo);
return crtcroStoreBo;
}
......@@ -143,11 +187,144 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
* source:crtcro.0001.script
*/
public void init1000(CrtcroStoreBo bo) {
// 不让Break
// Systems.resetVisible(bo.getMtabut(), "pen");
// Systems.setValues(bo.getCrdgrp().getRec(), "rcvobjtyp", "CPD" + CR + "BCD" + CR + "BRD" + CR + "GID");
String msgTyp = NULLSTR;
String ptyInr = NULLSTR;
if (sysmodService.sptIsRimLoaded(bo.getSpt().getSta())) {
// 汇出清算通过Register队列进入
bo.getCrdgrp().getRec().setClrtyp("O");
bo.getCrdgrp().getRec().setCredat(Dates.today());
bo.getCrdgrp().getRec().setOpndat(Dates.today());
bo.getCrdgrp().getRec().setSptinr(bo.getSpt().getInr());
// 查找TRN记录
bo.getCretrn().setInr(bo.getSpt().getCreobjinr());
Trn dbTrn = (Trn) sysmodService.sdbRead(bo.getCretrn());
if (Objects.isNull(dbTrn)) {
throw new CommonServiceException("根据Creobjinr:" + bo.getSpt().getCreobjinr() + "找不到TRN数据");
}
bo.setCretrn(dbTrn);
bo.getCrdgrp().getRec().setRcvobjtyp(bo.getCretrn().getObjtyp());
bo.getCrdgrp().getRec().setRcvobjinr(bo.getCretrn().getObjinr());
bo.getCrdgrp().getRec().setRcvbchinr(bo.getCretrn().getBchkeyinr());
bo.getCrdgrp().getRec().setMsgref(bo.getCretrn().getOwnref());
// 查找SMH记录(202)
bo.getBndsmh().setInr(bo.getSpt().getSmhinr());
Smh dbSmh = (Smh) sysmodService.sdbRead(bo.getBndsmh());
if (Objects.isNull(dbSmh)) {
throw new CommonServiceException("根据Smhinr:" + bo.getSpt().getSmhinr() + "找不到SMH数据");
}
bo.setBndsmh(dbSmh);
// ctx.getDaoSession().dbRead(bo.getBndsmh(), bo.getSpt().getSmhinr(), "INR");
bo.getCrdgrp().getRec().setBndinr(bo.getBndsmh().getInr());
bo.getCrdgrp().getRec().setBndtyp(bo.getBndsmh().getMsgtyp());
// 查找绑定这笔202的其他SWIFT报文信息
switch (bo.getCrdgrp().getRec().getRcvobjtyp()) {
case "CPD":
// Platform.getCPdGrp(this.getCpdgrp(),this.getCrdgrp().getRec().getRcvobjinr());
Cpdgrp dbCpdgrp = crToolComponent.getCpdgrpByInr(bo.getCrdgrp().getRec().getRcvobjinr());
bo.setCpdgrp(dbCpdgrp);
// 汇出汇款发103+202
if (MdaUtils.compareTo(bo.getCpdgrp().getRec().getSwftyp(), "COV") == 0) {
msgTyp = "103";
}
break;
case "BCD":
msgTyp = "400";
// Platform.getBcdGrp(bo.getBcdgrp(), bo.getCrdgrp().getRec().getRcvobjinr());
Bcdgrp dbBcdgrp = crToolComponent.getBcdgrpByInr(bo.getCrdgrp().getRec().getRcvobjinr());
bo.setBcdgrp(dbBcdgrp);
break;
case "BRD":
msgTyp = "756";
// Platform.getBrdGrp(bo.getBrdgrp(), bo.getCrdgrp().getRec().getRcvobjinr());
// Platform.getLidGrp(bo.getLidgrp(), bo.getBrdgrp().getRec().getPntinr());
Brdgrp dbBrdgrp = crToolComponent.getBrdgrpByInr(bo.getCrdgrp().getRec().getRcvobjinr());
bo.setBrdgrp(dbBrdgrp);
Lidgrp dbLidgrp = crToolComponent.getLidgrpByInr(bo.getBrdgrp().getRec().getPntinr());
bo.setLidgrp(dbLidgrp);
break;
case "GID":
msgTyp = "";
// Platform.getGidGrp(bo.getGidgrp(), bo.getCrdgrp().getRec().getRcvobjinr());
Gidgrp dbGidgrp = crToolComponent.getGidgrpByInr(bo.getCrdgrp().getRec().getRcvobjinr());
bo.setGidgrp(dbGidgrp);
break;
default:
msgTyp = "";
}
if (!MdaUtils.isEmpty(msgTyp)) {
// ctx.getDaoSession().dbRead(bo.getCresmh(), "WHERE TRNTYP = 'TRN' AND TRNINR = '" + bo.getBndsmh().getTrninr() + "' AND MSGTYP = '" + msgTyp + "'");
List<Smh> smhList = smhMapper.selectByTrninrAndMsgtyp(bo.getBndsmh().getTrninr(), msgTyp);
if (CollectionUtils.isEmpty(smhList)) {
// 找不到,可能发了999
// ctx.getDaoSession().dbRead(bo.getCresmh(), "WHERE TRNTYP = 'TRN' AND TRNINR = '" + bo.getBndsmh().getTrninr() + "' AND MSGTYP = '999'");
List<Smh> smhList2 = smhMapper.selectByTrninrAndMsgtyp(bo.getBndsmh().getTrninr(), "999");
if (CollectionUtils.isNotEmpty(smhList2)) {
bo.setCresmh(smhList2.get(0));
}
} else {
bo.setCresmh(smhList.get(0));
}
bo.getCrdgrp().getRec().setMsginr(bo.getCresmh().getInr());
bo.getCrdgrp().getRec().setMsgtyp(bo.getCresmh().getMsgtyp());
} else {
// CRTP\\ACCP\\PANSTA = PanStaShow
// Platform.setModuleContent(bo.getCresmh(), bo.getBndsmh());
Smh smh = MdaUtils.deepClone(bo.getBndsmh());
bo.setCresmh(smh);
// MdaUtils.clear(bo.getBndsmh());
bo.setBndsmh(new Smh());
bo.getCrdgrp().getRec().setBndinr(NULLSTR);
bo.getCrdgrp().getRec().setBndtyp(NULLSTR);
bo.getCrdgrp().getRec().setMsginr(bo.getCresmh().getInr());
bo.getCrdgrp().getRec().setMsgtyp(bo.getCresmh().getMsgtyp());
}
// 读取前手交易的清算汇出账务信息
// ctx.getDaoSession().dbRead(bo.getSpcgle(), "WHERE TRNINR = '" + bo.getCretrn().getInr() + "' AND DBTCDT = 'C' AND ( DBTDFT ='SP-ROC' OR DBTDFT = 'SP-ROP') ");
Gle gle = gleMapper.selectSpcGLeByTrninr(bo.getCretrn().getInr());
bo.setSpcgle(gle);
if (MdaUtils.compareTo(bo.getSpcgle().getDbtdft(), "SP-ROP") == 0) {
bo.getCrdgrp().getRec().setCustyp("1");
} else {
bo.getCrdgrp().getRec().setCustyp("0");
}
bo.getCrdgrp().getCbs().getMax().setCur(bo.getSpcgle().getCur());
bo.getCrdgrp().getCbs().getMax().setAmt(bo.getSpcgle().getAmt());
// 将收报行信息赋值到PTSPTA中
if (!MdaUtils.isEmpty(bo.getCresmh().getSndkey())) {
// 说明有主报文(103/400/756)
Pty crePty = ptyMapper.selectByExtkey(bo.getCresmh().getSndkey());
ptsptaToolComponent.ptsmodGetPtsptaFromPtyINR(bo.getCrdgrp().getRcv(), crePty.getInr());
if (!MdaUtils.isEmpty(bo.getBndsmh().getSndkey())) {
// 副报文(202)读取到账户行中
Pty bndPty = ptyMapper.selectByExtkey(bo.getBndsmh().getSndkey());
ptsptaToolComponent.ptsmodGetPtsptaFromPtyINR(bo.getCrdgrp().getAcc(), bndPty.getInr());
}
}
// 读取同业账户116信息
if (!MdaUtils.isEmpty(bo.getCrdgrp().getAcc().getPts().getPtyinr())) {
ptyInr = bo.getCrdgrp().getAcc().getPts().getPtyinr();
} else {
ptyInr = bo.getCrdgrp().getRcv().getPts().getPtyinr();
}
// readAct(bo.getSysmod().getBch().getPtyinr(), ptyInr, bo.getPacact());
String maxCur = bo.getCrdgrp().getCbs().getMax().getCur();
readAct("", ptyInr, bo.getPacact(), maxCur);
// if (Objects.isNull(bo.getPacact()) || StringUtils.isEmpty(bo.getPacact().getInr())) {
// MdaUtils.clear(bo.getPacact());
// }
}
}
private void init950(CrtcroStoreBo crtcroStoreBo) {
crtcroStoreBo.setClrsta("O");
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
crtcroStoreBo.getCrdgrp().getRec().setOwnusr(extkey);
}
@Override
......@@ -170,30 +347,30 @@ public class CrtcroTransactionServiceImpl extends AbstractTransactionService<Crt
}
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;
public String getRef(CrtcroStoreBo bo) {
bo.reset();
if (Objects.isNull(SettleContext.getUserSession().getWrkbch()) || StringUtils.isEmpty(SettleContext.getUserSession().getWrkbch().getInr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Crdgrp crdgrp = crtcroStoreVo.getCrdgrp();
Crdgrp crdgrp = bo.getCrdgrp();
crToolComponent.getref(crdgrp);
return crdgrp.getRec().getOwnref();
}
private SetmodVo buildSetmodVo(CrtcroStoreVo vo) {
SetmodVo setmodVo = new SetmodVo();
return setmodVo;
/**
* source:crtcro.0006.script
*
* @param holPtyInr
* @param serPtyInr
* @param act
* @param cur this.getCrdgrp().getCbs().getMax().getCur()
*/
public void readAct(String holPtyInr, String serPtyInr, Act act, String cur) {
String sql = "SELECT * from act WHERE HOLPTYINR = '" + holPtyInr + "' AND SERPTYINR = '" + serPtyInr + "' 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);
}
}
}
package com.brilliance.isc.funds.fttfcm.check;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.common.transaction.newcheck.ValidResult;
import com.brilliance.isc.common.transaction.newcheck.Validate;
import com.brilliance.isc.common.util.Utils;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
* @program: isc-funds
* @ClassName: FttfcmValidator
* @description: 结售汇平盘确认 Fttfcm 校验
* @author: 肖桐
* @create: 2024-10-11 11:28
*/
@Component
public class FttfcmValidator extends AbstractModuleValidator <FttfcmStoreBo>{
@Override
@PostConstruct
public void register(){
super.register();;
}
@Override
public Map<String, String> validate(FttfcmStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
/**
* source:fttfcm.0018.script
*/
@Validate(path="fttp.mt32m.s30x")
public ValidResult checkFttpMt32mS30xN1000(FttfcmStoreBo bo){
if( ( MdaUtils.compareTo(bo.getFttp().getMt32m().getS22b(),"CONF") == 0 || MdaUtils.compareTo(bo.getFttp().getMt32m().getS22b(),"ROLL") == 0 ) && MdaUtils.isEmpty(bo.getFttp().getMt32m().getS30x()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0022.script
*/
@Validate(path="ftdgrp.cbs.ins.amt")
public ValidResult checkFtdgrpCbsInsAmtN1000(FttfcmStoreBo bo){
if( MdaUtils.compareTo(bo.getFttp().getPansta(),PanStaAdd) == 0 || MdaUtils.compareTo(bo.getFttp().getPansta(),PanStaEdit) == 0 )
{
if( MdaUtils.isEmpty(bo.getFtdgrp().getCbs().getIns().getAmt()) )
{
return errorMandatory();
}
}
return null;
}
/**
* source:fttfcm.0023.script
*/
@Validate(path="ftdgrp.rec.cntfra")
public ValidResult checkFtdgrpRecCntfraN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getCntfra()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0024.script
*/
@Validate(path="ftdgrp.rec.matdat")
public ValidResult checkFtdgrpRecMatdatN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getMatdat()) )
{
return errorMandatory();
}
else
{
if( ! MdaUtils.isEmpty(bo.getFtdgrp().getRec().getValdat()) && Dates.diff(bo.getFtdgrp().getRec().getValdat(),bo.getFtdgrp().getRec().getMatdat())>0 )
{
return ValidResult.build(false, MdaUtils.getI18NString("fttfcm","CT000008"));
}
}
return null;
}
/**
* source:fttfcm.0025.script
*/
@Validate(path="ftdgrp.rec.rat")
public ValidResult checkFtdgrpRecRatN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getRat()) )
{
return errorMandatory();
}
return null;
}
/**
* source:fttfcm.0038.script
*/
@Validate(path="ftdgrp.rec.bnktyp")
public ValidResult checkFtdgrpRecBnktypN1000(FttfcmStoreBo bo){
if( MdaUtils.isEmpty(bo.getFtdgrp().getRec().getBnktyp()) )
{
return errorMandatory();
}
return null;
}
}
package com.brilliance.isc.funds.fttfcm.document;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.Formats;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Service("fttfcm.BuildFtt320l1")
public class BuildFtt320l1 {
public Map<String, Object> build(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap map = new HashMap();
map.putAll(printHeader(trnBo, doceotVo));
//map.putAll(printBody(trnBo, doceotVo));
map.putAll(printFooter(trnBo, doceotVo));
return map;
}
private Map<String, Object> printHeader(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap<String, Object> map = new HashMap<>();
String title = "";
title = " Formatted outgoing message / mt320 Viewer";
map.put("title", title);
return map;
}
private Map<String, Object> printFooter(FttfcmStoreBo trnBo, DoceotVo doceotVo) {
HashMap<String, Object> map = new HashMap<>();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String format = sdf.format(new Date());
String footer = Strings.getText("Diary printed by $1 on $2 at $3 during the change",
SettleContext.getUserSession().getUsr().getExtkey(), Formats.fmtDateLong(Dates.today()), format);
map.put("footer", footer);
return map;
}
}
package com.brilliance.isc.funds.fttfcm.document;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Component("fttfcm.docset")
public class FttfcmDocset extends AbstractTransactionDocSet<FttfcmStoreBo> {
@Resource
private BuildFtt320l1 buildFtt320l1;
@PostConstruct
public void buildMember() {
buildLetterProvider("fttfcm","FTT3201","FTT1991","FTT2991");
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
public Map<String,Object> buildExtraMapForLetter(FttfcmStoreBo trnbo, DoceotVo doceotVo){
if (MdaUtils.compareTo(doceotVo.getDocnam(),"FTT3201")==0){
return buildFtt320l1.build(trnbo,doceotVo);
} else {
return new HashMap<>();
}
}
}
package com.brilliance.isc.funds.fttfcm.register.dissav;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.common.register.diasav.IDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.DftcreDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavZZZRegister;
import com.brilliance.isc.common.register.diasav.common.TrtcreDiasavRegister;
import com.brilliance.isc.common.trndia.service.TrndiaService;
import com.brilliance.isc.common.trndia.vo.TrndiaVo;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
* @program: isc-funds
* @ClassName: FttfcmDiasavRegister
* @description: 结售汇平盘确认 Fttfcm 备忘录注册
* @author: Lenovo
* @create: 2024-10-11 17:30
*/
@Component("fttfcm.diasavRegister")
public class FttfcmDiasavRegister implements IDiasavRegister {
@Autowired
private TrndiaService trndiaService;
@Autowired
private LiaallDiasavRegister liaallDiasavRegister;
@Autowired
private LiaallDiasavZZZRegister liaallDiasavZZZRegister;
@Autowired
private TrtcreDiasavRegister trtcreDiasavRegister;
@Autowired
private DftcreDiasavRegister dftcreDiasavRegister;
@Override
public void diasav(TrndiaVo trndia) {
trnDiasav(trndia);
liaallDiasavRegister.diasav(trndia);
liaallDiasavZZZRegister.diasav(trndia);
trtcreDiasavRegister.diasav(trndia);
dftcreDiasavRegister.diasav(trndia);
}
private void trnDiasav(TrndiaVo trndiaVo) {
FtdBizInfoVo ftdBizInfoVo=(FtdBizInfoVo)trndiaVo.getRec();
//取得上下文
Date date = null;
if (!MdaUtils.isEmpty(ftdBizInfoVo.getMatdat())) {
date = NULLDATE;
if (Dates.diff(ftdBizInfoVo.getMatdat(), Dates.today()) < 3) {
date = Dates.today();
} else {
date = Dates.add(ftdBizInfoVo.getMatdat(), -3);
}
trndiaService.trnDiaSet(trndiaVo, "FTDMAT", date, "EXP", Strings.getText("资金拆借到期提示:", ftdBizInfoVo.getOwnref()), "FTTFMT", DiaToReplace);
}
}
}
\ No newline at end of file
package com.brilliance.isc.funds.fttfcm.register.doc;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.register.document.common.SetmodDocumentRegister;
import com.brilliance.isc.common.trndoc.service.TrndocService;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.fttfcm.service.FttfcmTransactionServiceImpl;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Systems;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
/**
* @program: isc-funds
* @ClassName: FttfcmDocumentRegister
* @description: 结售汇平盘确认 Fttfcm 报文注册
* @author: Lenovo
* @create: 2024-10-11 17:47
*/
@Component("fttfcm.documentRegister")
public class FttfcmDocumentRegister implements IDocumentRegister {
@Autowired
TrndocService trndocService;
@Resource
PtsptaToolComponent ptsptaToolComponent;
@Autowired
private SetmodDocumentRegister setmodDocumentRegister;
@Resource
FtToolComponent ftToolComponent;
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
setmodDocumentRegister.registerDocument(trndoc);
//entmodDocumentRegister.registerDocument(trndoc);
}
public void doRegister(TrndocVo trndoc){
FtdBizInfoVo rec = (FtdBizInfoVo) trndoc.getRec();
PtsptaVo troPtspta = ptsptaToolComponent.getPtsFromListByRol(trndoc.getPtsptas(), "TRO");
PtsptaVo triPtspta = ptsptaToolComponent.getPtsFromListByRol(trndoc.getPtsptas(), "TRI");
if( 1==1 )
{
if( ptsptaToolComponent.ptsIsRolSet(troPtspta ))
{
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN320", "SWT", "MT320");
break;
case "199":
trndocService.defDocEot ( trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN199", "SWT", "MT199");
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN299", "SWT", "MT299");
break;
}
}
if( ptsptaToolComponent.ptsIsRolSet(triPtspta) )
{
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN320", "SWT", "MT320");
break;
case "199":
trndocService.defDocEot (trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN199", "SWT", "MT199");
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN299", "SWT", "MT299");
break;
}
}
}
}
}
package com.brilliance.isc.funds.fttfcm.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.DocumentFeeRegister;
import com.brilliance.isc.common.register.fee.common.LiaallFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setfeg.service.SetfegService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FttfcmFeeRegister
* @description: 结售汇平盘确认 Fttfcm 费用注册
* @author: Lenovo
* @create: 2024-10-11 17:36
*/
@Component("fttfcm.feeRegister")
public class FttfcmFeeRegister extends AbstractFeeRegister {
@Autowired
private SetfegService setfegService;
@Autowired
private DocumentFeeRegister documentFeeRegister;
@Autowired
private LiaallFeeRegister liaallFeeRegister;
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
setmodFeeRegister.registerSettlement(setmodVo);
documentFeeRegister.registerSettlement(setmodVo);
liaallFeeRegister.registerSettlement(setmodVo);
}
}
package com.brilliance.isc.funds.fttfcm.register.liaall;
import com.brilliance.isc.common.liaall.vo.LiaallVo;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.liaall.ILiaallRegister;
import com.brilliance.isc.common.register.liaall.common.LiaallRegister;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FttfcmLiaallRegister
* @description: 结售汇平盘确认 Fttfcm 表外注册
* @author: Lenovo
* @create: 2024-10-11 17:41
*/
@Component("fttfcm.liaallSetTransaction")
public class FttfcmLiaallRegister implements ILiaallRegister {
@Autowired
private LiaallRegister liaallRegister;
@Override
public void liaallSetTransaction(LiaallVo liaallVo) {
liaallRegister.liaallSetTransaction(liaallVo);
}
}
package com.brilliance.isc.funds.fttfcm.register.settle;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.register.settle.DefaultSettleRegister;
import com.brilliance.isc.common.register.settle.ISettleRegister;
import com.brilliance.isc.common.setglg.service.SetglgService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.brilliance.mda.runtime.mda.util.Formats;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import javax.annotation.Resource;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.*;
import static com.brilliance.mda.runtime.mda.Constants.CR;
@Component("fttfcm.settleRegister")
public class FttfcmSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private GlemodService glemodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
FtdBizInfoVo rec = (FtdBizInfoVo) setmodVo.getRec();
//Ftdgrp ftdgrp = ftToolComponent.getFtdgrpByInr(rec.getObjinr());
PtsptaVo tri = ptsptaToolComponent.getPtsFromListByRol(setmodVo.getPtsList(), "TRI");
PtsptaVo tro = ptsptaToolComponent.getPtsFromListByRol(setmodVo.getPtsList(), "TRO");
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO;
String opn1Cur=NULLSTR;
BigDecimal opn1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
maxCur= setmodVo.getCbsMap().get("MAX").getCur();
}
if (setmodVo.getCbsMap().get("OPN1") != null) {
opn1Amt= setmodVo.getCbsMap().get("OPN1").getAmt();
opn1Cur= setmodVo.getCbsMap().get("OPN1").getCur();
}
setmodVo.setDoccur(maxCur);
setmodVo.setDocamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
String acctyp = NULLSTR;
String acc = NULLSTR;
String cdtKey = NULLSTR;
String dbtKey = NULLSTR;
switch( rec.getFttyp() )
{
// 资金拆出
case "LO":
acctyp = "";
acc = "";
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "FL-FOG";
}
else
{
acctyp = "FL-DO" + rec.getBnktyp();
}
//贷记
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI", setmodVo.getDoccur(), maxAmt.negate(), "", "PAC", "C", "", "" );
acc = glemodService.getAvailAcc ( acctyp,setmodVo.getDoccur(), tri.getPts().getPtyinr(), maxAmt );
dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI",setmodVo.getDoccur(),maxAmt, "", "FLD", "C", acc, "" );
setmodVo.setFeeclirol( "TRI" );
// 定存存出
break;
case "DO":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRI.IsDemestic then
$acctyp = "DB-CLR"
else
$acctyp = "DB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "DB-FOG";
}
else
{
acctyp = "DB-CLR";
}
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI",setmodVo.getDoccur(),maxAmt.negate(), "", "PAC", "C", "", "" );
acc =glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(),tri.getPts().getPtyinr(), maxAmt );
/**
$DbtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRI", SETMOD\\DOCCUR, FTDGRP\\CBS\\MAX\\AMT, "", "DBD", "A", $acc, "" )
**/
dbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRI", setmodVo.getDoccur(),maxAmt, "", "DBD", "C", acc, "" );
setmodVo.setFeeclirol ( "TRI" );
// 资金拆入
break;
case "LI":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRO.IsDemestic then
$acctyp = "FB-DOM"
else
$acctyp = "FB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "FB-FOG";
}
else
{
acctyp = "FB-DO" + rec.getBnktyp();
}
acc = glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(),tro.getPts().getPtyinr(), maxAmt.negate() );
//贷记
/**
$CdtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRO", SETMOD\\DOCCUR, -FTDGRP\\CBS\\MAX\\AMT, "", "FBC", "A", $acc, "" )
**/
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO", setmodVo.getDoccur(),maxAmt.negate(), "", "FBC", "C", acc, "" );
//借记
dbtKey =setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO",setmodVo.getDoccur(), maxAmt, "", "FTD", "C", "", "" );
setmodVo.setFeeclirol ( "TRO" );
// 定存吸存
break;
case "DI":
acctyp = "";
acc = "";
/**
if FTDGRP\\TRO.IsDemestic then
$acctyp = "DB-CLR"
else
$acctyp = "DB-FOG"
endif
**/
if( MdaUtils.compareTo(rec.getBnktyp(),"9") == 0 )
{
acctyp = "VO-FOG";
}
else
{
acctyp = "VO-BO" + rec.getBnktyp();
}
acc = glemodService.getAvailAcc ( acctyp, setmodVo.getDoccur(), tro.getPts().getPtyinr(), maxAmt.negate() );
/**
$CdtKey = SETMOD\\SETGLG.SetglgAddAmount ( "TRN", "TRO", SETMOD\\DOCCUR, -FTDGRP\\CBS\\MAX\\AMT, "", "VOC", "A", $acc, "" )
**/
cdtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "TRO",setmodVo.getDoccur(), maxAmt.negate(), "", "VOC", "C", acc, "" );
dbtKey =setglgService.setglgAddAmount (setmodVo.getSetglg(), "TRN", "TRO",setmodVo.getDoccur(), maxAmt, "", "FTD", "C", "", "" );
setmodVo.setFeeclirol ( "TRO" );
break;
}
setmodService.setglgAllValDat ( setmodVo, rec.getValdat(), "D" );
}
}
package com.brilliance.isc.funds.fttfcm.register.wfe;
import com.brilliance.isc.common.trnism.service.IWfeRegister;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.common.wfmmod.service.WfmmodService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component("fttfcm"+"."+ IWfeRegister.REGISTER_NAME)
public class FttfcmWfeRegister implements IWfeRegister {
@Override
public void wfeRegister(TrnmodVo trnmodVo){
}
}
package com.brilliance.isc.funds.fttfcm.resource;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.fttfcm.service.FttfcmTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FttfcmResource
* @description: 结售汇平盘确认 Fttfcm 请求入口
* @author: xiaotong
* @create: 2024-10-11 17:09
*/
@RestController
@RequestMapping("/fttfcm")
public class FttfcmResource extends AbstractTransactionController<FttfcmStoreVo> {
@Resource
private FttfcmStructMapper fttfcmStructMapper;
public IStructMapper getStructMapper() {
return fttfcmStructMapper;
}
@Resource
FttfcmTransactionServiceImpl fttfcmTransactionService;
/**
* 根据结售汇类型 等获取业务参号
*
* @param FttfcmStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FttfcmStoreVo fttfcmStoreVo) {
String ref = fttfcmTransactionService.getRef(fttfcmStoreVo);
return ResponseSet.simpleSuccess(ref);
}
}
package com.brilliance.isc.funds.fttfcm.service;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.isc.vo.model.FtdVo;
import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.liaall.service.LiaallService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.common.transaction.AbstractTransactionService;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.transaction.help.TransactionServiceSet;
import com.brilliance.isc.common.trnmod.service.TrnmodService;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.fttfcm.check.FttfcmValidator;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brilliance.isc.mda.dao.ActMapper;
import com.brilliance.isc.common.component.SptDataComponent;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static com.brilliance.mda.runtime.mda.Constants.*;
import static com.brilliance.mda.runtime.mda.Constants.CR;
/**
* @program: isc-funds
* @ClassName: FttfcmTransactionServiceImpl
* @description: 结售汇平盘确认 Fttfcm 业务处理
* @author: xiaotong
* @create: 2024-10-11 15:20
*/
@Service("fttfcm.transaction")
public class FttfcmTransactionServiceImpl extends AbstractTransactionService<FttfcmStoreBo> {
@Resource
private FttfcmValidator fttfcmValidator;
// @Autowired
// private FttfcmService fttfcmService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private TrnmodService trnmodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private CbsmodService cbsmodService;
@Resource
private LiaallService liaallService;
@Resource
private SettleContext settleContext;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private SysmodService sysmodService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private ActMapper actMapper;
@Resource
private SetmodService setmodService;
@Autowired
private FttfcmStructMapper fttfcmStructMapper;
@Autowired
SptDataComponent sptDataComponent;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDOC_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.UMDMOD_SERVICE, "N");
// serviceRegisterMaps.put(CommonContants.LIMMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_RMB_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_SZSB_BOPREM_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_CFABOP_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.FANXIQIAN_SERVICE, "Y");
}
@Override
protected void txnSave(FttfcmStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
@Override
protected Map<String, String> txnCheck(FttfcmStoreBo transactionVo) {
return fttfcmValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(FttfcmStoreBo transactionVo) {
FtdBizInfoVo bizInfoVo = new FtdBizInfoVo();
bizInfoVo.setObjtyp("FTD");
Ftd rec = transactionVo.getFtdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFttyp(rec.getFttyp());
bizInfoVo.setRat(rec.getRat());
bizInfoVo.setValdat(rec.getValdat());
bizInfoVo.setBnktyp(rec.getBnktyp());
bizInfoVo.setMsgtyp(transactionVo.getFttp().getMsgtyp());
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FttfcmStoreBo transactionVo) {
return null;
}
@Override
public FttfcmStoreBo init(FttfcmStoreBo fttfcmStoreBo) {
fttfcmStoreBo.reset();
init950(fttfcmStoreBo);
init1000(fttfcmStoreBo);
initFtdgrpRecOpndatN1000(fttfcmStoreBo);
return fttfcmStoreBo;
}
private void init950(FttfcmStoreBo fttfcmStoreBo) {
}
private void init1000(FttfcmStoreBo bo) {
if( ! sysmodService.sptIsAnyLoaded(bo.getSpt().getSta()) )
{
bo.getFttp().setMsgtyp( "320");
}
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
bo.getFtdgrp().getRec().setOwnusr(extkey);
bo.getFtdgrp().getRec().setUsr(extkey);
bo.getFtdgrp().getRec().setBnktyp("9");
bo.getFttp().setBnaktypflg("X");
}
@Override
public void beforeSave(FttfcmStoreBo transactionVo) {
transactionVo.reset();
Ftdgrp ftdgrp = transactionVo.getFtdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(ftdgrp.getRec());
transactionServiceSet.setBlk(ftdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
ftToolComponent.collectCbsMap(transactionServiceSet, "", ftdgrp.getCbs(), "max", "ins", "opn1", "opn2");
ftToolComponent.collectPtsList(transactionServiceSet, ftdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FttfcmStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFtdgrp().getRec().getInr());
}
public void ruleMtabutSavN500(FttfcmStoreBo bo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
ftToolComponent.getref(bo.getFtdgrp());
// 1. Create (rsp. update) Contract (incl. Texts)
bo.getFtdgrp().getRec().setCnfdat( Dates.today());
ftToolComponent.sav(bo.getFtdgrp());
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract ( trnmodVo);
cbsSav(bo,trnmodVo);
// save documents
//TODO
//记录116台账
//transactionVo.getNosmod().savNostro();
}
public String getRef(FttfcmStoreVo fttfcmStorevo) {
FttfcmStoreBo fttfcmStoreBo= fttfcmStructMapper.voTransferToBo(fttfcmStorevo);
return getRef(fttfcmStoreBo);
}
public String getRef(FttfcmStoreBo fttfcmStoreBo) {
fttfcmStoreBo.reset();
PtsptaVo ptsptaVo = fttfcmStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}else{
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
SettleContext.getUserSession().setWrkbch(wrkbch);
}
Ftdgrp ftdgrp = fttfcmStoreBo.getFtdgrp();
ftToolComponent.getref(ftdgrp);
return ftdgrp.getRec().getOwnref();
}
public void cbsSav(FttfcmStoreBo transactionVo, TrnmodVo trnmodVo) {
String trninr = transactionHelpService.getTrninr();
cbsmodService.cbsTrnSetNew("TRN",trnmodVo.getTrn().getInr());
trnmodService.cbsTrnStore("MAXAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getMax().getCur(),transactionVo.getFtdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fttfcm","CT000003"),transactionVo.getFtdgrp().getRec(),trninr);
trnmodService.cbsTrnStore("INSAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getIns().getCur(),transactionVo.getFtdgrp().getCbs().getIns().getAmt(),MdaUtils.getI18NString("fttfcm","CT000009"),transactionVo.getFtdgrp().getRec(),trninr);
if( MdaUtils.compareTo(transactionVo.getFtdgrp().getRec().getFttyp(),"LI") == 0 || MdaUtils.compareTo(transactionVo.getFtdgrp().getRec().getFttyp(),"DI") == 0 )
{
trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),transactionVo.getFtdgrp().getCbs().getMax().getCur(),transactionVo.getFtdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fttfcm","CT000010"),transactionVo.getFtdgrp().getRec(),trninr);
}
cbsmodService.cbsTrnCommit();
}
//Event fttp.msgtyp
public boolean ruleFttpMsgtypN1000(FttfcmStoreBo vo){
vo.reset();
SetglgVo setglgVo=vo.getSetglg();
for(int i = 1;i <= setglgVo.getSetgll().size();i++)
{
setglgVo.getSetgll().get(i).setMacold(NULLSTR);
}
return true;
}
/**
* source:fttfcm.0031.script
*/
@JsonIgnore
public void setMTn99(FttfcmStoreBo fttfcmStoreBo)
{
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
String blk = "ATTN:NANFANG SUB-BRANCH";
blk = blk + CR + "PLS DEBIT OUR A/C NO. " + fttp.getTriact() + " WITH " + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur()) + " FOR FIXED DEPOSIT DEAL, DETAILS BELOW:";
blk = blk + CR + "VALUE DATE: " + Formats.format(ftdgrp.getRec().getValdat(),"YYYYMMDD");
blk = blk + CR + "MATURITY DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND AMOUNT: " + ftdgrp.getCbs().getMax().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur());
blk = blk + CR + "INTEREST DUE DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND INTEREST AMT: " + ftdgrp.getCbs().getIns().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getIns().getAmt(),ftdgrp.getCbs().getIns().getCur());
blk = blk + CR + "INTEREST RATE: " + MdaUtils.toString(ftdgrp.getRec().getRat());
blk = blk + CR + "DATCOUNT FRACTION: " + ftdgrp.getRec().getCntfra();
blk = blk + CR + "PLS EFFECT OVER OUR ACCOUNT.";
blk = blk + CR + ".";
blk = blk + CR + "BEST REGARD";
blk = blk + CR + "IBD";
fttfcmStoreBo.setNarblk( blk);
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DO") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LO") == 0 )
{
fttfcmStoreBo.setRelref( ftdgrp.getTri().getPts().getRef());
}
else
{
fttfcmStoreBo.setRelref( ftdgrp.getTro().getPts().getRef());
}
}
public boolean defaultSwtn99N1000(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
String blk = NULLSTR;
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("narblk"))
{
blk = "ATTN:NANFANG SUB-BRANCH";
blk = blk + CR + "PLS DEBIT OUR A/C NO. " + fttp.getTriact() + " WITH " + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur()) + " FOR FIXED DEPOSIT DEAL, DETAILS BELOW:";
blk = blk + CR + "VALUE DATE: " + Formats.format(ftdgrp.getRec().getValdat(),"YYYYMMDD");
blk = blk + CR + "MATURITY DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND AMOUNT: " + ftdgrp.getCbs().getMax().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur());
blk = blk + CR + "INTEREST DUE DATE: " + Formats.format(ftdgrp.getRec().getMatdat(),"YYYYMMDD");
blk = blk + CR + "CURRENCY AND INTEREST AMT: " + ftdgrp.getCbs().getIns().getCur() + Formats.fmtAmount(ftdgrp.getCbs().getIns().getAmt(),ftdgrp.getCbs().getIns().getCur());
blk = blk + CR + "INTEREST RATE: " + MdaUtils.toString(ftdgrp.getRec().getRat());
blk = blk + CR + "DATCOUNT FRACTION: " + ftdgrp.getRec().getCntfra();
blk = blk + CR + "PLS EFFECT OVER OUR ACCOUNT.";
blk = blk + CR + ".";
blk = blk + CR + "BEST REGARD";
blk = blk + CR + "IBD";
fttfcmStoreBo.setNarblk( blk);
}
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("relref"))
{
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DO") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LO") == 0 )
{
fttfcmStoreBo.setRelref( ftdgrp.getTri().getPts().getRef());
}
else
{
fttfcmStoreBo.setRelref( ftdgrp.getTro().getPts().getRef());
}
}
return true;
}
/**
* source:fttfcm.0035.script
*/
//@Default(target="fttp.triact",order=1200)
public List<String> defaultFttpTriactN1200(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
/**
if not IsEmpty( FTDGRP\\CBS\\MAX\\CUR ) and not IsEmpty( FTDGRP\\ACT\\PTS\\PTYINR ) and ( FTDGRP\\REC\\FTTYP == "DO" or FTDGRP\\REC\\FTTYP == "LO" ) then
**/
List<String> actLst=new ArrayList<>();
if( ! MdaUtils.isEmpty(ftdgrp.getCbs().getMax().getCur()) && ! MdaUtils.isEmpty(ftdgrp.getAct().getPts().getPtyinr()) )
{
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getTri().getPtyinr() + "' AND TYP = 'DB'";
List<String > actList = actMapper.getSerAccByConditionSql(sql);
if( ! fttp.isModified("triact") && actLst.size()>0) {
fttp.setTriact( actLst.get(1));
}
}
else{
fttp.setTriact(NULLSTR);
}
return actLst;
}
public List<String> defaultFttpTroactN1200(FttfcmStoreBo fttfcmStoreBo){
Ftdgrp ftdgrp=fttfcmStoreBo.getFtdgrp();
Fttp fttp=fttfcmStoreBo.getFttp();
/**
if not IsEmpty( FTDGRP\\CBS\\MAX\\CUR ) and not IsEmpty( FTDGRP\\ACT\\PTS\\PTYINR ) and ( FTDGRP\\REC\\FTTYP == "DO" or FTDGRP\\REC\\FTTYP == "LO" ) then
**/
List<String> actLst=new ArrayList<>();
if( ! MdaUtils.isEmpty(ftdgrp.getCbs().getMax().getCur()) && ! MdaUtils.isEmpty(ftdgrp.getAct().getPts().getPtyinr()) )
{
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getTro().getPtyinr() + "' AND TYP = 'DB'";
List<String > actList = actMapper.getSerAccByConditionSql(sql);
if( ! fttp.isModified("troact") && actLst.size()>0) {
fttp.setTroact( actLst.get(1));
}
}
else{
fttp.setTroact(NULLSTR);
}
return actLst;
}
/**
* source:fttfcm.0003.script
*/
//@Default(target="ftdgrp.rec.opndat",order=1000)
public boolean initFtdgrpRecOpndatN1000(FttfcmStoreBo fttfcmStoreBo){
if( MdaUtils.isEmpty(fttfcmStoreBo.getFtdgrp().getRec().getOpndat()) )
{
fttfcmStoreBo.getFtdgrp().getRec().setOpndat( Dates.today());
}
if( MdaUtils.isEmpty(fttfcmStoreBo.getFtdgrp().getRec().getValdat()) )
{
fttfcmStoreBo.getFtdgrp().getRec().setValdat( Dates.today());
}
return true;
}
/**
* source:fttfcm.0019.script
*/
//@Default(target="ftdgrp.cbs.ins.amt",order=1000)
public boolean defaultFtdgrpCbsInsAmtN1000(FttfcmStoreBo fttfcmStoreBo){
switch( fttfcmStoreBo.getFtdgrp().getRec().getCntfra() )
{
case "ACT/365":
case "AFI/365":
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( xrtmodService.amtRnd( Decimals.div(Decimals.mul(Decimals.div(Decimals.mul(fttfcmStoreBo.getFtdgrp().getCbs().getMax().getAmt(),fttfcmStoreBo.getFtdgrp().getRec().getRat()),100),Dates.diff(fttfcmStoreBo.getFtdgrp().getRec().getMatdat(),fttfcmStoreBo.getFtdgrp().getRec().getValdat())),365), fttfcmStoreBo.getFtdgrp().getCbs().getIns().getCur() ));
break;
case "ACT/360":
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( xrtmodService.amtRnd( Decimals.div(Decimals.mul(Decimals.div(Decimals.mul(fttfcmStoreBo.getFtdgrp().getCbs().getMax().getAmt(),fttfcmStoreBo.getFtdgrp().getRec().getRat()),100),Dates.diff(fttfcmStoreBo.getFtdgrp().getRec().getMatdat(),fttfcmStoreBo.getFtdgrp().getRec().getValdat())),360), fttfcmStoreBo.getFtdgrp().getCbs().getIns().getCur() ));
break;
default:
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setAmt( new BigDecimal("0"));
}
return true;
}
/**
* source:fttfcm.0020.script
*/
//@Default(target="ftdgrp.cbs.ins.cur",order=1000)
public boolean defaultFtdgrpCbsInsCurN1000(FttfcmStoreBo fttfcmStoreBo){
fttfcmStoreBo.getFtdgrp().getCbs().getIns().setCur( fttfcmStoreBo.getFtdgrp().getCbs().getMax().getCur());
return true;
}
}
package com.brilliance.isc.funds.fttfcn.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.FttfcnStoreBo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import static com.brilliance.mda.runtime.mda.Constants.PanStaAdd;
import static com.brilliance.mda.runtime.mda.Constants.PanStaEdit;
/**
* @program: isc-funds
* @ClassName: FttfcnValidator
* @description: 结售汇平盘确认 fttfcn 校验
* @author: 肖桐
* @create: 2024-10-11 11:28
*/
@Component
public class FttfcnValidator extends AbstractModuleValidator <FttfcnStoreBo>{
@Override
@PostConstruct
public void register(){
super.register();;
}
@Override
public Map<String, String> validate(FttfcnStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
/**
* source:fttfcn.0022.script
*/
@Validate(path="canamt")
public ValidResult checkFtdgrpCbsInsAmtN1000(FttfcnStoreBo bo){
if (bo.getCanamt().compareTo(bo.getFtdgrp().getCbs().getOpn2().getAmt())>0 ) {
return ValidResult.build(false, "实际销账金额不能大于待销账金额!");
}
return null;
}
}
package com.brilliance.isc.funds.fttfcn.document;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FttfcnStoreBo;
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("fttfcn.docset")
public class FttfcnDocset extends AbstractTransactionDocSet<FttfcnStoreBo> {
}
package com.brilliance.isc.funds.fttfcn.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 com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.DiaToReplace;
import static com.brilliance.mda.runtime.mda.Constants.NULLDATE;
/**
* @program: isc-funds
* @ClassName: FttfcnDiasavRegister
* @description: 结售汇平盘确认 fttfcn 备忘录注册
* @author: Lenovo
* @create: 2024-10-11 17:30
*/
@Component("fttfcn.diasavRegister")
public class FttfcnDiasavRegister 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.fttfcn.register.doc;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.register.document.common.SetmodDocumentRegister;
import com.brilliance.isc.common.trndoc.service.TrndocService;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FttfcnDocumentRegister
* @description: 结售汇平盘确认 fttfcn 报文注册
* @author: Lenovo
* @create: 2024-10-11 17:47
*/
@Component("fttfcn.documentRegister")
public class FttfcnDocumentRegister implements IDocumentRegister {
@Autowired
TrndocService trndocService;
@Resource
PtsptaToolComponent ptsptaToolComponent;
@Autowired
private SetmodDocumentRegister setmodDocumentRegister;
@Resource
FtToolComponent ftToolComponent;
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
setmodDocumentRegister.registerDocument(trndoc);
//entmodDocumentRegister.registerDocument(trndoc);
}
public void doRegister(TrndocVo trndoc){
}
}
package com.brilliance.isc.funds.fttfcn.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: FttfcnFeeRegister
* @description: 结售汇平盘确认 fttfcn 费用注册
* @author: Lenovo
* @create: 2024-10-11 17:36
*/
@Component("fttfcn.feeRegister")
public class FttfcnFeeRegister 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.fttfcn.register.liaall;
import com.brilliance.isc.common.liaall.vo.LiaallVo;
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: FttfcnLiaallRegister
* @description: 结售汇平盘确认 fttfcn 表外注册
* @author: Lenovo
* @create: 2024-10-11 17:41
*/
@Component("fttfcn.liaallSetTransaction")
public class FttfcnLiaallRegister implements ILiaallRegister {
@Autowired
private LiaallRegister liaallRegister;
@Override
public void liaallSetTransaction(LiaallVo liaallVo) {
liaallRegister.liaallSetTransaction(liaallVo);
}
}
package com.brilliance.isc.funds.fttfcn.register.settle;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.register.settle.DefaultSettleRegister;
import com.brilliance.isc.common.register.settle.ISettleRegister;
import com.brilliance.isc.common.setglg.service.SetglgService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.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;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NO_ERROR;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component("fttfcn.settleRegister")
public class FttfcnSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private GlemodService glemodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private PtsptaToolComponent ptsptaToolComponent;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
FtdBizInfoVo rec = (FtdBizInfoVo) setmodVo.getRec();
Ftdgrp ftdgrp = ftToolComponent.getFtdgrpByInr(rec.getObjinr());
setmodVo.setDoccur(ftdgrp.getCbs().getMax().getCur());
setmodVo.setDocamt(rec.getCanamt());
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount ( setglg,"TRN" );
String cact = glemodService.getAvailAcc ( "FT-FXR", setmodVo.getDoccur(), "", ftdgrp.getCbs().getMax().getAmt() );
String cdtKey = setglgService.setglgAddAmount ( setglg,"TRN", "OWN", setmodVo.getDoccur(), rec.getCanamt().negate(), "", "FTC", "C", cact, "" );
String dbtKey = NULLSTR;
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LI") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DI") == 0 )
{
dbtKey =setglgService.setglgAddAmount ( setglg,"TRN", "TRO", setmodVo.getDoccur(), rec.getCanamt(), "", "DBD", "C", "", "" );
}
else
{
dbtKey = setglgService.setglgAddAmount ( setglg,"TRN", "TRI", setmodVo.getDoccur(), rec.getCanamt(), "", "DBD", "C", "", "" );
}
}
}
package com.brilliance.isc.funds.fttfcn.register.wfe;
import com.brilliance.isc.common.trnism.service.IWfeRegister;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import org.springframework.stereotype.Component;
@Component("fttfcn"+"."+ IWfeRegister.REGISTER_NAME)
public class FttfcnWfeRegister implements IWfeRegister {
@Override
public void wfeRegister(TrnmodVo trnmodVo){
}
}
package com.brilliance.isc.funds.fttfcn.resource;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.fttfcn.service.FttfcnTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FttfcnStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcnStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @program: isc-funds
* @ClassName: FttfcnResource
* @description: 结售汇平盘确认 fttfcn 请求入口
* @author: xiaotong
* @create: 2024-10-11 17:09
*/
@RestController
@RequestMapping("/fttfcn")
public class FttfcnResource extends AbstractTransactionController<FttfcnStoreVo> {
@Resource
private FttfcnStructMapper fttfcnStructMapper;
public IStructMapper getStructMapper() {
return fttfcnStructMapper;
}
@Resource
FttfcnTransactionServiceImpl fttfcnTransactionService;
}
package com.brilliance.isc.funds.fttfcn.service;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.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.SptDataComponent;
import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.liaall.service.LiaallService;
import com.brilliance.isc.common.setglg.vo.SetglgVo;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.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.FttfcnStoreBo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.fttfcn.check.FttfcnValidator;
import com.brilliance.isc.funds.transfer.transaction.FttfcnStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcnStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfcnStoreVo;
import com.brilliance.isc.mda.dao.ActMapper;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FtdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.brilliance.mda.runtime.mda.Constants.*;
/**
* @program: isc-funds
* @ClassName: FttfcnTransactionServiceImpl
* @description: 结售汇平盘确认 fttfcn 业务处理
* @author: xiaotong
* @create: 2024-10-11 15:20
*/
@Service("fttfcn.transaction")
public class FttfcnTransactionServiceImpl extends AbstractTransactionService<FttfcnStoreBo> {
@Resource
private FttfcnValidator fttfcnValidator;
// @Autowired
// private FttfcnService fttfcnService;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private TrnmodService trnmodService;
@Resource
private XrtmodService xrtmodService;
@Resource
private TransactionHelpService transactionHelpService;
@Resource
private CbsmodService cbsmodService;
@Resource
private LiaallService liaallService;
@Resource
private SettleContext settleContext;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private SysmodService sysmodService;
@Resource
private PtyratMapper ptyratMapper;
@Resource
private ActMapper actMapper;
@Resource
private SetmodService setmodService;
@Autowired
private FttfcnStructMapper fttfcnStructMapper;
@Autowired
SptDataComponent sptDataComponent;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDOC_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.GLEMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.UMDMOD_SERVICE, "N");
// serviceRegisterMaps.put(CommonContants.LIMMOD_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_RMB_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_SZSB_BOPREM_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.BOPSET_CFABOP_SERVICE, "Y");
// serviceRegisterMaps.put(CommonContants.FANXIQIAN_SERVICE, "Y");
}
@Override
protected void txnSave(FttfcnStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
}
@Override
protected Map<String, String> txnCheck(FttfcnStoreBo transactionVo) {
return fttfcnValidator.validate(transactionVo);
}
@Override
protected BizInfoVo buildBizInfo(FttfcnStoreBo transactionVo) {
FtdBizInfoVo bizInfoVo = new FtdBizInfoVo();
bizInfoVo.setObjtyp("FTD");
Ftd rec = transactionVo.getFtdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFttyp(rec.getFttyp());
bizInfoVo.setCanamt(transactionVo.getCanamt());
return bizInfoVo;
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FttfcnStoreBo transactionVo) {
return null;
}
@Override
public FttfcnStoreBo init(FttfcnStoreBo fttfcnStoreBo) {
fttfcnStoreBo.reset();
init950(fttfcnStoreBo);
init1000(fttfcnStoreBo);
if( MdaUtils.isEmpty(fttfcnStoreBo.getFtdgrp().getRec().getOpndat()) )
{
fttfcnStoreBo.getFtdgrp().getRec().setOpndat( Dates.today());
}
return fttfcnStoreBo;
}
private void init950(FttfcnStoreBo fttfcnStoreBo) {
}
private void init1000(FttfcnStoreBo bo) {
}
@Override
public void beforeSave(FttfcnStoreBo transactionVo) {
transactionVo.reset();
Ftdgrp ftdgrp = transactionVo.getFtdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(ftdgrp.getRec());
transactionServiceSet.setBlk(ftdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
ftToolComponent.collectCbsMap(transactionServiceSet, "", ftdgrp.getCbs(), "max", "ins", "opn1", "opn2");
ftToolComponent.collectPtsList(transactionServiceSet, ftdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FttfcnStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFtdgrp().getRec().getInr());
}
public void ruleMtabutSavN500(FttfcnStoreBo bo) {
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
ftToolComponent.getref(bo.getFtdgrp());
// 1. Create (rsp. update) Contract (incl. Texts)
ftToolComponent.sav(bo.getFtdgrp());
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract ( trnmodVo);
cbsSav(bo,trnmodVo);
// save documents
//TODO
//记录116台账
//transactionVo.getNosmod().savNostro();
}
public String getRef(FttfcnStoreVo fttfcnStorevo) {
FttfcnStoreBo fttfcnStoreBo= fttfcnStructMapper.voTransferToBo(fttfcnStorevo);
return getRef(fttfcnStoreBo);
}
public String getRef(FttfcnStoreBo fttfcnStoreBo) {
fttfcnStoreBo.reset();
PtsptaVo ptsptaVo = fttfcnStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}else{
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
SettleContext.getUserSession().setWrkbch(wrkbch);
}
Ftdgrp ftdgrp = fttfcnStoreBo.getFtdgrp();
ftToolComponent.getref(ftdgrp);
return ftdgrp.getRec().getOwnref();
}
public void cbsSav(FttfcnStoreBo transactionVo, TrnmodVo trnmodVo) {
String trninr = transactionHelpService.getTrninr();
SetmodVo setmodVo = transactionHelpService.getTransactionStoreSet().getSetmodVo();
cbsmodService.cbsTrnSetNew("TRN",trninr);
trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),setmodVo.getDoccur(),transactionVo.getCanamt().negate(),"Funds Transfer",transactionVo.getFtdgrp().getRec(),trninr);
cbsmodService.cbsTrnCommit();
}
//@Default(target="mtabut.clsflg",order=5000)
// public boolean defaultMtabutclsflgN5000(FttfcnStoreBo fttfcnStoreBo){
// Ftdgrp ftdgrp = fttfcnStoreBo.getFtdgrp();
// SetmodVo setmodVo = transactionHelpService.getTransactionStoreSet().getSetmodVo();
// // Close Flag is defaulted with X, if the conditions for setting close date like in MTABUT\\SAV are fulfilled
// boolean clsflg = true;
// if( ! MdaUtils.isEmpty(ftdgrp.getRec().getCnfdat()) )
// {
// if( MdaUtils.compareTo(ftdgrp.getCbs().getOpn1().getAmt(),0)>0 )
// {
// clsflg = false;
// }
// if( MdaUtils.compareTo(ftdgrp.getCbs().getOpn2().getAmt(),fttfcnStoreBo.getCanamt()) != 0 )
// {
// clsflg = false;
// }
// if( clsflg )
// {
// if( ! Systems.isModified(this.getMtabut(),"clsflg") )
// {
// this.getMtabut().setclsflg("C");
// }
// Systems.setEnabled(this.getMtabut(),"clsflg");
// }
// else
// {
// Dynamic.disableAndClearField( MdaDriver.getDatafield(this.getMtabut(),"clsflg") );
// this.getMtabut().setclsflg("O");
// }
// }
// else
// {
// Dynamic.disableAndClearField( MdaDriver.getDatafield(this.getMtabut(),"clsflg") );
// this.getMtabut().setclsflg("O");
// }
//
//
// return true;
// }
}
......@@ -2,6 +2,7 @@ package com.brilliance.isc.funds.fxtssb.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.bo.funds.FxtssbStoreBo;
import com.brilliance.isc.funds.fxtssb.service.FxtssbTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtssbStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
......@@ -52,7 +53,8 @@ public class FxtssbResource extends AbstractTransactionController<FxtssbStoreVo>
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
String ref = fxtssbTransactionService.getRef(fxtssbStoreVo);
FxtssbStoreBo fxtssbStoreBo = fxtssbStructMapper.voTransferToBo(fxtssbStoreVo);
String ref = fxtssbTransactionService.getRef(fxtssbStoreBo);
return ResponseSet.simpleSuccess(ref);
}
......@@ -60,7 +62,8 @@ public class FxtssbResource extends AbstractTransactionController<FxtssbStoreVo>
public ResponseSet defaultAccountsN1000(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
try {
settleContext.loadSettleSession("FXTSSB","","");
Map<String, List<String>> codeSet = fxtssbTransactionService.defaultAccountsN1000(fxtssbStoreVo);
FxtssbStoreBo fxtssbStoreBo = fxtssbStructMapper.voTransferToBo(fxtssbStoreVo);
Map<String, List<String>> codeSet = fxtssbTransactionService.defaultAccountsN1000(fxtssbStoreBo);
ResponseSet success = ResponseSet.simpleSuccess(fxtssbStoreVo);
success.setCodeSet(codeSet);
return success;
......@@ -75,7 +78,8 @@ public class FxtssbResource extends AbstractTransactionController<FxtssbStoreVo>
public ResponseSet defaultRateN1000(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
try {
settleContext.loadSettleSession("FXTSSB","","");
fxtssbTransactionService.defaultRateN1000(fxtssbStoreVo);
FxtssbStoreBo fxtssbStoreBo = fxtssbStructMapper.voTransferToBo(fxtssbStoreVo);
fxtssbTransactionService.defaultRateN1000(fxtssbStoreBo);
return ResponseSet.simpleSuccess(fxtssbStoreVo);
} catch (Exception e) {
throw e;
......@@ -89,7 +93,8 @@ public class FxtssbResource extends AbstractTransactionController<FxtssbStoreVo>
public ResponseSet defaultCalculateN1100(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
try {
settleContext.loadSettleSession("FXTSSB","","");
fxtssbTransactionService.defaultCalculateN1100(fxtssbStoreVo);
FxtssbStoreBo fxtssbStoreBo = fxtssbStructMapper.voTransferToBo(fxtssbStoreVo);
fxtssbTransactionService.defaultCalculateN1100(fxtssbStoreBo);
return ResponseSet.simpleSuccess(fxtssbStoreVo);
} catch (Exception e) {
throw e;
......
......@@ -110,8 +110,8 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
@Override
protected void txnSave(FxtssbStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
protected void txnSave(FxtssbStoreBo bo) {
ruleMtabutSavN500(bo);
}
public void ruleMtabutSavN500(FxtssbStoreBo bo) {
......@@ -135,15 +135,15 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
}
@Override
protected Map<String, String> txnCheck(FxtssbStoreBo transactionVo) {
return fxtssbValidator.validate(transactionVo);
protected Map<String, String> txnCheck(FxtssbStoreBo bo) {
return fxtssbValidator.validate(bo);
}
@Override
protected BizInfoVo buildBizInfo(FxtssbStoreBo transactionVo) {
protected BizInfoVo buildBizInfo(FxtssbStoreBo bo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD");
Fxd rec = transactionVo.getFxdgrp().getRec();
Fxd rec = bo.getFxdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFxtyp(rec.getFxtyp());
......@@ -159,7 +159,7 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FxtssbStoreBo transactionVo) {
protected BizAmdInfoVo buildBizAmdInfo(FxtssbStoreBo bo) {
return null;
}
......@@ -178,7 +178,7 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
bo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
// MAXAMT = 200000.00
// Systems.setValues(fxtssbStoreVo.getFxdgrp().getRec(), "fxtyp", "SB");
// Systems.setValues(bo.getFxdgrp().getRec(), "fxtyp", "SB");
//结售汇类型 SB:即期结汇
bo.getFxdgrp().getRec().setFxtyp("SB");
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
......@@ -199,107 +199,107 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
}
@Override
public void beforeSave(FxtssbStoreBo transactionVo) {
transactionVo.reset();
Fxdgrp fxdgrp = transactionVo.getFxdgrp();
public void beforeSave(FxtssbStoreBo bo) {
bo.reset();
Fxdgrp fxdgrp = bo.getFxdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(fxdgrp.getRec());
transactionServiceSet.setBlk(fxdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
transactionServiceSet.setTransactionVo(bo);
fxToolComponent.collectCbsMap(transactionServiceSet, "", fxdgrp.getCbs(), "max", "nom1", "opn1", "opn2");
fxToolComponent.collectPtsList(transactionServiceSet, fxdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
settleContext.loadSettleSession(bo.getTransName(), bo.getUserId(), buildBizInfo(bo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FxtssbStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFxdgrp().getRec().getInr());
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FxtssbStoreBo bo) {
bizInfoVo.setObjinr(bo.getFxdgrp().getRec().getInr());
}
/**
* source:fxtssb.0003.script
*/
public void cbsSav(FxtssbStoreBo transactionVo, TrnmodVo trnmodVo) {
public void cbsSav(FxtssbStoreBo bo, TrnmodVo trnmodVo) {
cbsmodService.cbsTrnSetNew("TRN", trnmodVo.getTrn().getInr());
Fxacbs cbs = transactionVo.getFxdgrp().getCbs();
Fxacbs cbs = bo.getFxdgrp().getCbs();
String trninr = transactionHelpService.getTrninr();
trnmodService.cbsTrnStore("MAXAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), transactionVo.getFxdgrp().getRec(), trninr);
trnmodService.cbsTrnStore("MAXAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), bo.getFxdgrp().getRec(), trninr);
if (!MdaUtils.isEmpty(cbs.getNom1().getAmt())) {
trnmodService.cbsTrnStore("NOMAMT", "AMT1", Dates.today(), cbs.getNom1().getCur(), cbs.getNom1().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), transactionVo.getFxdgrp().getRec(), trninr);
trnmodService.cbsTrnStore("UTLAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), transactionVo.getFxdgrp().getRec(), trninr);
trnmodService.cbsTrnStore("NOMAMT", "AMT1", Dates.today(), cbs.getNom1().getCur(), cbs.getNom1().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), bo.getFxdgrp().getRec(), trninr);
trnmodService.cbsTrnStore("UTLAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), bo.getFxdgrp().getRec(), trninr);
}
}
/**
* source:fxtssb.0022.script
*/
public Map<String, List<String>> defaultAccountsN1000(FxtssbStoreVo fxtssbStoreVo) {
fxtssbStoreVo.reset();
public Map<String, List<String>> defaultAccountsN1000(FxtssbStoreBo bo) {
bo.reset();
String trnTyp = NULLSTR;
String accLst = NULLSTR;
IStream accStm = new StreamImpl();
String acc2Lst = NULLSTR;
IStream acc2Stm = new StreamImpl();
Map<String, List<String>> map = new HashMap();
if (!MdaUtils.isEmpty(fxtssbStoreVo.getFxdgrp().getCbs().getMax().getCur()) && !MdaUtils.isEmpty(fxtssbStoreVo.getFxdgrp().getApl().getPts().getPtyinr())) {
if (!MdaUtils.isEmpty(fxtssbStoreVo.getFxdgrp().getRec().getDsp())) {
trnTyp = fxtssbStoreVo.getFxdgrp().getRec().getDsp();
if (!MdaUtils.isEmpty(bo.getFxdgrp().getCbs().getMax().getCur()) && !MdaUtils.isEmpty(bo.getFxdgrp().getApl().getPts().getPtyinr())) {
if (!MdaUtils.isEmpty(bo.getFxdgrp().getRec().getDsp())) {
trnTyp = bo.getFxdgrp().getRec().getDsp();
if (MdaUtils.compareTo(trnTyp, "CA") == 0) {
trnTyp = "LO-TT2";
}
if (MdaUtils.compareTo(trnTyp, "SP") == 0 || MdaUtils.compareTo(trnTyp, "HA") == 0) {
accLst = glemodService.getAvailAcc(trnTyp, fxtssbStoreVo.getFxdgrp().getCbs().getMax().getCur(), "", fxtssbStoreVo.getFxdgrp().getCbs().getMax().getAmt());
accLst = glemodService.getAvailAcc(trnTyp, bo.getFxdgrp().getCbs().getMax().getCur(), "", bo.getFxdgrp().getCbs().getMax().getAmt());
} else {
accLst = glemodService.getAvailAcc(trnTyp, fxtssbStoreVo.getFxdgrp().getCbs().getMax().getCur(), fxtssbStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), fxtssbStoreVo.getFxdgrp().getCbs().getMax().getAmt());
accLst = glemodService.getAvailAcc(trnTyp, bo.getFxdgrp().getCbs().getMax().getCur(), bo.getFxdgrp().getApl().getPts().getPtyinr(), bo.getFxdgrp().getCbs().getMax().getAmt());
}
// Systems.setValues(fxtssbStoreVo.getFxdgrp().getRec(), "acc", accLst);
// Systems.setValues(bo.getFxdgrp().getRec(), "acc", accLst);
if (StringUtils.isNotEmpty(accLst)) {
String[] split = accLst.split("[\\n]|\\r\\n");
map.put("accLst", new ArrayList<>(Arrays.asList(split)));
}
if (!fxtssbStoreVo.getFxdgrp().getRec().isModified("acc")) {
if (!bo.getFxdgrp().getRec().isModified("acc")) {
if (!MdaUtils.isEmpty(accLst)) {
Streams.streamClear(accStm);
Streams.streamSet(accStm, accLst);
fxtssbStoreVo.getFxdgrp().getRec().setAcc(Strings.getLine(accStm, 1));
bo.getFxdgrp().getRec().setAcc(Strings.getLine(accStm, 1));
}
}
// Systems.setEnabled(fxtssbStoreVo.getFxdgrp().getRec(), "acc");
// Systems.setEnabled(bo.getFxdgrp().getRec(), "acc");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtssbStoreVo.getFxdgrp().getRec(), "acc"));
fxtssbStoreVo.getFxdgrp().getRec().setAcc(NULLSTR);
// Dynamic.disableAndClearField(MdaDriver.getDatafield(bo.getFxdgrp().getRec(), "acc"));
bo.getFxdgrp().getRec().setAcc(NULLSTR);
}
if (!MdaUtils.isEmpty(fxtssbStoreVo.getFxdgrp().getRec().getDsp2())) {
if (MdaUtils.compareTo(fxtssbStoreVo.getFxdgrp().getRec().getDsp2(), "SP") == 0) {
acc2Lst = glemodService.getAvailAcc(fxtssbStoreVo.getFxdgrp().getRec().getDsp2(), "CNY", "", BigDecimal.ONE);
if (!MdaUtils.isEmpty(bo.getFxdgrp().getRec().getDsp2())) {
if (MdaUtils.compareTo(bo.getFxdgrp().getRec().getDsp2(), "SP") == 0) {
acc2Lst = glemodService.getAvailAcc(bo.getFxdgrp().getRec().getDsp2(), "CNY", "", BigDecimal.ONE);
} else {
acc2Lst = glemodService.getAvailAcc(fxtssbStoreVo.getFxdgrp().getRec().getDsp2(), "CNY", fxtssbStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), BigDecimal.ONE);
acc2Lst = glemodService.getAvailAcc(bo.getFxdgrp().getRec().getDsp2(), "CNY", bo.getFxdgrp().getApl().getPts().getPtyinr(), BigDecimal.ONE);
}
// Systems.setValues(fxtssbStoreVo.getFxdgrp().getRec(), "acc2", acc2Lst);
// Systems.setValues(bo.getFxdgrp().getRec(), "acc2", acc2Lst);
if (StringUtils.isNotEmpty(acc2Lst)) {
String[] split = acc2Lst.split("[\\n]|\\r\\n");
map.put("acc2Lst", new ArrayList<>(Arrays.asList(split)));
}
if (!fxtssbStoreVo.getFxdgrp().getRec().isModified("acc2")) {
if (!bo.getFxdgrp().getRec().isModified("acc2")) {
if (!MdaUtils.isEmpty(acc2Lst)) {
Streams.streamClear(acc2Stm);
Streams.streamSet(acc2Stm, acc2Lst);
fxtssbStoreVo.getFxdgrp().getRec().setAcc2(Strings.getLine(acc2Stm, 1));
bo.getFxdgrp().getRec().setAcc2(Strings.getLine(acc2Stm, 1));
}
}
// Systems.setEnabled(fxtssbStoreVo.getFxdgrp().getRec(), "acc2");
// Systems.setEnabled(bo.getFxdgrp().getRec(), "acc2");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtssbStoreVo.getFxdgrp().getRec(), "acc2"));
fxtssbStoreVo.getFxdgrp().getRec().setAcc2(NULLSTR);
// Dynamic.disableAndClearField(MdaDriver.getDatafield(bo.getFxdgrp().getRec(), "acc2"));
bo.getFxdgrp().getRec().setAcc2(NULLSTR);
}
}
return map;
}
public String getRef(FxtssbStoreVo fxtssbStoreVo) {
fxtssbStoreVo.reset();
PtsptaVo ptsptaVo = fxtssbStoreVo.getFxdgrp().getApl();
public String getRef(FxtssbStoreBo bo) {
bo.reset();
PtsptaVo ptsptaVo = bo.getFxdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
......@@ -311,7 +311,7 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Fxdgrp fxdgrp = fxtssbStoreVo.getFxdgrp();
Fxdgrp fxdgrp = bo.getFxdgrp();
fxToolComponent.getref(fxdgrp);
return fxdgrp.getRec().getOwnref();
}
......@@ -325,7 +325,7 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
* fxtp.cshflg 钞汇标志 1:现汇 2:现钞
* fxtp.quoflg Quote Flag
*/
public void defaultRateN1000(FxtssbStoreVo vo) {
public void defaultRateN1000(FxtssbStoreBo vo) {
vo.reset();
String rmbRat = NULLSTR;
BigDecimal buyRat = null;
......@@ -418,7 +418,7 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
}
}
private SetmodVo buildSetmodVo(FxtssbStoreVo vo) {
private SetmodVo buildSetmodVo(FxtssbStoreBo vo) {
SetmodVo setmodVo = new SetmodVo();
Map cbsMap = new HashMap();
Cbb max = vo.getFxdgrp().getCbs().getMax();
......@@ -434,8 +434,8 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
return setmodVo;
}
public void defaultCalculateN1100(FxtssbStoreVo fxtssbStoreVo) {
fxtssbStoreVo.reset();
fxtpService.defaultCalculateN1100(fxtssbStoreVo.getFxdgrp(), fxtssbStoreVo.getFxtp());
public void defaultCalculateN1100(FxtssbStoreBo bo) {
bo.reset();
fxtpService.defaultCalculateN1100(bo.getFxdgrp(), bo.getFxtp());
}
}
......@@ -2,6 +2,7 @@ package com.brilliance.isc.funds.fxtsss.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.bo.funds.FxtsssStoreBo;
import com.brilliance.isc.funds.fxtsss.service.FxtsssTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtsssStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtsssStoreVo;
......@@ -51,7 +52,8 @@ public class FxtsssResource extends AbstractTransactionController<FxtsssStoreVo>
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FxtsssStoreVo fxtsssStoreVo) {
String ref = fxtsssTransactionService.getRef(fxtsssStoreVo);
FxtsssStoreBo fxtsssStoreBo = fxtsssStructMapper.voTransferToBo(fxtsssStoreVo);
String ref = fxtsssTransactionService.getRef(fxtsssStoreBo);
return ResponseSet.simpleSuccess(ref);
}
......@@ -59,7 +61,8 @@ public class FxtsssResource extends AbstractTransactionController<FxtsssStoreVo>
public ResponseSet defaultAccountsN1000(@RequestBody FxtsssStoreVo fxtsssStoreVo) {
try {
settleContext.loadSettleSession("FXTSSS", "", "");
Map<String, List<String>> codeSet = fxtsssTransactionService.defaultAccountsN1000(fxtsssStoreVo);
FxtsssStoreBo fxtsssStoreBo = fxtsssStructMapper.voTransferToBo(fxtsssStoreVo);
Map<String, List<String>> codeSet = fxtsssTransactionService.defaultAccountsN1000(fxtsssStoreBo);
ResponseSet success = ResponseSet.simpleSuccess(fxtsssStoreVo);
success.setCodeSet(codeSet);
return success;
......@@ -74,7 +77,8 @@ public class FxtsssResource extends AbstractTransactionController<FxtsssStoreVo>
public ResponseSet defaultRateN1000(@RequestBody FxtsssStoreVo fxtsssStoreVo) {
try {
settleContext.loadSettleSession("FXTSSS", "", "");
fxtsssTransactionService.defaultRateN1000(fxtsssStoreVo);
FxtsssStoreBo fxtsssStoreBo = fxtsssStructMapper.voTransferToBo(fxtsssStoreVo);
fxtsssTransactionService.defaultRateN1000(fxtsssStoreBo);
return ResponseSet.simpleSuccess(fxtsssStoreVo);
} catch (Exception e) {
throw e;
......@@ -88,7 +92,8 @@ public class FxtsssResource extends AbstractTransactionController<FxtsssStoreVo>
public ResponseSet defaultCalculateN1100(@RequestBody FxtsssStoreVo fxtsssStoreVo) {
try {
settleContext.loadSettleSession("FXTSSS", "", "");
fxtsssTransactionService.defaultCalculateN1100(fxtsssStoreVo);
FxtsssStoreBo fxtsssStoreBo = fxtsssStructMapper.voTransferToBo(fxtsssStoreVo);
fxtsssTransactionService.defaultCalculateN1100(fxtsssStoreBo);
return ResponseSet.simpleSuccess(fxtsssStoreVo);
} catch (Exception e) {
throw e;
......
......@@ -24,10 +24,10 @@ 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.FxtsssStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtsssStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtlop.service.FxtpService;
import com.brilliance.isc.funds.fxtsss.check.FxtsssValidator;
import com.brilliance.isc.funds.vo.funds.FxtsssStoreVo;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.IStream;
......@@ -109,8 +109,8 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
@Override
protected void txnSave(FxtsssStoreBo transactionVo) {
ruleMtabutSavN500(transactionVo);
protected void txnSave(FxtsssStoreBo bo) {
ruleMtabutSavN500(bo);
}
public void ruleMtabutSavN500(FxtsssStoreBo bo) {
......@@ -144,15 +144,15 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
@Override
protected Map<String, String> txnCheck(FxtsssStoreBo transactionVo) {
return fxtsssValidator.validate(transactionVo);
protected Map<String, String> txnCheck(FxtsssStoreBo bo) {
return fxtsssValidator.validate(bo);
}
@Override
protected BizInfoVo buildBizInfo(FxtsssStoreBo transactionVo) {
protected BizInfoVo buildBizInfo(FxtsssStoreBo bo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD");
Fxd rec = transactionVo.getFxdgrp().getRec();
Fxd rec = bo.getFxdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFxtyp(rec.getFxtyp());
......@@ -168,15 +168,15 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
@Override
protected BizAmdInfoVo buildBizAmdInfo(FxtsssStoreBo transactionVo) {
protected BizAmdInfoVo buildBizAmdInfo(FxtsssStoreBo bo) {
return null;
}
@Override
public FxtsssStoreBo init(FxtsssStoreBo fxtsssStoreBo) {
fxtsssStoreBo.reset();
init1000(fxtsssStoreBo);
return fxtsssStoreBo;
public FxtsssStoreBo init(FxtsssStoreBo bo) {
bo.reset();
init1000(bo);
return bo;
}
/**
......@@ -186,7 +186,7 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
bo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
// MAXAMT = 200000.00
// Systems.setValues(fxtsssStoreVo.getFxdgrp().getRec(), "fxtyp", "SB");
// Systems.setValues(bo.getFxdgrp().getRec(), "fxtyp", "SB");
//结售汇类型 SS:即期售汇
bo.getFxdgrp().getRec().setFxtyp("SS");
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
......@@ -203,99 +203,98 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
private void init950(FxtsssStoreBo fxtsssStoreBo) {
private void init950(FxtsssStoreBo bo) {
}
@Override
public void beforeSave(FxtsssStoreBo transactionVo) {
transactionVo.reset();
transactionVo.reset();
Fxdgrp fxdgrp = transactionVo.getFxdgrp();
public void beforeSave(FxtsssStoreBo bo) {
bo.reset();
bo.reset();
Fxdgrp fxdgrp = bo.getFxdgrp();
TransactionServiceSet transactionServiceSet = transactionHelpService.getTransactionStoreSet();
transactionServiceSet.setRec(fxdgrp.getRec());
transactionServiceSet.setBlk(fxdgrp.getBlk());
transactionServiceSet.setTransactionVo(transactionVo);
transactionServiceSet.setTransactionVo(bo);
fxToolComponent.collectCbsMap(transactionServiceSet, "", fxdgrp.getCbs(), "max", "nom1", "opn1", "opn2");
fxToolComponent.collectPtsList(transactionServiceSet, fxdgrp, null);
settleContext.loadSettleSession(transactionVo.getTransName(), transactionVo.getUserId(), buildBizInfo(transactionVo), transactionServiceSet.getPtsList());
settleContext.loadSettleSession(bo.getTransName(), bo.getUserId(), buildBizInfo(bo), transactionServiceSet.getPtsList());
}
@Override
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FxtsssStoreBo transactionVo) {
bizInfoVo.setObjinr(transactionVo.getFxdgrp().getRec().getInr());
protected void updateBizInfoVo(BizInfoVo bizInfoVo, FxtsssStoreBo bo) {
bizInfoVo.setObjinr(bo.getFxdgrp().getRec().getInr());
}
/**
* source:fxtsss.0022.script
*/
public Map<String, List<String>> defaultAccountsN1000(FxtsssStoreVo fxtsssStoreVo) {
fxtsssStoreVo.reset();
public Map<String, List<String>> defaultAccountsN1000(FxtsssStoreBo bo) {
bo.reset();
String trnTyp = NULLSTR;
String accLst = NULLSTR;
IStream accStm = new StreamImpl();
String acc2Lst = NULLSTR;
IStream acc2Stm = new StreamImpl();
Map<String, List<String>> map = new HashMap();
if (!MdaUtils.isEmpty(fxtsssStoreVo.getFxdgrp().getCbs().getMax().getCur()) && !MdaUtils.isEmpty(fxtsssStoreVo.getFxdgrp().getApl().getPts().getPtyinr())) {
if (!MdaUtils.isEmpty(fxtsssStoreVo.getFxdgrp().getRec().getDsp())) {
trnTyp = fxtsssStoreVo.getFxdgrp().getRec().getDsp();
if (!MdaUtils.isEmpty(bo.getFxdgrp().getCbs().getMax().getCur()) && !MdaUtils.isEmpty(bo.getFxdgrp().getApl().getPts().getPtyinr())) {
if (!MdaUtils.isEmpty(bo.getFxdgrp().getRec().getDsp())) {
trnTyp = bo.getFxdgrp().getRec().getDsp();
if (MdaUtils.compareTo(trnTyp, "CA") == 0) {
trnTyp = "LO-TT2";
}
if (MdaUtils.compareTo(trnTyp, "SP") == 0 || MdaUtils.compareTo(trnTyp, "HA") == 0) {
accLst = glemodService.getAvailAcc(trnTyp, fxtsssStoreVo.getFxdgrp().getCbs().getMax().getCur(), "", fxtsssStoreVo.getFxdgrp().getCbs().getMax().getAmt());
accLst = glemodService.getAvailAcc(trnTyp, bo.getFxdgrp().getCbs().getMax().getCur(), "", bo.getFxdgrp().getCbs().getMax().getAmt());
} else {
accLst = glemodService.getAvailAcc(trnTyp, fxtsssStoreVo.getFxdgrp().getCbs().getMax().getCur(), fxtsssStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), fxtsssStoreVo.getFxdgrp().getCbs().getMax().getAmt());
accLst = glemodService.getAvailAcc(trnTyp, bo.getFxdgrp().getCbs().getMax().getCur(), bo.getFxdgrp().getApl().getPts().getPtyinr(), bo.getFxdgrp().getCbs().getMax().getAmt());
}
// Systems.setValues(fxtsssStoreVo.getFxdgrp().getRec(), "acc", accLst);
// Systems.setValues(bo.getFxdgrp().getRec(), "acc", accLst);
if (StringUtils.isNotEmpty(accLst)) {
String[] split = accLst.split("[\\n]|\\r\\n");
map.put("accLst", new ArrayList<>(Arrays.asList(split)));
}
if (!fxtsssStoreVo.getFxdgrp().getRec().isModified("acc")) {
if (!bo.getFxdgrp().getRec().isModified("acc")) {
if (!MdaUtils.isEmpty(accLst)) {
Streams.streamClear(accStm);
Streams.streamSet(accStm, accLst);
fxtsssStoreVo.getFxdgrp().getRec().setAcc(Strings.getLine(accStm, 1));
bo.getFxdgrp().getRec().setAcc(Strings.getLine(accStm, 1));
}
}
// Systems.setEnabled(fxtsssStoreVo.getFxdgrp().getRec(), "acc");
// Systems.setEnabled(bo.getFxdgrp().getRec(), "acc");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtsssStoreVo.getFxdgrp().getRec(), "acc"));
fxtsssStoreVo.getFxdgrp().getRec().setAcc(NULLSTR);
// Dynamic.disableAndClearField(MdaDriver.getDatafield(bo.getFxdgrp().getRec(), "acc"));
bo.getFxdgrp().getRec().setAcc(NULLSTR);
}
if (!MdaUtils.isEmpty(fxtsssStoreVo.getFxdgrp().getRec().getDsp2())) {
if (MdaUtils.compareTo(fxtsssStoreVo.getFxdgrp().getRec().getDsp2(), "SP") == 0) {
acc2Lst = glemodService.getAvailAcc(fxtsssStoreVo.getFxdgrp().getRec().getDsp2(), "CNY", "", BigDecimal.ONE);
if (!MdaUtils.isEmpty(bo.getFxdgrp().getRec().getDsp2())) {
if (MdaUtils.compareTo(bo.getFxdgrp().getRec().getDsp2(), "SP") == 0) {
acc2Lst = glemodService.getAvailAcc(bo.getFxdgrp().getRec().getDsp2(), "CNY", "", BigDecimal.ONE);
} else {
acc2Lst = glemodService.getAvailAcc(fxtsssStoreVo.getFxdgrp().getRec().getDsp2(), "CNY", fxtsssStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), BigDecimal.ONE);
acc2Lst = glemodService.getAvailAcc(bo.getFxdgrp().getRec().getDsp2(), "CNY", bo.getFxdgrp().getApl().getPts().getPtyinr(), BigDecimal.ONE);
}
// Systems.setValues(fxtsssStoreVo.getFxdgrp().getRec(), "acc2", acc2Lst);
// Systems.setValues(bo.getFxdgrp().getRec(), "acc2", acc2Lst);
if (StringUtils.isNotEmpty(acc2Lst)) {
String[] split = acc2Lst.split("[\\n]|\\r\\n");
map.put("acc2Lst", new ArrayList<>(Arrays.asList(split)));
}
if (!fxtsssStoreVo.getFxdgrp().getRec().isModified("acc2")) {
if (!bo.getFxdgrp().getRec().isModified("acc2")) {
if (!MdaUtils.isEmpty(acc2Lst)) {
Streams.streamClear(acc2Stm);
Streams.streamSet(acc2Stm, acc2Lst);
fxtsssStoreVo.getFxdgrp().getRec().setAcc2(Strings.getLine(acc2Stm, 1));
bo.getFxdgrp().getRec().setAcc2(Strings.getLine(acc2Stm, 1));
}
}
// Systems.setEnabled(fxtsssStoreVo.getFxdgrp().getRec(), "acc2");
// Systems.setEnabled(bo.getFxdgrp().getRec(), "acc2");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtsssStoreVo.getFxdgrp().getRec(), "acc2"));
fxtsssStoreVo.getFxdgrp().getRec().setAcc2(NULLSTR);
// Dynamic.disableAndClearField(MdaDriver.getDatafield(bo.getFxdgrp().getRec(), "acc2"));
bo.getFxdgrp().getRec().setAcc2(NULLSTR);
}
}
return map;
}
public String getRef(FxtsssStoreVo fxtsssStoreVo) {
fxtsssStoreVo.reset();
PtsptaVo ptsptaVo = fxtsssStoreVo.getFxdgrp().getApl();
public String getRef(FxtsssStoreBo bo) {
bo.reset();
PtsptaVo ptsptaVo = bo.getFxdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
......@@ -307,7 +306,7 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Fxdgrp fxdgrp = fxtsssStoreVo.getFxdgrp();
Fxdgrp fxdgrp = bo.getFxdgrp();
fxToolComponent.getref(fxdgrp);
return fxdgrp.getRec().getOwnref();
}
......@@ -321,8 +320,8 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
* fxtp.cshflg 钞汇标志 1:现汇 2:现钞
* fxtp.quoflg Quote Flag
*/
public void defaultRateN1000(FxtsssStoreVo vo) {
vo.reset();
public void defaultRateN1000(FxtsssStoreBo bo) {
bo.reset();
String rmbRat = NULLSTR;
BigDecimal buyRat = null;
BigDecimal selRat = null;
......@@ -335,12 +334,12 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
String setCur = NULLSTR;
BigDecimal setAmt = BigDecimal.ZERO;
BigDecimal favRat = BigDecimal.ZERO;
Cbb max = vo.getFxdgrp().getCbs().getMax();
Fxd rec = vo.getFxdgrp().getRec();
Pts pts = vo.getFxdgrp().getApl().getPts();
if (MdaUtils.isEmpty(vo.getFxtp().getQuoflg())
Cbb max = bo.getFxdgrp().getCbs().getMax();
Fxd rec = bo.getFxdgrp().getRec();
Pts pts = bo.getFxdgrp().getApl().getPts();
if (MdaUtils.isEmpty(bo.getFxtp().getQuoflg())
&& !MdaUtils.isEmpty(rec.getFxtyp()) && !MdaUtils.isEmpty(pts.getPtyinr())) {
// Systems.setEnabled(vo.getFxdgrp().getRec(), "rat");
// Systems.setEnabled(bo.getFxdgrp().getRec(), "rat");
Argument<String> rmbRatBox = new Argument<String>();
Argument<BigDecimal> buyRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> selRatBox = new Argument<BigDecimal>();
......@@ -361,14 +360,14 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
// 如果没有优惠,则根据配置文件来进行优惠
setCur = max.getCur();
SetmodVo setmodVo = buildSetmodVo(vo);
SetmodVo setmodVo = buildSetmodbo(bo);
setAmt = setmodService.getSettlementAmount(setmodVo, setCur);
// 默认都是按照点数优惠
if (MdaUtils.compareTo(setAmt, 0) > 0) {
buyTyp = "1";
selTyp = "1";
/* TODO setusd.ini 未提供 暂时注释
favRat = vo.getFxtp().getFavorRatePoint(setCur, setAmt);
favRat = bo.getFxtp().getFaborRatePoint(setCur, setAmt);
if (MdaUtils.compareTo(favRat, buyPreRat) > 0) {
buyPreRat = favRat;
}
......@@ -378,7 +377,7 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
if (!rec.isModified("rat")) {
if (MdaUtils.compareTo(Strings.mid(rec.getFxtyp(), 2, 1), "B") == 0) {
if (MdaUtils.compareTo(vo.getFxtp().getCshflg(), "2") == 0) {
if (MdaUtils.compareTo(bo.getFxtp().getCshflg(), "2") == 0) {
rec.setRat(buy1Rat);
} else {
switch (buyTyp) {
......@@ -414,14 +413,14 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
}
}
private SetmodVo buildSetmodVo(FxtsssStoreVo vo) {
private SetmodVo buildSetmodbo(FxtsssStoreBo bo) {
SetmodVo setmodVo = new SetmodVo();
Map cbsMap = new HashMap();
Cbb max = vo.getFxdgrp().getCbs().getMax();
Cbb max = bo.getFxdgrp().getCbs().getMax();
cbsMap.put("MAX", max);
setmodVo.setCbsMap(cbsMap);
List<PtsptaVo> ptsList = new ArrayList();
PtsptaVo apl = vo.getFxdgrp().getApl();
PtsptaVo apl = bo.getFxdgrp().getApl();
ptsList.add(apl);
setmodVo.setPtsList(ptsList);
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
......@@ -430,8 +429,8 @@ public class FxtsssTransactionServiceImpl extends AbstractTransactionService<Fxt
return setmodVo;
}
public void defaultCalculateN1100(FxtsssStoreVo fxtsssStoreVo) {
fxtsssStoreVo.reset();
fxtpService.defaultCalculateN1100(fxtsssStoreVo.getFxdgrp(), fxtsssStoreVo.getFxtp());
public void defaultCalculateN1100(FxtsssStoreBo bo) {
bo.reset();
fxtpService.defaultCalculateN1100(bo.getFxdgrp(), bo.getFxtp());
}
}
......@@ -4,7 +4,7 @@ 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.nosmod.bo.Nosmod;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......
......@@ -4,8 +4,8 @@ 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.bo.model.*;
import com.brilliance.isc.common.nosmod.bo.Nosmod;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -62,6 +62,8 @@ public class CrtcroStoreBo extends BaseTransactionVo {
private Crdgrp crdgrp;
private Crtp crtp;
private Crtmod crtmod;
private Trn cretrn;
......@@ -73,6 +75,13 @@ public class CrtcroStoreBo extends BaseTransactionVo {
private Gle spcgle;
private Act pacact;
private Cpdgrp cpdgrp;
private Gidgrp gidgrp;
private Bcdgrp bcdgrp;
private Brdgrp brdgrp;
private Lidgrp lidgrp;
private Nosmod nosmod;
@Override
public void reset() {
......@@ -81,6 +90,10 @@ public class CrtcroStoreBo extends BaseTransactionVo {
crdgrp = new Crdgrp();
}
crdgrp.reset();
if (crtp == null) {
crtp = new Crtp();
}
crtp.reset();
if (crtmod == null) {
crtmod = new Crtmod();
......@@ -104,5 +117,31 @@ public class CrtcroStoreBo extends BaseTransactionVo {
if (pacact == null) {
pacact = new Act();
}
if (cpdgrp == null) {
cpdgrp = new Cpdgrp();
}
cpdgrp.reset();
if (gidgrp == null) {
gidgrp = new Gidgrp();
}
gidgrp.reset();
if (bcdgrp == null) {
bcdgrp = new Bcdgrp();
}
bcdgrp.reset();
if (brdgrp == null) {
brdgrp = new Brdgrp();
}
brdgrp.reset();
if (lidgrp == null) {
lidgrp = new Lidgrp();
}
lidgrp.reset();
if (nosmod == null) {
nosmod = new Nosmod();
}
nosmod.reset();
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcmStoreBo extends BaseTransactionVo {
String narblk=NULLSTR;
String relref=NULLSTR;
private Ftdgrp ftdgrp;
private Fttp fttp;
@Override
public void reset(){
super.reset();
if (ftdgrp == null){
ftdgrp = new Ftdgrp();
}
ftdgrp.reset();
if (fttp == null){
fttp = new Fttp();
}
fttp.reset();
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcnStoreBo extends BaseTransactionVo {
private BigDecimal canamt= Decimals.ZERO_SCALE2;
boolean clsflg = true;
private Ftdgrp ftdgrp;
private Fttp fttp;
@Override
public void reset(){
super.reset();
if (ftdgrp == null){
ftdgrp = new Ftdgrp();
}
ftdgrp.reset();
if (fttp == null){
fttp = new Fttp();
}
fttp.reset();
}
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring")
public interface FttfcmStructMapper extends IBaseStructMapper<FttfcmStoreBo, FttfcmStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FttfcmStructMapper INSTANCE = Mappers.getMapper(FttfcmStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FttfcmStoreBo voTransferToBo(FttfcmStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FttfcmStoreVo vo, @MappingTarget FttfcmStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FttfcmStoreVo boTransferToVo(FttfcmStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FttfcmStoreBo bo, @MappingTarget FttfcmStoreVo vo);
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.FttfcnStoreBo;
import com.brilliance.isc.funds.vo.funds.FttfcnStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring")
public interface FttfcnStructMapper extends IBaseStructMapper<FttfcnStoreBo, FttfcnStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FttfcnStructMapper INSTANCE = Mappers.getMapper(FttfcnStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FttfcnStoreBo voTransferToBo(FttfcnStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FttfcnStoreVo vo, @MappingTarget FttfcnStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FttfcnStoreVo boTransferToVo(FttfcnStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FttfcnStoreBo bo, @MappingTarget FttfcnStoreVo 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.bo.SptVo;
import com.brilliance.isc.common.nosmod.vo.NosmodVo;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.vo.funds.CrdgrpVo;
import com.brilliance.isc.vo.funds.CrtpVo;
import com.brilliance.isc.vo.manager.ActVo;
import com.brilliance.isc.vo.model.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......@@ -30,21 +29,21 @@ public class CrtcriStoreVo extends BaseTransactionVo {
//Object Type of Associated Contract Optional (max=6)
private String rcvobjtyp = NULLSTR;
private Crdgrp crdgrp;
private CrdgrpVo crdgrp;
private Crtp crtp;
private CrtpVo crtp;
private Smh smh;
private Smh corsmh;
private Act sndact;
private ActVo sndact;
private Act aplact;
private ActVo aplact;
private Act rcvact;
private ActVo rcvact;
private Spt crtspt;
private SptVo crtspt;
private Bodgrp bodgrp;
......@@ -66,19 +65,19 @@ public class CrtcriStoreVo extends BaseTransactionVo {
// private Cldgrp cldgrp;
private Cpdgrp cpdgrp;
private CpdgrpVo cpdgrp;
private Nosmod nosmod;
private NosmodVo nosmod;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
crdgrp = new CrdgrpVo();
}
crdgrp.reset();
if (crtp == null) {
crtp = new Crtp();
crtp = new CrtpVo();
}
crtp.reset();
......@@ -89,19 +88,19 @@ public class CrtcriStoreVo extends BaseTransactionVo {
corsmh = new Smh();
}
if (sndact == null) {
sndact = new Act();
sndact = new ActVo();
}
if (aplact == null) {
aplact = new Act();
aplact = new ActVo();
}
if (rcvact == null) {
rcvact = new Act();
rcvact = new ActVo();
}
if (crtspt == null) {
crtspt = new Spt();
crtspt = new SptVo();
}
if (bodgrp == null) {
......@@ -137,12 +136,12 @@ public class CrtcriStoreVo extends BaseTransactionVo {
}
gidgrp.reset();
if (cpdgrp == null) {
cpdgrp = new Cpdgrp();
cpdgrp = new CpdgrpVo();
}
cpdgrp.reset();
// private Cldgrp cldgrp;
if (nosmod == null) {
nosmod = new Nosmod();
nosmod = new NosmodVo();
}
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.bo.model.Cpdgrp;
import com.brilliance.isc.common.nosmod.vo.NosmodVo;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.vo.GleVo;
import com.brilliance.isc.model.act.ActVO;
import com.brilliance.isc.vo.funds.CrdgrpVo;
import com.brilliance.isc.vo.funds.CrtmodVo;
import com.brilliance.isc.vo.manager.SmhVo;
import com.brilliance.isc.vo.manager.TrnVo;
import com.brilliance.isc.vo.model.Bcdgrp;
import com.brilliance.isc.vo.model.Brdgrp;
import com.brilliance.isc.vo.model.Gidgrp;
import com.brilliance.isc.vo.model.Lidgrp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......@@ -60,35 +67,41 @@ public class CrtcroStoreVo extends BaseTransactionVo {
//Status I-INCOMING, O-OUTGOING, N-NOTNEED (max=1)
private String clrsta = NULLSTR;
private Crdgrp crdgrp;
private CrdgrpVo crdgrp;
private Crtmod crtmod;
private CrtmodVo crtmod;
private Trn cretrn;
private TrnVo cretrn;
private Smh cresmh;
private Smh bndsmh;
private Gle spcgle;
private GleVo spcgle;
private Act pacact;
private ActVO pacact;
private Cpdgrp cpdgrp;
private Gidgrp gidgrp;
private Bcdgrp bcdgrp;
private Brdgrp brdgrp;
private Lidgrp lidgrp;
private NosmodVo nosmod;
@Override
public void reset() {
super.reset();
if (crdgrp == null) {
crdgrp = new Crdgrp();
crdgrp = new CrdgrpVo();
}
crdgrp.reset();
if (crtmod == null) {
crtmod = new Crtmod();
crtmod = new CrtmodVo();
}
crtmod.reset();
if (cretrn == null) {
cretrn = new Trn();
cretrn = new TrnVo();
}
if (cresmh == null) {
......@@ -99,10 +112,35 @@ public class CrtcroStoreVo extends BaseTransactionVo {
bndsmh = new Smh();
}
if (spcgle == null) {
spcgle = new Gle();
spcgle = new GleVo();
}
if (pacact == null) {
pacact = new Act();
pacact = new ActVO();
}
if (cpdgrp == null) {
cpdgrp = new Cpdgrp();
}
cpdgrp.reset();
if (gidgrp == null) {
gidgrp = new Gidgrp();
}
gidgrp.reset();
if (bcdgrp == null) {
bcdgrp = new Bcdgrp();
}
bcdgrp.reset();
if (brdgrp == null) {
brdgrp = new Brdgrp();
}
brdgrp.reset();
if (lidgrp == null) {
lidgrp = new Lidgrp();
}
lidgrp.reset();
if (nosmod == null) {
nosmod = new NosmodVo();
}
nosmod.reset();
}
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcmStoreVo extends BaseTransactionVo {
String narblk=NULLSTR;
String relref=NULLSTR;
private FtdgrpVo ftdgrp;
private FttpVo fttp;
@Override
public void reset() {
super.reset();
if (ftdgrp == null) {
ftdgrp = new FtdgrpVo();
}
ftdgrp.reset();
if (fttp == null) {
fttp = new FttpVo();
}
fttp.reset();
}
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.mda.runtime.mda.util.Decimals;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FttfcnStoreVo extends BaseTransactionVo {
BigDecimal canamt= Decimals.ZERO_SCALE2;
boolean clsflg = true;
private FtdgrpVo ftdgrp;
private FttpVo fttp;
@Override
public void reset() {
super.reset();
if (ftdgrp == null) {
ftdgrp = new FtdgrpVo();
}
ftdgrp.reset();
if (fttp == null) {
fttp = new FttpVo();
}
fttp.reset();
}
}
......@@ -3,6 +3,8 @@ 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.brilliance.isc.vo.funds.FxdgrpVo;
import com.brilliance.isc.vo.funds.FxtpVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......@@ -17,20 +19,20 @@ import lombok.Data;
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtssbStoreVo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
private FxdgrpVo fxdgrp;
private Fxtp fxtp;
private FxtpVo fxtp;
@Override
public void reset() {
super.reset();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
fxdgrp = new FxdgrpVo();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
fxtp = new FxtpVo();
}
fxtp.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.brilliance.isc.vo.funds.FxdgrpVo;
import com.brilliance.isc.vo.funds.FxtpVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
......@@ -16,20 +16,20 @@ import lombok.Data;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtsssStoreVo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
private FxdgrpVo fxdgrp;
private Fxtp fxtp;
private FxtpVo fxtp;
@Override
public void reset() {
super.reset();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
fxdgrp = new FxdgrpVo();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
fxtp = new FxtpVo();
}
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