Commit 74fa9a3b by huangshunlin

FX 结售汇交易 wrkbch 取申请人apl

parent 9d5fe65f
...@@ -36,7 +36,7 @@ public class SettleContext { ...@@ -36,7 +36,7 @@ public class SettleContext {
private final String ETY_EXTKEY = "CEB"; private final String ETY_EXTKEY = "CEB";
private final String ETG_EXTKEY = "CEBGRP"; private final String ETG_EXTKEY = "CEBGRP";
private final static List<String> US_LOCALE_LIST = Arrays.asList("LE","LI","BE","BR"); private final static List<String> US_LOCALE_LIST = Arrays.asList("LE", "LI", "BE", "BR");
private Ety ety; private Ety ety;
private Etg etg; private Etg etg;
...@@ -86,61 +86,60 @@ public class SettleContext { ...@@ -86,61 +86,60 @@ public class SettleContext {
private static ThreadLocal<Integer> TRANS_STA = ThreadLocal.withInitial(() -> 0); private static ThreadLocal<Integer> TRANS_STA = ThreadLocal.withInitial(() -> 0);
public static int getTransSta(){ public static int getTransSta() {
return TRANS_STA.get(); return TRANS_STA.get();
} }
public static void setTransSta(int status){ public static void setTransSta(int status) {
TRANS_STA.set(status); TRANS_STA.set(status);
} }
public static void setInitTransSta(){ public static void setInitTransSta() {
setTransSta(0); setTransSta(0);
} }
public static void setHoldTransSta(){ public static void setHoldTransSta() {
setTransSta(1); setTransSta(1);
} }
public static void setSavTransSta(){ public static void setSavTransSta() {
setTransSta(2); setTransSta(2);
} }
public static void setViewDocTransSta(){ public static void setViewDocTransSta() {
setTransSta(3); setTransSta(3);
} }
public static void setViewTextTransSta(){ public static void setViewTextTransSta() {
setTransSta(4); setTransSta(4);
} }
public static void setCheckTransSta(){ public static void setCheckTransSta() {
setTransSta(4); setTransSta(4);
} }
public static boolean isInitTransSta(){ public static boolean isInitTransSta() {
return getTransSta() == 0; return getTransSta() == 0;
} }
public static boolean isPedTransSta(){ public static boolean isPedTransSta() {
return getTransSta() == 1; return getTransSta() == 1;
} }
public static boolean isSavTransSta(){ public static boolean isSavTransSta() {
return getTransSta() == 2; return getTransSta() == 2;
} }
public static boolean isViewDocTransSta(){ public static boolean isViewDocTransSta() {
return getTransSta() == 3; return getTransSta() == 3;
} }
public static boolean isViewTextTransSta(){ public static boolean isViewTextTransSta() {
return getTransSta() == 4; return getTransSta() == 4;
} }
public static void setUserSession(SettleSession userSession) { public static void setUserSession(SettleSession userSession) {
userSessionThreadLocal.set(userSession); userSessionThreadLocal.set(userSession);
} }
...@@ -167,7 +166,7 @@ public class SettleContext { ...@@ -167,7 +166,7 @@ public class SettleContext {
} }
// 后台服务使用改方法,用于初始化 SessionUserVo // 后台服务使用改方法,用于初始化 SessionUserVo
public static void setSessionUserVo(String logName,String ownOrgDepartmentNumber) { public static void setSessionUserVo(String logName, String ownOrgDepartmentNumber) {
SessionUserVo sessionUserVo = new SessionUserVo(); SessionUserVo sessionUserVo = new SessionUserVo();
sessionUserVo.setLogName(logName); sessionUserVo.setLogName(logName);
sessionUserVo.setOwnOrgDepartmentNumber(ownOrgDepartmentNumber); sessionUserVo.setOwnOrgDepartmentNumber(ownOrgDepartmentNumber);
...@@ -267,7 +266,6 @@ public class SettleContext { ...@@ -267,7 +266,6 @@ public class SettleContext {
settleSession.setOrgBch(orgBch); settleSession.setOrgBch(orgBch);
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName()); Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp); settleSession.setAtp(atp);
...@@ -275,7 +273,6 @@ public class SettleContext { ...@@ -275,7 +273,6 @@ public class SettleContext {
settleSession.setEtg(etg); settleSession.setEtg(etg);
//如果wrkbchinr有值,则读取wrkbch,并读取对应的记账机构 //如果wrkbchinr有值,则读取wrkbch,并读取对应的记账机构
String wrkbchinr = bizInfoVo == null ? "" : bizInfoVo.getBranchInr(); String wrkbchinr = bizInfoVo == null ? "" : bizInfoVo.getBranchInr();
if (!MdaUtils.isEmpty(wrkbchinr)) { if (!MdaUtils.isEmpty(wrkbchinr)) {
...@@ -319,7 +316,7 @@ public class SettleContext { ...@@ -319,7 +316,7 @@ public class SettleContext {
String hndtyp = Utils.getFieldValue(bizInfoVo, "hndtyp"); String hndtyp = Utils.getFieldValue(bizInfoVo, "hndtyp");
String segtyp = Utils.getFieldValue(bizInfoVo, "segtyp"); String segtyp = Utils.getFieldValue(bizInfoVo, "segtyp");
String gartyp = Utils.getFieldValue(bizInfoVo, "gartyp"); String gartyp = Utils.getFieldValue(bizInfoVo, "gartyp");
if("OT".equals(hndtyp) && ("02".equals(segtyp) || "F".equalsIgnoreCase(gartyp))){ if ("OT".equals(hndtyp) && ("02".equals(segtyp) || "F".equalsIgnoreCase(gartyp))) {
//海关保函转开模式的wrkbch应该取当前记账机构 //海关保函转开模式的wrkbch应该取当前记账机构
settleSession.setWrkbch(settleSession.getBch()); settleSession.setWrkbch(settleSession.getBch());
} }
...@@ -337,16 +334,16 @@ public class SettleContext { ...@@ -337,16 +334,16 @@ public class SettleContext {
//20240131 满足海口自贸区上收到总行的业务 //20240131 满足海口自贸区上收到总行的业务
setAccBch4Zmq(settleSession, bizInfoVo, ptsList); setAccBch4Zmq(settleSession, bizInfoVo, ptsList);
Bch bch =settleSession.getBch(); Bch bch = settleSession.getBch();
String inifrm=settleSession.getTransName(); String inifrm = settleSession.getTransName();
String branch=""; String branch = "";
if(bch!=null){ if (bch != null) {
branch=bch.getBranch(); branch = bch.getBranch();
} }
Atpbch atpbch=atpbchMapper.selectByBranchAndInifrm(branch,inifrm); Atpbch atpbch = atpbchMapper.selectByBranchAndInifrm(branch, inifrm);
if(atpbch!=null && Objects.equals(atpbch.getNegflg(),"X")){ if (atpbch != null && Objects.equals(atpbch.getNegflg(), "X")) {
settleSession.setSdhTransaction(true); settleSession.setSdhTransaction(true);
}else { } else {
settleSession.setSdhTransaction(false); settleSession.setSdhTransaction(false);
} }
//设置经办机构 //设置经办机构
...@@ -433,16 +430,16 @@ public class SettleContext { ...@@ -433,16 +430,16 @@ public class SettleContext {
//20240131 满足海口自贸区上收到总行的业务 //20240131 满足海口自贸区上收到总行的业务
setAccBch4Zmq(settleSession, null, ptsList); setAccBch4Zmq(settleSession, null, ptsList);
Bch bch =settleSession.getBch(); Bch bch = settleSession.getBch();
String inifrm=settleSession.getTransName(); String inifrm = settleSession.getTransName();
String branch=""; String branch = "";
if(bch!=null){ if (bch != null) {
branch=bch.getBranch(); branch = bch.getBranch();
} }
Atpbch atpbch=atpbchMapper.selectByBranchAndInifrm(branch,inifrm); Atpbch atpbch = atpbchMapper.selectByBranchAndInifrm(branch, inifrm);
if(atpbch!=null && Objects.equals(atpbch.getNegflg(),"X")){ if (atpbch != null && Objects.equals(atpbch.getNegflg(), "X")) {
settleSession.setSdhTransaction(true); settleSession.setSdhTransaction(true);
}else { } else {
settleSession.setSdhTransaction(false); settleSession.setSdhTransaction(false);
} }
//设置经办机构 //设置经办机构
...@@ -507,21 +504,22 @@ public class SettleContext { ...@@ -507,21 +504,22 @@ public class SettleContext {
settleSession.setBch(accBch); settleSession.setBch(accBch);
} }
Bch bch =settleSession.getBch(); Bch bch = settleSession.getBch();
String inifrm=settleSession.getTransName(); String inifrm = settleSession.getTransName();
String branch=""; String branch = "";
if(bch!=null){ if (bch != null) {
branch=bch.getBranch(); branch = bch.getBranch();
} }
Atpbch atpbch=atpbchMapper.selectByBranchAndInifrm(branch,inifrm); Atpbch atpbch = atpbchMapper.selectByBranchAndInifrm(branch, inifrm);
if(atpbch!=null && Objects.equals(atpbch.getNegflg(),"X")){ if (atpbch != null && Objects.equals(atpbch.getNegflg(), "X")) {
settleSession.setSdhTransaction(true); settleSession.setSdhTransaction(true);
}else { } else {
settleSession.setSdhTransaction(false); settleSession.setSdhTransaction(false);
} }
//设置经办机构 //设置经办机构
setHandleBch(settleSession); setHandleBch(settleSession);
} }
/** /**
* 加载归属机构 经办机构 登录机构 * 加载归属机构 经办机构 登录机构
*/ */
...@@ -602,6 +600,7 @@ public class SettleContext { ...@@ -602,6 +600,7 @@ public class SettleContext {
/** /**
* 找到交易的wrkbch相关的Ptspta * 找到交易的wrkbch相关的Ptspta
* 代码出处 Mtabut.getWrkBranch * 代码出处 Mtabut.getWrkBranch
*
* @param bizInfoVo * @param bizInfoVo
* @param ptsList * @param ptsList
* @return * @return
...@@ -618,6 +617,7 @@ public class SettleContext { ...@@ -618,6 +617,7 @@ public class SettleContext {
switch (objtyp.substring(0, 2)) { switch (objtyp.substring(0, 2)) {
case "LI": case "LI":
case "BR": case "BR":
case "FX":
role = "APL"; role = "APL";
break; break;
case "LE": case "LE":
...@@ -635,14 +635,14 @@ public class SettleContext { ...@@ -635,14 +635,14 @@ public class SettleContext {
case "GI": case "GI":
String hndtypG = Utils.getFieldValue(bizInfoVo, "hndtyp"); String hndtypG = Utils.getFieldValue(bizInfoVo, "hndtyp");
String segtypG = Utils.getFieldValue(bizInfoVo, "segtyp"); String segtypG = Utils.getFieldValue(bizInfoVo, "segtyp");
if("OT".equals(hndtypG) && "02".equals(segtypG)){ if ("OT".equals(hndtypG) && "02".equals(segtypG)) {
//海关保函转开模式的wrkbch应该取当前记账机构 //海关保函转开模式的wrkbch应该取当前记账机构
return null; return null;
} }
if (StringUtils.isNotEmpty(hndtypG) && ("OT".equals(hndtypG) || hndtypG.startsWith("F"))) { if (StringUtils.isNotEmpty(hndtypG) && ("OT".equals(hndtypG) || hndtypG.startsWith("F"))) {
role = "BEN"; role = "BEN";
} else { } else {
if (ptsptaToolComponent.ptsIsRolSet(ptsList,"CTR")){ if (ptsptaToolComponent.ptsIsRolSet(ptsList, "CTR")) {
role = "CTR"; role = "CTR";
} else { } else {
role = "APL"; role = "APL";
...@@ -654,7 +654,7 @@ public class SettleContext { ...@@ -654,7 +654,7 @@ public class SettleContext {
case "NC": case "NC":
String hndtyp = Utils.getFieldValue(bizInfoVo, "hndtyp"); String hndtyp = Utils.getFieldValue(bizInfoVo, "hndtyp");
String segtyp = Utils.getFieldValue(bizInfoVo, "segtyp"); String segtyp = Utils.getFieldValue(bizInfoVo, "segtyp");
if("OT".equals(hndtyp) && "02".equals(segtyp)){ if ("OT".equals(hndtyp) && "02".equals(segtyp)) {
//海关保函转开模式的wrkbch应该取当前记账机构 //海关保函转开模式的wrkbch应该取当前记账机构
return null; return null;
} }
...@@ -675,10 +675,10 @@ public class SettleContext { ...@@ -675,10 +675,10 @@ public class SettleContext {
break; break;
case "CP": case "CP":
String paytyp = Utils.getFieldValue(bizInfoVo, "paytyp"); String paytyp = Utils.getFieldValue(bizInfoVo, "paytyp");
if( MdaUtils.compareTo(paytyp,"O") == 0 ) { if (MdaUtils.compareTo(paytyp, "O") == 0) {
role = "ORC"; role = "ORC";
} }
if( MdaUtils.compareTo(paytyp,"I") == 0 ) { if (MdaUtils.compareTo(paytyp, "I") == 0) {
role = "PYE"; role = "PYE";
} }
break; break;
...@@ -714,7 +714,7 @@ public class SettleContext { ...@@ -714,7 +714,7 @@ public class SettleContext {
* 适用于:自贸区业务上收到总行的逻辑 * 适用于:自贸区业务上收到总行的逻辑
* 记账机构从数据库中获取 * 记账机构从数据库中获取
*/ */
private void setAccBch4Zmq(SettleSession settleSession, BizInfoVo bizInfo, List<PtsptaVo> ptsList){ private void setAccBch4Zmq(SettleSession settleSession, BizInfoVo bizInfo, List<PtsptaVo> ptsList) {
Bch orgbch = settleSession.getOrgBch(); Bch orgbch = settleSession.getOrgBch();
if (orgbch != null && "0".equalsIgnoreCase(orgbch.getLev())) { if (orgbch != null && "0".equalsIgnoreCase(orgbch.getLev())) {
String objinr = ""; String objinr = "";
...@@ -750,7 +750,7 @@ public class SettleContext { ...@@ -750,7 +750,7 @@ public class SettleContext {
return new Locale("en", "US"); return new Locale("en", "US");
} else { } else {
// 国际信用证部分 // 国际信用证部分
if(!MdaUtils.isEmpty(atp.getBus()) && US_LOCALE_LIST.contains(atp.getBus())){ if (!MdaUtils.isEmpty(atp.getBus()) && US_LOCALE_LIST.contains(atp.getBus())) {
return Locale.US; return Locale.US;
} }
return Locale.SIMPLIFIED_CHINESE; return Locale.SIMPLIFIED_CHINESE;
...@@ -772,10 +772,10 @@ public class SettleContext { ...@@ -772,10 +772,10 @@ public class SettleContext {
Method method = clazz.getDeclaredMethod(methodName, bo.getClass()); Method method = clazz.getDeclaredMethod(methodName, bo.getClass());
if (method != null) { if (method != null) {
method.setAccessible(true); method.setAccessible(true);
return (BizInfoVo)method.invoke(transactionService, bo); return (BizInfoVo) method.invoke(transactionService, bo);
} }
return null; return null;
}catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
throw new CommonServiceException(e.getMessage()); throw new CommonServiceException(e.getMessage());
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
throw new CommonServiceException(e.getMessage()); throw new CommonServiceException(e.getMessage());
...@@ -786,6 +786,7 @@ public class SettleContext { ...@@ -786,6 +786,7 @@ public class SettleContext {
/** /**
* 获取收单行交易的非收单交易码 * 获取收单行交易的非收单交易码
*
* @param settleSession * @param settleSession
* @return * @return
*/ */
...@@ -801,6 +802,7 @@ public class SettleContext { ...@@ -801,6 +802,7 @@ public class SettleContext {
/** /**
* 设置经办机构 * 设置经办机构
*
* @param settleSession * @param settleSession
*/ */
public void setHandleBch(SettleSession settleSession) { public void setHandleBch(SettleSession settleSession) {
......
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