Commit 0a1c9258 by huangshunlin

清算smh 新增收报行rcvkey ,清算新增nosmod模块

parent b06d3cf0
......@@ -13,8 +13,6 @@ import static com.brilliance.mda.runtime.mda.Constants.NULLDATE;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* TABLE:smh:SMH - Structured Message Header
*/
......@@ -22,134 +20,137 @@ import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Smh implements Serializable {
//Internal Unique ID of Message
private String inr = NULLSTR;
//Internal Unique ID of Message
private String inr = NULLSTR;
//Object Type of Owning Contract Optional
private String objtyp = NULLSTR;
//Object Type of Owning Contract Optional
private String objtyp = NULLSTR;
//INR of Owning Contract Optional
private String objinr = NULLSTR;
//INR of Owning Contract Optional
private String objinr = NULLSTR;
//Type of Transaction
private String trntyp = NULLSTR;
//Type of Transaction
private String trntyp = NULLSTR;
//Transaction, which Handles the Document
private String trninr = NULLSTR;
//Transaction, which Handles the Document
private String trninr = NULLSTR;
//Counter within TRN
private int trnsub;
//Counter within TRN
private int trnsub ;
//External Key
private String extkey = NULLSTR;
//External Key
private String extkey = NULLSTR;
//Name to Identify Document
private String nam = NULLSTR;
//Name to Identify Document
private String nam = NULLSTR;
//Creating User
private String creusr = NULLSTR;
//Creating User
private String creusr = NULLSTR;
//Creating Transaction
private String crefrm = NULLSTR;
//Creating Transaction
private String crefrm = NULLSTR;
//Timestamp Created
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date credattim = NULLDATE;
//Timestamp Created
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date credattim = NULLDATE;
//Direction '>'=Outgoing, '<'=Incoming
private String dir = NULLSTR;
//Direction '>'=Outgoing, '<'=Incoming
private String dir = NULLSTR;
//Document Path Relative to Appl. or Data Root
private String docpth = NULLSTR;
//Document Path Relative to Appl. or Data Root
private String docpth = NULLSTR;
//Document Name File ID
private String docfil = NULLSTR;
//Document Name File ID
private String docfil = NULLSTR;
//Document Format RTF, TIF, TXT etc. Used to Created File Extension
private String docfxt = NULLSTR;
//Document Format RTF, TIF, TXT etc. Used to Created File Extension
private String docfxt = NULLSTR;
//MAC
private String docmac = NULLSTR;
//MAC
private String docmac = NULLSTR;
//Position of Message in Document 1=Begin of Document, 0=Whole Document
private long msgpos;
//Position of Message in Document 1=Begin of Document, 0=Whole Document
private long msgpos ;
//Length of Message in Document 0=Rest of Document
private long msglen;
//Length of Message in Document 0=Rest of Document
private long msglen ;
//INR of the First Message of Split Messages/Secondary Messages
private String grpinr = NULLSTR;
//INR of the First Message of Split Messages/Secondary Messages
private String grpinr = NULLSTR;
//Sequence Number of Split Messages
private int grpseq;
//Sequence Number of Split Messages
private int grpseq ;
//Structure/Syntax of Message SWT, LET, TLX, TCO
private String cortyp = NULLSTR;
//Structure/Syntax of Message SWT, LET, TLX, TCO
private String cortyp = NULLSTR;
//Subtype of Message Defines SRV
private String cortypsub = NULLSTR;
//Subtype of Message Defines SRV
private String cortypsub = NULLSTR;
//Application Form
private String apf = NULLSTR;
//Application Form
private String apf = NULLSTR;
//Receiver Key BIC/Telex#/Fax#/email
private String sndkey = NULLSTR;
//Receiver Key BIC/Telex#/Fax#/email
private String sndkey = NULLSTR;
//Count per Form
private String apfcnt = NULLSTR;
//Count per Form
private String apfcnt = NULLSTR;
//PTA Receiving Documents
private String ptainr = NULLSTR;
//PTA Receiving Documents
private String ptainr = NULLSTR;
//Type of Copy
private String oriflg = NULLSTR;
//Type of Copy
private String oriflg = NULLSTR;
//Internal Unique ID of Original Message
private String orismhinr = NULLSTR;
//Internal Unique ID of Original Message
private String orismhinr = NULLSTR;
//Counter of Partial Messages i.e. 1/2
private String partflg = NULLSTR;
//Counter of Partial Messages i.e. 1/2
private String partflg = NULLSTR;
//Message Type Optional
private String msgtyp = NULLSTR;
//Message Type Optional
private String msgtyp = NULLSTR;
//Relevant Currency Optional
private String relcur = NULLSTR;
//Relevant Currency Optional
private String relcur = NULLSTR;
//Relevant Amount Optional
private BigDecimal relamt = Decimals.ZERO_SCALE2;
//Relevant Amount Optional
private BigDecimal relamt = Decimals.ZERO_SCALE2;
//STP Message
private String stp = NULLSTR;
//STP Message
private String stp = NULLSTR;
//Entity holding Message
private String etyextkey = NULLSTR;
//Entity holding Message
private String etyextkey = NULLSTR;
//清算报文的清算编号
private String sysno = NULLSTR;
//清算报文的清算编号
private String sysno = NULLSTR;
//flag M 999加押,T TELEX加押
private String staflg = NULLSTR;
//flag M 999加押,T TELEX加押
private String staflg = NULLSTR;
//文件清理日期
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date clndat = NULLDATE;
//文件清理日期
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date clndat = NULLDATE;
//ReferenceDZT
private String f20 = NULLSTR;
//ReferenceDZT
private String f20 = NULLSTR;
//系统通道标志
private String chlflg = NULLSTR;
//系统通道标志
private String chlflg = NULLSTR;
//原ISO报文类型
private String orimsgtyp = NULLSTR;
//原ISO报文类型
private String orimsgtyp = NULLSTR;
private String mpiinr = NULLSTR;
private String mpiinr=NULLSTR;
private String docmd5 = NULLSTR;
private String docmd5 = NULLSTR;
private long doclen;
private long doclen ;
private int xxxcnt;
private int xxxcnt ;
//清算模块用刀的 收报行
private String rcvkey = NULLSTR;
}
package com.brilliance.isc.bo.model;
import com.brilliance.isc.bo.Usr;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
/**
*
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Crtp extends AbstractCommonVo {
private static Logger log = LoggerFactory.getLogger(Crtp.class);
//Value Date
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date valdat;
//USE FOR ARE AMTOUNT (max=1)
private Usr usr;
@Override
public void reset() {
super.reset();
if (usr == null) {
usr = new Usr();
}
}
}
\ No newline at end of file
package com.brilliance.isc.common.nosmod.vo;
import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serializable;
/**
* @program: isc-core
* @ClassName: Noscbs
* @description:
* @author: huangshunlin
* @create: 2024-10-18 20:34
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Noscbs extends AbstractCommonVo implements Serializable {
private Cbb nos;
@Override
public void reset() {
super.reset();
if (nos == null) {
nos = new Cbb();
}
nos.reset();
}
}
package com.brilliance.isc.common.nosmod.vo;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.bo.Cbe;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serializable;
/**
* @program: isc-funds
* @ClassName: Nosmod
* @description:
* @author:huangshunlin
* @create:2024-10-18 20:30
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Nosmod extends AbstractCommonVo implements Serializable {
private Noscbs cbs;
private Cbe wrkcbe;
private Act rec;
@Override
public void reset() {
super.reset();
if (cbs == null) {
cbs = new Noscbs();
}
cbs.reset();
if (wrkcbe == null) {
wrkcbe = new Cbe();
}
if (rec == null) {
rec = new Act();
}
}
}
......@@ -5,7 +5,9 @@ import com.brilliance.mda.runtime.mda.util.Decimals;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import static com.brilliance.mda.runtime.mda.Constants.NULLDATE;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
......@@ -31,7 +33,6 @@ public class FxdBizInfoVo extends BizInfoVo {
//fxdgrp.rec.dsp2
private String dsp2 = NULLSTR;
;
//结售汇业务的本币的记账账号 fxdgrp.rec.acc2
private String acc2 = NULLSTR;
......@@ -52,4 +53,7 @@ public class FxdBizInfoVo extends BizInfoVo {
private String cancur = NULLSTR;
private BigDecimal canamt = BigDecimal.ZERO;
//fxdgrp.rec.setdat
private Date setdat = NULLDATE;
}
......@@ -48,6 +48,7 @@
<result property="xxxcnt" column="xxxcnt" jdbcType="INTEGER"/>
<result property="docmd5" column="docmd5" jdbcType="VARCHAR"/>
<result property="doclen" column="doclen" jdbcType="NUMERIC"/>
<result property="rcvkey" column="rcvkey" jdbcType="VARCHAR"/>
</resultMap>
......@@ -64,7 +65,7 @@
<!-- </resultMap>-->
<sql id="Base_Column_List">
inr,objtyp,objinr,trntyp,trninr,trnsub,extkey,nam,creusr,crefrm,credattim,dir,docpth,docfil,docfxt,docmac,msgpos,msglen,grpinr,grpseq,cortyp,cortypsub,apf,sndkey,apfcnt,ptainr,oriflg,orismhinr,partflg,msgtyp,relcur,relamt,stp,etyextkey,sysno,staflg,clndat,f20,chlflg,orimsgtyp,mpiinr,xxxcnt,docmd5,doclen
inr,objtyp,objinr,trntyp,trninr,trnsub,extkey,nam,creusr,crefrm,credattim,dir,docpth,docfil,docfxt,docmac,msgpos,msglen,grpinr,grpseq,cortyp,cortypsub,apf,sndkey,apfcnt,ptainr,oriflg,orismhinr,partflg,msgtyp,relcur,relamt,stp,etyextkey,sysno,staflg,clndat,f20,chlflg,orimsgtyp,mpiinr,xxxcnt,docmd5,doclen,rcvkey
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
......@@ -127,6 +128,7 @@
#{xxxcnt,jdbcType=INTEGER},
#{docmd5,jdbcType=VARCHAR},
#{doclen,jdbcType=NUMERIC},
#{rcvkey,jdbcType=VARCHAR},
</trim>
</insert>
......@@ -177,6 +179,7 @@
<if test="xxxcnt != null">xxxcnt,</if>
<if test="docmd5 != null">docmd5,</if>
<if test="doclen != null">doclen,</if>
<if test="rcvkey != null">rcvkey,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
......@@ -223,6 +226,7 @@
<if test="xxxcnt != null">#{xxxcnt,jdbcType=INTEGER},</if>
<if test="docmd5 != null">#{docmd5,jdbcType=VARCHAR},</if>
<if test="doclen != null">#{doclen,jdbcType=NUMERIC},</if>
<if test="rcvkey != null">#{rcvkey,jdbcType=VARCHAR},</if>
</trim>
</insert>
......@@ -272,6 +276,7 @@
<if test="xxxcnt != null">xxxcnt = #{xxxcnt,jdbcType=INTEGER},</if>
<if test="docmd5 != null">docmd5 = #{docmd5,jdbcType=VARCHAR},</if>
<if test="doclen != null">doclen = #{doclen,jdbcType=NUMERIC},</if>
<if test="rcvkey != null">rcvkey = #{rcvkey,jdbcType=VARCHAR},</if>
</set>
where inr = #{inr,jdbcType=VARCHAR}
</update>
......@@ -322,6 +327,7 @@
xxxcnt = #{xxxcnt,jdbcType=INTEGER},
docmd5 = #{docmd5,jdbcType=VARCHAR},
doclen = #{doclen,jdbcType=NUMERIC},
rcvkey = #{rcvkey,jdbcType=VARCHAR},
</set>
where inr = #{inr,jdbcType=VARCHAR}
</update>
......@@ -379,6 +385,7 @@
<if test="module.xxxcnt != null">xxxcnt = #{module.xxxcnt,jdbcType=INTEGER},</if>
<if test="module.docmd5 != null">docmd5 = #{module.docmd5,jdbcType=VARCHAR},</if>
<if test="module.doclen != null">doclen = #{module.doclen,jdbcType=NUMERIC},</if>
<if test="module.rcvkey != null">rcvkey = #{module.rcvkey,jdbcType=VARCHAR},</if>
</set>
${conditions}
</update>
......@@ -466,6 +473,7 @@
<if test="xxxcnt != null">and xxxcnt = #{xxxcnt,jdbcType=INTEGER}</if>
<if test="docmd5 != null">and docmd5 = #{docmd5,jdbcType=VARCHAR}</if>
<if test="doclen != null">and doclen = #{doclen,jdbcType=NUMERIC}</if>
<if test="rcvkey != null">and rcvkey = #{rcvkey,jdbcType=VARCHAR}</if>
</select>
<select id="selectRelationSmh" resultMap="BaseResultMap">
......
package com.brilliance.isc.common.component;
import cn.hutool.core.bean.BeanUtil;
import com.brilliance.isc.bo.*;
import com.brilliance.isc.common.cache.adr.AdrCacheService;
import com.brilliance.isc.common.cache.pta.PtaCacheService;
......@@ -61,10 +62,10 @@ public class PtsptaToolComponent {
@Autowired
private PtsptaMapper ptsptaMapper;
public boolean IsDemestic(PtsptaVo ptsptaVo){
if (ptsptaVo.getAdr() !=null && "CN".equals(ptsptaVo.getAdr().getLoccty())) {
public boolean IsDemestic(PtsptaVo ptsptaVo) {
if (ptsptaVo.getAdr() != null && "CN".equals(ptsptaVo.getAdr().getLoccty())) {
return true;
} else{
} else {
return false;
}
}
......@@ -1005,6 +1006,7 @@ public class PtsptaToolComponent {
/**
* 根据objinr和objtyp补录缺失的role
*
* @param ptsptaList
* @param objinr
* @param objtyp
......@@ -1025,6 +1027,7 @@ public class PtsptaToolComponent {
/**
* 清掉ptspta层的值,通过ptainr重复赋值
*
* @param ptsptaVo
*/
private void clearPtspta(PtsptaVo ptsptaVo) {
......@@ -1034,4 +1037,34 @@ public class PtsptaToolComponent {
ptsptaVo.setAdrblk("");
ptsptaVo.setDbfadrblk("");
}
/**
* source:ptsmod.0003.script
*/
public void ptsmodGetPtsptaFromPtyINR(PtsptaVo argPtspta, String argPtyInr) {
//! Sets Argptspta based on ArgptyInr
//! that means the main address of party ARGPTYINR is read and based on this PTA argPtspta is filled completely
// if no ArgPtaInr is empty, clear argptspta
if (MdaUtils.isEmpty(argPtyInr)) {
// MdaUtils.clear(argPtspta);
PtsptaVo ptspta = new PtsptaVo();
BeanUtil.copyProperties(ptspta, argPtspta);
} else {
// else read PTA
Pta maa = ptaCacheService.selectByPtyInrAndUsg(argPtyInr, "MAA");
// cacheDbRead2(argPtspta.getPta(), argPtyInr, "PTYINR", "MAA", "USG");
if (Objects.isNull(maa)) {
// MdaUtils.clear(argPtspta);
PtsptaVo ptspta = new PtsptaVo();
BeanUtil.copyProperties(ptspta, argPtspta);
} else {
// if found, get remaining fields
argPtspta.setPta(maa);
// ptsmodGetPtsptaFromPta(argPtspta);
PtsptaVo ptspta = getPtsptaFromPtaINR(maa.getInr());
BeanUtil.copyProperties(ptspta, argPtspta);
}
}
}
}
package com.brilliance.isc.common.nosmod;
import com.brilliance.isc.common.nosmod.vo.Nosmod;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import java.math.BigDecimal;
import java.util.Date;
/**
* @program: isc-core
* @ClassName: NosmodService
* @description:
* @author: huangshunlin
* @create: 2024-10-18 20:42
*/
public interface NosmodService {
void cbsNostroStore(Nosmod nosmod, String cbt, String extid, String trninr, Date dat, String actcur, BigDecimal amt, String nam, String acc, Object obj);
boolean isSavNostroCbs(SetmodVo setmodVo);
int getNosRowInSetgll(SetmodVo setmodVo);
void savNostroCbs(Nosmod nosmod, String trninr, String actcur, BigDecimal amt, String acc, Date dat, String nam, Object obj);
void savNostro(Nosmod nosmod, SetmodVo setmodVo, TrnmodVo trnmodVo);
}
package com.brilliance.isc.common.nosmod.impl;
import com.brilliance.isc.bo.Act;
import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.nosmod.NosmodService;
import com.brilliance.isc.common.nosmod.vo.Nosmod;
import com.brilliance.isc.common.setgll.vo.SetgllVo;
import com.brilliance.isc.common.setmod.vo.SetmodVo;
import com.brilliance.isc.common.trnmod.vo.TrnmodVo;
import com.brilliance.isc.mda.dao.ActMapper;
import com.brilliance.isc.utils.StringUtils;
import com.brilliance.mda.runtime.mda.util.Dates;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;
/**
* @program: isc-core
* @ClassName: NosmodServiceImpl
* @description:
* @author: huangshunlin
* @create: 2024-10-18 20:43
*/
@Service
public class NosmodServiceImpl implements NosmodService {
@Resource
private CbsmodService cbsmodService;
@Resource
private ActMapper actMapper;
/**
* source:nosmod.0000.script
*/
public void cbsNostroStore(Nosmod nosmod, String cbt, String extid, String trninr, Date dat, String actcur, BigDecimal amt, String nam, String acc, Object obj) {
//!保存存放同业台账
nosmod.getWrkcbe().setCbt(cbt);
nosmod.getWrkcbe().setExtid(extid);
nosmod.getWrkcbe().setTrntyp("TRN");
nosmod.getWrkcbe().setTrninr(trninr);
nosmod.getWrkcbe().setDat(dat);
nosmod.getWrkcbe().setCur(actcur);
nosmod.getWrkcbe().setAmt(amt);
nosmod.getWrkcbe().setNam(nam);
nosmod.getWrkcbe().setAcc(acc);
cbsmodService.cbsStoreEntry(nosmod.getWrkcbe(), obj);
}
/**
* source:nosmod.0001.script
*/
public boolean isSavNostroCbs(SetmodVo setmodVo) {
//!判断是否需要保存存放同业的台账
return getNosRowInSetgll(setmodVo) >= 0;
}
/**
* source:nosmod.0002.script
*/
public int getNosRowInSetgll(SetmodVo setmodVo) {
//!取存放同业分录在settlement的位置
int row = -1;
// int size = Grids.gridCount(MdaDriver.getModuleList("\\SETMOD\\SETGLG\\SETGLL"));
List<SetgllVo> setgll = setmodVo.getSetglg().getSetgll();
if (CollectionUtils.isEmpty(setgll)) {
return row;
}
String dsp = NULLSTR;
for (int i = 0, size = setgll.size(); i < size; i++) {
// dsp = Datas.getContent(this, "\\SETMOD\\SETGLG\\SETGLL(" + MdaUtils.toString(i) + ")\\DSP");
dsp = setgll.get(i).getDsp();
switch (StringUtils.trimToEmpty(dsp)) {
case "NOD":
case "PAC":
case "DBD":
case "DBC":
row = i;
break;
}
}
return row;
}
/**
* source:nosmod.0003.script
*/
public void savNostroCbs(Nosmod nosmod, String trninr, String actcur, BigDecimal amt, String acc, Date dat, String nam, Object obj) {
//!保存存放同业台账
cbsmodService.cbsTrnSetNew("TRN", trninr);
cbsNostroStore(nosmod, "NOSAMT", "AMT1", trninr, dat, actcur, amt, nam, acc, obj);
}
/**
* source:nosmod.0004.script
*/
public void savNostro(Nosmod nosmod, SetmodVo setmodVo, TrnmodVo trnmodVo) {
//! 保存存放同业台账
int row = getNosRowInSetgll(setmodVo);
String trninr = NULLSTR;
int err = 0;
String actcur = NULLSTR;
BigDecimal amt = null;
String act = NULLSTR;
List<SetgllVo> setgll = setmodVo.getSetglg().getSetgll();
if (row >= 0) {
// trninr = Datas.getContent(this, "\\TRNMOD\\TRN\\INR");
trninr = trnmodVo.getTrn().getInr();
// actcur = Datas.getContent(this, "\\SETMOD\\SETGLG\\SETGLL(" + MdaUtils.toString(row) + ")\\CUR");
// amt = Datas.getContentNumeric(this, "\\SETMOD\\SETGLG\\SETGLL(" + MdaUtils.toString(row) + ")\\AMT");
// act = Datas.getContent(this, "\\SETMOD\\SETGLG\\SETGLL(" + MdaUtils.toString(row) + ")\\ACT");
// actcur = Datas.getContent(this, "\\SETMOD\\SETGLG\\SETGLL(" + MdaUtils.toString(row) + ")\\CUR");
amt = setgll.get(row).getAmt();
act = setgll.get(row).getAct();
actcur = setgll.get(row).getCur();
List<Act> actList = actMapper.getActListByExtkey(act);
// modify for hzbank,only save when act exist
if (CollectionUtils.isNotEmpty(actList)) {
nosmod.setRec(actList.get(0));
savNostroCbs(nosmod, trninr, actcur, amt, act, Dates.today(), SettleContext.getTransName(), nosmod.getRec());
}
}
}
}
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