Commit 82b2ba0a by zhoujunpeng

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

parents f1fde268 005d1e10
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
c.INR inr, c.INR inr,
c.EXTKEY extkey, c.EXTKEY extkey,
c.ETY ety, c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam, c.NAM nam,
c.RELCUR relcur, c.RELCUR relcur,
c.RELAMT relamt, c.RELAMT relamt,
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
c.INR inr, c.INR inr,
c.EXTKEY extkey, c.EXTKEY extkey,
c.ETY ety, c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam, c.NAM nam,
c.RELCUR relcur, c.RELCUR relcur,
c.RELAMT relamt, c.RELAMT relamt,
...@@ -159,6 +161,7 @@ ...@@ -159,6 +161,7 @@
c.INR inr, c.INR inr,
c.EXTKEY extkey, c.EXTKEY extkey,
c.ETY ety, c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam, c.NAM nam,
c.RELCUR relcur, c.RELCUR relcur,
c.RELAMT relamt, c.RELAMT relamt,
...@@ -226,6 +229,7 @@ ...@@ -226,6 +229,7 @@
c.INR inr, c.INR inr,
c.EXTKEY extkey, c.EXTKEY extkey,
c.ETY ety, c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam, c.NAM nam,
c.RELCUR relcur, c.RELCUR relcur,
c.RELAMT relamt, c.RELAMT relamt,
......
...@@ -8,6 +8,35 @@ import java.util.Map; ...@@ -8,6 +8,35 @@ import java.util.Map;
public interface BchService { public interface BchService {
// 总行
String HEAD_BRANCH_LEVEL = "0";
// 一级全辖
String JURISDICTION_ONE_LEVEL = "A";
// 二级全辖
String JURISDICTION_TWO_LEVEL = "B";
// 分行
String BRANCH_LEVEL = "1";
// 支行
String SUB_BRANCH_LEVEL = "2";
// 经办行
String HANDLING_BRANCH = "1";
// 收单行
String ACQUIRING_BRANCH = "6";
// 自贸区标识
String FTA_TYPE = "X";
String TYPE = "BCH";
default String generatekey(String inr) {
return TYPE + "_" + inr;
}
int insert(Bch record); int insert(Bch record);
int insertSelective(Bch record); int insertSelective(Bch record);
......
...@@ -15,6 +15,7 @@ import org.slf4j.Logger; ...@@ -15,6 +15,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -25,21 +26,17 @@ import java.util.concurrent.TimeUnit; ...@@ -25,21 +26,17 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
//@ConditionalOnMissingBean(BchService.class)
public class BchServiceImpl implements BchService { public class BchServiceImpl implements BchService {
private final Logger logger = LoggerFactory.getLogger(BchServiceImpl.class); private final Logger logger = LoggerFactory.getLogger(BchServiceImpl.class);
private static final String TYPE = "BCH";
private static final long EXPIRETIMES = 10l; private static final long EXPIRETIMES = 10l;
private static final TimeUnit EXPIRETYPE = TimeUnit.MINUTES; private static final TimeUnit EXPIRETYPE = TimeUnit.MINUTES;
public static final String ZONGHANGLEV = "0";
public static final String ZHIHANGLEV = "2";
public static final String QUANXIALEV1 = "A";
public static final String QUANXIALEV2 = "B";
@Resource @Resource
private BchMapper bchMapper; private BchMapper bchMapper;
...@@ -86,29 +83,7 @@ public class BchServiceImpl implements BchService { ...@@ -86,29 +83,7 @@ public class BchServiceImpl implements BchService {
bchInrCacheThreadLocal.remove(); bchInrCacheThreadLocal.remove();
} }
// 总行
private static final String HEAD_BRANCH_LEVEL = "0";
// 一级全辖
private static final String JURISDICTION_ONE_LEVEL = "A";
// 二级全辖
private static final String JURISDICTION_TWO_LEVELS = "B";
// 分行
private static final String BRANCH_LEVEL = "1";
// 支行
private static final String SUB_BRANCH_LEVEL = "2";
// 经办行
private static final String HANDLING_BRANCH = "1";
// 收单行
private static final String ACQUIRING_BRANCH = "6";
// 自贸区标识
private static final String FTA_TYPE = "X";
@Override @Override
public int insert(Bch record) { public int insert(Bch record) {
...@@ -457,7 +432,7 @@ public class BchServiceImpl implements BchService { ...@@ -457,7 +432,7 @@ public class BchServiceImpl implements BchService {
if (bchList == null) { if (bchList == null) {
return null; return null;
} }
return bchList.stream().filter(item -> (JURISDICTION_ONE_LEVEL.equalsIgnoreCase(item.getLev()) || JURISDICTION_TWO_LEVELS.equalsIgnoreCase(item.getLev()))).collect(Collectors.toList()); return bchList.stream().filter(item -> (JURISDICTION_ONE_LEVEL.equalsIgnoreCase(item.getLev()) || JURISDICTION_TWO_LEVEL.equalsIgnoreCase(item.getLev()))).collect(Collectors.toList());
} }
@Override @Override
...@@ -538,7 +513,7 @@ public class BchServiceImpl implements BchService { ...@@ -538,7 +513,7 @@ public class BchServiceImpl implements BchService {
result.add(bch); result.add(bch);
break; break;
case JURISDICTION_ONE_LEVEL: case JURISDICTION_ONE_LEVEL:
case JURISDICTION_TWO_LEVELS: case JURISDICTION_TWO_LEVEL:
Bch accBch = getDirectAccBch(branch); Bch accBch = getDirectAccBch(branch);
result = listAllChildSubBchByAccBch(accBch.getBranch()); result = listAllChildSubBchByAccBch(accBch.getBranch());
break; break;
...@@ -563,7 +538,7 @@ public class BchServiceImpl implements BchService { ...@@ -563,7 +538,7 @@ public class BchServiceImpl implements BchService {
return null; return null;
} }
// 全辖 // 全辖
if (JURISDICTION_ONE_LEVEL.equalsIgnoreCase(bch.getLev()) || JURISDICTION_TWO_LEVELS.equalsIgnoreCase(bch.getLev())) { if (JURISDICTION_ONE_LEVEL.equalsIgnoreCase(bch.getLev()) || JURISDICTION_TWO_LEVEL.equalsIgnoreCase(bch.getLev())) {
// 获取全辖下的记账机构列表 // 获取全辖下的记账机构列表
List<Bch> bchList = bchMapper.selectAccBchListByBranch(branch); List<Bch> bchList = bchMapper.selectAccBchListByBranch(branch);
if (bchList != null && bchList.size() > 0) { if (bchList != null && bchList.size() > 0) {
...@@ -757,9 +732,7 @@ public class BchServiceImpl implements BchService { ...@@ -757,9 +732,7 @@ public class BchServiceImpl implements BchService {
} }
} }
public String generatekey(String inr) {
return TYPE + "_" + inr;
}
@Override @Override
public List<Bch> getBchcodelist(BchVo bch) { public List<Bch> getBchcodelist(BchVo bch) {
...@@ -768,10 +741,10 @@ public class BchServiceImpl implements BchService { ...@@ -768,10 +741,10 @@ public class BchServiceImpl implements BchService {
Bch orgBch = getByBranch(bch.getBranch()); Bch orgBch = getByBranch(bch.getBranch());
// 获取用户当前机构之后,获取当前机构下辖经办机构列表 // 获取用户当前机构之后,获取当前机构下辖经办机构列表
// 支行调用listAllChildAndItselfBch // 支行调用listAllChildAndItselfBch
if (ZHIHANGLEV.equalsIgnoreCase(orgBch.getLev())) { if (SUB_BRANCH_LEVEL.equalsIgnoreCase(orgBch.getLev())) {
// 支行返回自己 // 支行返回自己
bchList = listAllChildAndItselfBch(orgBch.getBranch()); bchList = listAllChildAndItselfBch(orgBch.getBranch());
} else if (ZONGHANGLEV.equalsIgnoreCase(orgBch.getLev()) || QUANXIALEV1.equalsIgnoreCase(orgBch.getLev()) || QUANXIALEV2.equalsIgnoreCase(orgBch.getLev())) { } else if (HEAD_BRANCH_LEVEL.equalsIgnoreCase(orgBch.getLev()) || JURISDICTION_ONE_LEVEL.equalsIgnoreCase(orgBch.getLev()) || JURISDICTION_TWO_LEVEL.equalsIgnoreCase(orgBch.getLev())) {
// 总行,全辖返回下级分支行 // 总行,全辖返回下级分支行
bchList = listAllChildExcludeJurisdictionBch(orgBch.getBranch()); bchList = listAllChildExcludeJurisdictionBch(orgBch.getBranch());
} else { } else {
......
...@@ -125,6 +125,7 @@ public class CbsRange { ...@@ -125,6 +125,7 @@ public class CbsRange {
String sql = ""; String sql = "";
sql += " WHERE CUR = '" + cur + "'"; sql += " WHERE CUR = '" + cur + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " "; sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
// sql = Utils.sdbEtyGenSql("XRT",sql);
List<Xrt> xrtList = xrtMapper.getXrtByConditionSql(sql); List<Xrt> xrtList = xrtMapper.getXrtByConditionSql(sql);
if (xrtList != null && xrtList.size() > 0) { if (xrtList != null && xrtList.size() > 0) {
BeanUtils.copyProperties(xrtList.get(0), xrt); //需要深拷贝,不然调用得到的对象指向的还是原来的地址 BeanUtils.copyProperties(xrtList.get(0), xrt); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......
...@@ -33,13 +33,13 @@ import java.util.Objects; ...@@ -33,13 +33,13 @@ import java.util.Objects;
@Component @Component
public class SettleContext { 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;
@Autowired @Autowired
private EtyMapper etyMapper; private EtyMapper etyMapper;
...@@ -73,11 +73,11 @@ public class SettleContext { ...@@ -73,11 +73,11 @@ public class SettleContext {
@Autowired @Autowired
private AtpBchCacheService atpBchCacheService; private AtpBchCacheService atpBchCacheService;
@PostConstruct // @PostConstruct
public void loadEtyAndEtg() { // public void loadEtyAndEtg() {
ety = etyMapper.getEtyByExtkey(ETY_EXTKEY); // ety = etyMapper.getEtyByExtkey(ETY_EXTKEY);
etg = etgMapper.getEtgByExtkey(ETG_EXTKEY); // etg = etgMapper.getEtgByExtkey(ETG_EXTKEY);
} // }
private static ThreadLocal<SettleSession> userSessionThreadLocal = new ThreadLocal<>(); private static ThreadLocal<SettleSession> userSessionThreadLocal = new ThreadLocal<>();
...@@ -243,7 +243,7 @@ public class SettleContext { ...@@ -243,7 +243,7 @@ public class SettleContext {
if (userVo == null) { if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!"); throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
} }
userVo.setEty(ETY_EXTKEY); // userVo.setEty(userVo.getEtyextkey());
// 填充用户信息 // 填充用户信息
settleSession.setUserVo(userVo); settleSession.setUserVo(userVo);
...@@ -269,6 +269,9 @@ public class SettleContext { ...@@ -269,6 +269,9 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName()); Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp); settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety); settleSession.setEty(ety);
settleSession.setEtg(etg); settleSession.setEtg(etg);
...@@ -387,7 +390,7 @@ public class SettleContext { ...@@ -387,7 +390,7 @@ public class SettleContext {
if (userVo == null) { if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!"); throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
} }
userVo.setEty(ETY_EXTKEY); // userVo.setEty(ETY_EXTKEY);
// 填充用户信息 // 填充用户信息
settleSession.setUserVo(userVo); settleSession.setUserVo(userVo);
...@@ -413,6 +416,8 @@ public class SettleContext { ...@@ -413,6 +416,8 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName()); Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp); settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety); settleSession.setEty(ety);
settleSession.setEtg(etg); settleSession.setEtg(etg);
...@@ -463,7 +468,7 @@ public class SettleContext { ...@@ -463,7 +468,7 @@ public class SettleContext {
if (userVo == null) { if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!"); throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
} }
userVo.setEty(ETY_EXTKEY); // userVo.setEty(ETY_EXTKEY);
// 填充用户信息 // 填充用户信息
settleSession.setUserVo(userVo); settleSession.setUserVo(userVo);
...@@ -489,6 +494,8 @@ public class SettleContext { ...@@ -489,6 +494,8 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName()); Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp); settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety); settleSession.setEty(ety);
settleSession.setEtg(etg); settleSession.setEtg(etg);
......
...@@ -55,6 +55,7 @@ public class Utils { ...@@ -55,6 +55,7 @@ public class Utils {
tbletyetgMap.put("PTM", "Y"); tbletyetgMap.put("PTM", "Y");
tbletyetgMap.put("USG", "Y"); tbletyetgMap.put("USG", "Y");
tbletyetgMap.put("ACK", "G"); tbletyetgMap.put("ACK", "G");
tbletyetgMap.put("XRT", "G");
} }
public static String recGetObj(Object obj) { public static String recGetObj(Object obj) {
......
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