Index: pom.xml
===================================================================
diff -u -r8b191f4ce87e9bde997c6caf2232d468eb1061d3 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- pom.xml (.../pom.xml) (revision 8b191f4ce87e9bde997c6caf2232d468eb1061d3)
+++ pom.xml (.../pom.xml) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -10,7 +10,7 @@
4.0.0
313devgrp
java-service-tree-framework-backend-server
- 22.11.22
+ 22.11.23
pom
java-service-tree-framework
Index: web-module/pom.xml
===================================================================
diff -u -ref381a7d8a044cd402172087c5bf151ec77625cf -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/pom.xml (.../pom.xml) (revision ef381a7d8a044cd402172087c5bf151ec77625cf)
+++ web-module/pom.xml (.../pom.xml) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -7,7 +7,7 @@
313devgrp
java-service-tree-framework-backend-server
- 22.11.22
+ 22.11.23
../pom.xml
@@ -17,7 +17,7 @@
Web Project by 313 DEV GRP
- 23.01.05
+ 23.01.07
Index: web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/controller/UserFileRepositoryLogController.java
===================================================================
diff -u -r9328381608b679a7f66c02117a302fc4fa22d1a5 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/controller/UserFileRepositoryLogController.java (.../UserFileRepositoryLogController.java) (revision 9328381608b679a7f66c02117a302fc4fa22d1a5)
+++ web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/controller/UserFileRepositoryLogController.java (.../UserFileRepositoryLogController.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -11,13 +11,16 @@
*/
package egovframework.api.arms.module_filerepositorylog.controller;
+import egovframework.api.arms.module_pdserviceconnectlog.model.PdServiceConnectLogDTO;
import lombok.extern.slf4j.Slf4j;
+import org.hibernate.criterion.Order;
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.stereotype.Controller;
import org.springframework.ui.Model;
+import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -50,4 +53,20 @@
private final Logger logger = LoggerFactory.getLogger(this.getClass());
+ @ResponseBody
+ @RequestMapping(
+ value = {"/getMonitor.do"},
+ method = {RequestMethod.GET}
+ )
+ public ModelAndView getMonitor(
+ FileRepositoryLogDTO fileRepositoryLogDTO, ModelMap model, HttpServletRequest request) throws Exception {
+
+ fileRepositoryLogDTO.setOrder(Order.asc("c_left"));
+ fileRepositoryLogDTO.setWhere("c_title", "pdService");
+ fileRepositoryLogDTO.setWhere("C_FILE_ID_LINK", fileRepositoryLogDTO.getFileIdLink());
+ List list = this.fileRepositoryLog.getChildNode(fileRepositoryLogDTO);
+ ModelAndView modelAndView = new ModelAndView("jsonView");
+ modelAndView.addObject("result", list);
+ return modelAndView;
+ }
}
Index: web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/model/FileRepositoryLogDTO.java
===================================================================
diff -u -r3694e9d898855952691463ee8c08b1d9fd776be2 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/model/FileRepositoryLogDTO.java (.../FileRepositoryLogDTO.java) (revision 3694e9d898855952691463ee8c08b1d9fd776be2)
+++ web-module/src/main/java/egovframework/api/arms/module_filerepositorylog/model/FileRepositoryLogDTO.java (.../FileRepositoryLogDTO.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -50,39 +50,6 @@
@Column(name="C_DATE")
private Date c_date;
- @Column(name="C_FILE_ID_LINK")
- private Long fileIdLink;
-
- @Column(name="C_FILE_NAME")
- private String fileName;
-
- @Column(name="C_CONTENT_TYPE")
- private String contentType;
-
- @Column(name="C_SERVER_SUB_PATH")
- private String serverSubPath;
-
- @Column(name="C_PHYSICAL_NAME")
- private String physicalName;
-
- @Column(name="C_SIZE")
- private Long size;
-
- @Column(name="C_NAME")
- private String name;
-
- @Column(name="C_URL")
- private String url;
-
- @Column(name="C_THUMBNAIL_URL")
- private String thumbnailUrl;
-
- @Column(name="C_DELETE_URL")
- private String delete_url;
-
- @Column(name="C_DELETE_TYPE")
- private String delete_type;
-
public String getC_method() {
return c_method;
}
@@ -107,6 +74,20 @@
this.c_date = c_date;
}
+ //필드명과 컬럼명이 다를 경우는 하기와 같이 처리.
+ private Long fileIdLink;
+ private String fileName;
+ private String contentType;
+ private String serverSubPath;
+ private String physicalName;
+ private Long size;
+ private String name;
+ private String url;
+ private String thumbnailUrl;
+ private String delete_url;
+ private String delete_type;
+
+ @Column(name="C_FILE_ID_LINK")
public Long getFileIdLink() {
return fileIdLink;
}
@@ -115,6 +96,8 @@
this.fileIdLink = fileIdLink;
}
+
+ @Column(name="C_FILE_NAME")
public String getFileName() {
return fileName;
}
@@ -123,6 +106,7 @@
this.fileName = fileName;
}
+ @Column(name="C_CONTENT_TYPE")
public String getContentType() {
return contentType;
}
@@ -131,6 +115,7 @@
this.contentType = contentType;
}
+ @Column(name="C_SERVER_SUB_PATH")
public String getServerSubPath() {
return serverSubPath;
}
@@ -139,6 +124,7 @@
this.serverSubPath = serverSubPath;
}
+ @Column(name="C_PHYSICAL_NAME")
public String getPhysicalName() {
return physicalName;
}
@@ -147,6 +133,7 @@
this.physicalName = physicalName;
}
+ @Column(name="C_SIZE")
public Long getSize() {
return size;
}
@@ -155,6 +142,7 @@
this.size = size;
}
+ @Column(name="C_NAME")
public String getName() {
return name;
}
@@ -163,6 +151,7 @@
this.name = name;
}
+ @Column(name="C_URL")
public String getUrl() {
return url;
}
@@ -171,6 +160,7 @@
this.url = url;
}
+ @Column(name="C_THUMBNAIL_URL")
public String getThumbnailUrl() {
return thumbnailUrl;
}
@@ -179,6 +169,7 @@
this.thumbnailUrl = thumbnailUrl;
}
+ @Column(name="C_DELETE_URL")
public String getDelete_url() {
return delete_url;
}
@@ -187,6 +178,7 @@
this.delete_url = delete_url;
}
+ @Column(name="C_DELETE_TYPE")
public String getDelete_type() {
return delete_type;
}
Index: web-module/src/main/java/egovframework/api/arms/module_pdserviceconnectlog/controller/UserPdServiceConnectLogController.java
===================================================================
diff -u -r9328381608b679a7f66c02117a302fc4fa22d1a5 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_pdserviceconnectlog/controller/UserPdServiceConnectLogController.java (.../UserPdServiceConnectLogController.java) (revision 9328381608b679a7f66c02117a302fc4fa22d1a5)
+++ web-module/src/main/java/egovframework/api/arms/module_pdserviceconnectlog/controller/UserPdServiceConnectLogController.java (.../UserPdServiceConnectLogController.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -64,8 +64,8 @@
PdServiceConnectLogDTO pdServiceConnectLogDTO, ModelMap model, HttpServletRequest request) throws Exception {
pdServiceConnectLogDTO.setOrder(Order.asc("c_left"));
+ pdServiceConnectLogDTO.setWhere("c_id", pdServiceConnectLogDTO.getC_id());
List list = this.pdServiceConnectLog.getChildNode(pdServiceConnectLogDTO);
-
ModelAndView modelAndView = new ModelAndView("jsonView");
modelAndView.addObject("result", list);
return modelAndView;
Index: web-module/src/main/java/egovframework/api/arms/module_pdservicelog/controller/UserPdServiceLogController.java
===================================================================
diff -u -r9328381608b679a7f66c02117a302fc4fa22d1a5 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_pdservicelog/controller/UserPdServiceLogController.java (.../UserPdServiceLogController.java) (revision 9328381608b679a7f66c02117a302fc4fa22d1a5)
+++ web-module/src/main/java/egovframework/api/arms/module_pdservicelog/controller/UserPdServiceLogController.java (.../UserPdServiceLogController.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -64,6 +64,7 @@
PdServiceLogDTO pdServiceLogDTO, ModelMap model, HttpServletRequest request) throws Exception {
pdServiceLogDTO.setOrder(Order.asc("c_left"));
+ pdServiceLogDTO.setWhere("c_id", pdServiceLogDTO.getC_id());
List list = this.pdServiceLog.getChildNode(pdServiceLogDTO);
ModelAndView modelAndView = new ModelAndView("jsonView");
Index: web-module/src/main/java/egovframework/api/arms/module_pdserviceversionlog/controller/UserPdServiceVersionLogController.java
===================================================================
diff -u -r9328381608b679a7f66c02117a302fc4fa22d1a5 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_pdserviceversionlog/controller/UserPdServiceVersionLogController.java (.../UserPdServiceVersionLogController.java) (revision 9328381608b679a7f66c02117a302fc4fa22d1a5)
+++ web-module/src/main/java/egovframework/api/arms/module_pdserviceversionlog/controller/UserPdServiceVersionLogController.java (.../UserPdServiceVersionLogController.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -61,9 +61,11 @@
method = {RequestMethod.GET}
)
public ModelAndView getMonitor(
- PdServiceVersionLogDTO pdServiceVersionLogDTO, ModelMap model, HttpServletRequest request) throws Exception {
+ PdServiceVersionLogDTO pdServiceVersionLogDTO,
+ ModelMap model, HttpServletRequest request) throws Exception {
- pdServiceVersionLogDTO.setOrder(Order.asc("c_left"));
+ pdServiceVersionLogDTO.setWhere("c_pdservice_link", pdServiceVersionLogDTO.getC_pdservice_link());
+ pdServiceVersionLogDTO.setOrder(Order.asc("c_date"));
List list = this.pdServiceVersionLog.getChildNode(pdServiceVersionLogDTO);
ModelAndView modelAndView = new ModelAndView("jsonView");
Index: web-module/src/main/java/egovframework/api/arms/module_reqadd/controller/UserReqAddController.java
===================================================================
diff -u -r3694e9d898855952691463ee8c08b1d9fd776be2 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_reqadd/controller/UserReqAddController.java (.../UserReqAddController.java) (revision 3694e9d898855952691463ee8c08b1d9fd776be2)
+++ web-module/src/main/java/egovframework/api/arms/module_reqadd/controller/UserReqAddController.java (.../UserReqAddController.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -13,6 +13,10 @@
import egovframework.api.arms.module_filerepository.model.FileRepositoryDTO;
import egovframework.api.arms.module_filerepository.service.FileRepository;
+import egovframework.api.arms.module_filerepositorylog.model.FileRepositoryLogDTO;
+import egovframework.api.arms.module_filerepositorylog.service.FileRepositoryLog;
+import egovframework.api.arms.module_pdservicelog.model.PdServiceLogDTO;
+import egovframework.api.arms.module_pdservicelog.service.PdServiceLog;
import egovframework.api.arms.module_reqadd.model.ReqAddDTO;
import egovframework.api.arms.module_reqadd.service.ReqAdd;
import egovframework.api.arms.util.PropertiesReader;
@@ -21,11 +25,13 @@
import egovframework.com.ext.jstree.springHibernate.core.validation.group.AddNode;
import egovframework.com.ext.jstree.springHibernate.core.validation.group.MoveNode;
import egovframework.com.ext.jstree.springHibernate.core.validation.group.UpdateNode;
+import egovframework.com.ext.jstree.springHibernate.core.vo.JsTreeHibernateSearchDTO;
import egovframework.com.ext.jstree.support.util.ParameterParser;
import egovframework.com.ext.jstree.support.util.StringUtils;
import egovframework.com.utl.fcc.service.EgovFileUploadUtil;
import egovframework.com.utl.fcc.service.EgovFormBasedFileVo;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.SetUtils;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
@@ -36,16 +42,21 @@
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
+import org.springframework.util.ObjectUtils;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
+import org.unitils.util.ReflectionUtils;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Field;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
@Slf4j
@Controller
@@ -196,9 +207,10 @@
ReqAddDTO refReqAddDTO = new ReqAddDTO();
refReqAddDTO.setC_id(reqAddDTO.getRef());
- ReqAddDTO nodeByRef = reqAdd.getNode(refReqAddDTO);
+ //ReqAddDTO nodeByRef = reqAdd.getNode(refReqAddDTO);
- ReqAddDTO returnNode = reqAdd.addNodeToSwitchTable(reqAddDTO, nodeByRef);
+ //ReqAddDTO returnNode = reqAdd.addNodeToSwitchTable(reqAddDTO, nodeByRef);
+ ReqAddDTO returnNode = reqAdd.addNode(reqAddDTO);
SessionUtil.removeAttribute("addNode");
@@ -245,13 +257,15 @@
SessionUtil.setAttribute("moveNode",changeReqTableName);
- ReqAddDTO refReqAddDTO = new ReqAddDTO();
- refReqAddDTO.setC_id(reqAddDTO.getRef());
- ReqAddDTO nodeByRef = reqAdd.getNode(refReqAddDTO);
+// ReqAddDTO refReqAddDTO = new ReqAddDTO();
+// refReqAddDTO.setC_id(reqAddDTO.getRef());
+// ReqAddDTO nodeByRef = reqAdd.getNode(refReqAddDTO);
- this.reqAdd.moveNodeToSwitchTable(reqAddDTO, nodeByRef, request);
+ //this.reqAdd.moveNodeToSwitchTable(reqAddDTO, nodeByRef, request);
+ this.reqAdd.moveNode(reqAddDTO, request);
super.setJsonDefaultSetting(reqAddDTO);
+
SessionUtil.removeAttribute("moveNode");
ModelAndView modelAndView = new ModelAndView("jsonView");
@@ -328,4 +342,42 @@
return modelAndView;
}
+ @Autowired
+ @Qualifier("fileRepositoryLog")
+ private FileRepositoryLog fileRepositoryLog;
+
+ @Autowired
+ @Qualifier("pdServiceLog")
+ private PdServiceLog pdServiceLog;
+
+ @ResponseBody
+ @RequestMapping(
+ value = {"/getHistory.do"},
+ method = {RequestMethod.GET}
+ )
+ public ModelAndView getHistory(
+ ModelMap model, HttpServletRequest request) throws Exception {
+
+ ParameterParser parser = new ParameterParser(request);
+
+ FileRepositoryLogDTO fileRepositoryLogDTO = new FileRepositoryLogDTO();
+ fileRepositoryLogDTO.setOrder(Order.asc("c_left"));
+ fileRepositoryLogDTO.setWhere("c_title", "pdService");
+ fileRepositoryLogDTO.setWhere("fileIdLink", parser.getLong("fileIdLink"));
+ List fileRepositoryLogList = fileRepositoryLog.getChildNode(fileRepositoryLogDTO);
+ Set fileRepositoryLogSet = new HashSet<>(fileRepositoryLogList);
+
+ PdServiceLogDTO pdServiceLogDTO = new PdServiceLogDTO();
+ pdServiceLogDTO.setOrder(Order.asc("c_left"));
+ pdServiceLogDTO.setWhere("c_id", parser.getLong("c_id"));
+ List pdServiceLogDTOList = this.pdServiceLog.getChildNode(pdServiceLogDTO);
+ Set pdServiceLogDTOSet = new HashSet<>(pdServiceLogDTOList);
+
+ SetUtils.SetView list = SetUtils.union(fileRepositoryLogSet, pdServiceLogDTOSet);
+
+ ModelAndView modelAndView = new ModelAndView("jsonView");
+ modelAndView.addObject("result", list);
+ return modelAndView;
+ }
+
}
Index: web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAdd.java
===================================================================
diff -u -r705db60c7eea6e025d2695816c923ace0ecb49f6 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAdd.java (.../ReqAdd.java) (revision 705db60c7eea6e025d2695816c923ace0ecb49f6)
+++ web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAdd.java (.../ReqAdd.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -18,8 +18,4 @@
public interface ReqAdd extends JsTreeHibernateService {
- public T addNodeToSwitchTable(T jsTreeHibernateDTO, T refNode) throws Exception;
-
- public T moveNodeToSwitchTable(T jsTreeHibernateDTO, T refNode , HttpServletRequest request) throws Exception;
-
}
\ No newline at end of file
Index: web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAddImpl.java
===================================================================
diff -u -r705db60c7eea6e025d2695816c923ace0ecb49f6 -r25e72c1b1feeea878dac441ae16157af5ff7f2c2
--- web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAddImpl.java (.../ReqAddImpl.java) (revision 705db60c7eea6e025d2695816c923ace0ecb49f6)
+++ web-module/src/main/java/egovframework/api/arms/module_reqadd/service/ReqAddImpl.java (.../ReqAddImpl.java) (revision 25e72c1b1feeea878dac441ae16157af5ff7f2c2)
@@ -23,6 +23,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@@ -36,167 +37,4 @@
private final Logger logger = LoggerFactory.getLogger(this.getClass());
- @SuppressWarnings("rawtypes")
- @Resource(name = "jsTreeHibernateDao")
- private JsTreeHibernateDao jsTreeHibernateDao;
-
- @Override
- @Transactional(rollbackFor = { Exception.class }, propagation = Propagation.REQUIRED)
- public T addNodeToSwitchTable(T jsTreeHibernateDTO, T refNode) throws Exception {
- jsTreeHibernateDao.setClazz(jsTreeHibernateDTO.getClass());
- if (jsTreeHibernateDTO.getRef() < 0) {
- throw new RuntimeException("ref is minus");
- } else {
- //T nodeByRef = (T) jsTreeHibernateDao.getUnique(jsTreeHibernateDTO.getRef());
-
- if ("default".equals(refNode.getC_type())) {
- throw new RuntimeException("nodeByRef is default Type");
- }
-
- refNode.setWhere("c_parentid", refNode.getC_id());
- final long lastPosiotionOfNodeByRef = jsTreeHibernateDao.getCount(refNode);
-
- jsTreeHibernateDTO.setC_position(lastPosiotionOfNodeByRef);
-
- long rightPointFromNodeByRef = refNode.getC_right();
- rightPointFromNodeByRef = Math.max(rightPointFromNodeByRef, 1);
-
- long spaceOfTargetNode = 2;
-
- super.stretchLeftRightForMyselfFromJstree(spaceOfTargetNode, rightPointFromNodeByRef,
- jsTreeHibernateDTO.getCopy(), null, jsTreeHibernateDTO);
-
- long targetNodeLevel = jsTreeHibernateDTO.getRef() == 0 ? 0 : refNode.getC_level() + 1;
-
- jsTreeHibernateDTO.setC_parentid(jsTreeHibernateDTO.getRef());
- jsTreeHibernateDTO.setC_left(rightPointFromNodeByRef);
- jsTreeHibernateDTO.setC_right(rightPointFromNodeByRef + 1);
- jsTreeHibernateDTO.setC_level(targetNodeLevel);
-
- long insertSeqResult = (long) jsTreeHibernateDao.insert(jsTreeHibernateDTO);
- if (insertSeqResult > 0) {
- final long SUCCESS = 1;
- jsTreeHibernateDTO.setStatus(SUCCESS);
- jsTreeHibernateDTO.setId(insertSeqResult);
- } else {
- throw new RuntimeException("심각한 오류 발생 - 삽입 노드");
- }
- }
- return jsTreeHibernateDTO;
- }
-
- @Override
- @Transactional(rollbackFor = { Exception.class }, propagation = Propagation.REQUIRED)
- public T moveNodeToSwitchTable(T jsTreeHibernateDTO, T refNode, HttpServletRequest request) throws Exception {
- jsTreeHibernateDao.setClazz(jsTreeHibernateDTO.getClass());
-
- logger.debug("***********************MoveNode***********************");
- logger.debug("-----------------------getNode 완료-----------------------");
-
- T nodeById = getNode(jsTreeHibernateDTO);
- if (nodeById == null) {
- throw new RuntimeException("nodeById is null");
- }
- Long nodeByIdLeft = nodeById.getC_left();
-
- logger.debug("-----------------------getChildNodeByLeftRight 완료-----------------------");
- DetachedCriteria getChildNodeByLeftRightCriteria = DetachedCriteria.forClass(jsTreeHibernateDTO.getClass());
- Criterion whereChildNodeByLeftRight = Restrictions.ge("c_left", nodeById.getC_left());
- getChildNodeByLeftRightCriteria.add(whereChildNodeByLeftRight);
- getChildNodeByLeftRightCriteria.add(Restrictions.and(Restrictions.le("c_right", nodeById.getC_right())));
- getChildNodeByLeftRightCriteria.addOrder(Order.asc("c_left"));
- List childNodesFromNodeById = jsTreeHibernateDao.getListWithoutPaging(getChildNodeByLeftRightCriteria);
-
- logger.debug("-----------------------nodeByRef 완료-----------------------");
- //T nodeByRef = (T) jsTreeHibernateDao.getUnique(jsTreeHibernateDTO.getRef());
- long rightPointFromNodeByRef = refNode.getC_right();
-
- logger.debug("-----------------------childNodesFromNodeByRef 완료-----------------------");
- DetachedCriteria getNodeByRefCriteria = DetachedCriteria.forClass(jsTreeHibernateDTO.getClass());
- Criterion whereNodeByRef = Restrictions.eq("c_parentid", refNode.getC_id());
- getNodeByRefCriteria.add(whereNodeByRef);
- List childNodesFromNodeByRef = (List) jsTreeHibernateDao.getListWithoutPaging(getNodeByRefCriteria);
-
- T t_ComprehensiveTree = newInstance(jsTreeHibernateDTO);
-
- long spaceOfTargetNode = 2;
- Collection c_idsByChildNodeFromNodeById = null;
-
- logger.debug("-----------------------c_idsByChildNodeFromNodeById 완료-----------------------");
- c_idsByChildNodeFromNodeById = CollectionUtils.collect(childNodesFromNodeById, new Transformer() {
- @Override
- public Long transform(T childNodePerNodeById) {
- return childNodePerNodeById.getC_id();
- }
- });
-
- if (c_idsByChildNodeFromNodeById.contains(jsTreeHibernateDTO.getRef())) {
- throw new RuntimeException("myself contains already refTargetNode");
- }
-
- spaceOfTargetNode = nodeById.getC_right() - nodeById.getC_left() + 1;
-
- if (!jsTreeHibernateDTO.isCopied()) {
- logger.debug("-----------------------cutMyself 완료-----------------------");
- this.cutMyself(nodeById, spaceOfTargetNode, c_idsByChildNodeFromNodeById);
- }
-
- logger.debug("-----------------------calculatePostion 완료-----------------------");
- this.calculatePostion(jsTreeHibernateDTO, nodeById, childNodesFromNodeByRef, request);
-
- if (rightPointFromNodeByRef < 1) {
- rightPointFromNodeByRef = 1;
- }
-
- if (!jsTreeHibernateDTO.isCopied()) {
- logger.debug("-----------------------stretchPositionForMyselfFromJstree 완료-----------------------");
- this.stretchPositionForMyselfFromJstree(c_idsByChildNodeFromNodeById, jsTreeHibernateDTO);
-
- int selfPosition = (nodeById.getC_parentid() == jsTreeHibernateDTO.getRef() && jsTreeHibernateDTO
- .getC_position() > nodeById.getC_position()) ? 1 : 0;
-
- for (T child : childNodesFromNodeByRef) {
- if (child.getC_position() - selfPosition == jsTreeHibernateDTO.getC_position()) {
- rightPointFromNodeByRef = child.getC_left();
- break;
- }
- }
-
- if (nodeById.getC_left() < rightPointFromNodeByRef) {
- rightPointFromNodeByRef -= spaceOfTargetNode;
- }
- }
-
- logger.debug("-----------------------stretchLeftRightForMyselfFromJstree 완료-----------------------");
- this.stretchLeftRightForMyselfFromJstree(spaceOfTargetNode, rightPointFromNodeByRef,
- jsTreeHibernateDTO.getCopy(), c_idsByChildNodeFromNodeById, jsTreeHibernateDTO);
-
- if (logger.isDebugEnabled()) {
- logger.debug(">>>>>>>>>>>>>>>>>>>>" + rightPointFromNodeByRef);
- }
-
- long targetNodeLevel = nodeById.getC_level() - (refNode.getC_level() + 1);
- long comparePoint = nodeByIdLeft - rightPointFromNodeByRef;
-
- if (logger.isDebugEnabled()) {
- logger.debug(">>>>>>>>>>>>>>>>>>>>" + comparePoint);
- }
-
- if (jsTreeHibernateDTO.isCopied()) {
- logger.debug("-----------------------pasteMyselfFromJstree 완료-----------------------");
- long insertSeqResult = this
- .pasteMyselfFromJstree(jsTreeHibernateDTO.getRef(), comparePoint, spaceOfTargetNode,
- targetNodeLevel, c_idsByChildNodeFromNodeById, rightPointFromNodeByRef, nodeById);
- t_ComprehensiveTree.setId(insertSeqResult);
- logger.debug("-----------------------fixPositionParentIdOfCopyNodes-----------------------");
- this.fixPositionParentIdOfCopyNodes(insertSeqResult, jsTreeHibernateDTO.getC_position(), jsTreeHibernateDTO);
- } else {
- logger.debug("-----------------------enterMyselfFromJstree 완료-----------------------");
- this.enterMyselfFromJstree(jsTreeHibernateDTO.getRef(), jsTreeHibernateDTO.getC_position(),
- jsTreeHibernateDTO.getC_id(), comparePoint, targetNodeLevel, c_idsByChildNodeFromNodeById,
- jsTreeHibernateDTO);
- enterMyselfFixLeftRight(comparePoint, targetNodeLevel, c_idsByChildNodeFromNodeById, jsTreeHibernateDTO);
- }
- return t_ComprehensiveTree;
- }
}
\ No newline at end of file