Commit 4bfc0473 by xiaotong

FXTLOP后端逻辑调整

parent e0df9afc
...@@ -4,6 +4,7 @@ import com.brilliance.isc.common.glemod.service.GlemodService; ...@@ -4,6 +4,7 @@ import com.brilliance.isc.common.glemod.service.GlemodService;
import com.brilliance.isc.common.register.settle.DefaultSettleRegister; import com.brilliance.isc.common.register.settle.DefaultSettleRegister;
import com.brilliance.isc.common.register.settle.ISettleRegister; import com.brilliance.isc.common.register.settle.ISettleRegister;
import com.brilliance.isc.common.setglg.service.SetglgService; 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.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo; import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.vo.funds.FxdBizInfoVo; import com.brilliance.isc.vo.funds.FxdBizInfoVo;
...@@ -12,6 +13,10 @@ import com.brilliance.mda.runtime.mda.util.Strings; ...@@ -12,6 +13,10 @@ import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component("fxtlop.settleRegister") @Component("fxtlop.settleRegister")
public class FxtlopSettleRegister implements ISettleRegister { public class FxtlopSettleRegister implements ISettleRegister {
...@@ -33,8 +38,19 @@ public class FxtlopSettleRegister implements ISettleRegister { ...@@ -33,8 +38,19 @@ 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();
//this.getSetmod().setDocAmt ( this.getFxdgrp().getCbs().getMax().getCur(), this.getFxdgrp().getCbs().getMax().getAmt(), "Disable" ); BigDecimal maxAmt = BigDecimal.ZERO;
//this.getSetmod().setOpnAmt ( this.getFxdgrp().getCbs().getMax().getAmt() ); 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();
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" ); setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"SET" ); setglgService.setglgClrAmount ( setmodVo.getSetglg(),"SET" );
//平盘登记交易不产生分录 //平盘登记交易不产生分录
...@@ -58,26 +74,26 @@ public class FxtlopSettleRegister implements ISettleRegister { ...@@ -58,26 +74,26 @@ public class FxtlopSettleRegister implements ISettleRegister {
String cbtKey = null; String cbtKey = null;
if( ! MdaUtils.isEmpty(rec.getFxtyp()) ) if( ! 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.getSetamt() ); // act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "", "FXD", "C", act1, "" ); // ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "", "FXD", "C", act1, "" );
//C:281106 // //C:281106
act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() ); // act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().negate(), "SET", "FXC", "F", act4, "SET" ); // cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "SET", "FXC", "F", act4, "SET" );
} // }
else // else
{ // {
//卖出登记 // //卖出登记
//D:281106 // //D:281106
act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() ); // act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDocamt() );
ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "SET", "FXD", "F", act4, "SET" ); // ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt(), "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.getSetamt().negate(), "", "FXC", "C", act1, "" ); // cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDocamt().negate(), "", "FXC", "C", act1, "" );
} // }
} }
} }
......
package com.brilliance.isc.funds.fxtlop.resource; package com.brilliance.isc.funds.fxtlop.resource;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController; import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.funds.fxtlop.service.impl.FxtlopTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtlopStructMapper; import com.brilliance.isc.funds.transfer.transaction.FxtlopStructMapper;
import com.brilliance.isc.funds.vo.funds.FxtlopStoreVo; import com.brilliance.isc.funds.vo.funds.FxtlopStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
import com.brilliance.isc.transfer.IStructMapper; import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
import io.swagger.annotations.Api; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -29,7 +36,44 @@ public class FxtlopResource extends AbstractTransactionController<FxtlopStoreVo> ...@@ -29,7 +36,44 @@ public class FxtlopResource extends AbstractTransactionController<FxtlopStoreVo>
return fxtlopStructMapper; return fxtlopStructMapper;
} }
@Resource(name = "fxtlop.transaction")
FxtlopTransactionServiceImpl fxtlopTransactionService;
@Autowired
private SettleContext settleContext;
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FxtlopStoreVo fxtlopStoreVo) {
String ref = fxtlopTransactionService.getRef(fxtlopStoreVo);
return ResponseSet.simpleSuccess(ref);
}
@PostMapping("/defaultRateN1000")
public ResponseSet defaultRateN1000(@RequestBody FxtlopStoreVo fxtlopStoreVo) {
try {
settleContext.loadSettleSession("FXTLOP","","");
fxtlopTransactionService.defaultRateN1000(fxtlopStoreVo);
return ResponseSet.simpleSuccess(fxtlopStoreVo);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
@PostMapping("/defaultCalculateN1100")
public ResponseSet defaultCalculateN1100(@RequestBody FxtlopStoreVo fxtlopStoreVo) {
try {
settleContext.loadSettleSession("FXTLOP","","");
fxtlopTransactionService.defaultCalculateN1100(fxtlopStoreVo);
return ResponseSet.simpleSuccess(fxtlopStoreVo);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
} }
...@@ -4,6 +4,4 @@ import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo; ...@@ -4,6 +4,4 @@ import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
public interface FxtlopService { public interface FxtlopService {
void initFxtlop(FxtlopStoreBo fxtlopStoreBo); void initFxtlop(FxtlopStoreBo fxtlopStoreBo);
void defaultFxtlop(FxtlopStoreBo fxtlopStoreBo);
} }
package com.brilliance.isc.funds.fxtlop.service.impl; package com.brilliance.isc.funds.fxtlop.service.impl;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo; import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
import com.brilliance.isc.funds.fxtlop.service.FxtlopService; import com.brilliance.isc.funds.fxtlop.service.FxtlopService;
import com.brilliance.mda.runtime.mda.util.Dates; import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils; import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.slf4j.Logger; import org.slf4j.Logger;
@Service @Service
public class FxtlopServiceImpl implements FxtlopService { public class FxtlopServiceImpl implements FxtlopService {
@Autowired
XrtmodService xrtmodService;
private static final Logger logger = LoggerFactory.getLogger(FxtlopServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(FxtlopServiceImpl.class);
@Override @Override
...@@ -19,30 +26,10 @@ public class FxtlopServiceImpl implements FxtlopService { ...@@ -19,30 +26,10 @@ public class FxtlopServiceImpl implements FxtlopService {
} }
private void initFxtlop950(FxtlopStoreBo fxtlopStoreBo) { private void initFxtlop950(FxtlopStoreBo fxtlopStoreBo) {
//this.getTrnmod().troLockExistingOrNewContract ( this.getFxdgrp());
// if DISSEL is empty, a contract can be copied
// if( Dynamic.troIsObjTypLoaded( this.getFxdgrp()) )
// {
// this.getFxtp().getRecget().setDissel( "X");
// }
// else
// {
// this.getFxtp().getRecget().setDissel( "");
// }
} }
private void initFxtlop1000(FxtlopStoreBo fxtlopStoreBo) { private void initFxtlop1000(FxtlopStoreBo fxtlopStoreBo) {
// this.getFxtp().setPansta( PanStaEdit); fxtlopStoreBo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
// this.getFxtp().getAplp().setPansta( PanStaEdit);
// Systems.resetVisible(this.getFxtp(),"ovwp");
// Systems.setActivePanel(this.getRegp());
// this.getFxdgrp().getCbs().getNom1().setCur( Dynamic.sysiso());
// Systems.resetEnabled(this.getFxdgrp().getCbs().getNom1(),"cur");
// Systems.setValues(this.getFxdgrp().getRec(),"fxtyp","LB" + CR + "LS");
}
@Override
public void defaultFxtlop(FxtlopStoreBo fxtlopStoreBo) {
// 成交日 // 成交日
if( MdaUtils.isEmpty(fxtlopStoreBo.getFxdgrp().getRec().getOpndat()) || (!fxtlopStoreBo.getFxdgrp().getRec().isModified("opndat")) ) if( MdaUtils.isEmpty(fxtlopStoreBo.getFxdgrp().getRec().getOpndat()) || (!fxtlopStoreBo.getFxdgrp().getRec().isModified("opndat")) )
{ {
...@@ -54,8 +41,7 @@ public class FxtlopServiceImpl implements FxtlopService { ...@@ -54,8 +41,7 @@ public class FxtlopServiceImpl implements FxtlopService {
{ {
fxtlopStoreBo.getFxdgrp().getRec().setValdat( fxtlopStoreBo.getFxdgrp().getRec().getOpndat()); fxtlopStoreBo.getFxdgrp().getRec().setValdat( fxtlopStoreBo.getFxdgrp().getRec().getOpndat());
} }
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
fxtlopStoreBo.getFxdgrp().getRec().setUsr(extkey);
} }
} }
package com.brilliance.isc.funds.fxtlop.service.impl; package com.brilliance.isc.funds.fxtlop.service.impl;
import com.brilliance.isc.bo.*;
import com.brilliance.isc.bo.model.Fxacbs; import com.brilliance.isc.bo.model.Fxacbs;
import com.brilliance.isc.bo.model.Fxdgrp; 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.CbsmodService;
import com.brilliance.isc.common.cbsmod.service.XrtmodService;
import com.brilliance.isc.common.contants.CommonContants; import com.brilliance.isc.common.contants.CommonContants;
import com.brilliance.isc.common.context.SettleContext; import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.liaall.service.LiaallService; import com.brilliance.isc.common.liaall.service.LiaallService;
import com.brilliance.isc.common.setmod.service.SetmodService;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.transaction.AbstractTransactionService; import com.brilliance.isc.common.transaction.AbstractTransactionService;
import com.brilliance.isc.common.transaction.help.TransactionHelpService; import com.brilliance.isc.common.transaction.help.TransactionHelpService;
import com.brilliance.isc.common.transaction.help.TransactionServiceSet; import com.brilliance.isc.common.transaction.help.TransactionServiceSet;
import com.brilliance.isc.common.trnmod.service.TrnmodService; import com.brilliance.isc.common.trnmod.service.TrnmodService;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo; import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.common.util.I18nUtil; 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.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo; import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo; import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtssbStoreBo; import com.brilliance.isc.funds.bo.funds.FxtssbStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent; import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtlop.check.FxtlopValidator; import com.brilliance.isc.funds.fxtlop.check.FxtlopValidator;
import com.brilliance.isc.funds.fxtlop.service.FxtlopService; import com.brilliance.isc.funds.fxtlop.service.FxtlopService;
import com.brilliance.isc.funds.fxtlop.service.FxtpService;
import com.brilliance.isc.funds.vo.funds.FxtlopStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtssbStoreVo;
import com.brilliance.isc.mda.dao.PtyratMapper;
import com.brilliance.isc.vo.funds.FxdBizInfoVo; import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.util.MdaUtils; import com.brilliance.mda.runtime.mda.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Map; import java.util.*;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/** /**
* @program: isc-funds * @program: isc-funds
...@@ -56,6 +70,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -56,6 +70,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
private LiaallService liaallService; private LiaallService liaallService;
@Resource @Resource
private SettleContext settleContext; private SettleContext settleContext;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private BchService bchService;
@Resource
private XrtmodService xrtmodService;
@Resource
private SetmodService setmodService;
@Resource
private FxtpService fxtpService;
@Autowired
private PtyratMapper ptyratMapper;
...@@ -67,7 +93,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -67,7 +93,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.TRNDIA_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.TRNMOD_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.UMDMOD_SERVICE, "N"); serviceRegisterMaps.put(CommonContants.UMDMOD_SERVICE, "N");
serviceRegisterMaps.put(CommonContants.LIMMOD_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.LIMMOD_SERVICE, "N");
serviceRegisterMaps.put(CommonContants.BOPSET_RMB_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.BOPSET_RMB_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.BOPSET_SZSB_BOPREM_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.BOPSET_SZSB_BOPREM_SERVICE, "Y");
serviceRegisterMaps.put(CommonContants.BOPSET_CFABOP_SERVICE, "Y"); serviceRegisterMaps.put(CommonContants.BOPSET_CFABOP_SERVICE, "Y");
...@@ -89,6 +115,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -89,6 +115,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
protected BizInfoVo buildBizInfo(FxtlopStoreBo transactionVo) { protected BizInfoVo buildBizInfo(FxtlopStoreBo transactionVo) {
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo(); FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD"); bizInfoVo.setObjtyp("FXD");
Fxd rec = transactionVo.getFxdgrp().getRec();
bizInfoVo.setObjinr(rec.getInr());
bizInfoVo.setOwnref(rec.getOwnref());
bizInfoVo.setFxtyp(rec.getFxtyp());
bizInfoVo.setAcc(rec.getAcc());
bizInfoVo.setAcc2(rec.getAcc2());
bizInfoVo.setDsp(rec.getDsp());
bizInfoVo.setDsp2(rec.getDsp2());
bizInfoVo.setTrdint(rec.getTrdint());
bizInfoVo.setTrdout(rec.getTrdout());
bizInfoVo.setTrnman(rec.getTrnman());
bizInfoVo.setRat(rec.getRat());
return bizInfoVo; return bizInfoVo;
} }
...@@ -101,7 +139,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -101,7 +139,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
public FxtlopStoreBo init(FxtlopStoreBo fxtlopStoreBo) { public FxtlopStoreBo init(FxtlopStoreBo fxtlopStoreBo) {
fxtlopStoreBo.reset(); fxtlopStoreBo.reset();
fxtlopService.initFxtlop(fxtlopStoreBo); fxtlopService.initFxtlop(fxtlopStoreBo);
fxtlopService.defaultFxtlop(fxtlopStoreBo); //fxtlopService.defaultFxtlop(fxtlopStoreBo);
return fxtlopStoreBo; return fxtlopStoreBo;
} }
...@@ -141,8 +179,8 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -141,8 +179,8 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
//平盘登记后产生4条CBB,MAX,NOM,OPN,OPN2 //平盘登记后产生4条CBB,MAX,NOM,OPN,OPN2
//后续两个交易分别消OPN和OPN2 //后续两个交易分别消OPN和OPN2
String trninr = transactionHelpService.getTrninr(); String trninr = transactionHelpService.getTrninr();
trnmodService.cbsTrnStore("MAXAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000000"),transactionVo.getFxdgrp(),trninr); trnmodService.cbsTrnStore("MAXAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000000"),transactionVo.getFxdgrp().getRec(),trninr);
trnmodService.cbsTrnStore("NOMAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getNom1().getCur(),transactionVo.getFxdgrp().getCbs().getNom1().getAmt(),MdaUtils.getI18NString("fxtlop","CT000001"),transactionVo.getFxdgrp(),trninr); trnmodService.cbsTrnStore("NOMAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getNom1().getCur(),transactionVo.getFxdgrp().getCbs().getNom1().getAmt(),MdaUtils.getI18NString("fxtlop","CT000001"),transactionVo.getFxdgrp().getRec(),trninr);
/** /**
if FXDGRP\\REC\\FXTYP.is ( "LB" ) or FXDGRP\\REC\\FXTYP.is ( "LS" ) then if FXDGRP\\REC\\FXTYP.is ( "LB" ) or FXDGRP\\REC\\FXTYP.is ( "LS" ) then
...@@ -153,9 +191,144 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt ...@@ -153,9 +191,144 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
**/ **/
if( MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LB")== 0 || MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LS")== 0 ) if( MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LB")== 0 || MdaUtils.compareTo(transactionVo.getFxdgrp().getRec().getFxtyp(),"LS")== 0 )
{ {
trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000002"),transactionVo.getFxdgrp(),trninr); trnmodService.cbsTrnStore("OPNAMT","AMT1",Dates.today(),transactionVo.getFxdgrp().getCbs().getMax().getCur(),transactionVo.getFxdgrp().getCbs().getMax().getAmt(),MdaUtils.getI18NString("fxtlop","CT000002"),transactionVo.getFxdgrp().getRec(),trninr);
}
if ( !MdaUtils.isEmpty( transactionHelpService.getTransactionStoreSet().getLiaall())) {
liaallService.storeAll(transactionHelpService.getTransactionStoreSet().getLiaall());
} }
liaallService.storeAll(transactionHelpService.getTransactionStoreSet().getLiaall());
//Platform.cbsTrnCommit(); //Platform.cbsTrnCommit();
} }
public String getRef(FxtlopStoreVo fxtlopStoreVo) {
fxtlopStoreVo.reset();
PtsptaVo ptsptaVo = fxtlopStoreVo.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 = fxtlopStoreVo.getFxdgrp();
fxToolComponent.getref(fxdgrp);
return fxdgrp.getRec().getOwnref();
}
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;
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");
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);
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);
}
}
}
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);
}
}
private SetmodVo buildSetmodVo(FxtlopStoreVo vo) {
SetmodVo setmodVo = new SetmodVo();
Map cbsMap = new HashMap();
Cbb max = vo.getFxdgrp().getCbs().getMax();
cbsMap.put("MAX", max);
setmodVo.setCbsMap(cbsMap);
List<PtsptaVo> ptsList = new ArrayList();
PtsptaVo apl = vo.getFxdgrp().getApl();
ptsList.add(apl);
setmodVo.setPtsList(ptsList);
FxdBizInfoVo bizInfoVo = new FxdBizInfoVo();
bizInfoVo.setObjtyp("FXD");
setmodVo.setRec(bizInfoVo);
return setmodVo;
}
public void defaultCalculateN1100(FxtlopStoreVo fxtlopStoreVo) {
fxtlopStoreVo.reset();
fxtpService.defaultCalculateN1100(fxtlopStoreVo.getFxdgrp(), fxtlopStoreVo.getFxtp());
}
} }
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