Commit b3e5e14d by hulei

XRT增加多实体过滤

parent 7c35976f
......@@ -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); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......
......@@ -269,7 +269,7 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEty());
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety);
......@@ -416,7 +416,7 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEty());
Ety ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety);
settleSession.setEtg(etg);
......@@ -494,7 +494,7 @@ public class SettleContext {
Atp atp = atpMapper.getAtpByCod(settleSession.getTransName());
settleSession.setAtp(atp);
Ety ety = etyMapper.getEtyByExtkey(usr.getEty());
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