Commit 1c47f394 by jianglong

开发fxtfop交易

parent 2b742cbc
package com.brilliance.isc.funds.fxtfop.check;
import com.brilliance.isc.common.transaction.newcheck.AbstractModuleValidator;
import com.brilliance.isc.funds.bo.funds.FxtfopStoreBo;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
@Component
public class FxtfopValidator extends AbstractModuleValidator<FxtfopStoreBo> {
@Override
@PostConstruct
public void register() {
super.register();
}
@Override
public Map<String, String> validate(FxtfopStoreBo vo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
return maps;
}
}
package com.brilliance.isc.funds.fxtfop.document;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FxtfopStoreBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @program: isc-funds
* @ClassName: FxtfopDocSet
* @description: 即期结汇 Fxtfop 面函
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtfop.docset")
public class FxtfopDocSet extends AbstractTransactionDocSet<FxtfopStoreBo> {
private static final Logger logger = LoggerFactory.getLogger(FxtfopDocSet.class);
/**
* 构建需要支持的面函组件
*/
@PostConstruct
public void buildMember() {
//扫描Cortype支持,必须要执行
scanDocCortypSupport();
}
}
package com.brilliance.isc.funds.fxtfop.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: FxtfopDiasavRegister
* @description: 即期结汇 Fxtfop 备忘录注册
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtfop.diasavRegister")
public class FxtfopDiasavRegister 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.fxtfop.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: FxtfopDocumentRegister
* @description: 即期结汇 Fxtfop 面函注册
* @author: huangshunlin
* @create: 2024-10-08 15:39
*/
@Component("fxtfop.documentRegister")
public class FxtfopDocumentRegister implements IDocumentRegister {
@Override
public void registerDocument(TrndocVo trndoc) {
doRegister(trndoc);
}
public void doRegister(TrndocVo trndoc) {
}
}
package com.brilliance.isc.funds.fxtfop.register.fee;
import com.brilliance.isc.common.register.fee.AbstractFeeRegister;
import com.brilliance.isc.common.register.fee.common.SetmodFeeRegister;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("fxtfop.feeRegister")
public class FxtfopFeeRegister extends AbstractFeeRegister {
@Autowired
private SetmodFeeRegister setmodFeeRegister;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
setmodFeeRegister.registerSettlement(setmodVo);
}
private void transRegister(SetmodVo setmodVo) {
}
}
package com.brilliance.isc.funds.fxtfop.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.glemod.service.GlemodService;
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("fxtfop.settleRegister")
public class FxtfopSettleRegister implements ISettleRegister {
@Autowired
private SetmodService setmodService;
@Autowired
private SetglgService setglgService;
@Autowired
private DefaultSettleRegister defaultSettleRegister;
@Autowired
private GlemodService glemodService;
@Override
public void registerSettlement(SetmodVo setmodVo) {
transRegister(setmodVo);
defaultSettleRegister.registerSettlement(setmodVo);
//dftcreSettleRegister.registerSettlement(setmodVo);
//trtcreSettleRegister.registerSettlement(setmodVo);
}
/**
* source:fxtfop.0010.script
*/
private void transRegister(SetmodVo setmodVo) {
//取得上下文
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO;
String nom1Cur = NULLSTR;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
maxCur= setmodVo.getCbsMap().get("MAX").getCur();
}
if (setmodVo.getCbsMap().get("NOM1") != null) {
nom1Amt = setmodVo.getCbsMap().get("NOM1").getAmt();
nom1Cur= setmodVo.getCbsMap().get("NOM1").getCur();
}
setmodVo.setDoccur(maxCur);
setmodVo.setDocamt(maxAmt);
setmodVo.setOpnamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount(setglg, "TRN");
setglgService.setglgClrAmount(setglg, "SET");
String act1 = NULLSTR;
String ddtKey = NULLSTR;
String act4 = NULLSTR;
String cbtKey = NULLSTR;
if( ! MdaUtils.isEmpty(nom1Amt) && ! MdaUtils.isEmpty(rec.getFxtyp() ))
{
//D 281101
act1=glemodService.getAvailAcc( "FX-EXS",maxCur,"", setmodVo.getSetamt());
ddtKey =setglgService.setglgAddAmount ( setglg,"TRN", "OWN", maxCur, setmodVo.getSetamt(), "", "FXD", "C", act1, "" );
//C:281105
act4 = glemodService.getAvailAcc ( "FX-ELQ",maxCur, "", setmodVo.getSetamt() );
cbtKey = setglgService.setglgAddAmount ( setglg,"SET", "OWN", maxCur, setmodVo.getSetamt().negate(), "SET", "FXC", "F", act4, "SET" );
}
}
}
package com.brilliance.isc.funds.fxtfop.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.fxtfop.service.FxtfopTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtfopStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
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;
/**
* @program: isc-funds
* @ClassName: FxtfopResource
* @description: 即期结汇 Fxtfop 请求入口
* @author: huangshunlin
* @create: 2024-10-08 15:34
*/
@RestController
@RequestMapping("/fxtfop")
@Api("外币兑换登记")
public class FxtfopResource extends AbstractTransactionController<FxtfopStoreVo> {
@Resource
private FxtfopStructMapper fxtfopStructMapper;
public IStructMapper getStructMapper() {
return fxtfopStructMapper;
}
@Resource(name = "fxtfop.transaction")
FxtfopTransactionServiceImpl fxtfopTransactionService;
@Autowired
private SettleContext settleContext;
/**
* 根据结售汇类型 等获取业务参号
*
* @param fxtfopStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FxtfopStoreVo fxtfopStoreVo) {
String ref = fxtfopTransactionService.getRef(fxtfopStoreVo);
return ResponseSet.simpleSuccess(ref);
}
@PostMapping("/defaultRateN1000")
public ResponseSet defaultRateN1000(@RequestBody FxtfopStoreVo fxtfopStoreVo) {
try {
settleContext.loadSettleSession("FXTFOP","","");
fxtfopTransactionService.defaultRateN1000(fxtfopStoreVo);
return ResponseSet.simpleSuccess(fxtfopStoreVo);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
@PostMapping("/defaultCalculateN1100")
public ResponseSet defaultCalculateN1100(@RequestBody FxtfopStoreVo fxtfopStoreVo) {
try {
settleContext.loadSettleSession("FXTFOP","","");
fxtfopTransactionService.defaultCalculateN1100(fxtfopStoreVo);
return ResponseSet.simpleSuccess(fxtfopStoreVo);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
}
package com.brilliance.isc.funds.bo.funds;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.bo.model.Fxtp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: FxtsssStoreBo
* @description: 即期结汇bo
* @author: huangshunlin
* @create: 2024-10-08 15:51
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtfopStoreBo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
private Fxtp fxtp;
@Override
public void reset() {
super.reset();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
}
fxtp.reset();
}
}
package com.brilliance.isc.funds.transfer.transaction;
import com.brilliance.isc.funds.bo.funds.FxtfopStoreBo;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
/**
* @program: isc-funds
* @ClassName: FxtssbStructMapper
* @description: 即期结汇转换Fxtssb Bo、Vo之间的转换处理类。如果有很复杂的函数,则可以用适配器模式重写
* @author: huangshunlin
* @create: 2024-10-08 15:27
*/
@Mapper(componentModel = "spring")
public interface FxtfopStructMapper extends IBaseStructMapper<FxtfopStoreBo, FxtfopStoreVo> {
/**
* 此行语句一定要写,StructMapper需要
*/
FxtfopStructMapper INSTANCE = Mappers.getMapper(FxtfopStructMapper.class);
/**
* Vo转为Bo
*
* @param vo
* @return 返回业务Bo
*/
@Override
FxtfopStoreBo voTransferToBo(FxtfopStoreVo vo);
/**
* Vo追加更新至Bo
*
* @param vo
* @param bo
*/
@Override
@Mappings({
})
void voUpdateToBo(FxtfopStoreVo vo, @MappingTarget FxtfopStoreBo bo);
/**
* Bo转为Vo
*
* @param bo
* @return 返回Vo
*/
@Override
FxtfopStoreVo boTransferToVo(FxtfopStoreBo bo);
/**
* bo追加更新至Bo
*
* @param bo
* @param vo
*/
@Override
void boUpdateToVo(FxtfopStoreBo bo, @MappingTarget FxtfopStoreVo vo);
}
package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.model.Fxdgrp;
import com.brilliance.isc.bo.model.Fxtp;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
/**
* @program: isc-funds
* @ClassName: FxtssbStoreVo
* @description: 即期结汇bo
* @author: huangshunlin
* @create: 2024-10-08 15:26
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class FxtfopStoreVo extends BaseTransactionVo {
private Fxdgrp fxdgrp;
private Fxtp fxtp;
@Override
public void reset() {
super.reset();
if (fxdgrp == null) {
fxdgrp = new Fxdgrp();
}
fxdgrp.reset();
if (fxtp == null) {
fxtp = new Fxtp();
}
fxtp.reset();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment