Commit dd008b0f by jianglong

修改ftxlcm

parent 504b3031
......@@ -29,9 +29,9 @@ public class FxtlcmValidator extends AbstractModuleValidator <FxtlcmStoreBo>{
}
@Override
public Map<String, String> validate(FxtlcmStoreBo vo) {
public Map<String, String> validate(FxtlcmStoreBo bo) {
Map<String, String> maps = new HashMap<>();
maps.putAll(super.validate(vo));
maps.putAll(super.validate(bo));
return maps;
}
......@@ -39,10 +39,10 @@ public class FxtlcmValidator extends AbstractModuleValidator <FxtlcmStoreBo>{
* source:Fxtlcm.0023.script
*/
@Validate(path="fxdgrp.apl.pts.ref")
public ValidResult checkFxdgrpAplPtsRefN1000(FxtlcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && ( MdaUtils.compareTo(vo.getMt30m().getS22a(),"AMND") == 0 || MdaUtils.compareTo(vo.getMt30m().getS22a(),"CANC") == 0 ) )
public ValidResult checkFxdgrpAplPtsRefN1000(FxtlcmStoreBo bo){
if( ! MdaUtils.isEmpty(bo.getSwtflg()) && ( MdaUtils.compareTo(bo.getMt30m().getS22a(),"AMND") == 0 || MdaUtils.compareTo(bo.getMt30m().getS22a(),"CANC") == 0 ) )
{
if( MdaUtils.isEmpty(vo.getFxdgrp().getApl().getPts().getRef()) )
if( MdaUtils.isEmpty(bo.getFxdgrp().getApl().getPts().getRef()) )
{
return errorMandatory();
}
......@@ -54,8 +54,8 @@ public class FxtlcmValidator extends AbstractModuleValidator <FxtlcmStoreBo>{
* source:Fxtlcm.0024.script
*/
@Validate(path="mt30m.rbc.pts.extkey")
public ValidResult checkMt30mRbcPtsExtkeyN1000(FxtlcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && MdaUtils.isEmpty(vo.getMt30m().getRbc().getPts().getExtkey()) )
public ValidResult checkMt30mRbcPtsExtkeyN1000(FxtlcmStoreBo bo){
if( ! MdaUtils.isEmpty(bo.getSwtflg()) && MdaUtils.isEmpty(bo.getMt30m().getRbc().getPts().getExtkey()) )
{
return errorMandatory();
}
......@@ -66,8 +66,8 @@ public class FxtlcmValidator extends AbstractModuleValidator <FxtlcmStoreBo>{
* source:Fxtlcm.0025.script
*/
@Validate(path="mt30m.owc.pts.extkey")
public ValidResult checkMt30mOwcPtsExtkeyN1000(FxtlcmStoreBo vo){
if( ! MdaUtils.isEmpty(vo.getSwtflg()) && MdaUtils.isEmpty(vo.getMt30m().getOwc().getPts().getExtkey()) )
public ValidResult checkMt30mOwcPtsExtkeyN1000(FxtlcmStoreBo bo){
if( ! MdaUtils.isEmpty(bo.getSwtflg()) && MdaUtils.isEmpty(bo.getMt30m().getOwc().getPts().getExtkey()) )
{
return errorMandatory();
}
......
......@@ -48,21 +48,27 @@ public class FxtlcmSettleRegister implements ISettleRegister {
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) {
maxCur=setmodVo.getCbsMap().get("MAX").getCur();
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.setDoccur(maxCur);
setmodVo.setDocamt(maxAmt);
setmodVo.setOpnamt(maxAmt);
SetglgVo setglg = setmodVo.getSetglg();
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"TRN" );
setglgService.setglgClrAmount ( setmodVo.getSetglg(),"SET" );
setglgService.setglgClrAmount ( setglg,"TRN" );
setglgService.setglgClrAmount ( setglg,"SET" );
//!==============================================
//!卖出:D:139(CNY) C:4250305(CNY)
//! D:4250305外币 C:114(116)外币
......@@ -198,6 +204,6 @@ public class FxtlcmSettleRegister implements ISettleRegister {
**/
}
}
//this.getSetmod().setglgAllValDat ( this.getFxdgrp().getRec().getValdat(), "D" );
setmodService.setglgAllValDat (setmodVo,rec.getValdat(), "D" );
}
}
......@@ -22,11 +22,16 @@ import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.vo.BizAmdInfoVo;
import com.brilliance.isc.common.vo.BizInfoVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.bo.funds.FxtlcmStoreBo;
import com.brilliance.isc.funds.common.component.FxToolComponent;
import com.brilliance.isc.funds.fxtlcm.check.FxtlcmValidator;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.transfer.transaction.FxtlcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtlcmStoreVo;
import com.brilliance.isc.vo.funds.FxdBizInfoVo;
import com.brilliance.mda.runtime.mda.util.Dates;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -63,6 +68,15 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
@Resource
private BchService bchService;
@Resource
private LiaallService liaallService;
@Resource
private CbsmodService cbsmodService;
@Autowired
private FxtlcmStructMapper fxtlcmStructMapper;
@PostConstruct
public void regisertService() {
serviceRegisterMaps.put(CommonContants.SETMOD_SERVICE, "Y");
......@@ -104,6 +118,7 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
bizInfoVo.setTrdout(rec.getTrdout());
bizInfoVo.setTrnman(rec.getTrnman());
bizInfoVo.setRat(rec.getRat());
bizInfoVo.setValdat(rec.getValdat());
return bizInfoVo;
}
......@@ -122,6 +137,8 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
public void initFxtlcm(FxtlcmStoreBo fxtlcmStoreBo){
Fxdgrp fxdgrp = fxtlcmStoreBo.getFxdgrp();
String fxdinr = fxdgrp.getRec().getInr();
fxdgrp = fxToolComponent.getFxdgrpByInr(fxtlcmStoreBo.getFxdgrp().getRec().getInr());
fxtlcmStoreBo.setFxdgrp(fxdgrp);
}
......@@ -147,18 +164,31 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
public void ruleMtabutSavN500(FxtlcmStoreBo transactionVo){
TrnmodVo trnmodVo = transactionHelpService.getTransactionStoreSet().getTrnmodVo();
Fxdgrp fxdgrp=transactionVo.getFxdgrp();
fxToolComponent.getref(transactionVo.getFxdgrp());
//# 1. Create (rsp. update) Contract (incl. Texts)
fxdgrp.getRec().setCnfdat(Dates.today());
if (fxdgrp.getCbs().getOpn2().getAmt().compareTo(BigDecimal.ZERO)==0){
fxdgrp.getRec().setClsdat(Dates.today());
}
fxdgrp.setAcc(transactionVo.getAplacc());
// 1. Create (rsp. update) Contract (incl. Texts)
fxToolComponent.sav(transactionVo.getFxdgrp(), BigDecimal.ZERO);
// 2. Build Transaction from FTDGRP
trnmodService.trnSetFromContract ( trnmodVo);
cbsSav(transactionVo, trnmodVo);
// save documents
// #记录116台账
// NOSMOD.savNostro
}
public void cbsSav(FxtlcmStoreBo transactionVo, TrnmodVo trnmodVo) {
// cbsmodService.cbsTrnSetNew("TRN",trnmodVo.getTrn().getInr());
cbsmodService.cbsTrnSetNew("TRN",trnmodVo.getTrn().getInr());
// //#cgl
// //平盘登记后产生4条CBB,MAX,NOM,OPN,OPN2
// //后续两个交易分别消OPN和OPN2
......@@ -180,12 +210,19 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
// if ( !MdaUtils.isEmpty( transactionHelpService.getTransactionStoreSet().getLiaall())) {
// liaallService.storeAll(transactionHelpService.getTransactionStoreSet().getLiaall());
// }
// //Platform.cbsTrnCommit();
liaallService.storeAll(transactionHelpService.getTransactionStoreSet().getLiaall());
cbsmodService.cbsTrnCommit();
}
public String getRef(FxtlcmStoreVo fxtlcmStoreVo) {
fxtlcmStoreVo.reset();
PtsptaVo ptsptaVo = fxtlcmStoreVo.getFxdgrp().getApl();
FxtlcmStoreBo fxtlcmStoreBo= fxtlcmStructMapper.voTransferToBo(fxtlcmStoreVo);
return getRef(fxtlcmStoreBo);
}
public String getRef(FxtlcmStoreBo fxtlcmStoreBo) {
fxtlcmStoreBo.reset();
PtsptaVo ptsptaVo = fxtlcmStoreBo.getFxdgrp().getApl();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return NULLSTR;
}
......@@ -197,7 +234,7 @@ public class FxtlcmTransactionServiceImpl extends AbstractTransactionService<Fxt
return NULLSTR;
}
SettleContext.getUserSession().setWrkbch(wrkbch);
Fxdgrp fxdgrp = fxtlcmStoreVo.getFxdgrp();
Fxdgrp fxdgrp = fxtlcmStoreBo.getFxdgrp();
fxToolComponent.getref(fxdgrp);
return fxdgrp.getRec().getOwnref();
}
......
......@@ -259,21 +259,21 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
}
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;
}
// 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();
......
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