Commit bee1ec8e by jianglong

新增FTTFCN代码

parent 9ebe054b
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.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();
}
}
...@@ -14,7 +14,7 @@ public interface FttfcmStructMapper extends IBaseStructMapper<FttfcmStoreBo, Ftt ...@@ -14,7 +14,7 @@ public interface FttfcmStructMapper extends IBaseStructMapper<FttfcmStoreBo, Ftt
/** /**
* 此行语句一定要写,StructMapper需要 * 此行语句一定要写,StructMapper需要
*/ */
FxtfcmStructMapper INSTANCE = Mappers.getMapper(FxtfcmStructMapper.class); FttfcmStructMapper INSTANCE = Mappers.getMapper(FttfcmStructMapper.class);
/** /**
* Vo转为Bo * Vo转为Bo
......
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.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();
}
}
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