Commit cf3cf622 by zhoujunpeng

Merge branch 'develop' of http://192.168.0.110:11080/isc-v3.1/isc-funds into develop

 Conflicts:
	isc-funds-business/src/main/java/com/brilliance/isc/funds/common/component/FtToolComponent.java
parents 3b0ddfc8 443f1f5f
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
funds_fxtssb_000000=Settlement funds_fxtssb_000000=Settlement
funds_fxtsss_000000=Settlement funds_fxtsss_000000=Settlement
funds_fxtsqo_000000=Settlement funds_fxtsqo_000000=Settlement
funds_fxtsqo_000001=期结售汇交割提示:{0} funds_fxtsqo_000001=Զ�ڽ��ۻ㽻����ʾ:{0}
funds_fxtsqo_000002=The clearing amount has to be positive. funds_fxtsqo_000002=The clearing amount has to be positive.
funds_fxtsqo_000003=非汇款业务请输入业务编号 funds_fxtsqo_000003=�ǻ��ҵ��������ҵ����
funds_fxtsqo_000004={0} funds_fxtsqo_000004={0}
funds_fxtfop_000000=Foreign Exchange Liquidation funds_fxtfop_000000=Foreign Exchange Liquidation
funds_fxtfcn_CT000009=Foreign Exchange Liquidation funds_fxtfcn_CT000009=Foreign Exchange Liquidation
0136=This contract is overdrawn by {0} 0136=This contract is overdrawn by {0}
fttfcm=资金拆借到期提示:
funds_crtcri_000000=Clearing in funds_crtcri_000000=Clearing in
...@@ -3,6 +3,7 @@ package com.brilliance.isc.funds.common.component; ...@@ -3,6 +3,7 @@ package com.brilliance.isc.funds.common.component;
import com.brilliance.isc.bo.Cbb; import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.bo.Cnd; import com.brilliance.isc.bo.Cnd;
import com.brilliance.isc.bo.Ftd; import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.Ftt;
import com.brilliance.isc.bo.model.*; import com.brilliance.isc.bo.model.*;
import com.brilliance.isc.common.cbsmod.service.CbsmodService; import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent; import com.brilliance.isc.common.component.PtsptaToolComponent;
...@@ -12,11 +13,10 @@ import com.brilliance.isc.common.trnmod.service.TrnmodService;import com.brillia ...@@ -12,11 +13,10 @@ import com.brilliance.isc.common.trnmod.service.TrnmodService;import com.brillia
import com.brilliance.isc.common.util.Utils; import com.brilliance.isc.common.util.Utils;
import com.brilliance.isc.common.vo.PtsptaVo; import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.FtdMapper; import com.brilliance.isc.mda.dao.*;
import com.brilliance.isc.mda.dao.CbbMapper;
import com.brilliance.isc.mda.dao.CndMapper;
import com.brilliance.isc.vo.TrncodVo; import com.brilliance.isc.vo.TrncodVo;
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 com.brilliance.mda.runtime.mda.util.Strings; import com.brilliance.mda.runtime.mda.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -24,10 +24,9 @@ import org.springframework.stereotype.Component; ...@@ -24,10 +24,9 @@ import org.springframework.stereotype.Component;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map; import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
import java.util.Objects;import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@Component @Component
public class FtToolComponent { public class FtToolComponent {
...@@ -38,7 +37,7 @@ public class FtToolComponent { ...@@ -38,7 +37,7 @@ public class FtToolComponent {
@Autowired @Autowired
private TrnmodService trnmodService; private TrnmodService trnmodService;
@Autowired @Autowired
private FtdMapper ftdMapper; private FtdselMapper ftdselMapper;
@Autowired @Autowired
private CbbMapper cbbMapper; private CbbMapper cbbMapper;
@Autowired @Autowired
...@@ -50,17 +49,37 @@ public class FtToolComponent { ...@@ -50,17 +49,37 @@ public class FtToolComponent {
@Autowired @Autowired
private SysmodService sysmodService; private SysmodService sysmodService;
@Autowired
private FtdMapper ftdMapper;
@Autowired
private FttMapper fttMapper;
public Ftdgrp getFtdgrpByInr(String inr) { public Ftdgrp getFtdgrpByInr(String inr) {
Ftd ftd = new Ftd(); Ftd rec = new Ftd();
ftd.setInr(inr); rec.setInr(inr);
ftd = ftdMapper.selectByPrimaryKey(ftd); rec = ftdMapper.selectByPrimaryKey(rec);
if (ftd == null) { if (Objects.isNull(rec)) {
throw new CommonServiceException("主键" + inr + "找不到FTD数据"); throw new CommonServiceException("主键" + inr + "找不到FTD数据");
} }
Ftdgrp ftdgrp = new Ftdgrp(); Ftdgrp ftdgrp = new Ftdgrp();
ftdgrp.reset(); ftdgrp.reset();
ftdgrp.setRec(ftd); ftdgrp.setRec(rec);
Ftt blk = new Ftt();
blk.setInr(inr);
blk = fttMapper.selectByPrimaryKey(blk);
ftdgrp.setBlk(blk);
//获取cbs金额信息
Date date = Dates.add(Utils.getMaxDate(), -1);
cbsmodService.cbsGetBalance(ftdgrp.getCbs().getMax(), "FTD", inr, "MAXSUM", "AMT1", date);
cbsmodService.cbsGetBalance(ftdgrp.getCbs().getIns(), "FTD", inr, "INSSUM", "AMT1", date);
cbsmodService.cbsGetBalance(ftdgrp.getCbs().getOpn1(), "FTD", inr, "OPN", "AMT1", date);
cbsmodService.cbsGetBalance(ftdgrp.getCbs().getOpn2(), "FTD", inr, "OPN2", "AMT1", date);
//获取ptspta信息
storePtsToGrp(ftdgrp, inr, "FTD");
return ftdgrp; return ftdgrp;
} }
...@@ -254,9 +273,199 @@ public class FtToolComponent { ...@@ -254,9 +273,199 @@ public class FtToolComponent {
} }
} }
public void sav(Ftdgrp ftdgrp,BigDecimal cshpct) { public void sav(Ftdgrp ftdgrp) {
trnmodService.trnStoreContract(ftdgrp); trnmodService.trnStoreContract(ftdgrp);
} }
public void setObjNam(String objref, String nam) {
//Setting OBJNAM. If the setting of OBJREF is not standard, here you can change it.
// ctx.absGet(Sysmod.class).setObjnam(NULLSTR);
// ctx.absGet(Sysmod.class).setObjnam(objref + "/" + nam);
}
public String getFtdInrByOwnref(String ownref) {
Ftd ftd= ftdMapper.selectByOwnref(ownref);
if (ftd !=null && StringUtils.isNotEmpty(ftd.getInr())) {
return ftd.getInr();
} else {
return null;
}
}
public static void isFXTrnAllowed(Ftdgrp ftdgrp, TrncodVo trncodVo)
{
ftdgrp.reset();
String trnNam = trncodVo.getInifrm().toUpperCase();
String errOpnY ="Selected funds transfer is already opened.";
String errOpnN ="No funds transfer selected.";
String errAccN ="There is no amount in transit.";
String errCnfY ="This funds transfer has beed confirmed.";
String errCnfN ="This funds transfer has not yet confirmed.";
String errClsY ="This funds transfer has been closed.";
String errMatY ="This funds transfer has no open balance.";
String errZJB = "此交易只能资金部经办!";
String errYYB = "此交易只能营运部经办!";
if ("FTTFCM".equals(trnNam)||"FTTPCM".equals(trnNam)) {
if (!StringUtils.isEmpty(ftdgrp.getRec().getInr())){
trncodVo.setDisResult(errOpnY);
trncodVo.setIsAllowed("N");
}
}
if ("FTTFMT".equals(trnNam)) {
if (StringUtils.isEmpty(ftdgrp.getRec().getInr())){
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}else if( MdaUtils.isEmpty(ftdgrp.getRec().getCnfdat())){
trncodVo.setDisResult(errCnfY);
trncodVo.setIsAllowed("N");
}
if( ! MdaUtils.isEmpty(ftdgrp.getRec().getClsdat()) ) {
trncodVo.setDisResult(errClsY);
trncodVo.setIsAllowed("N");
}
else if( MdaUtils.isEmpty(ftdgrp.getCbs().getOpn1().getAmt()) ) {
trncodVo.setDisResult(errMatY);
trncodVo.setIsAllowed("N");
}
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"PT") == 0 )
{
trncodVo.setDisResult("");
trncodVo.setIsAllowed("N");
}
// if( ! Platform.checkUsrBranch("2") ) { // 资金调拨到期交易只能营运部做
// trncodVo.setDisResult(errYYB);
// trncodVo.setIsAllowed("N");
// }
}
if ("FTTFCN".equals(trnNam)){
if( MdaUtils.isEmpty(ftdgrp.getRec().getInr()) )
{
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}
else
{
if( MdaUtils.compareTo(ftdgrp.getCbs().getOpn2().getAmt(),0)<=0 )
{
trncodVo.setDisResult(errAccN);
trncodVo.setIsAllowed("N");
}
}
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"PT") == 0 )
{
trncodVo.setDisResult("");
trncodVo.setIsAllowed("N");
}
// if( ! Platform.checkUsrBranch("2") )
// { // 资金调拨销账交易只能营运部做
//
// trncodVo.setDisResult(errYYB);
// trncodVo.setIsAllowed("N");
// }
}
if ("FTTFCN".equals(trnNam)){
if( MdaUtils.isEmpty(ftdgrp.getRec().getInr()) )
{
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}
else
{
if( MdaUtils.compareTo(ftdgrp.getCbs().getOpn2().getAmt(),0)<=0 )
{
trncodVo.setDisResult(errAccN);
trncodVo.setIsAllowed("N");
}
}
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"PT") != 0 )
{
trncodVo.setDisResult("");
trncodVo.setIsAllowed("N");
}
// if( ! Platform.checkUsrBranch("2") )
// { // 资金调拨销账交易只能营运部做
// trncodVo.setDisResult(errYYB);
// trncodVo.setIsAllowed("N");
// }
}
if ("FTTFCN".equals(trnNam)){
if( MdaUtils.isEmpty(ftdgrp.getRec().getInr()) )
{
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}
else
{
if( MdaUtils.compareTo(ftdgrp.getCbs().getOpn2().getAmt(),0)<=0 )
{
trncodVo.setDisResult(errAccN);
trncodVo.setIsAllowed("N");
}
}
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"PT") != 0 )
{
trncodVo.setDisResult("");
trncodVo.setIsAllowed("N");
}
// if( ! Platform.checkUsrBranch("2") )
// { // 资金调费用交易交易只能营运部做
//
// trncodVo.setDisResult(errYYB);
// trncodVo.setIsAllowed("N");
// }
}
if ("FTTFCN".equals(trnNam)){
if( MdaUtils.isEmpty(ftdgrp.getRec().getInr()) )
{
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}
}
if ("FTTFCN".equals(trnNam)){
if( MdaUtils.isEmpty(ftdgrp.getRec().getInr()) )
{
trncodVo.setDisResult(errOpnN);
trncodVo.setIsAllowed("N");
}
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"PT") == 0 )
{
trncodVo.setDisResult("");
trncodVo.setIsAllowed("N");
}
}
if(MdaUtils.isEmpty(trnNam)) {
String msgTxt = "The selected transaction cannot be started under the selected F/T.";
trncodVo.setDisResult(msgTxt);
trncodVo.setIsAllowed("N");
}
if(Strings.isEmpty(trncodVo.getDisResult())){
trncodVo.setIsAllowed("Y");
}
}
} }
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