Commit 504b3031 by jianglong

1.开发fxtlop交易结算注册;利率计算请求及界面利率联动计算;

2.优化结售汇平盘交易查询,结售汇交易查询功能
parent ac5b86e2
......@@ -111,7 +111,7 @@ public class FxToolComponent {
}
public void collectPtsList(TransactionServiceSet set, Fxdgrp fxdgrp, String... ptsNames) {
public void collectPtsList(TransactionServiceSet set, Object fxdgrp, String... ptsNames) {
if (ptsNames == null) {
//找所有的ptspta对象
Field[] fields = fxdgrp.getClass().getDeclaredFields();
......
......@@ -38,16 +38,21 @@ public class FxtlopSettleRegister implements ISettleRegister {
private void transRegister(SetmodVo setmodVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) {
maxCur = setmodVo.getCbsMap().get("MAX").getCur();
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
}
String nom1Cur = NULLSTR;
BigDecimal nom1Amt = BigDecimal.ZERO;
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();
......@@ -72,28 +77,28 @@ public class FxtlopSettleRegister implements ISettleRegister {
String ddtKey = null;
String act4 = null;
String cbtKey = null;
if( ! MdaUtils.isEmpty(rec.getFxtyp()) )
if( ! MdaUtils.isEmpty(nom1Amt) && ! MdaUtils.isEmpty(rec.getFxtyp()) )
{
// //买入登记
// if( MdaUtils.compareTo(Strings.mid(rec.getFxtyp(),2,1),"B") == 0 )
// {
// //D 281110
// act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "", "FXD", "C", act1, "" );
// //C:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "SET", "FXC", "F", act4, "SET" );
// }
// else
// {
// //卖出登记
// //D:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "SET", "FXD", "F", act4, "SET" );
// //C 281110
// act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "", "FXC", "C", act1, "" );
// }
//买入登记
if( MdaUtils.compareTo(Strings.mid(rec.getFxtyp(),2,1),"B") == 0 )
{
//D 281110
act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
ddtKey = setglgService.setglgAddAmount ( setglg,"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "", "FXD", "C", act1, "" );
//C:281106
act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
cbtKey = setglgService.setglgAddAmount ( setglg,"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "SET", "FXC", "F", act4, "SET" );
}
else
{
//卖出登记
//D:281106
act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
ddtKey = setglgService.setglgAddAmount ( setglg,"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "SET", "FXD", "F", act4, "SET" );
//C 281110
act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
cbtKey = setglgService.setglgAddAmount ( setglg,"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "", "FXC", "C", act1, "" );
}
}
}
......
......@@ -220,95 +220,43 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
public void defaultRateN1000(FxtlopStoreVo vo) {
vo.reset();
String rmbRat = NULLSTR;
BigDecimal buyRat = null;
BigDecimal selRat = null;
BigDecimal midRat = null;
BigDecimal buy1Rat = null;
String selTyp = NULLSTR;
BigDecimal selPreRat = null;
String buyTyp = NULLSTR;
BigDecimal buyPreRat = null;
String setCur = NULLSTR;
BigDecimal setAmt = BigDecimal.ZERO;
BigDecimal favRat = BigDecimal.ZERO;
BigDecimal buyRat1 = null;
Cbb max = vo.getFxdgrp().getCbs().getMax();
Fxd rec = vo.getFxdgrp().getRec();
Pts pts = vo.getFxdgrp().getApl().getPts();
if (MdaUtils.isEmpty(vo.getFxtp().getQuoflg())
&& !MdaUtils.isEmpty(rec.getFxtyp()) && !MdaUtils.isEmpty(pts.getPtyinr())) {
// Systems.setEnabled(vo.getFxdgrp().getRec(), "rat");
if( ! MdaUtils.isEmpty(rec.getFxtyp()) && ! MdaUtils.isEmpty(max.getCur()) )
{
Argument<String> rmbRatBox = new Argument<String>();
Argument<BigDecimal> buyRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> selRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> midRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> buy1RatBox = new Argument<BigDecimal>();
xrtmodService.getratCebTim(max.getCur(), xrtmodService.sysiso(), Dates.today(), rmbRatBox, buyRatBox, selRatBox, midRatBox, buy1RatBox);
Argument<BigDecimal> buyRat1Box = new Argument<BigDecimal>();
xrtmodService.getratCebTim ( max.getCur(), vo.getFxdgrp().getCbs().getNom1().getCur(), Dates.today(), rmbRatBox, buyRatBox, selRatBox, midRatBox, buyRat1Box );
rmbRat = rmbRatBox.value;
buyRat = buyRatBox.value;
selRat = selRatBox.value;
midRat = midRatBox.value;
buy1Rat = buy1RatBox.value;
Ptyrat ptyrat = ptyratMapper.getPtyratByPtyinrAndCur(pts.getPtyinr(), max.getCur());
if (Objects.nonNull(ptyrat)) {
selTyp = ptyrat.getSeltyp();
selPreRat = ptyrat.getBuyrat();
buyTyp = ptyrat.getBuytyp();
buyPreRat = ptyrat.getBuyrat();
}
// 如果没有优惠,则根据配置文件来进行优惠
setCur = max.getCur();
SetmodVo setmodVo = buildSetmodVo(vo);
setAmt = setmodService.getSettlementAmount(setmodVo, setCur);
// 默认都是按照点数优惠
if (MdaUtils.compareTo(setAmt, 0) > 0) {
buyTyp = "1";
selTyp = "1";
/* TODO setusd.ini 未提供 暂时注释
favRat = vo.getFxtp().getFavorRatePoint(setCur, setAmt);
if (MdaUtils.compareTo(favRat, buyPreRat) > 0) {
buyPreRat = favRat;
}
if (MdaUtils.compareTo(favRat, selPreRat) > 0) {
selPreRat = favRat;
}*/
}
if (!rec.isModified("rat")) {
if (MdaUtils.compareTo(Strings.mid(rec.getFxtyp(), 2, 1), "B") == 0) {
if (MdaUtils.compareTo(vo.getFxtp().getCshflg(), "2") == 0) {
rec.setRat(buy1Rat);
} else {
switch (buyTyp) {
case "1":
rec.setRat(Decimals.add(buyRat, Decimals.div(buyPreRat, 10000)));
break;
case "2":
rec.setRat(Decimals.add(buyRat, Decimals.div(Decimals.mul(buyRat, buyPreRat), 100)));
break;
default:
rec.setRat(buyRat);
}
}
} else {
switch (Strings.trim(selTyp)) {
case "1":
rec.setRat(Decimals.sub(selRat, Decimals.div(selPreRat, 10000)));
break;
case "2":
rec.setRat(Decimals.sub(selRat, Decimals.div(Decimals.mul(selRat, selPreRat), 100)));
break;
default:
rec.setRat(selRat);
}
buyRat1 = buyRat1Box.value;
if( ! rec.isModified("midrat") )
{
rec.setMidrat( midRat);
}
}
rec.setRat(Numerics.round(rec.getRat(), 4));
rec.setMidrat(Numerics.round(midRat, 4));
} else {
// Systems.resetEnabled(rec, "rat");
rec.setRat(BigDecimal.ZERO);
rec.setMidrat(BigDecimal.ZERO);
else
{
rec.setRat(Decimals.ZERO_SCALE0);
rec.setMidrat(Decimals.ZERO_SCALE0);
}
}
private SetmodVo buildSetmodVo(FxtlopStoreVo vo) {
......
......@@ -92,19 +92,48 @@ public class FxtselServiceImpl implements FxtselService {
@Override
public List<TrncodVo> dealWithByInr(TrnCodeQueryVo trnCodeQueryVo) {
String type=trnCodeQueryVo.getType();
if (type ==null){
type="";
}
List<TrncodVo> result = Lists.newArrayList();
Fxdgrp fxdgrp=new Fxdgrp();
fxdgrp = fxToolComponent.getFxdgrpByInr(trnCodeQueryVo.getInr());
String[] fxTraArray = {"FXTFCM", "FXTFCN","FXTLCM"};
String[] fxButArray = {"外币兑换平盘确认", "外币兑换平盘销账","结售汇平盘确认"};
if ("dhpp".equals(type.toLowerCase())){
String[] fxTraArray = {"FXTFCM", "FXTFCN"};
String[] fxButArray = {"外币兑换平盘确认", "外币兑换平盘销账"};
String isAllowed = "";
for (int i = 0; i < fxTraArray.length; i++) {
TrncodVo trncodVo = new TrncodVo(fxTraArray[i], fxButArray[i], isAllowed,"Y","");
fxToolComponent.isFXTrnAllowed(fxdgrp,trncodVo);
result.add(trncodVo);
}
}else if("jshpp".equals(type.toLowerCase())){
String[] fxTraArray = {"FXTLCM", "FXTLCN"};
String[] fxButArray = {"结售汇平盘确认", "结售汇平盘销账"};
String isAllowed = "";
for (int i = 0; i < fxTraArray.length; i++) {
TrncodVo trncodVo = new TrncodVo(fxTraArray[i], fxButArray[i], isAllowed,"Y","");
fxToolComponent.isFXTrnAllowed(fxdgrp,trncodVo);
result.add(trncodVo);
}
}else if("jsh".equals(type.toLowerCase())){
String[] fxTraArray = {"FXTSQO"};
String[] fxButArray = {"结售汇报价"};
String isAllowed = "";
for (int i = 0; i < fxTraArray.length; i++) {
TrncodVo trncodVo = new TrncodVo(fxTraArray[i], fxButArray[i], isAllowed,"Y","");
fxToolComponent.isFXTrnAllowed(fxdgrp,trncodVo);
result.add(trncodVo);
}
}else{
}
return result;
}
......
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.bo.model.Mt30m;
import com.brilliance.isc.vo.funds.FxdgrpVo;
import com.brilliance.isc.vo.funds.FxtpVo;
import com.brilliance.isc.vo.model.Mt30m;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -28,9 +28,9 @@ public class FxtlcmStoreVo extends BaseTransactionVo {
//XMLPanel fxt300l1的内置block
private String fxt300l1blk= null;
private Fxdgrp fxdgrp;
private FxdgrpVo fxdgrp;
private Fxtp fxtp;
private FxtpVo fxtp;
private Mt30m mt30m;
......@@ -40,12 +40,12 @@ public class FxtlcmStoreVo extends BaseTransactionVo {
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