Index: core-module/pom.xml
===================================================================
diff -u -rd90aca52dd4986317dab1ce299d9e2f9825d90b4 -r4dab208ec27495ad766bc5db9fc1e13faea62261
--- core-module/pom.xml (.../pom.xml) (revision d90aca52dd4986317dab1ce299d9e2f9825d90b4)
+++ core-module/pom.xml (.../pom.xml) (revision 4dab208ec27495ad766bc5db9fc1e13faea62261)
@@ -7,7 +7,7 @@
313devgrp
java-service-tree-framework-core-library
- 23.01.10
+ 23.01.11
../pom.xml
@@ -31,7 +31,7 @@
313devgrp
lib-module
- 23.01.10
+ 23.01.11
pom
Index: core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/interceptor/RouteTableInterceptor.java
===================================================================
diff -u -r0aef861c5af52347379be8661a725f0df722679e -r4dab208ec27495ad766bc5db9fc1e13faea62261
--- core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/interceptor/RouteTableInterceptor.java (.../RouteTableInterceptor.java) (revision 0aef861c5af52347379be8661a725f0df722679e)
+++ core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/interceptor/RouteTableInterceptor.java (.../RouteTableInterceptor.java) (revision 4dab208ec27495ad766bc5db9fc1e13faea62261)
@@ -74,4 +74,37 @@
}
return prepedStatement;
}
+
+ public static String setArmsReplaceTableName(HttpServletRequest request, String tableName) throws Exception {
+ if(StringUtils.equals(tableName, "T_ARMS_REQADD")){
+ String servletPath = request.getServletPath();
+ if(StringUtils.contains(servletPath,"T_ARMS_REQADD_")){
+ if(StringUtils.contains(servletPath,"getMonitor.do")){
+ tableName = (String) SessionUtil.getAttribute("getMonitor");
+ }
+ if(StringUtils.contains(servletPath,"getNode.do")){
+ tableName = (String) SessionUtil.getAttribute("getNode");
+ }
+ if(StringUtils.contains(servletPath,"getChildNode.do")){
+ tableName = (String) SessionUtil.getAttribute("getChildNode");
+ }
+ if(StringUtils.contains(servletPath,"getChildNodeWithParent.do")){
+ tableName = (String) SessionUtil.getAttribute("getChildNodeWithParent");
+ }
+ if(StringUtils.contains(servletPath,"addNode.do")){
+ tableName = (String) SessionUtil.getAttribute("addNode");
+ }
+ if(StringUtils.contains(servletPath,"updateNode.do")){
+ tableName = (String) SessionUtil.getAttribute("updateNode");
+ }
+ if(StringUtils.contains(servletPath,"moveNode.do")){
+ tableName = (String) SessionUtil.getAttribute("moveNode");
+ }
+ if(StringUtils.contains(servletPath,"getHistory.do")){
+ tableName = (String) SessionUtil.getAttribute("getHistory");
+ }
+ }
+ }
+ return tableName;
+ }
}
\ No newline at end of file
Index: core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/service/JsTreeHibernateServiceImpl.java
===================================================================
diff -u -rd90aca52dd4986317dab1ce299d9e2f9825d90b4 -r4dab208ec27495ad766bc5db9fc1e13faea62261
--- core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/service/JsTreeHibernateServiceImpl.java (.../JsTreeHibernateServiceImpl.java) (revision d90aca52dd4986317dab1ce299d9e2f9825d90b4)
+++ core-module/src/main/java/egovframework/com/ext/jstree/springHibernate/core/service/JsTreeHibernateServiceImpl.java (.../JsTreeHibernateServiceImpl.java) (revision 4dab208ec27495ad766bc5db9fc1e13faea62261)
@@ -1,7 +1,11 @@
package egovframework.com.ext.jstree.springHibernate.core.service;
+import egovframework.com.cmm.util.string.StringUtil;
import egovframework.com.ext.jstree.springHibernate.core.dao.JsTreeHibernateDao;
+import egovframework.com.ext.jstree.springHibernate.core.interceptor.RouteTableInterceptor;
+import egovframework.com.ext.jstree.springHibernate.core.interceptor.SessionUtil;
import egovframework.com.ext.jstree.springHibernate.core.vo.JsTreeHibernateSearchDTO;
+import egovframework.com.ext.jstree.support.util.StringUtils;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import org.apache.commons.collections15.CollectionUtils;
import org.apache.commons.collections15.Transformer;
@@ -20,6 +24,7 @@
import org.unitils.util.ReflectionUtils;
import javax.annotation.Resource;
+import javax.persistence.Table;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.lang.reflect.Field;
@@ -412,8 +417,14 @@
}
logger.debug("-----------------------calculatePostion 완료-----------------------");
- this.calculatePostion(jsTreeHibernateDTO, nodeById, childNodesFromNodeByRef, request);
+ //bug fix: 세션 값이 유지되므로, 구분자를 줘야 하는 문제를 테이블 명으로 잡았음.
+ Table table = jsTreeHibernateDTO.getClass().getAnnotation(Table.class);
+ String tableName = table.name();
+
+ tableName = RouteTableInterceptor.setArmsReplaceTableName(request, tableName);
+ this.calculatePostion(jsTreeHibernateDTO, nodeById, childNodesFromNodeByRef, request, tableName);
+
if (rightPointFromNodeByRef < 1) {
rightPointFromNodeByRef = 1;
}
@@ -656,7 +667,7 @@
}
public void calculatePostion(T jsTreeHibernateDTO, T nodeById,
- List childNodesFromNodeByRef, HttpServletRequest request) throws Exception {
+ List childNodesFromNodeByRef, HttpServletRequest request, String tableName) throws Exception {
HttpSession session = request.getSession();
final boolean isMoveNodeInMyParent = (jsTreeHibernateDTO.getRef() == nodeById.getC_parentid());
@@ -695,15 +706,15 @@
if (logger.isDebugEnabled()) {
logger.debug("노드의 최종 위치값=" + jsTreeHibernateDTO.getC_position());
}
- session.setAttribute("settedPosition", jsTreeHibernateDTO.getC_position());
+ session.setAttribute(tableName + "_settedPosition", jsTreeHibernateDTO.getC_position());
} else {
if (logger.isDebugEnabled()) {
logger.debug(">>>>>>>>>>>>>>>멀티 카운터가 0 이 아닐때");
logger.debug("노드값=" + nodeById.getC_title());
logger.debug("노드의 초기 위치값=" + nodeById.getC_position());
logger.debug("노드의 요청받은 위치값=" + jsTreeHibernateDTO.getC_position());
logger.debug("노드의 요청받은 멀티카운터=" + jsTreeHibernateDTO.getMultiCounter());
- logger.debug("0번 노드의 위치값=" + session.getAttribute("settedPosition"));
+ logger.debug("0번 노드의 위치값=" + session.getAttribute(tableName + "_settedPosition"));
}
long increasePosition = 0;
@@ -716,20 +727,20 @@
logger.debug(">>>>>>>>>>>>>>>멀티 노드의 위치가 0번 노드보다 뒤일때");
}
- increasePosition = (Integer) session.getAttribute("settedPosition") + 1;
+ increasePosition = (Integer) session.getAttribute(tableName + "_settedPosition") + 1;
} else {
if (logger.isDebugEnabled()) {
logger.debug(">>>>>>>>>>>>>>>멀티 노드의 위치가 0번 노드보다 앞일때");
}
if (jsTreeHibernateDTO.isCopied()) {
- increasePosition = (Integer) session.getAttribute("settedPosition") + 1;
+ increasePosition = (Integer) session.getAttribute(tableName + "_settedPosition") + 1;
} else {
- increasePosition = (Integer) session.getAttribute("settedPosition");
+ increasePosition = (Integer) session.getAttribute(tableName + "_settedPosition");
}
}
- session.setAttribute("settedPosition", increasePosition);
+ session.setAttribute(tableName + "_settedPosition", increasePosition);
jsTreeHibernateDTO.setC_position(increasePosition);
@@ -740,7 +751,7 @@
logger.debug(">>>>>>>>>>>>>>>원래 노드 위치값과 최종 계산된 노드의 위치값이 동일한 경우");
}
- session.setAttribute("settedPosition", increasePosition - 1);
+ session.setAttribute(tableName + "_settedPosition", increasePosition - 1);
}
if (logger.isDebugEnabled()) {
@@ -762,7 +773,7 @@
logger.debug("노드의 최종 위치값=" + jsTreeHibernateDTO.getC_position());
}
- session.setAttribute("settedPosition", jsTreeHibernateDTO.getC_position());
+ session.setAttribute(tableName + "_settedPosition", jsTreeHibernateDTO.getC_position());
} else {
if (logger.isDebugEnabled()) {
logger.debug(">>>>>>>>>>>>>>>멀티 카운터가 0 이 아닐때");
@@ -773,9 +784,9 @@
}
long increasePosition = 0;
- increasePosition = NumberUtils.toLong(session.getAttribute("settedPosition").toString()) + 1;
+ increasePosition = NumberUtils.toLong(session.getAttribute(tableName + "_settedPosition").toString()) + 1;
jsTreeHibernateDTO.setC_position(increasePosition);
- session.setAttribute("settedPosition", increasePosition);
+ session.setAttribute(tableName + "_settedPosition", increasePosition);
if (logger.isDebugEnabled()) {
logger.debug("노드의 최종 위치값=" + jsTreeHibernateDTO.getC_position());
@@ -785,6 +796,7 @@
}
@SuppressWarnings("unchecked")
+ @Transactional(rollbackFor = { Exception.class }, isolation = Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED)
public void cutMyself(T nodeById, long spaceOfTargetNode,
Collection c_idsByChildNodeFromNodeById) throws Exception {
Index: lib-module/pom.xml
===================================================================
diff -u -rd90aca52dd4986317dab1ce299d9e2f9825d90b4 -r4dab208ec27495ad766bc5db9fc1e13faea62261
--- lib-module/pom.xml (.../pom.xml) (revision d90aca52dd4986317dab1ce299d9e2f9825d90b4)
+++ lib-module/pom.xml (.../pom.xml) (revision 4dab208ec27495ad766bc5db9fc1e13faea62261)
@@ -5,7 +5,7 @@
313devgrp
java-service-tree-framework-core-library
- 23.01.10
+ 23.01.11
../pom.xml
Index: pom.xml
===================================================================
diff -u -rd90aca52dd4986317dab1ce299d9e2f9825d90b4 -r4dab208ec27495ad766bc5db9fc1e13faea62261
--- pom.xml (.../pom.xml) (revision d90aca52dd4986317dab1ce299d9e2f9825d90b4)
+++ pom.xml (.../pom.xml) (revision 4dab208ec27495ad766bc5db9fc1e13faea62261)
@@ -10,7 +10,7 @@
4.0.0
313devgrp
java-service-tree-framework-core-library
- 23.01.10
+ 23.01.11
pom
java-service-tree-framework-core-library