Index: pom.xml =================================================================== diff -u -r1936e60dae53301428372e99f188a288734f8d2f -r55ebb4fdbc0bd1d3413b8b0e9c695020c457873c --- pom.xml (.../pom.xml) (revision 1936e60dae53301428372e99f188a288734f8d2f) +++ pom.xml (.../pom.xml) (revision 55ebb4fdbc0bd1d3413b8b0e9c695020c457873c) @@ -10,7 +10,7 @@ 4.0.0 313devgrp java-service-tree-framework-backend-server - 22.12.20 + 22.12.21 pom java-service-tree-framework Index: web-module/pom.xml =================================================================== diff -u -r1936e60dae53301428372e99f188a288734f8d2f -r55ebb4fdbc0bd1d3413b8b0e9c695020c457873c --- web-module/pom.xml (.../pom.xml) (revision 1936e60dae53301428372e99f188a288734f8d2f) +++ web-module/pom.xml (.../pom.xml) (revision 55ebb4fdbc0bd1d3413b8b0e9c695020c457873c) @@ -7,7 +7,7 @@ 313devgrp java-service-tree-framework-backend-server - 22.12.20 + 22.12.21 ../pom.xml Index: web-module/src/main/java/egovframework/api/arms/module_pdserviceversion/controller/UserPdServiceVersionController.java =================================================================== diff -u -r1ef1321bb86080bac3998083f059d27762a92f2a -r55ebb4fdbc0bd1d3413b8b0e9c695020c457873c --- web-module/src/main/java/egovframework/api/arms/module_pdserviceversion/controller/UserPdServiceVersionController.java (.../UserPdServiceVersionController.java) (revision 1ef1321bb86080bac3998083f059d27762a92f2a) +++ web-module/src/main/java/egovframework/api/arms/module_pdserviceversion/controller/UserPdServiceVersionController.java (.../UserPdServiceVersionController.java) (revision 55ebb4fdbc0bd1d3413b8b0e9c695020c457873c) @@ -13,9 +13,14 @@ import egovframework.api.arms.module_pdserviceversion.model.PdServiceVersionDTO; import egovframework.api.arms.module_pdserviceversion.service.PdServiceVersion; +import egovframework.api.arms.util.StringUtility; import egovframework.com.ext.jstree.springHibernate.core.controller.SHVAbstractController; +import egovframework.com.ext.jstree.support.util.ParameterParser; +import egovframework.com.ext.jstree.support.util.StringUtils; import lombok.extern.slf4j.Slf4j; +import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -29,7 +34,10 @@ import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; @Slf4j @@ -62,6 +70,38 @@ return modelAndView; } + public String[] jsonStringifyConvert(String versionInfo) { + versionInfo = StringUtils.remove(versionInfo, "\""); + versionInfo = StringUtils.remove(versionInfo, "]"); + versionInfo = StringUtils.remove(versionInfo, "["); + return StringUtils.split(versionInfo, ","); + } + + @RequestMapping(value="/getVersions.do",method= RequestMethod.GET) + public ModelAndView getVersions(PdServiceVersionDTO pdServiceVersionDTO, ModelMap model, + HttpServletRequest request) throws Exception { + + ParameterParser parser = new ParameterParser(request); + String parse_c_ids = parser.get("c_ids"); + String[] convert_c_ids = jsonStringifyConvert(parse_c_ids); + List longList = new ArrayList<>(); + for (String c_id : convert_c_ids ) { + longList.add(StringUtility.toLong(c_id)); + } + + PdServiceVersionDTO versionDTO = new PdServiceVersionDTO(); + Criterion criterion = Restrictions.in("c_id", longList); + + versionDTO.getCriterions().add(criterion); + + List pdServiceVersionDTOS = pdServiceVersion.getChildNode(versionDTO); + logger.info("UserPdServiceVersionController :: getVersions :: pdServiceVersionDTOS = " + pdServiceVersionDTOS.size()); + + ModelAndView modelAndView = new ModelAndView("jsonView"); + modelAndView.addObject("result", pdServiceVersionDTOS); + return modelAndView; + } + @RequestMapping(value="/updateVersionNode.do", method=RequestMethod.POST) public ModelAndView updateVersionNode(PdServiceVersionDTO pdServiceVersionDTO, BindingResult bindingResult) throws Exception {