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 @@
c.INR inr,
c.EXTKEY extkey,
c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam,
c.RELCUR relcur,
c.RELAMT relamt,
......@@ -101,6 +102,7 @@
c.INR inr,
c.EXTKEY extkey,
c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam,
c.RELCUR relcur,
c.RELAMT relamt,
......@@ -159,6 +161,7 @@
c.INR inr,
c.EXTKEY extkey,
c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam,
c.RELCUR relcur,
c.RELAMT relamt,
......@@ -226,6 +229,7 @@
c.INR inr,
c.EXTKEY extkey,
c.ETY ety,
c.ETYEXTKEY etyextkey,
c.NAM nam,
c.RELCUR relcur,
c.RELAMT relamt,
......
......@@ -8,6 +8,35 @@ import java.util.Map;
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 insertSelective(Bch record);
......
......@@ -15,6 +15,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -25,21 +26,17 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
//@ConditionalOnMissingBean(BchService.class)
public class BchServiceImpl implements BchService {
private final Logger logger = LoggerFactory.getLogger(BchServiceImpl.class);
private static final String TYPE = "BCH";
private static final long EXPIRETIMES = 10l;
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
private BchMapper bchMapper;
......@@ -86,29 +83,7 @@ public class BchServiceImpl implements BchService {
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
public int insert(Bch record) {
......@@ -457,7 +432,7 @@ public class BchServiceImpl implements BchService {
if (bchList == 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
......@@ -538,7 +513,7 @@ public class BchServiceImpl implements BchService {
result.add(bch);
break;
case JURISDICTION_ONE_LEVEL:
case JURISDICTION_TWO_LEVELS:
case JURISDICTION_TWO_LEVEL:
Bch accBch = getDirectAccBch(branch);
result = listAllChildSubBchByAccBch(accBch.getBranch());
break;
......@@ -563,7 +538,7 @@ public class BchServiceImpl implements BchService {
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);
if (bchList != null && bchList.size() > 0) {
......@@ -757,9 +732,7 @@ public class BchServiceImpl implements BchService {
}
}
public String generatekey(String inr) {
return TYPE + "_" + inr;
}
@Override
public List<Bch> getBchcodelist(BchVo bch) {
......@@ -768,10 +741,10 @@ public class BchServiceImpl implements BchService {
Bch orgBch = getByBranch(bch.getBranch());
// 获取用户当前机构之后,获取当前机构下辖经办机构列表
// 支行调用listAllChildAndItselfBch
if (ZHIHANGLEV.equalsIgnoreCase(orgBch.getLev())) {
if (SUB_BRANCH_LEVEL.equalsIgnoreCase(orgBch.getLev())) {
// 支行返回自己
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());
} else {
......
......@@ -125,6 +125,7 @@ public class CbsRange {
String sql = "";
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 = Utils.sdbEtyGenSql("XRT",sql);
List<Xrt> xrtList = xrtMapper.getXrtByConditionSql(sql);
if (xrtList != null && xrtList.size() > 0) {
BeanUtils.copyProperties(xrtList.get(0), xrt); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......
......@@ -33,13 +33,13 @@ import java.util.Objects;
@Component
public class SettleContext {
private final String ETY_EXTKEY = "CEB";
private final String ETG_EXTKEY = "CEBGRP";
// private final String ETY_EXTKEY = "CEB";
// private final String ETG_EXTKEY = "CEBGRP";
private final static List<String> US_LOCALE_LIST = Arrays.asList("LE", "LI", "BE", "BR");
private Ety ety;
private Etg etg;
// private Ety ety;
// private Etg etg;
@Autowired
private EtyMapper etyMapper;
......@@ -73,11 +73,11 @@ public class SettleContext {
@Autowired
private AtpBchCacheService atpBchCacheService;
@PostConstruct
public void loadEtyAndEtg() {
ety = etyMapper.getEtyByExtkey(ETY_EXTKEY);
etg = etgMapper.getEtgByExtkey(ETG_EXTKEY);
}
// @PostConstruct
// public void loadEtyAndEtg() {
// ety = etyMapper.getEtyByExtkey(ETY_EXTKEY);
// etg = etgMapper.getEtgByExtkey(ETG_EXTKEY);
// }
private static ThreadLocal<SettleSession> userSessionThreadLocal = new ThreadLocal<>();
......@@ -243,7 +243,7 @@ public class SettleContext {
if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
}
userVo.setEty(ETY_EXTKEY);
// userVo.setEty(userVo.getEtyextkey());
// 填充用户信息
settleSession.setUserVo(userVo);
......@@ -269,6 +269,9 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety);
settleSession.setEtg(etg);
......@@ -387,7 +390,7 @@ public class SettleContext {
if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
}
userVo.setEty(ETY_EXTKEY);
// userVo.setEty(ETY_EXTKEY);
// 填充用户信息
settleSession.setUserVo(userVo);
......@@ -413,6 +416,8 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety);
settleSession.setEtg(etg);
......@@ -463,7 +468,7 @@ public class SettleContext {
if (userVo == null) {
throw new CommonServiceException("找不到 " + sessionUserVo.getLogName() + " 用户信息!");
}
userVo.setEty(ETY_EXTKEY);
// userVo.setEty(ETY_EXTKEY);
// 填充用户信息
settleSession.setUserVo(userVo);
......@@ -489,6 +494,8 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety);
settleSession.setEtg(etg);
......
......@@ -55,6 +55,7 @@ public class Utils {
tbletyetgMap.put("PTM", "Y");
tbletyetgMap.put("USG", "Y");
tbletyetgMap.put("ACK", "G");
tbletyetgMap.put("XRT", "G");
}
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