Commit 504b3031 by jianglong

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

2.优化结售汇平盘交易查询,结售汇交易查询功能
parent ac5b86e2
...@@ -111,7 +111,7 @@ public class FxToolComponent { ...@@ -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) { if (ptsNames == null) {
//找所有的ptspta对象 //找所有的ptspta对象
Field[] fields = fxdgrp.getClass().getDeclaredFields(); Field[] fields = fxdgrp.getClass().getDeclaredFields();
......
...@@ -38,16 +38,21 @@ public class FxtlopSettleRegister implements ISettleRegister { ...@@ -38,16 +38,21 @@ public class FxtlopSettleRegister implements ISettleRegister {
private void transRegister(SetmodVo setmodVo) { private void transRegister(SetmodVo setmodVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec(); FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
String maxCur=NULLSTR;
BigDecimal maxAmt = BigDecimal.ZERO; BigDecimal maxAmt = BigDecimal.ZERO;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("MAX") != null) { if (setmodVo.getCbsMap().get("MAX") != null) {
maxCur = setmodVo.getCbsMap().get("MAX").getCur();
maxAmt = setmodVo.getCbsMap().get("MAX").getAmt(); maxAmt = setmodVo.getCbsMap().get("MAX").getAmt();
} }
String nom1Cur = NULLSTR; String nom1Cur = NULLSTR;
BigDecimal nom1Amt = BigDecimal.ZERO;
if (setmodVo.getCbsMap().get("NOM1") != null) { if (setmodVo.getCbsMap().get("NOM1") != null) {
nom1Amt = setmodVo.getCbsMap().get("NOM1").getAmt(); nom1Amt = setmodVo.getCbsMap().get("NOM1").getAmt();
nom1Cur = setmodVo.getCbsMap().get("NOM1").getCur(); nom1Cur = setmodVo.getCbsMap().get("NOM1").getCur();
} }
setmodVo.setDoccur(maxCur);
setmodVo.setDocamt(maxAmt); setmodVo.setDocamt(maxAmt);
setmodVo.setOpnamt(maxAmt); setmodVo.setOpnamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg(); SetglgVo setglg = setmodVo.getSetglg();
...@@ -72,28 +77,28 @@ public class FxtlopSettleRegister implements ISettleRegister { ...@@ -72,28 +77,28 @@ public class FxtlopSettleRegister implements ISettleRegister {
String ddtKey = null; String ddtKey = null;
String act4 = null; String act4 = null;
String cbtKey = 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 ) if( MdaUtils.compareTo(Strings.mid(rec.getFxtyp(),2,1),"B") == 0 )
// { {
// //D 281110 //D 281110
// act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getDocamt() ); act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "", "FXD", "C", act1, "" ); ddtKey = setglgService.setglgAddAmount ( setglg,"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "", "FXD", "C", act1, "" );
// //C:281106 //C:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() ); act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "SET", "FXC", "F", act4, "SET" ); cbtKey = setglgService.setglgAddAmount ( setglg,"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "SET", "FXC", "F", act4, "SET" );
// } }
// else else
// { {
// //卖出登记 //卖出登记
// //D:281106 //D:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() ); act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "SET", "FXD", "F", act4, "SET" ); ddtKey = setglgService.setglgAddAmount ( setglg,"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "SET", "FXD", "F", act4, "SET" );
// //C 281110 //C 281110
// act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() ); act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "", "FXC", "C", act1, "" ); cbtKey = setglgService.setglgAddAmount ( setglg,"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "", "FXC", "C", act1, "" );
// } }
} }
} }
......
...@@ -220,95 +220,43 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -220,95 +220,43 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
public void defaultRateN1000(FxtlopStoreVo vo) { public void defaultRateN1000(FxtlopStoreVo vo) {
vo.reset(); vo.reset();
String rmbRat = NULLSTR; String rmbRat = NULLSTR;
BigDecimal buyRat = null; BigDecimal buyRat = null;
BigDecimal selRat = null; BigDecimal selRat = null;
BigDecimal midRat = null; BigDecimal midRat = null;
BigDecimal buy1Rat = null; BigDecimal buyRat1 = null;
String selTyp = NULLSTR;
BigDecimal selPreRat = null;
String buyTyp = NULLSTR;
BigDecimal buyPreRat = null;
String setCur = NULLSTR;
BigDecimal setAmt = BigDecimal.ZERO;
BigDecimal favRat = BigDecimal.ZERO;
Cbb max = vo.getFxdgrp().getCbs().getMax(); Cbb max = vo.getFxdgrp().getCbs().getMax();
Fxd rec = vo.getFxdgrp().getRec(); Fxd rec = vo.getFxdgrp().getRec();
Pts pts = vo.getFxdgrp().getApl().getPts(); Pts pts = vo.getFxdgrp().getApl().getPts();
if (MdaUtils.isEmpty(vo.getFxtp().getQuoflg()) if( ! MdaUtils.isEmpty(rec.getFxtyp()) && ! MdaUtils.isEmpty(max.getCur()) )
&& !MdaUtils.isEmpty(rec.getFxtyp()) && !MdaUtils.isEmpty(pts.getPtyinr())) { {
// Systems.setEnabled(vo.getFxdgrp().getRec(), "rat");
Argument<String> rmbRatBox = new Argument<String>(); Argument<String> rmbRatBox = new Argument<String>();
Argument<BigDecimal> buyRatBox = new Argument<BigDecimal>(); Argument<BigDecimal> buyRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> selRatBox = new Argument<BigDecimal>(); Argument<BigDecimal> selRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> midRatBox = new Argument<BigDecimal>(); Argument<BigDecimal> midRatBox = new Argument<BigDecimal>();
Argument<BigDecimal> buy1RatBox = new Argument<BigDecimal>(); Argument<BigDecimal> buyRat1Box = new Argument<BigDecimal>();
xrtmodService.getratCebTim(max.getCur(), xrtmodService.sysiso(), Dates.today(), rmbRatBox, buyRatBox, selRatBox, midRatBox, buy1RatBox); xrtmodService.getratCebTim ( max.getCur(), vo.getFxdgrp().getCbs().getNom1().getCur(), Dates.today(), rmbRatBox, buyRatBox, selRatBox, midRatBox, buyRat1Box );
rmbRat = rmbRatBox.value; rmbRat = rmbRatBox.value;
buyRat = buyRatBox.value; buyRat = buyRatBox.value;
selRat = selRatBox.value; selRat = selRatBox.value;
midRat = midRatBox.value; midRat = midRatBox.value;
buy1Rat = buy1RatBox.value; buyRat1 = buyRat1Box.value;
Ptyrat ptyrat = ptyratMapper.getPtyratByPtyinrAndCur(pts.getPtyinr(), max.getCur());
if (Objects.nonNull(ptyrat)) { if( ! rec.isModified("midrat") )
selTyp = ptyrat.getSeltyp(); {
selPreRat = ptyrat.getBuyrat(); rec.setMidrat( midRat);
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);
}
}
} }
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) { private SetmodVo buildSetmodVo(FxtlopStoreVo vo) {
......
...@@ -92,19 +92,48 @@ public class FxtselServiceImpl implements FxtselService { ...@@ -92,19 +92,48 @@ public class FxtselServiceImpl implements FxtselService {
@Override @Override
public List<TrncodVo> dealWithByInr(TrnCodeQueryVo trnCodeQueryVo) { public List<TrncodVo> dealWithByInr(TrnCodeQueryVo trnCodeQueryVo) {
String type=trnCodeQueryVo.getType();
if (type ==null){
type="";
}
List<TrncodVo> result = Lists.newArrayList(); List<TrncodVo> result = Lists.newArrayList();
Fxdgrp fxdgrp=new Fxdgrp(); Fxdgrp fxdgrp=new Fxdgrp();
fxdgrp = fxToolComponent.getFxdgrpByInr(trnCodeQueryVo.getInr()); fxdgrp = fxToolComponent.getFxdgrpByInr(trnCodeQueryVo.getInr());
String[] fxTraArray = {"FXTFCM", "FXTFCN","FXTLCM"};
String[] fxButArray = {"外币兑换平盘确认", "外币兑换平盘销账","结售汇平盘确认"}; if ("dhpp".equals(type.toLowerCase())){
String isAllowed = ""; String[] fxTraArray = {"FXTFCM", "FXTFCN"};
for (int i = 0; i < fxTraArray.length; i++) { String[] fxButArray = {"外币兑换平盘确认", "外币兑换平盘销账"};
TrncodVo trncodVo = new TrncodVo(fxTraArray[i], fxButArray[i], isAllowed,"Y",""); String isAllowed = "";
fxToolComponent.isFXTrnAllowed(fxdgrp,trncodVo); for (int i = 0; i < fxTraArray.length; i++) {
result.add(trncodVo); 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; return result;
} }
......
package com.brilliance.isc.funds.vo.funds; package com.brilliance.isc.funds.vo.funds;
import com.brilliance.isc.bo.model.Fxdgrp; import com.brilliance.isc.vo.funds.FxdgrpVo;
import com.brilliance.isc.bo.model.Fxtp; import com.brilliance.isc.vo.funds.FxtpVo;
import com.brilliance.isc.bo.model.Mt30m; import com.brilliance.isc.vo.model.Mt30m;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo; import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.vo.PtsptaVo; import com.brilliance.isc.common.vo.PtsptaVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -28,9 +28,9 @@ public class FxtlcmStoreVo extends BaseTransactionVo { ...@@ -28,9 +28,9 @@ public class FxtlcmStoreVo extends BaseTransactionVo {
//XMLPanel fxt300l1的内置block //XMLPanel fxt300l1的内置block
private String fxt300l1blk= null; private String fxt300l1blk= null;
private Fxdgrp fxdgrp; private FxdgrpVo fxdgrp;
private Fxtp fxtp; private FxtpVo fxtp;
private Mt30m mt30m; private Mt30m mt30m;
...@@ -40,12 +40,12 @@ public class FxtlcmStoreVo extends BaseTransactionVo { ...@@ -40,12 +40,12 @@ public class FxtlcmStoreVo extends BaseTransactionVo {
public void reset() { public void reset() {
super.reset(); super.reset();
if (fxdgrp == null) { if (fxdgrp == null) {
fxdgrp = new Fxdgrp(); fxdgrp = new FxdgrpVo();
} }
fxdgrp.reset(); fxdgrp.reset();
if (fxtp == null) { if (fxtp == null) {
fxtp = new Fxtp(); fxtp = new FxtpVo();
} }
fxtp.reset(); 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