Commit 4bfc0473 by xiaotong

FXTLOP后端逻辑调整

parent e0df9afc
......@@ -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.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.vo.funds.FxdBizInfoVo;
......@@ -12,6 +13,10 @@ 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("fxtlop.settleRegister")
public class FxtlopSettleRegister implements ISettleRegister {
......@@ -33,8 +38,19 @@ public class FxtlopSettleRegister implements ISettleRegister {
private void transRegister(SetmodVo setmodVo) {
FxdBizInfoVo rec = (FxdBizInfoVo) setmodVo.getRec();
//this.getSetmod().setDocAmt ( this.getFxdgrp().getCbs().getMax().getCur(), this.getFxdgrp().getCbs().getMax().getAmt(), "Disable" );
//this.getSetmod().setOpnAmt ( this.getFxdgrp().getCbs().getMax().getAmt() );
BigDecimal maxAmt = BigDecimal.ZERO;
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(),"SET" );
//平盘登记交易不产生分录
......@@ -58,26 +74,26 @@ public class FxtlopSettleRegister implements ISettleRegister {
String cbtKey = null;
if( ! 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.getSetamt() );
ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt(), "", "FXD", "C", act1, "" );
//C:281106
act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"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 ( setmodVo.getSetglg(),"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 ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getSetamt().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.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, "" );
// }
}
}
......
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.funds.fxtlop.service.impl.FxtlopTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FxtlopStructMapper;
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.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;
......@@ -29,7 +36,44 @@ public class FxtlopResource extends AbstractTransactionController<FxtlopStoreVo>
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;
public interface FxtlopService {
void initFxtlop(FxtlopStoreBo fxtlopStoreBo);
void defaultFxtlop(FxtlopStoreBo fxtlopStoreBo);
}
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.fxtlop.service.FxtlopService;
import com.brilliance.mda.runtime.mda.util.Dates;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
@Service
public class FxtlopServiceImpl implements FxtlopService {
@Autowired
XrtmodService xrtmodService;
private static final Logger logger = LoggerFactory.getLogger(FxtlopServiceImpl.class);
@Override
......@@ -19,30 +26,10 @@ public class FxtlopServiceImpl implements FxtlopService {
}
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) {
// this.getFxtp().setPansta( PanStaEdit);
// 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) {
fxtlopStoreBo.getFxdgrp().getCbs().getNom1().setCur(xrtmodService.sysiso());
// 成交日
if( MdaUtils.isEmpty(fxtlopStoreBo.getFxdgrp().getRec().getOpndat()) || (!fxtlopStoreBo.getFxdgrp().getRec().isModified("opndat")) )
{
......@@ -54,8 +41,7 @@ public class FxtlopServiceImpl implements FxtlopService {
{
fxtlopStoreBo.getFxdgrp().getRec().setValdat( fxtlopStoreBo.getFxdgrp().getRec().getOpndat());
}
String extkey = SettleContext.getUserSession().getUsr().getExtkey();
fxtlopStoreBo.getFxdgrp().getRec().setUsr(extkey);
}
}
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