Commit 7c35976f by hulei

SettleContext调整为多实体模式

parent c8c2c2e2
...@@ -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.getEty());
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.getEty());
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.getEty());
Etg etg = etgMapper.getEtgByExtkey(ety.getEtg());
settleSession.setEty(ety); settleSession.setEty(ety);
settleSession.setEtg(etg); settleSession.setEtg(etg);
......
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