Commit 7b54a174 by xiaotong

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

parents d800ca57 e743f47a
package com.brilliance.isc.funds.fxtssb.document;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FxtssbStoreBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @program: isc-funds
* @ClassName: FxtssbDocSet
* @description: 即期结汇 Fxtssb 面函
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtssb.docset")
public class FxtssbDocSet extends AbstractTransactionDocSet<FxtssbStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(FxtssbDocSet.class);
/**
* 构建需要支持的面函组件
*/
@PostConstruct
public void buildMember() {
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
}
package com.brilliance.isc.funds.fxtssb.register.diasav;
import com.brilliance.isc.common.register.diasav.IDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.DftcreDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavRegister;
import com.brilliance.isc.common.register.diasav.common.LiaallDiasavZZZRegister;
import com.brilliance.isc.common.register.diasav.common.TrtcreDiasavRegister;
import com.brilliance.isc.common.trndia.service.TrndiaService;
import com.brilliance.isc.common.trndia.vo.TrndiaVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FxtssbDiasavRegister
* @description: 即期结汇 Fxtssb 备忘录注册
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtssb.diasavRegister")
public class FxtssbDiasavRegister 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) {
}
}
package com.brilliance.isc.funds.fxtssb.register.doc;
import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import org.springframework.stereotype.Component;
/**
* @program: isc-funds
* @ClassName: FxtssbDocumentRegister
* @description: 即期结汇 Fxtssb 面函注册
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtssb.documentRegister")
public class FxtssbDocumentRegister implements IDocumentRegister {
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc) {
}
}
package com.brilliance.isc.funds.fxtssb.register.settle;
import com.brilliance.isc.common.register.settle.DefaultSettleRegister;
import com.brilliance.isc.common.register.settle.ISettleRegister;
import com.brilliance.isc.common.register.settle.common.DftcreSettleRegister;
import com.brilliance.isc.common.register.settle.common.TrtcreSettleRegister;
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.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component("fxtssb.settleRegister")
public class FxtssbSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DftcreSettleRegister dftcreSettleRegister;
@Autowired
private TrtcreSettleRegister trtcreSettleRegister;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
dftcreSettleRegister.registerSettlement(setmodVo);
trtcreSettleRegister.registerSettlement(setmodVo);
}
/**
* source:fxtssb.0010.script
*/
private void transRegister(SetmodVo setmodVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
BigDecimal maxAmt = BigDecimal.ZERO;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
}
String nom1Cur = NULLSTR;
if (setmodVo.getCbsMap().get("NOM1") != null) {
nom1Amt = setmodVo.getCbsMap().get("NOM1").getAmt();
nom1Cur = setmodVo.getCbsMap().get("NOM1").getCur();
}
setmodVo.setDocamt(maxAmt);
setmodVo.setOpnamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
// setmodVo.getSetglg().setglgClrAmount("TRN");
// setmodVo.getSetglg().setglgClrAmount("SET");
setglgService.setglgClrAmount(setglg, "TRN");
setglgService.setglgClrAmount(setglg, "SET");
String dsp = NULLSTR;
String dbtKey = NULLSTR;
String cdtKey = NULLSTR;
if (!MdaUtils.isEmpty(nom1Amt) && !MdaUtils.isEmpty(rec.getFxtyp())) {
if (MdaUtils.compareTo(Strings.mid(rec.getFxtyp(), 2, 1), "B") == 0) {
if (MdaUtils.compareTo(rec.getDsp(), "CA") == 0) {
dsp = "LOD";
} else {
dsp = rec.getDsp() + "D";
}
dbtKey = setglgService.setglgAddAmount(setglg, "TRN", "APL", setmodVo.getDoccur(), setmodVo.getDocamt(), "", dsp, "A", rec.getAcc(), "");
cdtKey = setglgService.setglgAddAmount(setglg, "SET", "APL", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "SET", rec.getDsp2() + "C", "F", rec.getAcc2(), "SET");
setglgService.setglgAddAmtFldAccCur(setglg,"SET", cdtKey, nom1Cur);
setglgService.setglgAddAmtFldExtRat(setglg,"SET", cdtKey, BigDecimal.ONE, rec.getRat());
setglgService.setSettlementDetails(setglg,"B", "APL", rec.getTrnman(), rec.getTrdint());
} else {
if (MdaUtils.compareTo(rec.getDsp(), "CA") == 0) {
dsp = "LOC";
} else {
dsp = rec.getDsp() + "C";
}
cdtKey = setglgService.setglgAddAmount(setglg,"TRN", "APL", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "", dsp, "A", rec.getAcc(), "");
dbtKey = setglgService.setglgAddAmount(setglg,"SET", "APL", setmodVo.getDoccur(), setmodVo.getSetamt(), "SET", rec.getDsp2() + "D", "F", rec.getAcc2(), "SET");
setglgService.setglgAddAmtFldAccCur(setglg,"SET", dbtKey, nom1Cur);
setglgService.setglgAddAmtFldExtRat(setglg,"SET", dbtKey, BigDecimal.ONE, rec.getRat());
setglgService.setSettlementDetails(setglg,"S", "APL", rec.getTrnman(), rec.getTrdout());
}
}
}
}
package com.brilliance.isc.funds.fxtssb.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.fxtssb.service.FxtssbTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtssbStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @program: isc-funds
......@@ -30,4 +38,30 @@ public class FxtssbResource extends AbstractTransactionController<FxtssbStoreVo>
}
@Resource(name = "fxtssb.transaction")
FxtssbTransactionServiceImpl fxtssbTransactionService;
@Autowired
private SettleContext settleContext;
/**
* 根据结售汇类型 等获取业务参号
*
* @param fxtssbStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
String ref = fxtssbTransactionService.getRef(fxtssbStoreVo);
return ResponseSet.simpleSuccess(ref);
}
@PostMapping("/defaultAccountsN1000")
public ResponseSet defaultAccountsN1000(@RequestBody FxtssbStoreVo fxtssbStoreVo) {
Map<String, List<String>> codeSet = fxtssbTransactionService.defaultAccountsN1000(fxtssbStoreVo);
ResponseSet success = ResponseSet.simpleSuccess(fxtssbStoreVo);
success.setCodeSet(codeSet);
return success;
}
}
package com.brilliance.isc.funds.fxtssb.service;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.bo.model.Fxacbs;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.sysmod.SysmodService;
import com.brilliance.isc.common.transaction.AbstractTransactionService;
import com.brilliance.isc.common.transaction.help.TransactionHelpService;
......@@ -13,21 +18,31 @@ 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.FxtssbStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtssb.check.FxtssbValidator;
import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Streams;
import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Map;
import java.util.*;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-funds
......@@ -65,19 +80,21 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
@Resource
private TrnmodService trnmodService;
@Resource
private GlemodService glemodService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@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");
}
......@@ -139,10 +156,17 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
bo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
// MAXAMT = 200000.00
// Systems.setValues(this.getFxdgrp().getRec(), "fxtyp", "SB");
// Systems.setValues(fxtssbStoreVo.getFxdgrp().getRec(), "fxtyp", "SB");
//结售汇类型 SB:即期结汇
bo.getFxdgrp().getRec().setFxtyp("SB");
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
bo.getFxdgrp().getRec().setUsr(extkey);
//钞汇 默认 1:现汇
bo.getFxtp().setCshflg("1");
//这笔结售汇业务的成交日期,系统默认为当前日期,可以根据业务实际情况修改。
bo.getFxdgrp().getRec().setOpndat(Dates.today());
//这笔结售汇业务的起息日,系统默认为成交日,可以根据业务实际情况修改。
bo.getFxdgrp().getRec().setValdat(bo.getFxdgrp().getRec().getOpndat());
}
......@@ -181,4 +205,89 @@ public class FxtssbTransactionServiceImpl extends AbstractTransactionService<Fxt
trnmodService.cbsTrnStore("UTLAMT", "AMT1", Dates.today(), cbs.getMax().getCur(), cbs.getMax().getAmt(), I18nUtil.getMessage("funds_fxtssb_000000"), transactionVo.getFxdgrp(), trninr);
}
}
/**
* source:fxtssb.0022.script
*/
public Map<String, List<String>> defaultAccountsN1000(FxtssbStoreVo fxtssbStoreVo) {
fxtssbStoreVo.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.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());
} else {
accLst = glemodService.getAvailAcc(trnTyp, fxtssbStoreVo.getFxdgrp().getCbs().getMax().getCur(), fxtssbStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), fxtssbStoreVo.getFxdgrp().getCbs().getMax().getAmt());
}
// Systems.setValues(fxtssbStoreVo.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 (!MdaUtils.isEmpty(accLst)) {
Streams.streamClear(accStm);
Streams.streamSet(accStm, accLst);
fxtssbStoreVo.getFxdgrp().getRec().setAcc(Strings.getLine(accStm, 1));
}
}
// Systems.setEnabled(fxtssbStoreVo.getFxdgrp().getRec(), "acc");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtssbStoreVo.getFxdgrp().getRec(), "acc"));
fxtssbStoreVo.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);
} else {
acc2Lst = glemodService.getAvailAcc(fxtssbStoreVo.getFxdgrp().getRec().getDsp2(), "CNY", fxtssbStoreVo.getFxdgrp().getApl().getPts().getPtyinr(), BigDecimal.ONE);
}
// Systems.setValues(fxtssbStoreVo.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 (!MdaUtils.isEmpty(acc2Lst)) {
Streams.streamClear(acc2Stm);
Streams.streamSet(acc2Stm, acc2Lst);
fxtssbStoreVo.getFxdgrp().getRec().setAcc2(Strings.getLine(acc2Stm, 1));
}
}
// Systems.setEnabled(fxtssbStoreVo.getFxdgrp().getRec(), "acc2");
} else {
// Dynamic.disableAndClearField(MdaDriver.getDatafield(fxtssbStoreVo.getFxdgrp().getRec(), "acc2"));
fxtssbStoreVo.getFxdgrp().getRec().setAcc2(NULLSTR);
}
}
return map;
}
public String getRef(FxtssbStoreVo fxtssbStoreVo) {
fxtssbStoreVo.reset();
PtsptaVo ptsptaVo = fxtssbStoreVo.getFxdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
if (Objects.isNull(wrkbch)) {
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Fxdgrp fxdgrp = fxtssbStoreVo.getFxdgrp();
fxToolComponent.getref(fxdgrp);
return fxdgrp.getRec().getOwnref();
}
}
......@@ -5,7 +5,6 @@ import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
/**
......@@ -38,9 +37,6 @@ public interface FxtssbStructMapper extends IBaseStructMapper<FxtssbStoreBo, Fxt
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FxtssbStoreVo vo, @MappingTarget FxtssbStoreBo bo);
/**
......
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