Commit cb613bc5 by jianglong

修改测试问题fttfcm: 修改报文展示,getref异常,troact,triact账号列表

parent 4e24d99c
package com.brilliance.isc.funds.common.controller;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.common.api.bch.service.BchService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.common.component.FtToolComponent;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.vo.ResponseSet;
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;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/getRef")
public class RefController {
@Autowired
private BchService bchService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private SettleContext settleContext;
@Resource
private FtToolComponent ftToolComponent;
@Resource
private FttfcmStructMapper fttfcmStructMapper;
@PostMapping("/ftt")
public ResponseSet<String> getRef(@RequestBody FttfcmStoreVo fttfcmStoreVo) {
FttfcmStoreBo fttfcmStoreBo= fttfcmStructMapper.voTransferToBo(fttfcmStoreVo);
fttfcmStoreBo.reset();
//已有ownref
if (StringUtils.isNotEmpty(fttfcmStoreBo.getFtdgrp().getRec().getOwnref())){
return ResponseSet.simpleSuccess(fttfcmStoreBo.getFtdgrp().getRec().getOwnref());
}
//Tro.ptainr为空
PtsptaVo ptsptaVo = fttfcmStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return ResponseSet.fail("无效的客户号,请检查是否为我行客户");
//SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}
//pta.Branchinr
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
if (pta == null || StringUtils.isEmpty(pta.getBranchinr())) {
return ResponseSet.fail("无效的客户号,请检查是否为我行客户和客户归属机构");
}
settleContext.loadSettleSession("", pta.getBranchinr(), "");
//检查归属机构的机构号是否存在
Bch wrkbch = SettleContext.getUserSession().getWrkbch();
if (wrkbch == null || StringUtils.isEmpty(wrkbch.getBchflg())) {
return ResponseSet.fail("客户所属机构未配置完整,请联系系统管理员,pta.branchinr="+pta.getBranchinr());
}
ftToolComponent.getref(fttfcmStoreBo.getFtdgrp());
String ref = fttfcmStoreBo.getFtdgrp().getRec().getOwnref();
return ResponseSet.simpleSuccess(ref);
}
}
package com.brilliance.isc.funds.fttfcm.document;
import com.brilliance.isc.bo.Lid;
import com.brilliance.isc.bo.model.Lidgrp;
import com.brilliance.isc.common.doc.TextResultVo;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.doc.annotation.DocFunc;
import com.brilliance.isc.doc.constant.DocConstant;
import com.brilliance.isc.doc.handle.impl.AbstractTransactionDocSet;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT199Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.MT299Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.swtmsg.SwiftMessageComponent;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import static com.brilliance.isc.doc.constant.DocConstant.COR_TYP_SWT;
@Component("fttfcm.docset")
public class FttfcmDocset extends AbstractTransactionDocSet<FttfcmStoreBo> {
@Resource
private BuildFtt320l1 buildFtt320l1;
@Autowired
private SwiftMessageComponent swiftMessageComponent;
@PostConstruct
public void buildMember() {
buildLetterProvider("fttfcm","FTT3201","FTT1991","FTT2991");
......@@ -31,4 +49,76 @@ public class FttfcmDocset extends AbstractTransactionDocSet<FttfcmStoreBo> {
return new HashMap<>();
}
}
@DocFunc(name = "ftt3201", cortyp = COR_TYP_SWT)
public TextResultVo ftt320s1(FttfcmStoreBo bo, DoceotVo doceotVo) {
MtResult _320MtResult=new MtResult();
//TODO
//MtResult _320MtResult=MtCreatorManager.packMT(mt320Creator)
_320MtResult.setMessage("这是一个临时报文返回,报文组装待开发");
return buildTextVo(_320MtResult);
}
@DocFunc(name = "ftt1991", cortyp = COR_TYP_SWT)
public TextResultVo ftt199s1(FttfcmStoreBo bo, DoceotVo doceotVo) {
MT199Creator mt199Creator = new MT199Creator("199");
mt199Creator.setRecvBic(doceotVo.getAdrbic());
mt199Creator.setSendBic(swiftMessageComponent.getSendBic());
//20
mt199Creator.setTransactionReferenceNumber(bo.getFtdgrp().getRec().getOwnref());
//21
if (!StringUtils.isEmpty( bo.getRelref())) {
mt199Creator.setRelatedReference(bo.getRelref());
}else{
mt199Creator.setRelatedReference("NONREF");
}
mt199Creator.setNarrative(bo.getNarblk());
return buildTextVo(MtCreatorManager.packMT(mt199Creator));
}
@DocFunc(name = "ftt2991", cortyp = COR_TYP_SWT)
public TextResultVo ftt299s1(FttfcmStoreBo bo, DoceotVo doceotVo) {
MT299Creator mt299Creator = new MT299Creator("299");
mt299Creator.setRecvBic(doceotVo.getAdrbic());
mt299Creator.setSendBic(swiftMessageComponent.getSendBic());
//20
mt299Creator.setTransactionReferenceNumber(bo.getFtdgrp().getRec().getOwnref());
//21
if (!StringUtils.isEmpty( bo.getRelref())) {
mt299Creator.setRelatedReference(bo.getRelref());
}else{
mt299Creator.setRelatedReference("NONREF");
}
mt299Creator.setNarrative(bo.getNarblk());
return buildTextVo(MtCreatorManager.packMT(mt299Creator));
}
private TextResultVo buildTextVo(MtResult mtResult) {
if (mtResult != null) {
TextResultVo textResultVo = new TextResultVo();
textResultVo.setData(mtResult.getMessage());
textResultVo.setFormat(DocConstant.TEXT);
textResultVo.setExtension(DocConstant.SF2);
textResultVo.setBinary(mtResult.getMessage().getBytes());
textResultVo.setAttach(mtResult.getAbsMTCreator());
return textResultVo;
}
return null;
}
}
......@@ -62,15 +62,15 @@ public class FttfcmDocumentRegister implements IDocumentRegister {
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRO", "" );
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "SWT", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN320", "SWT", "MT320");
break;
case "199":
trndocService.defDocEot ( trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRO", "" );
trndocService.defDocEot ( trndoc, "TRN", "199", "\\FTT199L1", "SWT", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN199", "SWT", "MT199");
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRO", "" );
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "SWT", 0, troPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRO", "" );
trndocService.setDocSendFormat(trndoc, "TRN299", "SWT", "MT299");
break;
}
......@@ -80,15 +80,15 @@ public class FttfcmDocumentRegister implements IDocumentRegister {
switch( rec.getMsgtyp() )
{
case "320":
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRI", "" );
trndocService.defDocEot (trndoc, "TRN", "320", "\\FTT320L1", "SWT", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC","MT 320", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN320", "SWT", "MT320");
break;
case "199":
trndocService.defDocEot (trndoc, "TRN", "199", "\\FTT199L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRI", "" );
trndocService.defDocEot (trndoc, "TRN", "199", "\\FTT199L1", "SWT", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 199", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN199", "SWT", "MT199");
break;
case "299":
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "LET", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRI", "" );
trndocService.defDocEot (trndoc, "TRN", "299", "\\FTT299L1", "SWT", 0, triPtspta.getPts().getPtainr(), "\\FTDGRP\\REC", "MT 299", "TRI", "" );
trndocService.setDocSendFormat(trndoc, "TRN299", "SWT", "MT299");
break;
}
......
package com.brilliance.isc.funds.fttfcm.resource;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pta;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.transaction.controller.AbstractTransactionController;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.funds.bo.funds.FttfcmStoreBo;
import com.brilliance.isc.funds.fttfcm.service.FttfcmTransactionServiceImpl;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfcmStoreVo;
import com.brilliance.isc.funds.vo.funds.FxtfopStoreVo;
import com.brilliance.isc.transfer.IStructMapper;
import com.brilliance.isc.vo.ResponseSet;
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;
import javax.annotation.Resource;
import java.util.List;
/**
* @program: isc-funds
......@@ -37,18 +46,83 @@ public class FttfcmResource extends AbstractTransactionController<FttfcmStoreVo>
@Resource
FttfcmTransactionServiceImpl fttfcmTransactionService;
@Autowired
private PtaCacheService ptaCacheService;
@Resource
private SettleContext settleContext;
/**
* 根据结售汇类型 等获取业务参号
*
* @param FttfcmStoreVo
* @param fttfcmStoreVo
* @return
*/
@PostMapping("/getRef")
public ResponseSet<String> getRef(@RequestBody FttfcmStoreVo fttfcmStoreVo) {
String ref = fttfcmTransactionService.getRef(fttfcmStoreVo);
FttfcmStoreBo fttfcmStoreBo= fttfcmStructMapper.voTransferToBo(fttfcmStoreVo);
fttfcmStoreBo.reset();
//已有ownref
if (StringUtils.isNotEmpty(fttfcmStoreBo.getFtdgrp().getRec().getOwnref())){
return ResponseSet.simpleSuccess(fttfcmStoreBo.getFtdgrp().getRec().getOwnref());
}
//Tro.ptainr为空
PtsptaVo ptsptaVo = fttfcmStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
return ResponseSet.fail("无效的客户号,请检查是否为我行客户");
//SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}
//pta.Branchinr
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
if (pta == null || StringUtils.isEmpty(pta.getBranchinr())) {
return ResponseSet.fail("无效的客户号,请检查是否为我行客户和客户归属机构");
}
settleContext.loadSettleSession("", pta.getBranchinr(), "");
//检查归属机构的机构号是否存在
Bch wrkbch = SettleContext.getUserSession().getWrkbch();
if (wrkbch == null || StringUtils.isEmpty(wrkbch.getBchflg())) {
return ResponseSet.fail("客户所属机构未配置完整,请联系系统管理员,pta.branchinr="+pta.getBranchinr());
}
String ref = fttfcmTransactionService.getRef(fttfcmStoreBo);
return ResponseSet.simpleSuccess(ref);
}
@PostMapping("/defaultSwtn99N1000")
public ResponseSet<String> defaultSwtn99N1000(@RequestBody FttfcmStoreBo fttfcmStorebo) {
fttfcmTransactionService.defaultSwtn99N1000(fttfcmStorebo);
return ResponseSet.simpleSuccess(fttfcmStorebo);
}
@PostMapping("/defaultFttpTriactN1200")
public ResponseSet defaultAcc1N1000(@RequestBody FttfcmStoreBo bo) {
try {
settleContext.loadSettleSession("FTTFCM","","");
List<String> accList= fttfcmTransactionService.defaultFttpTriactN1200(bo);
return ResponseSet.simpleSuccess(accList);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
@PostMapping("/defaultFttpTroactN1200")
public ResponseSet defaultAcc2N1000(@RequestBody FttfcmStoreBo bo) {
try {
settleContext.loadSettleSession("FTTFCM","","");
List<String> accList= fttfcmTransactionService.defaultFttpTroactN1200(bo);
return ResponseSet.simpleSuccess(accList);
} catch (Exception e) {
throw e;
} finally {
SettleContext.removeUserSession();
}
}
}
......@@ -8,6 +8,7 @@ import com.brilliance.isc.bo.model.Ftdgrp;
import com.brilliance.isc.bo.model.Fttp;
import com.brilliance.isc.funds.transfer.transaction.FttfcmStructMapper;
import com.brilliance.isc.funds.vo.funds.FttfcmStoreVo;
import com.brilliance.isc.vo.ResponseSet;
import com.brilliance.isc.vo.model.FtdgrpVo;
import com.brilliance.isc.vo.model.FttpVo;
import com.brilliance.isc.vo.model.FtdVo;
......@@ -224,21 +225,15 @@ public class FttfcmTransactionServiceImpl extends AbstractTransactionService<Ftt
public String getRef(FttfcmStoreBo fttfcmStoreBo) {
fttfcmStoreBo.reset();
PtsptaVo ptsptaVo = fttfcmStoreBo.getFtdgrp().getTro();
if (ptsptaVo == null || StringUtils.isEmpty(ptsptaVo.getPtainr())) {
SettleContext.getUserSession().setWrkbch(SettleContext.getUserSession().getBch());
}else{
Pta pta = ptaCacheService.getPtaByInr(ptsptaVo.getPtainr());
Bch wrkbch = new Bch();
wrkbch.setInr(pta.getBranchinr());
wrkbch = bchService.selectByPrimaryKey(wrkbch);
SettleContext.getUserSession().setWrkbch(wrkbch);
}
Ftdgrp ftdgrp = fttfcmStoreBo.getFtdgrp();
ftToolComponent.getref(ftdgrp);
return ftdgrp.getRec().getOwnref();
}
public void cbsSav(FttfcmStoreBo transactionVo, TrnmodVo trnmodVo) {
......@@ -321,7 +316,7 @@ public class FttfcmTransactionServiceImpl extends AbstractTransactionService<Ftt
Fttp fttp=fttfcmStoreBo.getFttp();
String blk = NULLSTR;
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("narblk"))
if(!fttfcmStoreBo.isModified("narblk"))
{
blk = "ATTN:NANFANG SUB-BRANCH";
blk = blk + CR + "PLS DEBIT OUR A/C NO. " + fttp.getTriact() + " WITH " + Formats.fmtAmount(ftdgrp.getCbs().getMax().getAmt(),ftdgrp.getCbs().getMax().getCur()) + " FOR FIXED DEPOSIT DEAL, DETAILS BELOW:";
......@@ -338,7 +333,7 @@ public class FttfcmTransactionServiceImpl extends AbstractTransactionService<Ftt
blk = blk + CR + "IBD";
fttfcmStoreBo.setNarblk( blk);
}
if(!fttfcmStoreBo.getFtdgrp().getRec().isModified("relref"))
if(!fttfcmStoreBo.isModified("relref"))
{
if( MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"DO") == 0 || MdaUtils.compareTo(ftdgrp.getRec().getFttyp(),"LO") == 0 )
{
......@@ -370,7 +365,7 @@ public class FttfcmTransactionServiceImpl extends AbstractTransactionService<Ftt
List<String> actLst=new ArrayList<>();
if( ! MdaUtils.isEmpty(ftdgrp.getCbs().getMax().getCur()) && ! MdaUtils.isEmpty(ftdgrp.getAct().getPts().getPtyinr()) )
{
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getTri().getPtyinr() + "' AND TYP = 'DB'";
String sql = "WHERE CUR = '" + ftdgrp.getCbs().getMax().getCur() + "' AND SERPTYINR = '" + ftdgrp.getAct().getPtyinr() + "' AND TYP = 'DB'";
List<String > actList = actMapper.getSerAccByConditionSql(sql);
if( ! fttp.isModified("triact") && actLst.size()>0) {
fttp.setTriact( actLst.get(1));
......
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